data to COSM from Idigi_dia

I am trying to push xbee sensor data (in CSV format) to COSM (former pachube) from idigi_dia using TCPSCV presentation with little luck. My network uses ConnectPortX4 and 10 xbee wall routers. COSM does not provide a Port No. This could be what I do wrong. Data pblishing to Idigi developer cloud works fine. Any help (code examples to start with) please ? [:-/]

I’d suggest you ask on the cosm.com forum.

I have NOT used cosm/pachube, but I would just guess from a quick browse of the web site FAQ that you need to use an HTTP POST to push your CSV to their site.

If true, then the TCPCSV presentation won’t help you. You will need to create your own presentation using the CSV code from that one, then use HTTPLIB to push up the ‘file’.

I’m interested in the solution.

It would be fine if your post your solution to this forum (or publish the code on the developer wiki) once you will have integrated your solution.

OK This is easy
i has been using this method for over 3 months now

req = urllib2.Request(url=‘https://api.cosm.com/v2/feeds/XX1.csv?_method=put’,data = XX2)
req.add_header(‘X-ApiKey’, ‘XX3’)
r = urllib2.urlopen(req)

just replace
XX1 with your feed Number
XX2 with your CSV Data like 1,20 or 2,40
XX3 with your API Key
Islam Galal