Go Down

Topic: Cosm library broken? (Read 1 time) previous topic - next topic

scary

Hi, about 6 months ago I had working sketches logging to Cosm. Now all my Cosm sketches- even the examples- won't even compile. What has changed? I'm running Arduino 1.0.1 and I've downloaded the Cosm library again and reinstalled it. No good. Here's the error text when I try to compile the DatastreamUpload example:

Quote

C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp: In member function 'int CosmClient::put(CosmFeed&, const char*)':
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:12: error: 'HttpClient' was not declared in this scope
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:12: error: expected `;' before 'http'
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:15: error: 'http' was not declared in this scope
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp: In member function 'int CosmClient::get(CosmFeed&, const char*)':
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:73: error: 'HttpClient' was not declared in this scope
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:73: error: expected `;' before 'http'
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:76: error: 'http' was not declared in this scope
C:\Google Drive\H@CKING\arduino-1.0.1\libraries\Cosm\CosmClient.cpp:163: error: 'delay' was not declared in this scope



fear my badger

draythomp

I use Cosm, but not the library.  I recently moved some code I have to IDE 1.0.3 and had a bunch of trouble compiling various things because I needed to change an #include.  It needs to change from WProgram.h to Arduino.h .

I suspect you're having the same problem.  Look through the library and see if this is the case.
Trying to keep my house under control http://www.desert-home.com/

scary

Thanks for the reply. I tried adding it to CosmClient.cpp and to the sketch without any improvement.
fear my badger

draythomp

Take a look at the README file, there is another library you have to get. 
Trying to keep my house under control http://www.desert-home.com/

draythomp

Yep, that was it.  The Cosm library requires the HttpClient library to work.  The url of the library is in the Cosm README file.
Trying to keep my house under control http://www.desert-home.com/

Nick_Pyner


6 months ago I had working sketches logging to Cosm.


I believe this may simply be due to not using the up-to-date libraries.  I understand that cosm changed something vital at their end and you need to use their kosher libraries

#include <HttpClient.h>       
#include <Cosm.h> 


draythomp

Back in the first post the OP said he downloaded the Cosm library recently.  I suspect he just forgot about the other library.  Plus, the error messages all point to the missing library.  I grabbed both of them and gave it a try under 1.0.3 and everything was fine.

But, the IDE changed and no longer tells you that it can't find an include file.  I've had to work around this problem a lot moving my stuff up to the new IDE.  It used to tell you that a file wasn't found, but now you just have to guess what is going on.  Annoying.
Trying to keep my house under control http://www.desert-home.com/

scary

Hi draythomp, thanks for sticking with this and working this out for me, I'll give the other library a go this weekend.

BTW, I downloaded the Cosm Arduimo library straight from the GitHub linked to on their website. As you pointed out, it does state fairly clearly in the ReadMe that you need to download it.  :smiley-red:
fear my badger

smokin_cannon

The newer libraries aren't mentioned in the Arduino tutorial (e.g. at http://arduino.cc/en/Tutorial/PachubeClientString?from=Tutorial.CosmClientString), is this needed? I've been trying to get multiple sensor values via one COSM feed w/o success and wondering if this is the reason.

draythomp

Terry King (one of the folks on this forum) has a nice example of posting multiple values.  Take a look and see if it helps.
http://arduino-info.wikispaces.com/Cosm-Arduino
Trying to keep my house under control http://www.desert-home.com/

smokin_cannon

Thanks, that's helpful.

Go Up