0

I am running this code.

import serial
import time

serialport = serial.Serial('/dev/serial0',baudrate=1200, timeout=3)


t = "ttt"
while True:
   serialport.flush()
   serialport.write(t.encode())
   rcv =serialport.read()

   print(rcv)

I have enabled Serial on raspi-config.

I have connected RF receiver MX-RM-5V to Rx GPIO 15 and RF transmitter FS1000A to Tx GPIO 14 on a Rpi3B. Always the output of the received message is empty. I am also using piscope to monitor the outputs of the Pins. When I connect Rx and Tx Pins together, I can see the message correctly (bypassing the RFs). Receiver and Transmitter work perfectly because I can test them in a RpiPico that I own.

Is there something I miss?

1 Answer 1

0

You should probably be using /dev/serial0 rather than /dev/ttys0.

What response is the message "ttt" meant to elicit? readline expects a new line character in the response.

2
  • tried also /dev/serial0 with no change in output. Also, checked with serialport.read() Commented Nov 26, 2021 at 15:51
  • 1
    You need to edit that information into your question. You also need to explain why you expect a response and what response you expect to ttt. All relevant information needs to be added to your question. Commented Nov 26, 2021 at 16:20

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.