Skip to content

Commit

Permalink
Add ESP32 d1 mini how to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Bettapro committed Sep 19, 2021
1 parent 1a28776 commit 68500e9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Refer to [Sw_getting_started.md](docs/Sw_getting_started.md)

Some details about some specific implementations:
- ESP8266 + MAX485 + EPEVER Solar Tracer [HOW TO](docs/Esp8266_max485_epever_rj45.md)
- ESP32 D1 MINI + MAX485 + EPEVER Solar Tracer [HOW TO](docs/Esp32_d1_mini_max485_epever_rj45.md)


## Reference

Expand Down
52 changes: 52 additions & 0 deletions docs/Esp32_d1_mini_max485_epever_rj45.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Connect ESP32 D1 MINI to EPEVER A/B Series ( + MAX485)

Here the material involved:
* [ESP32 D1 MINI](https://www.aliexpress.com/premium/esp32-d1-mini.html?d=y&origin=y&catId=0&initiative_id=SB_20210919083440&SearchText=esp32%20d1%20mini)
* [EPSolar/EPEver Tracer A/B-Series](https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20170114172728&SearchText=tracer+mppt+rs485)
* [MAX 485 UART Module](https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20210919083609&isPremium=y&SearchText=max485+module)
* An old ethernet cable with RJ45 connector you are happy to cut open


## ESP32 D1 MINI <-> MAX485 module

![This one worked for me](../images/max485_module.jpg)

It's powered from `+5V` from ESP32 module, and wired as following:


- `DI` -> `IO17` / `GPIO17` / `TX2`
- `RO` -> `IO16` / `GPIO16` / `RX2`
- `DE` and `RE` are interconnected with a jumper and then connected to pin `TCK` / `GPIO13`
- `VCC` to `+3.3V` / `3V3` on ESP32


![ESP32 D1 MINI](../images/esp32_d1_mini_pins.png)

## MAX485 module <-> EPEVER CONTROLLER (RJ45)

Cut open your ethernet cable and split out pin 3, 5, 7 (B, A, GND). Refer to [Tracer Modbus PDF](../docs/1733_modbus_protocol.pdf) for additional info.

Connect cables as follows:
- Ethernet green, pin `5` -> `A`
- Ethernet blue, pin `3` -> `B`
- Ethernet brown, pin `7` -> `GND` on module **and** EPS32 `GND` pin
- -> to prevent ground loops - **important!**
- **DON' T** use pin `1` or `2` to feed the ESP8266 (they supply 7,5/5V - 50mA maximum)

![EPEVER RJ485 SPEC](../images/epever_rj45_specs.png)

## BASE SW CONFIGURATION

Edits required on *src/config.h*:
- `#define BOARD_ST_SERIAL_PIN_MAPPING_RX 16`
- `#define BOARD_ST_SERIAL_PIN_MAPPING_TX 17`
- Uncomment `#define USE_SERIAL_MAX485`
- `#define MAX485_DE 13`
- `#define MAX485_RE_NEG 13`

Edit on *platformio.ini* (Platformio only):
- `platformio.default_envs = wemos_d1_mini32` (usb/serial fw flash) or `platformio.default_envs = wemos_d1_mini32_ota` (ota fw flash)

You may need to make more changes according to your needs (ntp syn/led status/ data to monitor ...).


Binary file added images/esp32_d1_mini_pins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 68500e9

Please sign in to comment.