How to write a string to UART in a custom component class?

Hi all,

For the next step in creating an interface with my chargepoint, I’m having trouble sending a message string over the UART bus. I can read what I send from the other side (with an Arduino), but the sending isn’t working. I’m guessing the Arduino Serial.write() method isn’t working, but I can’t figure out what’s the right method…

Here’s my method so far. I got the write_str() idea here but it isn’t working…

	void loop() override {
		if (!UARTBusySending && available()){
			ReceiveSerialMessage();
		}
		if (!available() && messageForChargepoint){
			UARTBusySending = true;
			//SendCommand69(setpointForChargepoint, 60, 6.0);
			ESP_LOGD("test", "Sending message: %f", setpointForChargepoint);
			
			digitalWrite(D8, HIGH);
			write_str("TEST");
			digitalWrite(D8, LOW);
			messageForChargepoint = false;

			UARTBusySending = false;
		}
		
	}

Thanks for any and all ideas!

I think the write_str() should be okay.

You could try using a jumper wire to loop the esp tx back into the esp rx. Whatever you send from the esp write should get read back by the esp read. That would help identify potential connection problems with the esp tx to the other side rx. Could add an LED to the esp tx pin to see if it flashes during transmit?