Skip to content

An arduino sketch to connect the EPSolar/EPEver Tracer A/B Series (RS-485 Modbus) to an ESP8266 and monitor using the Blynk mobile app - the RELOADED version

Notifications You must be signed in to change notification settings

tekk/Tracer-RS485-Modbus-Blynk-V2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracer-RS485-Modbus-Blynk V2.0 - RELOADED

An Arduino project to connect the EPSolar/EPEver Tracer A/B, Xtra, Triton Series MPPT Solar Controllers (RS-485 Modbus) to an ESP8266 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

Triton Xtra Tracer-AN Tracer-BN

Sample screenshot

Live data on Blynk on Android 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!

Tracer Wiring Diagram

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

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

Project 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

This one worked for me

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

  • MAX485 module <-> ESP8266

    • DI -> D10 / GPIO1 / TX
    • RO -> D9 / GPIO3 / RX
    • DE and RE are interconnected with a jumper and then connected do eighter pin D1 or D2
    • VCC to +5V / VIN on ESP8266
  • Tracer A/B MPPT Controller Ethernet cable <-> MAX485

    • Ethernet green, pin 5 -> A
    • Ethernet blue, pin 3 -> B
    • Ethernet brown, pin 7 -> GND on module and ESP8266 GND pin
      • -> to prevent ground loops - important!

ESP8266 NodeMCU v0.9

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!

About

An arduino sketch to connect the EPSolar/EPEver Tracer A/B Series (RS-485 Modbus) to an ESP8266 and monitor using the Blynk mobile app - the RELOADED version

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 80.7%
  • C 13.6%
  • Python 5.7%