NOTE ABOUT THIS FORK:
I decided to mark it as V2.1 because this project will probably stay as a fork as I don’t want to affect so heavily the original project (at least at this stage).
I’m testing the software on my setup day-by-day and keep improving on my needs.
My goal here is to create a “universal” way to monitor a solar-tracer via an ESP32-ESP8266 + Blynk. This is one reason I rewrite the code to introduce some OOP that gives the possibiliy for future customizations like different communication chanels or protocols (more solar tracer!).
Tracer-RS485-Modbus-Blynk V2.1
An Arduino project to connect the EPSolar/EPEver Tracer A/B, Xtra, Triton Series MPPT Solar Controllers (RS-485 Modbus) to an ESP8266/ESP32 and monitor it using the Blynk mobile app, the reloaded version!
This is almost complete rewrite of the original project, with ton of improvements, refactored code, brand new Blynk project, and wider compatibility of RS485 convertrs.
Feel free to make pull requests if you wish to help improving.
There is also a support forum on the Blynk community forums: http://community.blynk.cc/t/epsolar-tracer-2210a-charge-controller-blynk-epic-solar-monitor/10596
Hardware

Sample screenshot

Software
Wiring
Cut open your ethernet cable and split out pin 3, 5, 7 (B, A, GND). Refer to Tracer Modbus PDF for additional info.
Follow the wiring guide below: (note that the 2-pol switch is only needed during flashing) No longer needed!

Note: as @Don Vukovic noted, there is probably reversed RX and TX on this schematic. Correct is: DI to TX, and RO to RX
Setup
Libraries
Follow links to get them.
Tutorial
I moved all the settings in one file only (config.h) an example is available in conf/config.example.h . esp_credential.h is not part of the project any more.
Edit esp_credentials.h library
Firstly, enter WiFi credentials in esp_credentials.h.
You will be able to use this file by including it in any sketch by entering #include <esp_credentials.h>. (This include is already present in settings.h, there’s no need to add it.)
Example:
/**************************************************************
* Settings - Wifi Credentials
**************************************************************/
#define WIFI_SSID "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
#define WIFI_PASS "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Updated Blynk App V2.0
- Open the Blynk mobile app and create a new project by scanning the following QR code

- Send yourself the generated auth code
- Paste your auth code into
esp_credentials.h:
#define AUTH "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Disconnect TX/RX cables (or open the switch if you have one)
- You don’t have to do this anymore! But it’s always best to have it disconnected.
- Upload the sketch to your ESP8266
Once uploaded, reconnect the TX/RX cables and plug the cable in to the Tracer COM port
- Just plug the ethernet cable to the Solar controller. Anyhow, it is always a good idea to repower the MAX485 module, if you’re using one, between sketch uploads
- Load the Blynk project and hit PLAY button to start receiving data
Reference

I’m using this cheapo module and it works quite fine.
It’s powered from +5V from ESP8266, and wired as following:

Developing further
I plan to add more features and pull more data from the controller once I have my own solar system running.
If you’d like to pick this up and have a go at adding features, I’ll be happy to accept pull requests.
You are welcome for suggestions, bugreports, and of course any further improvements of this code.
@tekk’s V2 Changelog
- Rewrote whole sketch
- Tried to utilize HardwareSerial
UART2 - no avail :(
ModbusMaster library is incopatible with SoftwareSerial, (don’t even try)… Would need to rewrite whole ModbusMaster, so Hardware UART is the only option for smooth & seamless communication because of the interrupt driven data transmission, more precise timing, and HW buffer, and stuff
- Optimized for very cheap MAX485 module, you can buy it from usual sources…
- Feature: Added option to switch the output of the Tracer MPPT Controller ON/OFF from the Blynk app
- Improvement: You no longer need to disconnect and reconnect Modbus RS485 Serial port from the ESP8266 while uploading
- Code rewrote to use as little magic constants as possible
- Added
preTransmission abd postTransmission Modbus handling / signalling, just to be sure…
- Added calls to
ESP.wdtDisable() and ESP.wdtEnable(1), temporary System Watchdog shutdown and later found it to be not necessarry
- Avoids unwanted rebooting of ESP8366 while receiving data from the Modbus
- Added more debug outputs and results to USB Serial
Credits
-
@jaminNZx:
- Thanks to subtafuge on Reddit for lending me his working Tracer RS485 code!
-
@tekk:
- Feel free to contact me about my code changes in this version
- Thanks to @jaminNZx for the original code. Big up!
评论