Giter Club home page Giter Club logo

tracer-rs485-modbus-blynk-v2's Introduction

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!

tracer-rs485-modbus-blynk-v2's People

Contributors

jaminnzx avatar tekk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.