Here is a very rough draft of my notes for this project. This is an example configuration for ESPHome to communicate with a Renogy Wanderer 10A PWM Charge Controller. Pretty much any Renogy charge controller with an RS-232 port should work with more/less the same config, though some features and fields may not work with all Renogy charge controllers depending on their features.
Some day I plan on returning to this project and doing a more formal write-up, but hopefully this can help someone before then.
First, you need a RS-232/TTLconverter. I used this: Sparkfun BOB-11189 RS-232 Transceiver Breakout which is just a breakout for the MAX 3232. Any equivalent RS232/TTL converter should work. The wiring was a little tricky to get right and I did not take a photo or write down my schematic before tearing it down and throwing it in a box. :( But I used this as my reference for the Renogy pinout: https://github.com/collinturney/solarshed and this for the protocol (look in the reference directory): https://github.com/KyleJamesWalker/renogy_rover.
Sparkfun also has breakout boards for the 6P6C jack used on the Renogy projects so you can breadboard easily and connect it with a nice clean 6-pin cable.
Bonus: The renogy jack also supplies 15V out--if you have an appropriate step-down converter you can use this to power the ESP. DO NOT connect the V+ lines directly to your ESP--most boards cannot step down from 15V so you will likely need an external converter here.
(From memory--may not be accurate)
Device Pin | MAX3232 Pin |
---|---|
Renogy TX | R1 IN |
Renogy RX | T1 OUT |
Renogy GND | GND |
ESP TX | T1 IN |
ESP RX | R1 OUT |
ESP RX | R1 OUT |
ESP 3V3 | Vcc (3V-5.5V) |
ESP GND | GND |
If your wiring doesn't work you can try swapping the RX/TX directions, but make sure you only connect your ESP to the TTL/CMOS side (DO NOT connect the ESP to the T OUT or R IN pins--the ESP cannot handle RS-232 voltages).
Please double-check the schematics, pinouts, and datasheets they provide to avoid any possible damage--I take no responsibility for my memory! When I was playing around with this I did some sanity checking with a multimeter to make sure I didn't fry an ESP with RS-232 level voltages--read the note in the first github link RE: RJ12 pinout.
This is far from well-tested at this point. Use any information here at your own risk. I take no responsibility for errors, accuracy, or anything you choose to do with this information. If you spot something you know to be false, feel free to let me know so I can correct it.
Thanks to these two for posting highly useful information that helped me get this far, as well as a handful of others on GitHub who I no doubt forgot since last year:
Thanks to Renogy for releasing a really cool, really reasonably-priced line of Solar Charge Controllers with a standards-based communication protocol AND releasing the documentation around their specific registers to the community. This is AWESOME of them. They have a forum where some of this was discussed (I believe the original conversations were on a previous host, but still) https://pc.renogy-dchome.com/
Thanks to ESPHome, its developers both past and present and Nabu Casa for making such an awesome project that makes it so quick and easy to play with ESP32 microcontrollers.