Thingspeak on Raspberry or vmWare | GitHub Installation | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Thingspeak on Raspberry or vmWare
No permission to create posts
January 12, 2014
6:23 am
Avatar
meltsys

Silver
Members
Forum Posts: 17
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline

Hello,

Does anyone already install Thingspeak on a Raspberry ?

I'm looking for a light and easy reusable install.
If not possible on RPI, what is the best distri to use in VmWare ?
Ubuntu server ?

January 12, 2014
3:38 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

I use VMware and VirtualBox, and the easiest Linux distributions I've found to set up are Ubuntu and Debian.

lee

January 16, 2014
10:15 am
Avatar
Andrew
Squamish, BC

Silver
Members
Forum Posts: 5
Member Since:
December 31, 2013
sp_UserOfflineSmall Offline

I have installed the ThingSpeak server on an Raspberry Pi using this script: https://gist.github.com/abythell/8225124 . While I can confirm it does run, I cannot speak to the performance, such as how it would perform with many simultaneous Updates or retrieving very large Feeds.

January 19, 2014
4:57 pm
Avatar
meltsys

Silver
Members
Forum Posts: 17
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline

Great
Many Thanks
Works perfectly.

Two more question :
- how I can export more than 2 days values from thingspeak.com to import on RPI ?
- how can I configure the rail server to start at RPI Boot ?

Many thanks again

Alex

January 21, 2014
4:54 am
Avatar
meltsys

Silver
Members
Forum Posts: 17
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline

Hi,
I found how to launch the server at startup.

But I've still a problem to backup datas from Thingspeak.com to the raspberry.
I tried : http://api.thingspeak.com/channels/9681/field/1.csv?results=8000
But I got an error

Any idea ?

Thanks

Alex

January 21, 2014
6:18 pm
Avatar
Andrew
Squamish, BC

Silver
Members
Forum Posts: 5
Member Since:
December 31, 2013
sp_UserOfflineSmall Offline

The proper way to start the Rails server on boot would be to use an initscript, however the quick and easy way is to add the following to /etc/rc.local:

(cd /home/pi/thingspeak; /usr/local/bin/rails server -d)

This line should appear before the final "exit 0" line and assumes the ThingSpeak application is found in /home/pi/thingspeak.

January 22, 2014
1:04 pm
Avatar
meltsys

Silver
Members
Forum Posts: 17
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline

Hi Andrew,

Thanks for your reply.
I choosed the easy way ;)

But I don't know how to stop it ;) ... even with SSH.

January 22, 2014
2:51 pm
Avatar
meltsys

Silver
Members
Forum Posts: 17
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline

Is the Raspberry powerfull enough ?

I can't display a simple chart with a "sum" : http://IP:3000/channels/1/charts/2?sum=60&days=1
wheras with "timescale" it works : http://IP:3000/channels/1/charts/2?timescale=10&days=1

December 1, 2014
4:49 am
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Hi, I am trying to install ThingSpeak in a Raspberrian Pi with a Debian distribution.
I am following step by step as in https://github.com/other/thingspeak
When I get to rake db:create I have an error, any idea?
Thanks,
Rodri

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"thingspeak_development", "pool"=>5, "username"=>"thing", "password"=>"speak", "socket"=>"/var/run/mysqld/mysqld.sock"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"thingspeak_test", "pool"=>5, "username"=>"thing", "password"=>"speak", "socket"=>"/var/run/mysqld/mysqld.sock"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
-- create_table("active_admin_comments", {:force=>true})
rake aborted!
Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in `connect'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in `initialize'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_handling.rb:53:in `connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/migration.rb:615:in `connection'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/migration.rb:628:in `block in method_missing'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/migration.rb:601:in `block in say_with_time'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/migration.rb:601:in `say_with_time'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/migration.rb:621:in `method_missing'
/home/pi/thingspeak/db/schema.rb:16:in `block in '
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/schema.rb:42:in `instance_eval'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/schema.rb:42:in `define'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/schema.rb:62:in `define'
/home/pi/thingspeak/db/schema.rb:14:in `'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `load'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `block in load'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `load'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/railties/databases.rake:253:in `block (3 levels) in '
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/bin/ruby_executable_hooks:15:in `eval'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/bin/ruby_executable_hooks:15:in `'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
=> Booting Puma
=> Rails 4.0.5 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Puma 2.9.1 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:3000

December 1, 2014
8:54 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Rodri,

The location of your MySQL socket needs to be set correctly in your "config/database.yml" file. Here's the line you need to change: https://github.com/other/thingspeak/blob/master/config/database.yml.local#L27 . The location of the MySQL socket varies between systems, so you may have to search around to find out what works for you specifically.

lee

December 1, 2014
12:08 pm
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Thanks Lee,

I tried with every location and nothing. Here paths where both files are stored, wich one should I use?

pi@raspberrypi ~/thingspeak $ whereis mysqld.sock
mysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.gz

pi@raspberrypi ~/thingspeak $ whereis mysql.sock
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/bin/X11/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

Best,
Rodri

December 2, 2014
9:32 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Rodri,

You can try running "mysqladmin variables", or look into your MySQL configuration file (usually at /etc/mysql/my.cnf) for the location of the socket.

lee

December 10, 2014
4:38 am
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Hi Lee,

socket is ok on socket:/var/run/mysqld/mysqld.sock but I still have problems, thingspeak_development is created but thingspeak_test still have problems.

Best,
Rodri

pi@raspberrypi ~/thingspeak $ rake db:create
thingspeak_development already exists
Mysql2::Error: Access denied for user 'thing'@'localhost' to database 'thingspeak_test': CREATE DATABASE `thingspeak_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:in `query'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:in `block in execute'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:442:in `block in log'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activesupport-4.0.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:437:in `log'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:in `execute'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/mysql2_adapter.rb:222:in `execute'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:382:in `create_database'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/mysql_database_tasks.rb:16:in `create'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:73:in `create'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:87:in `block in create_current'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:183:in `block in each_current_configuration'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:182:in `each'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:182:in `each_current_configuration'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:86:in `create_current'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/activerecord-4.0.5/lib/active_record/railties/databases.rake:20:in `block (2 levels) in '
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/pi/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/gems/rake-10.3.2/bin/rake:33:in `'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/bin/rake:23:in `load'
/home/pi/.rvm/gems/ruby-2.1.0@thingspeak/bin/rake:23:in `'
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"thingspeak_test", "pool"=>5, "username"=>"thing", "password"=>"speak", "socket"=>"/var/run/mysqld/mysqld.sock"}

December 10, 2014
7:10 am
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Hi Lee, in the end I got TS running on a Raspberry Pi! Thank you very much!!
Best,
Rodrigo

December 10, 2014
12:29 pm
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Hi Lee, as I told you before I hace TS running in RPI!! Cool.

Now I have another problem... I am sending data from an arduino to TS, the code works ok on TS online but when I change to the server in my RPI I get this error.

pi@raspberrypi ~/thingspeak $ rails server
=> Booting Puma
=> Rails 4.0.5 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Puma 2.9.1 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:3000

---
2014-12-10 15:53:46 +0000: HTTP parse error, malformed request (): #
2014-12-10 15:53:46 +0000: ENV: {"rack.version"=>[1, 2], "rack.errors"=>#<IO:>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "CONTENT_TYPE"=>"text/plain", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.9.1", "GATEWAY_INTERFACE"=>"CGI/1.2", "REQUEST_METHOD"=>"POST", "REQUEST_PATH"=>"/update.json", "REQUEST_URI"=>"/update.json"}
---

Any idea?

I tried the code here and ir works, I sent 2 values in 8 fields!
https://thingspeak.com/channels/20390

I changed api.thingspeak.com for 10.95.0.24 and port 80 for 3000 and got the error

Best,
Rodri

December 10, 2014
1:59 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Rodri,

You may have some malformed data in the request you're sending. You can try using a different webserver for you requests by issuing a command such as:
rails server webrick
instead of just:
rails server

lee

December 12, 2014
3:46 am
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Hi Lee,

Thank you very much, with rails server webrick it is working perfectly!!

Last question, I want rails server webrick run after a boot automatically, do you know where should I add this line? add it to /etc/rc.local?

Best,
Rodri

December 12, 2014
8:54 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Rodri,

Glad you have the server working correctly now!

Starting a service automatically at boot is something that is extremely dependent on the operating system's environment, so I wouldn't know for sure how to do this.

lee

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Sahil Nair, ahancity, samexpert, Senseworks, h-kasiri, kleifimmakly

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457