gavinying/modpoll — reverse-engineered prompt
Reverse engineered prompt
Build me a simple command line tool called modpoll that I can use as a portable Modbus checker and also as a small Modbus to MQTT gateway. I want to be able to connect to Modbus devices over TCP, UDP, and serial, poll registers or coils based on an easy config file, and either print the values in the terminal for local debugging, save them to local files, or publish them to an MQTT broker so I can view the data remotely on my phone.
Please make it feel like a standalone tool that works out of the box on Linux, macOS, and Windows, and is also easy to run on a Raspberry Pi or in Docker for continuous polling. It should support one time polling and long running polling, and let the config come from either a local file or a public URL. Include a few working example configs and a quickstart against a test Modbus device if possible. Keep the setup straightforward, and look up current docs online if you need to.
Want more depth? Deep Reverse