Sunday, November 8, 2015

particle subscribe mine

Hello everyone!

I finally got a chance to play with my Photon from, and I had been using the dashboard to debug my events..

I have a snipit of code that uses the provided OneWire library to read the temp from all of the sensors attached to my photon, and one by one 'Publish' a key/value pair to the particle API.  I was using the OneWire address in hex as the key, and the temp in fahrenheit as the value.  This would allow me to later create a mapping of which sensor was located where, but didn't need to be hard-coded into the firmware of the device.

I learned about two things today, both from the particle cli tool: particle subscribe mine and particle serial monitor

particle serial monitor lets me read the Serial.print* statements from my photon if I have it plugged in with a usb cable.  I was previously opening up the editor to do this (while actually editing my code in the slick web IDE).

particle subscribe mine is a way to subscribe to all events produced by your devices on your account.  Since my events are dynamically named based on the OneWire address, I didn't have a direct name to subscribe to.  I'll have to create a service to read in the values from my sensors and log them for later processing.

Happy Hacking!