I have a PIC24 connected to a sensor that is programmed with a custom driver to send data when a '?\r' is sent as a request "0x3F0D".
I've confirmed NodeRed is connected to the right serial port and that data is sending as I can see the hex transmission by monitoring with "cat /dev/serial/by-path/ | xxd"
Data is sent from the device when NodeRed sends a request (as confirmed by the above)
Data is sent from the device when a request is sent using "echo -ne "\x3F0D" > /dev/serial/by-path/" or "echo -ne "?\r" > /dev/serial/by-path/" (as confirmed using cat again)
Data is clearly being transmitted in both cases, but NodeRed isn't picking it up? Timing out and returning undefined.
I have got NodeRed serial in/out nodes to work with other devices, I'm not sure what's different here given I can clearly see the data being sent. Any suggestions?
how have you configures the serial port ? presumably to split on \r and not the default \n ?
Isn't it that cat /dev/serial/by-path/ | xxd is blocking the serial port for NR to access?
To what port is you Pic connected on what kind of hardware? Pi, pc,...
This was it the configuration was wrong. It is supposed to split on \n, but it was set to wait for an optional start character that was incorrect, clearing this and just having it read everything + correct splitting sorted it.
Clearly it was receiving data but dismissing it as the start character was wrong. I shall check what the correct start character is (if there is one) and configure that.
Many thanks, Sam.
I had tried it without the command running as well as I know that would block access, I was just running that temporarily to check anything was being sent.
It is a PI. Connected over USB.