The sketch just combines the EggBus example with the EtherCard Cosm(Pachube) example, so it wouldn't be hard to replicate, but I just thought it might save someone some time.
The sketch will only currently work with a Nanode, not a standard Arduino due to the different Ethernet chipsets (I think), but maybe I should try to get that working as well.
The code is available here: https://github.com/smulube/aqe-shield
Any comments, suggestions, corrections gratefully received
--
Hey Ron,
thanks for the feedback. I'm no Arduino expert so this really was a copy/paste job from the work of others, but I'm glad it was of some interest. Will try and get a stock Arduino version working as well if I get a minute.
cheers
Sam
I just reminded I pushed some repositories yesterday with my very own keys!
Luckily these are just test feeds.
Time to reset them :-)
Best,
César
--
Hi. When I set up the Cosm feed should I manually set up datastreams with names that match the output descriptions in the serial monitor? Everything appears to be working fine but no data is arriving at the feed. Any ideas?
Rob
Hey Rob,
hmm that's a bit puzzling, but maybe we can figure it out. I did manually create the datastreams before I started the Nanode running, but actually you shouldn't need to do this - they should get created automatically by the incoming update if they're not present.
So I've had a look at your debug page here: https://cosm.com/users/axisdesign/debug , and there doesn't seem to be anything reaching the Cosm servers. This could mean either that your Nanode hasn't managed to connect to the network properly, or possibly that the API key you are using has a typo in it somewhere, as the only thing that links incoming requests to the debug page is if we have a valid API key to identify which user incoming requests belong to.
The possible API key issue is easy to verify, so maybe just double check that you copied the key correctly into your sketch, but to establish the device is correctly on the network we might need to back up a bit. When you look at the serial output from the board the first bit of output should show a little bit of network connection info. Does that all look alright, i.e. does it look like it's managed to obtain an IP address correctly?
To double check this it might be worth trying to run some of the other EtherCard examples just to make sure they seem to connect as they should. I normally start with the basic testDHCP example, but you should probably also try some of the examples that actually connect out to sites on the Internet.
If that all seems to work, could it be a firewall issue? I'm not sure what type of network you are trying to run the device on, but to test you could try making a manual request to Cosm from another machine. Typically for this we recommend using curl (http://curl.haxx.se/). If you have an OSX or Linux machine you probably already have this available, for windows you will probably need to install it manually.
Once you have it installed, make sure you have the debug page mentioned above open, and then from the same network your Nanode is connected to (actually maybe even using the same Ethernet cable if you can), you should be able to do:
curl --method GET --header "X-ApiKey: YOUR_API_KEY" http://api.cosm.com/v2/feeds/86131.json
which should show some data coming back from Cosm, and you should see the request appearing on your debug page. If that works then you should also try:
curl --method PUT --header "X-ApiKey: YOUR_API_KEY" --data-binary "0,0,0,0" http://api.cosm.com/v1/feeds/86131.csv
just to make sure that you are able to actually send a PUT request.
If all of that works, but still nothing is coming from the shield + nanode, then I'm a bit stuck, but if you drop us a line at sup...@cosm.com, we can dig a bit deeper to see if we can figure anything out.
Hope some of that is useful.
Best regards
Sam
Superb troubleshooting guide about putting data to Cosm in general. I think it should be included in the wiki/faq for new incoming users.
Best,
César
--
I'll try the method using Curl next and see if that explains it. I'm running Windows 64 bit but I have a Raspberry Pi I can use so that will probably be the easiest way to run curl.
What are the two figures below the CO measurement reading as zero? The characters don't appear to be showing correctly.
Rob
Sam,
I tried the sketch both on a MAC and a Windows machine and on both it compiles but I get an upload error to the nanode. I know that the FTDI cable is working correctly as I am able to open the serial port and read the data on the existing sketch. The error I get is:
avrdude: Version 5.11, compiled on Sep 2 2011 at 18:52:52
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/sanjayuppal/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/tty.usbserial-A4016Z0O
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
Seems like a generic nanode to computer error, but wanted to know if you came across this as well.
thx,
Sanjay
Sam
--
Hmm, that's interesting - it looks like the EggBus library is reporting more sensors from your shield than I see on mine. I've attached the output that I get in the Serial monitor.
I wonder if there's a difference in the EggBus version that we are using or if it's a genuine difference in the board (not sure if you have added any other sensors).
Oops, I see you've sent a follow up message. Will respond further there.
I think you're going to run up against the limits of my Arduino knowledge very rapidly. I really don't know what this is. I do remember that I had an issue when I first tried to upload this sketch to the Nanode I had lying around. Previously I'd been using an Arduino Ethernet, which meant that no code would upload until I changed the option in the Tools > Board menu to be "Arduino Nano w/ ATmega328" (actually I suspect any of the ATmega328 boards might well have worked).
So what's the current Board setting, I'm also wondering what version of the Arduino IDE you are currently running? Are you able to load any other sketches the Nanode because when I had that problem I couldn't load any?
You'll probably have more joy posting this message on either the Nanode or Arduino forums as I've very much not an expert in this field.
Sorry that's not more helpful.
Best regards
Sam
Thanks Sam,
I did get it to work when I selected UNO from the drop-down menu (hint from Vic at Wicked Device). Was not obvious to me, now the Nanode Gateway works fine with both OSX and Windows.
Cheers,
Sanjay
--
--
--
--
--
--
Some tips regarding Nanode Gateway:
-Old red Nanode were compatible with Arduino Duemillanove, and current green RF ones are compatible with Arduino UNO.
-I would advise against plugging other shields as most of the pins in RF are reserved by components on board. Only the analogs and digital pins 3,4,7,9 are free to use. We even got some side effects using digital ones.
-Six of the pins are moved in the Nanode RF. I think they are the ones for ISCP programming. Check if there is a connector under wifi shield trying to use those pins as some of the shields use them.
Best,
César
--