I am building a project with about 10 identical photons which hook up to a push button and send a timestamp along with the photon ID to a database for collection. So far, I’ve written a simple firmware to publish events from 3 different devices to my particle console(s), but when I refresh the page those events disappear, and I don’t see a “logs” option. I’ve tried the webhooks example with ThingSpeak several times and the events simply never show up on the page. I just need a simple “view only” export of the events in a google sheets/excel style, or even a MySQL / MongoDB database. At this point I am open to any low cost/free solutions. I am using the following code to publish events: Particle.publish("ON",myID, 60,PRIVATE);
Here’s what I would like the final output to look like (When I publish an event):
Photon1337, ON, {timestamp}
Photon1384, ON, {timestamp}
Photon1337, ON, {timestamp}
…
I would like to have this history accessible from any web-connected computer, with the ability to search/sort data without modifying it. Ideally a TXT or CSV file would be easy for me to work with, where I don’t have to worry about logins or random URL exports…
Howdy. I used Gustavo’s tutorial and had a temperature reading post to google sheets with the data every min. It ran all day with over 500 entries before I shut it off.
I started using the papertrail integration for the built-in logging. Papertrail is an on-line log viewer with 7-day history. There is a free version. You simply need to register for a papertrail account. Include the papertrail library in your project (search for papertrail). And then add a papertrail handler in your .ino file such as this:
You can change the URL, port number, application name, device ID and log level to your liking. In your function that handles the button press, you need to add a log command such as:
Log.info(“There was a button press!”);
The coolest part of the integration is being able to flash new firmware to a device at great distance away (miles) and being able to see the logs populate on papertrail and diagnose what’s going on.