OpenSprinkler Forums OpenSprinkler Unified Firmware MQTT Integration Reply To: MQTT Integration

#51711

digitalbits
Participant

I think what you have is pretty much the same thing as my initial post. One difference is wrapping the ‘data’ into a transaction type as if you subscribe to a parent topic, you will want to know what type of update it is (a station status update) for example. I have also changed things a bit, added weather update notifications, a heart beat to know that its alive and doing its thing and once per second updates when a zone/program is running which will also support flow sensor updates as well.

I have made significant progress – and actually have it working on my home sprinkler setup already. I’ve just got to add the options to the configuration pages to enable and provide a hostname. I also added i2c LCD support on the raspberry pi using a 20×4 LCD too and an option to have open sprinkler just bind to LOCALHOST so you can put it behind a reverse proxy (if you wish). I don’t know if Ray want’s all of this in a pull request or just the MQTT stuff. I got kinda carried away and added more features.

Ray – I guess a question for you would be what MQTT library is good to use on the raspberry pi? I know there’s a lot of code in OS that starts from an ESP type platform and is adapted or changed. To get started I just grabbed the embedded version of the PAHO-C MQTT library and used that. Is this acceptable? Should I look at an alternative library? I’ve abstracted the MQTT functions into a adapter class so it becomes pretty easy to make it portable to other devices based on whatever libraries we want to use, if different, vs changing them w/ #define statements.