Farm-Data-Relay-System icon indicating copy to clipboard operation
Farm-Data-Relay-System copied to clipboard

UART To PI MQTT Local Loopback

Open Devilbinder opened this issue 3 years ago • 5 comments

Looking at the setup diagram it is possible for a ESP to get connected directly to a PI and pull the serial JSON . The serial JSON can then be translated to MQTT and sent to the broker on the local loop back on the PI itself. This will eliminate the need for the extra ESP at the PI. chrome_2022-06-27_23-48-39

Devilbinder avatar Jun 27 '22 21:06 Devilbinder

This was an intermediate solution that I used for a good portion of time! It used to be the go-to method, but Andreas pointed out that it would be really beneficial to put the ESP-NOW antenna in an elevated and possibly obscure position, which wouldn't be a good spot for the server(s). I still suggest this to people with more critical applications. At one point it was officially documented, but it seems to have been removed in my last rewrite of the gateway readme. Noted.

timmbogner avatar Jun 27 '22 22:06 timmbogner

IMG_20220627_170826915

timmbogner avatar Jun 27 '22 22:06 timmbogner

I actually just used a serial node in Node-red, no MQTT at all.

timmbogner avatar Jun 27 '22 22:06 timmbogner

One can still implement this scheme (getting rid of the final ESP) and have the antenna at an elevated (or otherwise remote) location if needed. In such a case, I would recommend using RS-232 or even RS-485 (for more distance) for the link between the ESP and the PI instead of TTL-serial. Cheap TTL to RS-232 modules are available everywhere and easy to build as well.

lekrom avatar Jun 28 '22 05:06 lekrom

Would recommend RS485. Had enough industrial equipment on farms cause issues from EMI. Bi-directional communication becomes a pain then. RS422 is bi-directional but the it is sometimes expensive basically 2x RS485.

Devilbinder avatar Jun 28 '22 19:06 Devilbinder