Pachube and WiShield

Discussion about any of the included sketches (i.e. WebServer), or user-generated applications.

Pachube and WiShield

Postby mbdtsmo » Tue Sep 01, 2009 2:10 pm

Hi all,

has anyone managed to get the WiShield working with pachube (http://www.pachube.com) ? Unfortunately i am not much of a programmer. What i tried so far is using the simple client in conjunction with the manual pachube feed, which didn't work since you there is not PUT method available in WiShield. I also tried the automatic option (means pachube connects to arduino in WebServer mode), but it complains about the mime-type (although it is in the xml info).

I can upload the code i tried, if necessary.

Thanks all,
mbdtsmo
 
Posts: 3
Joined: Tue Sep 01, 2009 2:05 pm

Re: Pachube and WiShield

Postby GregEigsti » Tue Sep 01, 2009 9:12 pm

I wondered when "WiShield + Pachube" would become a question ;) I have just became aware of Pachube and have to admit not being sure what it is all about - but I do like the idea of Pachube's repository of sensor data approach.

There is no Pachube sketch that I am aware of nor do I have an extra WiShield to play with at the moment (and I am knee deep in a non-WiShield project). However if Pachube holds the promise that my uneducated brain thinks it might a Pachube sketch would be a good thing.

I'll go look at Pachube and see if I can figure something out.

Greg
Last edited by GregEigsti on Wed Sep 02, 2009 11:51 pm, edited 1 time in total.
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Pachube and WiShield

Postby GregEigsti » Tue Sep 01, 2009 9:23 pm

Just sent mail requesting a Pachube beta account...

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Pachube and WiShield

Postby mbdtsmo » Wed Sep 02, 2009 7:17 am

Hi Greg,

thanks for the feedback.
I agree, that the pachube website looks extremely beta, and that there is not too many useful projects out there so far.

I think if you have a look at http://www.marinetraffic.com/ais/default.aspx?centerx=30¢ery=25&zoom=2&level1=140 (and zoom in a bit) you can get an idea what pachube *could* be ;) That site has sort of the same philosophy as pachube. Each ship has to regularly send AIS data about its position, bearing and so on. And whoever wants to can use that info to track, visualise, statistically analyse the data. I can see pachube providing a similar service for, say, environmental pollution among other things.

I personally would like to hook up a couple of probes to my fishtank and feed that to pachube, so i can monitor it anywhere in the world. I am a geek, that would make me happy ;)

Matt
mbdtsmo
 
Posts: 3
Joined: Tue Sep 01, 2009 2:05 pm

Re: Pachube and WiShield

Postby GregEigsti » Wed Sep 02, 2009 8:34 pm

Just got my Pachube beta invite! Going to try to take a look at it tonight and mebbe add a few inputs (home power usage, outside temp and air pressure - Seattle area). Actually kind of excited about it. If I can get something going pretty easily I'll post back with more info. This is data already collected by a server at home and stuck into MySQL - not directly from a WiShield - for the time being. I'm thinking I need another WiShield + Arduino so maybe that could be another input. What can I measure with it??? I'm thinking inside temperature since I am not currently gathering that anywhere.

FYI - mid next week I'm taking off for a camping trip and will be off of the grid for ~10 days. But maybe I can look at WiShield + Pachube after that - doubt I'll get there sooner.

>>Each ship has to regularly send AIS data
Now that is extremely cool - thanks for the link! Gotta look up AIS hardware for the boat (AIS with Arduino, small radio and NMEA GPS module?). ;) We have a place in the San Juan islands and this would be a fun one to watch for passing ship identification! I have been using APRS for years and more recently the SPOT messenger too. I'm kinda a cartography and GPS nut (I'm the official navigator among my circle of friends).

Tonight is dinking with the ParkTron night; got the SparkFun SerLCD working yesterday and it is currently a bit "flashy" (asked to refresh too much/fast) so I'm gonna add some optimizations around LCD updates... That should actually be pretty quick, then I'll look at Pachube if I am not ready for bed.
Check out ParkTron! Unfortunately no WiShield involved but cool nonetheless.
http://asynclabs.com/forums/viewtopic.php?f=20&t=85

>>I am a geek, that would make me happy
Right there with you brother!

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Pachube and WiShield

Postby GregEigsti » Thu Sep 03, 2009 1:07 am

Took a look at Pachube and am intrigued, has some potential. Could not get a POST to work via telnet but did get the sample curl call to work. Seems to work as advertised. I'm going to need to work out a couple of solutions to deal with Pachube; one for a Win32 server that hosts a bunch of my data and another for "direct from WiShield" posting. The Pachube web site specifies the following HTTP requests for dealing with the service; the first two are the most interesting for the WiShield:
- Methods to retrieve data from the Pachube API require a GET request.
- Methods that update or edit feed data require a PUT (though see below for how to do this in clients that are unable to PUT).

I looked around (some of) the WiShield source and the higher level stuff (that enables samples such as Tweet, Web Client, etc.) support GET and POST but not yet PUT :( I don't recall the differences between them all but it looks like adding support for PUT would not be that bewildering. It may even be as simple as "overriding" the POST stuff in WiServer.cpp to do a little magic to achieve a PUT. I need to look at the lower level stuff to see if it could be done in a more flexible way (e.g. a close approximation to sockets).

From the Pachube API docs - re: using POST instead of PUT
If your client is unable to make PUT requests, then this can be simulated by a POST request and a "_method=put" parameter, e.g. by POSTing to http://www.pachube.com/api/504.xml?_method=put

Sounds like a good reason to buy another Arduino and WiShield ;)
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Pachube and WiShield

Postby GregEigsti » Thu Sep 03, 2009 4:03 pm

Ordered another WiShield + Arduino to keep aside for experimentation - shhh don't tell the wife ;)
Also got some thermistors and light sensors to tack on for some fun data to throw at Pachube. Should have the stuff when I get back from camping and then I'll look at what needs to be done to provide a Pachube sample sketch.

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Pachube and WiShield

Postby mbdtsmo » Thu Sep 03, 2009 4:11 pm

You are a dedicated person ;) Great timing btw, since i am away on holiday from tomorrow as well. (54.318125,8.618774)
Enjoy the camping
mbdtsmo
 
Posts: 3
Joined: Tue Sep 01, 2009 2:05 pm

Re: Pachube and WiShield

Postby GregEigsti » Thu Sep 03, 2009 9:21 pm

since i am away on holiday from tomorrow as well. (54.318125,8.618774)

GPS coordinates? Near Bad Sankt Peter in Germany? I'll be at (42.250567,-118.178387).

Gonna get the kids to bed and look at WiShield POST vs. PUT
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Pachube and WiShield

Postby GregEigsti » Fri Sep 04, 2009 12:34 am

You are a dedicated person


Well I think that the WiShield + Arduino are incredibly intriguing - add Pachube and things get really cool!
Wrote a Mac program this evening that PUTs and POSTs to Pachube (POST with the "_method=put" argument mentioned above). Have a good handle on how to make the WiShield's POST method work for Pachube - with no changes to the WiShield code.

A PUT to one of my feeds looks like - this is the "raw" data sent to the Pachube web werver:
Code: Select all
PUT /api/2555.csv HTTP/1.1
Host: www.pachube.com
X-PachubeApiKey: MY_API_KEY
Content-Length: 1
Connection: close

8


The 'PUT in a POST' looks like this (adds '?_method=put' to make POST act like a PUT):
Code: Select all
POST /api/2555.csv?_method=put HTTP/1.1
Host: www.pachube.com
X-PachubeApiKey: MY_API_KEY
Content-Length: 2
Connection: close

11



Just need a little time and a WiShield to see what is really going on when using POSTrequest and what needs to happen to persuade it to do a 'PUT in a POST'
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Next

Return to Sketches and Applications

Who is online

Users browsing this forum: No registered users and 2 guests

cron