0
\$\begingroup\$

I have a basic Arduino sketch. It reads from the serial port and prints the chars onto an LCD.

If I use the Arduino's serial monitor and start typing stuff in, it works great and displays each character to the display.

However, I'm trying to use this library to write to the port: https://github.com/voodootikigod/node-serialport

When I try to write to the port, I can see the tx light flashing but nothing appears on the screen at all.

Is there a way to spy on the data being sent down the wire to do what is different between the 2 cases? I apologise for my bad terminology.

\$\endgroup\$
0

2 Answers 2

2
\$\begingroup\$

Your problem is most likely related to the library that you are using. Make sure that you have correctly set up baud rate, parity, data bits and stop bits. You can write a simple program for adruino that sends back the received character over UART. This way you can test whether or not you have correctly configured your serial port.

\$\endgroup\$
1
\$\begingroup\$

Is there a way to spy on the data being sent down the wire to do what is different between the 2 cases?

By repeatedly sending a known character and using an Oscilloscope on the data line, its pretty easy to see what baud rate and framing is used.

Alternately you could cross-wire the sending serial port with another port and try different settings on the receiver side until you receive valid chars. But as already pointed out by Ashton, I would double check your code using the library first (verify baud, stop bit, data bits, parity is as expected by the receiver).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.