Issues reading VE.Direct serial output from MPPT 75/15 with ESP2866 (WeMos D1 R1 board)

Hi,

We want to use WiFi-enabled ESP2866 (WeMos D1 R1 board) to control some relays, and in addition, to provide us (re-send) output of VE.Direct via same WiFi connection we control relays. Everything is powered with Victron MPPT 75/15, using lead-acid battery and solar panel, i.e. sort of “off grid” power / device box.

Strangely, I can read VE.Direct output with ESP2866 correctly only if:

  • Using EspSoftwareSerial::UART (SoftwareSerial), but only with invert parameter set to true. Sadly, software serial does not seem stable enough, that is I lose some bytes (probably due to WiFi cpu usage, etc?).
  • Using HW SerialPort (D0 as RX), BUT with huge hack by using TWO UART->TTL MAX3232-based converters [see picture below], because otherwise I get garbage bytes into SerialPort.

Strangely, if I use same (single) UART-TTL converter to connect with PC (using random USB<->RS232 cable in addition), and connect VE.Direct with that UART-TTL headers, I can red VE.Direct output just fine.

Do I miss something? Maybe VE.Direct is inverted for a reason and I MUST use special cable? But why then it works with MAX3232 converted connected to PC…? I’m completely lost…

Here’s the hack I can use to avoid garbage bytes when using HW SerialPort of ESP2866:

P.S. I use same 19200 8N1 settings in ESP2866 and PC.

Use an oscilloscope to see what’s happening there.
As the VE.Direct is a permanent broadcasting port, you’ll see if needs to be inverted or not.

PS: Move it to DIY section, Q&A is for Victron’s equipment related questions. :slight_smile:

Sorry, I was pretty sure I selected DIY, probably miss-clicked or something.

Hey @Vincas

check GitHub - hoylabs/OpenDTU-OnBattery: Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters, VE.Direct devices, battery management systems, and related peripherals to compare your solution with a knowing working one.