Pages: [1]   Go Down
Author Topic: Cosm library broken?  (Read 1087 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

fear my badger

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 1
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

fear my badger

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at the README file, there is another library you have to get. 
Logged

Trying to keep my house under control http://www.desert-home.com/

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, that was it.  The Cosm library requires the HttpClient library to work.  The url of the library is in the Cosm README file.
Logged

Trying to keep my house under control http://www.desert-home.com/

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2270
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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> 

Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 1
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

fear my badger

Columbus, OH
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Trying to keep my house under control http://www.desert-home.com/

Columbus, OH
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, that's helpful.
Logged

Pages: [1]   Go Up
Jump to: