* [[:|Wiki Home]]
* [[:cheat_sheet|Cheat Sheet]]
* [[:compiling_on_virtualbox|Precompiled virtual tools]]
* [[:carambola_where_to_start|Where to start]]
* [[:carambola_connecting|Connecting to carambola]]
* [[:carambola_using_and_customizing|Using and Customizing]]
* [[:carambola_demo_projects|Demo projects/examples]]
* [[:carambola_hardware|Hardware]]
====== Real-time data ======
Live data was switched off. See [[carambola_pachube_nexus|weather station]] instead.
<html>
<img src="http://api.pachube.com/v2/feeds/35109/datastreams/0.png?width=500&height=200&colour=F15A24&duration=24hours&detailed_grid=true&show_axis_labels=true&timezone=+2&l=Temperature [*C]" class="media" alt="" width="500" />
<br>
<img src="http://api.pachube.com/v2/feeds/35109/datastreams/1.png?width=500&height=200&colour=F15A24&duration=24hours&detailed_grid=true&show_axis_labels=true&timezone=+2&l=Humidity" class="media" alt="" width="500" />
<br>
<img src="http://api.pachube.com/v2/feeds/35109/datastreams/2.png?width=500&height=200&colour=F15A24&duration=24hours&detailed_grid=true&show_axis_labels=true&timezone=+2&l=Pressure [Pa]" class="media" alt="" width="500" />
</html>
====== Register ======
{{:pachube_register.png?nolink&500|}}
====== Get API key ======
Get Pachube API key from [[https://pachube.com/users/sauliusl/keys|here]]
{{:pachube_api-keys.png?nolink&500|}}
====== Prepare carambola ======
Install curl.
* Build custom firmware with enabled USB serial port support:
Under ''Kernel modules / USB support / kmod-usb-serial'' select all drivers if you are unsure which one you have or ''kmod-usb-serial-ftdi'' in our case.
{{:carambola_usb_serial_drivers2.png?nolink&500|}}
Also good idea to select curl in advance. Or just do ''opkg install curl'' on your carambola after [[carambola_where_to_start|uploaded new firmware]].
====== Create new feed ======
[[https://pachube.com/feeds/new|Create new feed]]
====== Upload data ======
Create test data at ''/tmp/pachube.json'':
{
"version":"1.0.0",
"datastreams":[
{"id":"0", "current_value":"28.70"},
{"id":"1", "current_value":"41.37"},
{"id":"2", "current_value":"99813.8"}
]
}
Uplaod data:
curl -X PUT -d @pachube.json -H "X-PachubeApiKey: --------API_KEY-------" -v http://api.pachube.com/v2/feeds/35109
====== Results ======
You can view demo data [[https://pachube.com/feeds/35109|here]]
{{:pachube_graph1.png?nolink&500|}}
====== Links ======
* [[http://api.pachube.com/v2/|API description]]
* [[http://api.pachube.com/v2/feeds/35109/datastreams/0.png?width=500&height=200&colour=F15A24&duration=24hours&detailed_grid=true&show_axis_labels=true&timezone=+2&l=Temperature|Direct link to temperature .png file using v2 API]]
* [[https://pachube.com/feeds/35109/datastreams/0/history.png?w=500&h=200&c=9999FF&b=true&g=true&l=Temperature&s=6|Direct link to temperature .png file using v1 API]]
====== Further explanation ======
Previously mentioned example is running sparkfun [[http://www.sparkfun.com/products/10586|weather board]] with customized firmware. It prints data every second to serial port at 9600bps. Carambola and sparkfun weather board are connected using USB cable.
{{:cimg9538.jpg?nolink&|}}
Data format looks like:
t1:025.12, t2:025.15, hum:036.54, pres:99750.5, light:1002
t1:025.15, t2:025.17, hum:036.55, pres:99750.0, light:1000
t1:025.16, t2:025.19, hum:036.51, pres:99751.0, light:1001
I wrote small program which collects data from serial port and creates pachube.json file on /tmp. This program, together with curl command, is called every minute using crond.
root@OpenWrt:/tmp# crontab -l
# Minute Hour Day of Month Month Day of Week Command
# (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat)
* * * * * weather >/tmp/pachube.json; curl -X PUT -d @/tmp/pachube.json -H "X-PachubeApiKey: --------API_KEY-------" -v http://api.pachube.com/v2/feeds/35109
====== C code for carambola ======
see [[carambola_simple_serial_example|here]]
====== C code for weather station ======
[[8devices.com/wiki_carambola/data/media/weather.zip|weather.zip]] you should use WinAVR to compile it (*.hex file included in archive)
Original documentation and source code can be found [[http://www.sparkfun.com/products/10586|here]]. This example is running on older PCB, but it should run on newer modification.
====== LUA for carambola ======
TODO
====== TODO ======
Google gadgets API http://apps.pachube.com/google_viz/