[solved] How to verify USART send or receiving data?

Hi all,

I have a pixhawk connected to SUART1, and I would like to verify what the pixhawk is sending down that connection. It should be mavlink data, but is there a way I can monitor what Serial 1 is receiving and sending in real time?

Hi @silverburn you can forward all Serial1 characters received on the RX pin to the USB serial connection (back to the host), and all USB serial characters received (from the host) to Serial1 TX pin as follows:

void setup()

void loop()
    if (Serial.available())
        char c = Serial.read();

    if (Serial1.available()) {
        char c = Serial1.read();
1 Like

Looks to be working great! Thanks!

Just one further request…how I can send the raw input / output from SUART 1 to a UDP pipe on my electron? I see there is a UDP begin() sample in the reference material, but how to I bind it to SUART1?

As far as I know there is no current way to simply bind the two together, but you should be able to poll Serial1.available() and forward the data on via a few UDP functions: https://docs.particle.io/reference/firmware/photon/#begin-