3

I have been trying to send the bytes (in order): 2201, 2211 etc. to my Arduino board, which I've connected to my computer, using a USB to RS485 adapter.

However, when I connect it yo my computer, whenever I try to send 2201 to my Arduino, using the command echo 2 > /dev/ttyUSB0;echo 2 > /dev/ttyUSB0;echo 0 > /dev/ttyUSB0;echo 1 > /dev/ttyUSB0, it sometimes works, turning the LED on normally as it should, but other times it just doesn't, displaying bash: /dev/ttyUSB0: Input/output error.

Screenshot

If you have any way of getting through this, that'd be great. Also, please let me know if there's any better command than echo X > /dev/ttyUSB0 to send data to my Arduino. I'm new to serial communication, so I'm not sure what the best way to do this is.

indiv
  • 17,306
  • 6
  • 61
  • 82
Coto
  • 61
  • 1
  • 2
  • 6

0 Answers0