camalie networks Wireless Monitoring and Control
Open Source pcDuino, Arduino and XBee Based
Camalie Networks System 3 (CS3)
This program, snetbase.pl, (sensor-network-base station) receives data from XBee remote nodes and pushes it to cloud server(s). It also receives commands from cloud servers such as actuation, configuration and query commands and passes them on to XBee nodes. It provides a gateway between an XBee 900HP Digimesh network and the internet. This code is compatible with a CS3 shareware cloud server and can be run on the same linux platform as the server to form a stand alone offline monitoring/control system. Perhaps useful for maximum security applications. Runs well on a pCDuino from LinkSprite or any Ubuntu Linux platform. This code sets up the CS3 network to wake for 3 seconds every 2 minutes but can be easily changed.
snetbase This is a shell script to put into /etc/init.d which is used to start snetbase.pl when the CS3 gateway boots.
snetbaseWatch This is a shell script which is put in /etc/cron.hourly which runs every hour to check that snetbase.pl is still running, as evidenced by it touching file /home/ubuntu/cs3code/pushed within the last 20 minutes. This is an ugly hack to keep the code running. It seems to be less needed with the newer revisions of snetbase.
pcDpush.pl is a PERL program that runs on a pcDuino-Nano to push data from the pcDuino-Nano 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
pcDpush Shell script to start up pcDpush.pl on boot. Put this file into /etc/init.d and make it executable.
pcDpushWatch This is a shell script that when put in /etc/cron.hourly will run hourly and restart pcDpush if it has hung.
pcDpush_BuildScript This script describes how to install pcDpush.pl and associated files.
cpu_id This is a small executable which extracts the CPUid from a pcDuino3-Nano. It is called by pcDpush.pl. It should be copied to /home/ubuntu/cs3code. More information about it and how to build it can be found on the LinkSprite site here.
cpu_id.c Source code for the file above.
This is the CS3 webservice which interacts with remote networks to receive data and send actuation commands. It responds to http (port 80) requests from snetbase.pl running on a CS3 gateway. It stores data and metadata in an sqliteDB which it uses to communicate with a web app with a U.I. for control. This code runs well on any PC running Ubuntu 10.04 or later with Apache2, RRDTools and sqlite installed.
This .cgi code file displays a list of nodes currently sending data to the CS3 server and provides a simple command form which can be used to send commands to nodes in the list. Commands are queued in an sqlite table until the specified node sends a request for command at which point snetServe3 searches the table for any commands for that node and if found replies with that command from the sqlite table.
Arduino code file that will run on an arduino stalker from SeeedStudio and send data through a CS3 network to the web. This code Drives digital pins and samples analog inputs once per network sleep cycle. Suitable for resistive sensors like Watermark and thermistors as well as voltage outputing sensors like SSI pressure sensors and Maxbotix ultrasonic range finders. Fixed resistances and terminal blocks are normally installed on an arduino proto shield along with a few wires. Wiring and pin configuration is described in the code.
Arduino code file that will run on an arduino stalker from SeeedStudio with a RaysHobby Open Sprinkler OSBee (CS3-4Vact) 4 bistable valve actuation shield installed. It receives commands from the web across the CS3 network and switches bistable solenoid valves open and closed for specified durations.
Other code to be added includes arduino code for a Terraduino AtMega 2560 based node with a Davis Weather station.
Code for a node with a Spark fun GPS shield or a 16 x 2 line display shield which can display text messages from the web or sensor data is available.
Note: file extentions were removed from the above files to allow browsers to display them rather than run them. To run them copy the code to the location where you want to run them and add the appropriate extention back to the file and enable execution.
Send mail to
questions or comments about this web site.