Cosm sketch for official ethernet shield

Dear all,

I have an Arduino Mega 2560 and the Official R3 Ethernet Shield. I could not find a sketch that works until i stumbled upon the following thread (http://arduino.cc/forum/index.php/topic,137556.0.html), where this sketch (Arduino Playground - WebClient) was recommended.

However, I cannot get it to work with Cosm. Has anyone made any progress on that? Any other code I found just does not work.

Thanks in advance for any help!
P.

Any other code I found just does not work.

What code? What "doesn't work"? You know that "doesn't work" is pretty lame, right? There is absolutely nothing to go on. The only thing we know is that, by your definition of work, whatever that is, the code failed to live up to your expectations, whatever they were.

Works great for me.

John

Filippos:
However, I cannot get it to work with Cosm. Has anyone made any progress on that? Any other code I found just does not work.

The reason why the sketch won't work with cosm is that it was never intended to work with cosm. There is plenty of code around that does work. The most likely place to find it is in the "It Works!" section of the cosm forum. You will even find one of mine you can use or adapt.

I suspect you don't know what cosm is about. It is an internet data service that you feed to, but that data can be made available to the public. The vital thing is that it uses two keys - a feed id that the public can use, and yourself, and an API key that is exclusive to you, covers all your feeds, and is used for maintenance etc. Any cosm sketch will contain both these keys.

The first thing you need to do is register with cosm and thereby obtain the keys.

Note that a "feed" may include several sensors. It is not necessary to include date and time in a feed.

Note also that there a couple of new libraries, cosm and httpClient, that make life a lot easier.

https://cosm.com/feeds/83153

Hello,
Thanks for your replies. Let me be more specific in this post, I only meant to give a general idea of the issue in order to see of I was overlooking something apparent to more experienced users. I am just starting to work with the Arduino and my errors could be elementary... :frowning:

  • I can use the arduino as a server and i.e. set up a webpage that refreshes and contains the temperature I read from a sensor
  • I tried several sketches, like the ones for twitter, cosm, Thingspeak, but I could not get it to upload data. Even the simple http example from arduino didn't work. I could ping to the IP address, and I got messages with codes that I could not find what they meant (i.e. cosmclient.get returned -3). I tried the wiki on http error codes but there were no such numbers.
  • My connection is with static IP, so I give all the relevant info for the Ethernet. The fact that I can ping to it and it replies, means that this part has been properly set up right?
  • About cosm, I have set up a new account and feed, and have always included the keys in it.
  • The sketch in http://arduino.cc/forum/index.php/topic,137556.0.html is the only one that allowed me to use the arduino with the GET command

OK. Now assuming you have some code for using cosm, and assuming a clear understanding that there is no connection between the code you posted and that required for cosm, try uploading the cosm code. Use the # button and paste it between them. Truncate the API key.

Some reading material.

https://www.google.com/search?num=100&hl=en&tbo=d&site=&source=hp&q=cosm+site%3Ahttp%3A%2F%2Farduino.cc%2Fforum%2F&oq=cosm+site%3Ahttp%3A%2F%2Farduino.cc%2Fforum%2F&gs_l=hp.12...3302.9885.0.13018.3.3.0.0.0.0.49.143.3.3.0.les%3B..0.0...1c.1.vhd7bEUlpKE