0
votes

A program is running on the arduino uno which reads incoming strings and then calls a function based on what the string is.

The program works when I use arduino's serial monitor to pass the string. eg sending forward calls a function which passes a control byte to the motor controller making the motors turn forward.

However, when I use pyserial from linux it does not work. The connection is fine - i have checked it by having the arduino write to the serial and then using ser.readline() which reads correctly. but using ser.write("forward") does nothing.

Any ideas?

1

1 Answers

0
votes

What is the protocol you defined? Do you collect the characters entered into the serial up to a CR or a CRLF?

Arduino serial monitor sends all data at once including a CR when you send; Other software for example - HyperTerminal sends the data on the same instant you type character and does not automatically sends a CR.

Try sending your data all at once trough pyserial and attach a \n at the end.