Nanodes – online with Pachube

Continuing from the previous nanode blog post, this is some information on my next steps.

I wanted to show some data and have it uploaded to the internet and accessible from anywhere.

 

I had read about Pachube and the internet of things but had not had a play with it until I found some time. Firstly head to their site and set up a free account. They allow limited free accounts, where you can have up to 5 separate feeds and a 1 month data history buffer. Not quite what I want in the end, but good to test at the moment. This is the quickstart guide, which I found useful.

Create an account and login. Click on the ‘Create a feed’ menu and enter in some data. You need to say that you will ‘push data to us’, fill in the other boxes if you want, or you can do that later.

The next thing you need to to do is sort out the code for the nanode. Iused two main pieces of work, one from Andrew Lindsay and one from Trystan Lee.

First download and install the ethershield library from Andrew Lindsay (this might have been done already, as I did with my previous blog post). Place this in your Libraries folder.

Next download the openenergymonitor nanode sketch examples. Place this in your sketchbook.

I used the ‘EtherShield_simpleClient_pachube” example. This does not use DHCP (Dynamic Host Configuration Protocol) as the router I was using was set up with static IP. I will look at the other examples when I have a moment. I opened this example and then saved it under a different name so I could mess around with it.

The data you will need is:

Your mac address: (this just has to be different to anyone else’s change the XX to some number)

The IP address of your nanode – this has to be different to anything else on your local network (I am using static IPs and this is a free one on my particular LAN – you might have to use a different one):

This is the address of your gateway to the internet – in this case the address of the router. This can be found by following these instructions. My system was a bit crazy as we have two routers, one which does the wireless stuff and one for the LAN. I spent a long time trying to sort this out, only to find one router was set up with 192.168.0.XXX and one as 192.168.1.XXX and I was using 1 not 0:

You also need the server IP. This is from pachube:

You also need – The pachube host address:

Your pachube account API key. This can be found when you log in to your pachube account, under ‘My API Keys’. Create an additional key, which can be shared and restrictd, rather than your master key (The X’s are where you put your key):

Last thing to include is the feed number. You can find this by going to your pachube account, clicking ‘My Feeds’, then clicking on the feed title. The web address will have a number at the end – this is the feed ID number. In my case I was using a .csv feed, as this is simple for use with microcontrollers (again, the X’s note the number to enter):

Phew. Now all that is put into the sketch and saved. Upload the code to your nanode. Plug it in to the network. Click on the serial monitor of the arduino (I am assuming that you are using a FTDI cable to connect to the nanode) and you should get a message like this:

If you don’t get anything back then something is not right. I suggest checking the IP addresses used. Also my error message is after I have been using it a while and have gone over the ‘free’ allocation (hence it tells me rate is too fast). You should also check out your pachube feed. the data next to the feed name should be the two analogue values read from a1 and a0. Pachube might take a while to respond and show a graph as it only updates every 5mins or something.

I now have some graphs of random data. Now I need to make it more interesting….

2 responses to “Nanodes – online with Pachube

  1. Great article! I will definitely spread this around the Pachube community. The Nanode is a fantastic little board!

    You mentioned that Pachube isn’t “what you’d want in the end”, so I’m just wondering if you can expand on that a bit and let us know how we can make the service better!

  2. Quoting Ed Borden:Great article! I will definitely spread this around the Pachube community. The Nanode is a fantastic little board!

    You mentioned that Pachube isn’t “what you’d want in the end”, so I’m just wondering if you can expand on that a bit and let us know how we can make the service better!

    Hi Ed,
    Thanks for the comment. The nanode is a great board.
    I think my line about ‘not what I’d want in the end’ related to a potential use I have for the nanode/Pacube where I upload monitoring data which would have to be kept for more than one year (remote monitoring of renewable energy systems). I realise this is included in the paid for service. Its one potential use I have for the nanode.
    Other things that would be great would be different visualisations (bar charts/pie charts/ etc etc rather than line graphs) but maybe that can be implemented and I just have not realised it.
    I really need to have more of a play with it. My next moves are setting up some interesting data streams (I plan on monitoring a homebrew system) and then doing interesting stuff with the data.
    Keep up the good work with Pachube.
    Cheers. Matt

Leave a Reply

Your email address will not be published. Required fields are marked *