Is there a way to publish data to a CSV file hosted on a webserver?

I would like to use dygraphs which is javascript based graphing software, running on my own web hosting provider, to graph sensor data from the Particle Photon. Dygraphs reads data in the form of a CSV file and so I am trying to see if it is possible to publish from the Photon directly to a web-hosted CSV file. Is this possible? Any help is appreciated.

It sure is.
I use a webhook to add rows to a spreadsheet in Google Drive.
Got the code directly from a tutorial post. Should be able to find it with a quick search on this forum.

1 Like

I am aware of the google spreadsheet method however I don’t like it for multiple reasons incl. max 2000 rows and limit to single variable per row. I am really looking to put data in a csv file hosted on my own web server.

Check for example this thread, it uses webhook to send data to PHP script. You will need to replace JSON encoding with creating CVS line in the PHP script. Say your published variable is already CSV line, like:

value1,value2,value3

Then it should be as simple as (part with . "\n" adds newline character after you data so you don't have to send it from particle):

file_put_contents('path/to/file.csv', $_POST['data'] . "\n", FILE_APPEND);
1 Like

I don’t have either limitation.
As you can see on the attachment, rows > 2000 and fields >> 1.
The method I’m using also allows sheets to be created automatically. I have several devices, so I use the device name.
It’s all doable!

cool! what method are you using to do that?
thanks!
Gustavo.

1 Like

I too would like to know how you do that. I guess it is a method other than IFTTT.

@gusgonnet, @jdebonth

1 Like

thanks! nice method