ESP32ArduinoRenogy
ESP32ArduinoRenogy copied to clipboard
Had to use jumper on GND for my TTL to RS232 adapter
In case someone else has a similar issue....
The repo provided code works with my Wanderer 10A and my ESP32. Thank you very much for providing. I did struggle at first and used this loopback code to test my TTL RS232 and ESP32 without connecting to my Renogy. The only way to get a loopback to work, was to solder a jumper connecting the GND pins from the TTL side and the RS232 side of my converter (https://www.amazon.com/dp/B091TN2ZPY) along with jumping the TXD and RXD pins on the RS232 side. Once the loopback worked, I disconnected the TXD and RXD jumper, connected my RJ12 connector and was able to use the provided code.
Loopback test code:
#include <Arduino.h>
int counter = 0; // Counter variable
#define RXD2 16 // Define RXD2 as GPIO17
#define TXD2 17 // Define TXD2 as GPIO16
void setup() {
Serial.begin(9600); // For debugging via USB
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial.println("TTL Loopback Test Starting...");
}
void loop() {
Serial2.println("Hello TTL Loopback! Count: " + String(counter)); // Add counter to message
delay(1000);
if (Serial2.available()) {
Serial.print("Received: ");
while (Serial2.available()) {
Serial.write(Serial2.read());
}
Serial.println();
}
counter++; // Increment counter
}