Hello
I'm trying to connect an arduino R4 to my smart meter. I have a cable from P1 port to the usb-c from the arduino. I power my arduino with the vin.
This is the code i use
void setup() {
// Starts serial communication at 9600 bits per second
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// Checks if data is available on the serial port
if (Serial.available() > 0) {
digitalWrite(LED_BUILTIN, HIGH);
// Reads the incoming line as a string (String)
String inString = Serial.readStringUntil('\n');
// Print the text received on the serial console
Serial.print("Text Received: ");
Serial.println(inString);
}}
This works sometime but not stable. I tried different things to solve. 9v battery with jack clip on the jack connection. 9v to vin and 9v to 5v. Also 3X1.5 to vin and 5V.
Problem is it seams not to trigger the tx/rx more then ones...
Can someone explain this?