Tony - @Matti Airas I need serial on the HALMET...
@Matti Airas I need serial on the HALMET without using USB. I need receive NMEA0183 and have RS422 to TTL module already. Is it possible?
13 Replies
Sure. ESP32-WROOM supports two hardware serial devices. Serial0 is normally the one that is connected to the USB serial chip and is used for programming and Serial1 is available. It can be connected to any available GPIO pins.
So, you only need to instantiate Serial1 with the pins you use, and you're done.
Okay I will give it a try. Thanks for your prompt response. I’ll share this if I can get it working.
Just remember to cross the wires: TX goes to RX and RX goes to TX. Except when they don't. :-p
I think I have everything working, except when I print to Serial I am getting gibberish...
The default read and prints are just showing numbers
Using GPIO 34 + 32
I can't figure out what format this is. I changed wires and pin assignment so I am positive this is the correct configuration. Data is streaming fast, but not readable
Are you sure the bit rate is correct? Regular NMEA 0183 is usually 4800 bps and only AIS stuff use 38400.
I have tried both 4800 baud and 38400. Both output gibberish, just the lower baud less gibberish
I have two other connections I can try at a lower rate, but I think it's some formatting issue on the Serial
Is it possible to have a ground loop from NMEA0183 and the VCC+GND?
If you have full differential NMEA0183, that shouldn't have such a big impact. Could the UART signal have inverted logic?
I tried using the begin function to invert but still getting jibberish. I double checked the nmea 0183 bus and everything was setup as it should be. My only thought is maybe the RS422 breakout is causing some bits to break the stream. I will try a RPi GPIO header and see if I can stream via the ttl serial port. Also considering another breakout module. Let me know if you know of something reliable to hook esp32 and nmea0183 together
I ended up getting a different module that is 3.3v but still rs422 to ttl. I am getting nothing but -1, meaning zero data. On that same data circuit is NMEA at 4800 feeding into a SSB, which is displaying GPS. Can't figure out why the data is not being converted
I got it working with the new 3.3v module!
Now to send to Signalk to parse into a delta
In case anyone wants to duplicate this, the key for either module is to ground the negative side of the nmea0183 circuit to the ground circuit of the module/esp32
Both modules work fine by the way. It is just a matter of this tiny little change in the circuit. The basic code above will print to console so you know your NMEA is being read
There is very little code needed to proxy from serial to a TCP server connection
This will proxy a NMEA0183 bus to Signalk using esp32. Project is done. Thanks @Matti Airas for the support.
@Tony May you share a link where buying the RS422 to TTL 3.3v converter?