0

I have connected my RPi to my laptop via an RS232 to TTL adapter and a RS232 to USB cable and tried to write to it in C.

On my laptop everything worked just fine.

But when I move to the production environment, I see from the Pc they have that the program that was made to communicate with the RPi reads what it just wrote.

In fact, if it tries to write a long string, it works, but when he tries to write a short string (the hex for "ack"), that very string "bounces" back and is read by the program.

Schematically:

  • PC sends "message" to RPI
  • RPI sends "ack_1" to PC
  • PC sends "ack" to RPI
  • Both PC and RPI read "ack" from the line

I can post part of the code that I use, if you think it's necessary.

For now I can tell you that I use standard functions from the RS232 C library.

My OS is Raspbian.

  • 1
    Do you think you might have wired it incorrectly? – joan Jul 28 '14 at 13:25
  • Yes, I did. But the wiring is correct, I guess... I mean, everything works fine, I receive everything I need plus that single ack string that I just sent – Guerriky Jul 28 '14 at 13:29
  • Could you just clarify. Are you plugging into the USB port on the Pi or the UART pins (8/10 on the Pi P1 header). – joan Jul 28 '14 at 13:32
  • I am plugging the RS232 to ttl converter to the UART pins of the Rpi – Guerriky Jul 28 '14 at 14:04
  • I'd stop the Pi program and confirm that the serial link is OK by running something like minicom on the Pi. Alternatively just cat </dev/ttyAMA0 from a terminal and it should show what the PC is transmitting. Apologies in advance if you have already proven that the serial link is working correctly. – joan Jul 28 '14 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.