Here the material involved:
- ESP 32 MODULE, below the modules tested:
- ESP32 D1 MINI
- ESP32 WROOM DEV MODULE
- or any esp32 module you like
- EPSolar/EPEver Tracer A/B-Series
- MAX 485 UART Module
- An old ethernet cable with RJ45 connector you are happy to cut open
It's powered from +5V
from ESP32 module, and wired as following:
DI
->IO17
/GPIO17
/TX2
RO
->IO16
/GPIO16
/RX2
DE
andRE
are interconnected with a jumper and then connected to pinTCK
/GPIO13
VCC
to+3.3V
/3V3
on ESP32
DI
->28
/GPIO17
/TX2
RO
->27
/GPIO16
/RX2
DE
andRE
are interconnected with a jumper and then connected to pin15
/GPIO13
VCC
to+3.3V
/3.3v
on ESP32
Cut open your ethernet cable and split out pin 4, 6, 8 (B, A, GND). Refer to Tracer Modbus PDF for additional info.
Connect wires as follows (make sure your cable matches the color schema below - otherwise refer to pin numbers only):
- Ethernet green / pin
6
->A
- Ethernet blue / pin
4
->B
- Ethernet brown / pin
8
->GND
on module and ESP8266GND
pin - -> to prevent ground loops - important! - DON' T use pin
1
or2
to feed the ESP8266 (they supply 7,5/5V - 50mA maximum)
Edits required on src/config.h:
#define BOARD_ST_SERIAL_STREAM Serial2
[default]- Uncomment
#define USE_SERIAL_MAX485
#define MAX485_DE 13
#define MAX485_RE_NEG 13
Edit on platformio.ini (Platformio only):
- ESP32 MINI D1 - only
platformio.default_envs = wemos_d1_mini32
(usb/serial fw flash) orplatformio.default_envs = wemos_d1_mini32_ota
(ota fw flash)
- ESP32 DEV MODULE - only
platformio.default_envs = esp32dev
(usb/serial fw flash) orplatformio.default_envs = esp32dev_ota
(ota fw flash)
You may need to make more changes according to your needs (ntp syn/led status/ data to monitor ...).