Thursday, September 6, 2012

Post data to with WiseClock4 + WiFly

Last weekend I re-discovered, formerly known as
After spending a lot less time than I had planned (since things went so smoothly), I was about to post details about the experience; then I saw this fresh post on sparkfun, which pretty much explains everything one needs to know about creating an account and sending data.

The main difference between sparkfun's setup and mine is the connection to internet: I used the WiFly module plugged into the WiseClock4 board. Therefore, the code is a little bit different too: I used the great WiFly library, which even comes with a (little dated) "pachube client" example. All one needs to do is provide the right parameters (app key, network ssid, password etc) in credentials.h, then change all references from "pachube" to "cosm".

As a quick experiment, I read the value from (disconnected) A0 every 25 seconds, and this is how the cosm graph looks like:

A user-friendly cosm-client device based on WiseClock4 with WiFly (which, by the way, seems to be the cheapest way to connect to a WiFi network) would read the configuration parameters from a file on SD card (then, for security reasons, delete the file and store those parameters in eeprom) or provide a way to receive these parameters (ssid, password, app key etc) from a smart phone through bluetooth.

(To be continued)


  1. Hi. Would you have your source code available? I'm attempting to do the same thing with a WiFly and Arduino, but my code keeps hanging before connecting to Cosm. I'm suspecting it's something to do with the Arduino 1.0 update? Any help you have would be appreciated!

    1. I uploaded the code here:
      It compiles with Arduino 1.0.

  2. Sketch Arduino and PIC firmware for Wifly RN-XV modem configuration without Wifly library and
    with front-end:
    Type in browser address bar: to toggle Led and open a HTML page.
    The microcontroller can be, with this firmware and Wifly, a server (switching the led signal through in adress bar)
    or also client (the AD converter value is inserted in google databank).