For a university project we needed to transition from a regular Arduino to Photon so that the final product would be independent of “expensive” hardware like a laptop. However, to test our measurements, we need a way to constantly read values to at least a laptop (with no cable connection), and the only way I’ve found so far is to use
particle variable get [photon] analogvalue
This, of course, means I can get only one reading per the time interval it takes to copy and paste the command into the console, and is thus completely irrelevant for time-bound measurements
How can we ‘automate’ it or obtain a result somewhat close to Arduino’s serial-read option?
(This is the first day of me using a Photon, I could’ve missed an important chunk of information while trying to get at least some kind of results)
There are many ways to do this, depending on other requirements and how much work you want to do. For example, this is part of the display for my house that I have on a secondary monitor on one computer, and two cheap Android tablets around the house.
The Particle Photon and Argon devices communicate by UDP multicast over my LAN. This eliminates the use of data operations, and allows for fast and frequent updates for some sensors, like the wind speed sensor.
There are some cellular (Boron) devices that communicate using Particle.publish as they do not frequently transmit data.
The missing piece for the browser interface is a small server written in node.js. This is necessary because browsers can’t access UDP multicast, so the node server monitors the UDP multicast and converts it into server sent events (SSE) that the browser can display, basically in real-time.