Coder Social home page Coder Social logo

iobridge / thingspeak Goto Github PK

View Code? Open in Web Editor NEW
1.0K 133.0 326.0 3.55 MB

ThingSpeak is an open source “Internet of Things” application and API to store and retrieve data from things using HTTP over the Internet or via a Local Area Network. With ThingSpeak, you can create sensor logging applications, location tracking applications, and a social network of things with status updates.

Home Page: https://thingspeak.com

License: Other

Ruby 46.53% CoffeeScript 0.01% JavaScript 7.63% CSS 1.48% HTML 44.19% Shell 0.16%

thingspeak's Introduction

ThingSpeak

ThingSpeak is an open source “Internet of Things” application and API to store and retrieve data from things using HTTP over the Internet or via a Local Area Network. With ThingSpeak, you can create sensor logging applications, location tracking applications, and a social network of things with status updates.

In addition to storing and retrieving numeric and alphanumeric data, the ThingSpeak API allows for numeric data processing such as timescaling, averaging, median, summing, and rounding. Each ThingSpeak Channel supports data entries of up to 8 data fields, latitude, longitude, elevation, and status. The channel feeds support JSON, XML, and CSV formats for integration into applications.

The ThingSpeak application also features time zone management, read/write API key management and JavaScript-based charts from Highslide Software / Torstein Hønsi.

Support for ThingSpeak is available on the ThingSpeak Community site which features a Blog, Forum, Documentation, and Tutorials.

Before You Begin

1. Install Ruby 2, RubyGems, Rails 4, git, and a database like MySQL
2. Download the application using git: git clone [email protected]:iobridge/thingspeak.git
3. Change to the thingspeak directory and install the appropriate gems: sudo bundle install

Configuration

1. Set your database configuration file at config/database.yml (see config/database.yml.example for an example)
2. Create the database: rake db:create
3. Create the database tables: rake db:schema:load

Run The Application

1. Start the server: rails server

Your application will now be running at http://localhost:3000/

Changing Application Text

Make changes to config/locales/en.yml
To avoid errors, please ensure your lines start with spaces, not tabs.
Set your application name using the ‘application_name’ key.

(Optional) Email Setup

Set your domain, user_name, and password in config/environment.rb

(Optional) Admin Setup

Open a rails console: rails console or RAILS_ENV=production rails console, depending on your environment
Add the admin user: AdminUser.create!(email: '[email protected]', password: 'YOUR_PASSWORD', password_confirmation: 'YOUR_PASSWORD')
Exit the rails console: exit
Login via the admin web interface at: “http://YOUR_DOMAIN.COM/admin”

Installation on clean install of Ubuntu 12.04 LTS

sudo apt-get upgrade
sudo apt-get -y install build-essential mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev git-core curl rubygems
\curl -sSL https://get.rvm.io | bash -s stable
rvm install 2.1
git clone https://github.com/iobridge/thingspeak.git
cd thingspeak
bundle install
cp config/database.yml.example config/database.yml
rake db:create
rake db:schema:load
rails server

Upgrading existing installations

git pull origin master
bundle install
rake db:migrate
If your server is active you can restart it by going to the active terminal, hitting Ctrl-c, and then typing:
rails server

thingspeak's People

Contributors

abradburne avatar abythell avatar akinsgre avatar iobridge avatar llawlor avatar oiotoshi avatar powermik avatar puck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thingspeak's Issues

CSV Upload Issue

Reported by a user:

I am trying to upload csv files but I'm getting an error page. I even tried uploading the sample csv file you link to above, but I get the same error.

Could you help?

Impossible to install because of active_admin change

Following the install explanations, we can't pass the "bundle install" step :

Fetching gem metadata from http://rubygems.org/...........
Fetching version metadata from http://rubygems.org/..
Fetching dependency metadata from http://rubygems.org/.
Fetching git://github.com/gregbell/active_admin.git
fatal: unable to connect to github.com:
github.com[0: 192.30.253.113]: errno=Connexion terminée par expiration du délai d'attente
github.com[1: 192.30.253.112]: errno=Connexion terminée par expiration du délai d'attente

We can't fetch "git://github.com/gregbell/active_admin.git" as it seems that this repository don't exist anymore ?

We have tried Ubuntu 14.04 LTS and Ubuntu 16.04 LTS : same problem.

We absolutely need an upgrade of Thingspeak and also the last install explanation is for very old systems now !

Thanks for your work...

[Delete] causes NoMethodError

Hello,
I am pretty new to Ruby and have to fix a ThingSpeak server.
The problem is, the admin account cannot delete any accounts or Channels.
Neither of these errors show an application trace, only full traces

Error of Account-deletion:
NoMethodError in Admin::ChannelsController#destroy
undefined method `name' for nil:NilClass
Full-Trace:


vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/has_many_association.rb:81:in `cached_counter_attribute_name'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/has_many_association.rb:104:in `inverse_updates_counter_cache?'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/has_many_association.rb:114:in `delete_records'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:493:in `remove_records'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:486:in `block in delete_or_destroy'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:152:in `block in transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/transactions.rb:209:in `transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:151:in `transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:486:in `delete_or_destroy'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:247:in `destroy'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/collection_association.rb:170:in `destroy_all'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/has_many_association.rb:26:in `handle_dependency'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/associations/builder/association.rb:97:in `has_many_dependent_for_api_keys'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:377:in `_run__4271050200535634837__destroy__callbacks'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:80:in `run_callbacks'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/callbacks.rb:292:in `destroy'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/transactions.rb:265:in `block in destroy'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/transactions.rb:330:in `block in with_transaction_returning_status'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:221:in `within_new_transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/transactions.rb:209:in `transaction'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/transactions.rb:327:in `with_transaction_returning_status'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/transactions.rb:265:in `destroy'
vendor/bundle/ruby/2.3.0/bundler/gems/active_admin-0c83cfe0b9b4/lib/active_admin/resource_controller/data_access.rb:189:in `block in destroy_resource'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/core_ext/object/try.rb:45:in `public_send'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/core_ext/object/try.rb:45:in `try'
vendor/bundle/ruby/2.3.0/bundler/gems/active_admin-0c83cfe0b9b4/lib/active_admin/callbacks.rb:79:in `block (2 levels) in define_active_admin_callbacks'
vendor/bundle/ruby/2.3.0/bundler/gems/active_admin-0c83cfe0b9b4/lib/active_admin/resource_controller/data_access.rb:188:in `destroy_resource'
vendor/bundle/ruby/2.3.0/gems/inherited_resources-1.4.1/lib/inherited_resources/actions.rb:58:in `destroy'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/abstract_controller/base.rb:189:in `process_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:493:in `_run__3531449486506308946__process_action__callbacks'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:80:in `run_callbacks'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/abstract_controller/callbacks.rb:17:in `process_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/notifications.rb:159:in `block in instrument'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/notifications.rb:159:in `instrument'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/abstract_controller/base.rb:136:in `process'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/abstract_controller/rendering.rb:44:in `process'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal.rb:195:in `dispatch'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_controller/metal.rb:231:in `block in action'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:48:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:71:in `block in call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:59:in `each'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:59:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:674:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/rack/error_collector.rb:50:in `traced_call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/rack/agent_hooks.rb:26:in `traced_call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
vendor/bundle/ruby/2.3.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
vendor/bundle/ruby/2.3.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
vendor/bundle/ruby/2.3.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-xml_parser-1.0.1/lib/action_dispatch/xml_params_parser.rb:16:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/flash.rb:241:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/cookies.rb:486:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/query_cache.rb:36:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:373:in `_run__4364726816475611795__call__callbacks'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:80:in `run_callbacks'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/reloader.rb:64:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:38:in `call_app'
vendor/bundle/ruby/2.3.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `block in call'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:26:in `tagged'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `tagged'
vendor/bundle/ruby/2.3.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `call'
vendor/bundle/ruby/2.3.0/gems/quiet_assets-1.0.3/lib/quiet_assets.rb:23:in `call_with_quiet_assets'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/activesupport-4.0.5/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-utf8_sanitizer-1.2.2/lib/rack/utf8_sanitizer.rb:15:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/static.rb:64:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/railties-4.0.5/lib/rails/engine.rb:511:in `call'
vendor/bundle/ruby/2.3.0/gems/railties-4.0.5/lib/rails/application.rb:97:in `call'
vendor/bundle/ruby/2.3.0/gems/railties-4.0.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.9.5.251/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
vendor/bundle/ruby/2.3.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
vendor/bundle/ruby/2.3.0/gems/puma-2.9.1/lib/puma/server.rb:490:in `handle_request'
vendor/bundle/ruby/2.3.0/gems/puma-2.9.1/lib/puma/server.rb:361:in `process_client'
vendor/bundle/ruby/2.3.0/gems/puma-2.9.1/lib/puma/server.rb:254:in `block in run'
vendor/bundle/ruby/2.3.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `block in spawn_thread'

Request

Parameters:

{"_method"=>"delete",
 "authenticity_token"=>"mVLFQMTJRvdazg6BpsFs1FTirLJhodqHxwZsaeYrEFI=",
 "id"=>"5" 

Response

Headers:
None

As for the channel-deletion, its the same as Issue #52 , except for the fact, that there is no application Trace shown.

admin-user routing:

admin_user                         
GET        /admin/users/:id(.:format)                                  admin/users#show 
PATCH      /admin/users/:id(.:format)                                  admin/users#update
PUT        /admin/users/:id(.:format)                                  admin/users#update
DELETE     /admin/users/:id(.:format)                                  admin/users#destroy

Each user can delete their own account without problem, just the admin account cannot do that.

app/controlers/users_controller.rb (pastebin) (used pastebin due to long file)

app/admin/user.rb

ctiveAdmin.register User do
  require 'csv'

  filter :email
  filter :login
  filter :created_at

  permit_params :email, :login, :bio, :website

  index do
    column :id
    column :email
    column :login
    column :created_at
    actions
  end

  show do
    attributes_table do
      rows :id, :email, :login, :time_zone, :bio, :website, :created_at, :sign_in_count, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip, :last_sign_in_ip
    end
    panel 'Channels' do
      table_for user.channels do
        column :id
        column(:name) { |channel| link_to channel.name, channel }
      end
    end
  end

  form do |f|
    f.semantic_errors *f.object.errors.keys
    f.inputs :email, :login
    f.actions
  end

  # custom action for signups per day
  collection_action :signups, :method => :get, :format => :csv do
    @csv_headers = [:day, :signups]
    @days = User.signups_per_day
  end

  # custom action for emails list
  collection_action :emails, :method => :get do
    @users = User.all
  end

end

I don't know which other info is important, feel free to ask if anything else is needed.

Does anyone have a clue how to fix this?
Thanks in advice

TJ

Feature request: add RSS as feed format

Currently, we can access channel information in JSON, CSV and XML. Having RSS as an additional option would increase the interoperability of Thingspeak with solutions like IFTTT. Each channel would be an RSS channel, and each data entry an item. The data could be placed in the description in a standard format (JSON-like), and the title set as a composite of the timestamp and other data.

If the Thingspeak community thinks this is a good idea for a new feature, I'd be happy to start coding it up.

PUT on https://api.thingspeak.com/channels/#### returns 404

The call actually works, but the server returns 404. Here's a Node-JS test case. Note that I'm running this against thingspeak.com, and not necessarily this code here.

"use strict"

var unirest = require('unirest')

var sd = {
    channel_id: 15312,
    api_key: 'XXXXXXXXXXXX'
}

var url = 'https://api.thingspeak.com/channels/' + sd.channel_id

unirest
    .put(url)
    .send({
        api_key: sd.api_key,
        name: 'Saturday 6:32p'
    })
    .end(function(result) {
        if (result.error) {
            console.log(result.error)
        }
    })
;   

'show_comments_in_menu' has been removed from ActiveAdmin since 1.0.0

When I tried to load the schema, I encountered this error:

rake aborted!
NoMethodError: undefined method `show_comments_in_menu=' for #<ActiveAdmin::Application:0x007fbcaaa63970>

According to ActiveAdmin, this config has been removed. This repo should update the ActiveAdmin with the new config format or add the version dependencies to the gemfile.

For more information, have a look here:
https://github.com/activeadmin/activeadmin/pull/4187/files

Quickfix
comment the line
config.show_comments_in_menu = false found in active_admin.rb:124

Uploading a CSV file is processed as it is uploaded

Currently if a user uploads a CSV file it is processed as part of the HTTP request For even a vaguely large file this can take a while and leaves the user perplexed about what is happening.

What would be better is to store the CSV file, then have a worker process to handle parsing the CSV file. It could keep state somewhere about far through it is to be displayed in a web page.

Feature Request: Add support for JSONP

Hi, amazing job so far with the app. Could you please add support for JSONP? Given you already have JSON, it would be a simple tweak to add jsonp for users who are need to make cross domain calls.

Average aggregator works wrong when there are missing values for the period

Hi! I've noticed that average aggregator works wrong when there are missing values for the period.

Here I got an aggregated chart (generated by https://thingspeak.com/channels/134669/charts/3?title=CO2%20concentration&xaxis=&yaxis=&width=auto&days=1&average=10):
Aggregated

As you can see there is a gap at 22:00:00, but if we look on non-aggregated chart (generated by https://thingspeak.com/channels/134669/charts/3?title=CO2%20concentration&xaxis=&yaxis=&width=auto&start=2016-09-11%2021:00:00&end=2016-09-11%2023:00:00&offset=3):
Non-aggregated
we'll see that the gap was an aggregation error due to missing data.

Error displaying charts for certain timescales

When displaying a chart with a certain timescales, an exception is raised in the logs and the charts don't display

There is a gist here https://gist.github.com/1676729 which shows the logging output (including some additional logging in my fork that shows why the issue occurs)

I think the code should be written such that the timeslices is equal to the start_time - end_time [ ie, timeslices = Array.new(((start_time - end_time) / seconds).floor) ] because the start_time is the feeds.first.created_at which is the most recent feed having the greater absolute time value.

Logging

I've noticed screeds of logging into the Docker log file when:

  • a browser is monitoring a Channel and

  • a channel is being updated by sensors.

Can this level of monitoring be switched off- if so where?

Also, is the Rails side of things using the "Development" environment?

Thanks

Disabling plugins

Does anyone know what the canonical approach to disabling plugins might be? I wonder if there's a settings file somewhere or one would have to just take out blocks of code?

Thanks

Cannot install via pip

pip install thingspeak -vvv hangs:

Using version 0.4.1 (newest of versions: 0.4.1)
Collecting thingspeak==0.4.1
Created temporary directory: /private/var/folders/41/39__8bps2b7cncsp6kkp4x8c0000gn/T/pip-unpack-jsixg20o
https://files.pythonhosted.org:443 "GET /packages/2f/3c/51e6f81254a8d50ca442445c7eeb7a9ee959cf759dd2f1056c141c0df82c/thingspeak-0.4.1.tar.gz HTTP/1.1" 200 7758
Downloading thingspeak-0.4.1.tar.gz (7.8 kB)
Added thingspeak==0.4.1 from https://files.pythonhosted.org/packages/2f/3c/51e6f81254a8d50ca442445c7eeb7a9ee959cf759dd2f1056c141c0df82c/thingspeak-0.4.1.tar.gz#sha256=22b8ffe4d724639127bd166dd140ff098e48c8f386e81cf050da524a6da181d4 (from -r requirements.txt (line 67)) to build tracker '/private/var/folders/41/39__8bps2b7cncsp6kkp4x8c0000gn/T/pip-req-tracker-i7tzr8h6'
    Running setup.py (path:/private/var/folders/41/39__8bps2b7cncsp6kkp4x8c0000gn/T/pip-install-8z5eaznl/thingspeak/setup.py) egg_info for package thingspeak
    Running command python setup.py egg_info

There are no errors, it just hangs here forever.

Hardcoded references to api.thingspeak.com and thingspeak.com

The current code base has a few locations where api.thingspeak.com or thingspeak.com are hard-coded for either loading data in JavaScript, charting or in the documentation. In some locations, either constants or template variables are already used in similar areas, so this would just be an extension of ensuring that they're used everywhere. Overall, this would make the code and documentation more flexible and portable for self-installs.

Would a PR be accepted that cleans these up and uses template variables and/or contstants based upon environment variables? The default can always match the current implementation (eg default to thingspeak.com etc).

From #37, the current version of thingspeak.com differs from what's currently on GitHub so it would be good to know whether there are updates coming from that version any time soon -- avoiding reimplementation would be good.

Feature request: copying view from private to public

Hello!

In most of my projects I've noticed that the private view is pretty much identical to what I want to share into the public one.

Would it be possible to have an option that allows copying the private view layout onto the public one, and vice versa?

Or even better, a setting in "Channel Settings" which unifies them into a single channel for both public/private.

Thanks!

feature: update

Hey, do you plan on updating this repository to contain what is currently live at thingspeak.com? I would like the ability to use MATLAB on my local version if possible.

SUCCESS!! ThingSpeak working on Debian 10

Premise:
I want to get good use out of my Raspberry Pi zero with a waveshare
ethernet hat (i.e. NO wireless) which currently run
1. a thingSpeak server for my aquarium & Weather station + some test logging
2. Owncloud setup

I recently got myself a Pimoroni Pirate Audio Lineout hat. This works fine on
a new raspberry Pi zero 2WH. I use that one with Volumio so I can use the excellent
(new) plugin from AxLED for the OLED. Works with Spotify etc, really neat.

Caveat:
1. ThingSpeak needs to run on Wheezy... yes that old, but works great mind you for my above setup
2. Pirate Audio code is written for Buster..... + Volumio installs as an OS

So i wanted to know if i could combine everything under one OS. Initially I ran into
all kinds of issues, all seem due to the mismatch in OS's.

Spoiler:
1. I have tried this with a Jessie version of Volumio & i can get the ThingSpeak
server installed & working. However updating Volumio took me back to
Buster wiping the Jessie setup (changes repositories to legacy)
2. Using this Buster Volumio setup I have managed to install the ThingSpeak
server and it is running assigning a different port than 3000 as Volumio is
using it, but it does work. Quite a few hurdles but i tried to keep track of how i did it +
all the issues i came across (see final recipe below)

What i learned doing this suggested to me that i should be able to get this working
on a newer (Buster) based Debian OS because due to the proper install through RVM (Ruby
Version Manager) I figured i should be able to install this older version based setup using the
latest RVM framework. This should then be able to install a constrained (older) set
of an app (i.e. thingspeak), but with a newer database setup.

So going through the motions i tried to keep track of what i did to achieve this.
Hence the following recipe, with hopefully enough info, for someone else interested
in this the do this as well.

The Recipe:

sudo apt-get update

sudo apt purge ruby

Install MySQL. The thingspeak code wants/needs this. The newer OSs have MariaDB, so by
installing as "default-mysql", mariadb will still be installed HOWEVER with symbolic
links for you to be able to type in mysql commands instead of mariadb commands:
sudo apt-get -y install build-essential default-mysql-server default-mysql-client default-libmysqlclient-dev libxml2-dev libxslt-dev

gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
This didn't work for me so i did:
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -

Get RVM:
curl -L https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm
rvm install ruby 2.1.0
gem install rubygems-update -v 2.7.11 (note i don't use sudo, so anyone can run it)

Now need to make sure it uses this version:
update_rubygems

git clone https://github.com/iobridge/thingspeak.git
cd thingspeak

Change in Gemfile:
gem 'mysql2', '~> 0.3.18'
bundle update mysql2

gem install tzinfo -v 1.2.2
gem install tzinfo-data -v 1.2013.8

nano Gemfile.lock
change libv8 to version 3.16.14.5 (which is for arm6)
change myslq2 to version 0.3.21

gem install bundler -v 1.17.3
bundle install
cp config/database.yml.example config/database.yml

------------------- database stuff ----
seems needed for creation of the file /config/environment.db
I ignored errors about user "thing" being missing

------------------- database stuff ----
seems needed for creation of /config/environment.db
I ignored errors about user "thing" being missing

mysql -u root -p
enter:
show databases;
enter:
CREATE DATABASE thingspeak_test DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
enter:
GRANT ALL PRIVILEGES ON thingspeak_test.* TO 'thing'@'localhost';
enter:
FLUSH PRIVILEGES;
enter:
exit

nano config/initializers/abstract_mysql2_adapter.rb

I changed directories to get the right subdirectory as else i got an empty file.
enter:

config/initializers/abstract_mysql2_adapter.rb

class ActiveRecord::ConnectionAdapters::Mysql2Adapter
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end

cd config
nano environment.db
enter at the END:
require File.expand_path('../../config/initializers/abstract_mysql2_adapter', FILE)

As i got some error running "rake db:create" i had fix something else:

cd /home
cd .rvm

do a "ls" and make sure you end up in a directory something like "ruby-2.1.0@thingspeak"
keep doing this until you're in "gems/mysql2-0.3.21/lib/mysql2/":

nano client.rb

At the line Line 12
:connect_flags => REMEMBER_OPTIONS | LONG_PASSWORD | LONG_FLAG | TRANSACTIONS | PROTOCOL_41 | SECURE_CONNECTION,

Change like this:
:connect_flags => REMEMBER_OPTIONS | LONG_FLAG | TRANSACTIONS | PROTOCOL_41 | SECURE_CONNECTION,

cd ~/thingspeak
rake db:create (i ignored any errors)
rake db:schema:load

rails server (this will run on port 3000, i got a in-use complaint because of Volumio)

So i'm running it on a different port:
rails s -p 4000

Give it a few minutes. Then i went to http://xxx.xxx.xxx.xxx:4000/

SUCCESS !!! It's running

References:
1. https://www.cnx-software.com/2016/12/07/how-to-install-thingspeak-in-ubuntu-16-04/
2. https://www.teracomsystems.com/blog/how-to-install-local-thingspeak-server/?cn-reloaded=1
3. https://github.com/iobridge/thingspeak
4. https://vitux.com/installing-and-configuring-ruby-on-rails-on-debian-10/
5. https://rvm.io/rvm/install

Routing to a subdirectory is half functionnal

I wanted to have production and development instances running on the same host (production one on port 3000, and the dev one on 3001, and I masking these ones in the final URL with a proxy using apache), so I need to configure subdirectories for each ones.
But routing to a subdirectory is not fully working (top menu is OK, but channels links and documentation are KO)

I've configured development.rb by adding this line :

config.relative_url_root = "/thingspeak-dev"

And modified config.ru :

#run Thingspeak::Application
map Thingspeak::Application.config.relative_url_root || "/" do
 run Rails.application
end

As shown in this demo : https://github.com/kowal/rails4_teaspoon_test_app

A simple

$ grep -R 'href="/' app/views/

shows all routing issue in views.

For example, in app/views/channels/index.html.rb, I replaced :

<a href="/channels/<%= channel.id %>">

by

<a href="<%= channel_path(channel) %>">

And it's now ok.

I'll make a PR after having replaced all hrefs that can be.

Can't install due to tzinfo error

I am trying to install Thingspeak on a pc running Ubuntu 14.04. Everytime I try I get this error:
Fetching tzinfo-data 1.2013.8
Downloading tzinfo-data-1.2013.8 revealed dependencies not in the API or the lockfile (tzinfo (>= 1.0.0)).

Either installing with --full-index or running bundle update tzinfo-data should fix the problem.

In Gemfile:
tzinfo-data

I tried to do the bundle update like it says to but then it just brings up the same error again. Any help is appreciated!

Updated install instructions for Ubutu 12.04 server

I needed to make some amendments to the build instructions when installing a Thingspeak server on a fresh Ubuntu 12.04.05LTS server.

Before installing RVM, add signatures:

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 

After installing RVM, source script:

source ~/.rvm/scripts/rvm

Install ruby with a different syntax:

rvm install ruby-2.1.0

Before "bundle install", add a few missing gems:

gem install minitest -v '4.7.5' # Install gem
gem install json -v '1.8.1' #Install gem

To run the entire install process from a Bash script, see this gist.

I've also written another script which installs ruby from sources instead of using rvm. Details can be found here.

Step Chart Parameter

On a public / private view, the step parameter is not listed in the chart editor.

Manage OpenHUB project page

Someone from ioBridge / ThingSpeak.com may want to claim the manager role on OpenHUB for the ThingSpeak project page at https://www.openhub.net/p/thingspeak

On this project page I've reflected the license (as GPL v3 or later; from what I see in the https://github.com/iobridge/thingspeak/blob/master/LICENSE file), used a quick square logo based on the ThingSpeak.com homepage (NOTE: You probably want to change this...), the description was taken from GitHub by pointing OpenHUB to it, for the tags I looked at the most expressive keywords in the main page and first tutorial (you probably want to review those tags).

standard install broken after the update on api.thingspeak.com

show.html.erb contains code like:

<script type="text/javascript" src="http<%= 's' if @ssl %>://api.thingspeak.com/javascripts/highcharts<%= '-android' if get_header_value('user_agent').upcase.index('ANDROID') %>.js"></script>

it seems that the highcharts-library has vanished from api.thingspeak.com, so every unmodified install from thingspeak open source api can't display charts anymore

Please update the opensource api and as a workaround upload the highcharts librarys on your server again

Install on Debian 9 not successful

I ran:

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.1.0
rvm use 2.1.0 --default
git clone https://github.com/iobridge/thingspeak.git

Up to here successful.

cd thingspeak
bundle install

Here I got some errors:```

Bundler could not find compatible versions for gem "jquery-rails":
In Gemfile:
jquery-rails (= 3.0.4)

activeadmin was resolved to 2.0.0, which depends on
  jquery-rails (~> 4.2)

Bundler could not find compatible versions for gem "ruby":
In Gemfile:
ruby

nokogiri was resolved to 1.9.1, which depends on
  ruby (>= 2.1.0)

puma was resolved to 3.12.1, which depends on
  ruby (>= 2.2)

rails (= 4.0.5) was resolved to 4.0.5, which depends on
  ruby (>= 1.9.3)
What is the easiest way to repair dependencies and compatibility?

Thank you,

Franz

Thingspeak behind reverse proxy

Thank you for making thingspeak! Accessing my thingspeak server via the internet gives me some problems:

  • I cannot access port 3000 or other "unusual" port.
  • I want to access thingspeak via https.
    Configuring Apache as a reverse proxy would solve the problems. Unfortunately the charts are not shown. It only shows /dev-assets/ajax-loader.gif. Where is the point it breaks?
    Thank you for your advice!
    Happy new year,
    Franz

password forgotten process fails

i lost my userpassword and cannot start the password forgotten process. it fails (message attached)
is there a command line (root shell) password reset call?

###message###
EOFError in Devise::PasswordsController#create
end of file reached
Rails.root: /home/thingspeak/thingspeak

Application Trace | Framework Trace | Full Trace
Request
Parameters:

{"utf8"=>"✓",
"authenticity_token"=>"TOKENVAKUE",
"user"=>{"email"=>"EMAIL"},
"commit"=>"Submit"}
...

Problem html display

I installed everything without using sudo. But when I run the server (rails server) and go to localhost:3000, I get many html display problems. For example, the button New Model (when creating a channel) doesn't display. Instead of this, I get New Model.
And when I click on the button, I get (when inspecting) the following error:
SyntaxError: missing } after property list

But then, when I run sudo firefox in the terminal, and visit localhost:3000, I don't have any html display problem.
How can I solve this?

Thanks in advance for your help!

Gauge widget caused to hang a channel

I have just added a Gauge view and after clicking "Save", my channel became unresponsive from the web browser. I can see data only on smartphone's app, but if I try to navigate on the channel with the browser, the page hangs on forever. I have also cleared the channel, with no results (other than loosing all my data).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.