I’d like to ask if it’s possible to write a ‚driver‘ for another hardware device using PHP only, or if it’s not possible, if it is possible using the SDK. I want to read information from my weather station & solar panel reporting device which operate on 433 mhz. I have an rfxcom transceiver. Its API basically consists of reading/writing its custom protocol to a (virtual) serial port. Now I guess I could poll the serial port every second from PHP (through an event that is fired every second), but that feels wrong. Or is this the recommended way? I’d have to do the same if I were to use the SDK I guess, but at least that wouldn’t have to spin up a whole PHP process every second.
Secondly, I’d like to write a custom ‚configurator‘ as well. Is that possible?
The easiest way to get startest would be to add a RegisterVariable instance and connect it to a new I/O serial port instance. Then create a script which you choose as a target within the RegisterVariable instance. Now all data that gets received from your device gets piped into the php script.