Procedure to build a pcDuino-Nano that pushes data to a Camalie Networks Web Server Initiated as snetbase.pl by M.H. 6/10/13 Revised and Expanded 8/29/13 Revised again 1/17/14 Modified for LinkSprite pcDuino push to Camalie Networks 10/21/14 M.H. Introduction *********************************** This script describes how to install and configure software on a pcDuino Nano which will push data from the pcDuino or attached arduino shields to a Camalie Networks open data web server. HTTP protocol is used to push the data which is then stored on the server in an RRDTools database. An open source program, drraw.cgi, running on the server can then be used to access graphical trend charts of the data and/or csv files with the data which can be imported into a spread sheet. Hardware Platform *********************************** Use pcDuino Nano 4GB version Stock Linux computer from Link Sprite or SparkFun $39.95 Software Installation *********************************** Connect pcDuino to HDMI monitor, USB hub with keyboard and mouse, CAT5 to LAN, USB power connector to power pcDuino Factory password is ubuntu. Home directory is /home/ubuntu/ Change ubuntu password to cam0&alie or something better sudo passwd ubuntu With the synaptic package manager, click reload, then install: install: gnome-control-center Handy to edit various gnome desktop features gnome-time-admin Need this to change time to network time ntp Network time protocol obconf Open Box configuration manager vnstat used to get network bandwidth utilization gedit good code editor. Will load Python too. arduino (if you want to use an arduino ide to program UNO or stalker boards rather than pcDuino.) nautilus (if you prefer this file manager over the default one) ssh (if you want to access remotely) nano (if you want to edit remotely) firefox (opt.) Go to menu /System Tools/Time&Date and set the correct time. Download from http://99.115.132.118/html/cs3/Downloads.htm to /home/ubuntu/cs3code/ pcDpush.pl pcDpush pcDpushWatch cpu_id.ko Do: cd /home/ubuntu/cs3code/ Change permission on above files to allow execution chmod +x pcDpush.pl or use file manager. mkdir sqliteDBs in /home/ubuntu/ Do: sudo cpan App::cpanminus to install perl module installer, select sudo option when asked Do: sudo cpanm Device::XBee::API *only needed if the pcDuino Nano is being used as a CS3 gateway Do: sudo cpanm Device::SerialPort *only needed if the pcDuino Nano is being used as a CS3 gateway Do: sudo cpanm DBI Do: sudo cpanm DBD::SQLite add ubuntu to www-data group go to menu item: Systems Tools / Users and Groups In pcDpush.pl change push target if other than http://camalie.net/cs3 in line ~79 my $remoteServer = "http://camalie.net/cs3/snetServe3.cgi"; #camnets5 Gateway Computer w/Ubuntu 12.04 Add other target cloud servers as desired, this code will push to many different servers Copy pcDpush shell script to /etc/init.d make it executable Create symlink enter: sudo update-rc.d pcDpush defaults This starts pcDpush when the gateway is powered up or rebooted. Optionally to automatically restart pcDpush whenever it hangs longer than 20 minutes: Copy pcDpushWatch to /etc/cron.hourly make executable, create blank file "pushed" in /cs3code, test run pcDpushWatch at command line. should start pcDpush.pl if it has been more than 20 min. since the file pushed has been touched. Reboot and use ps -A at the command line to see if pcDpush.pl is running.