Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3466

Troubleshooting • Trying to transmit/receive with connected radio module SR105U

$
0
0
I have radio module 'SR105U' attached to 'raspberry-pi zero' and the connection is set as the attached image.

I set up PD pin as 'running (1)', PTT (Push to talk) as 'transmit (0)'.
Then to transmit using radio module, I'm using 'Serial Write' to send general byte data. However, the signal is not being detected with SDR attached to my computer.

I'll attach the code as well, and it will be super helpful if you could tell me what am I doing wrong here.

Thank you in advance.

Code :

Code:

import RPi.GPIO as GPIOimport serialimport time# Pin numbering setGPIO.setmode(GPIO.BOARD)GPIO.setwarnings(False)# Setup a channelchannel_ptt = 38channel_PD = 40  # 0: sleeping, 1: runningchannel_TXD = 8channel_RXD = 10###################### Setup()  ######################### Set PD Channel to run radio moduleGPIO.setup(channel_PD, GPIO.OUT, initial=GPIO.HIGH)# Set PTT Channel as an input# GPIO.LOW: Transmit# GPIO.HIGH: ReceiveGPIO.setup(channel_ptt, GPIO.OUT, initial=GPIO.LOW)# Serial Setup# Open serial portser = serial.Serial('/dev/serial0', baudrate=9600, timeout=1)######################## Loop() #########################try:    while True:        GPIO.output(channel_PD, GPIO.LOW)        GPIO.output(channel_ptt, GPIO.LOW)        # Check if the GPIO values are set correctly        pd_state = GPIO.input(channel_PD)        ptt_state = GPIO.input(channel_ptt)        print(f"PD state: {'HIGH' if pd_state == GPIO.HIGH else 'LOW'}")        print(f"PTT state: {'HIGH' if ptt_state == GPIO.HIGH else 'LOW'}")        ser.write(b'\xAA\x55' * 50)        time.sleep(1)except KeyboardInterrupt:    print("Transmission stopped by user")finally:    ser.close()    GPIO.cleanup()
radio_module.png

gpio_pin.png

Statistics: Posted by blueed96 — Wed Aug 28, 2024 4:44 pm — Replies 0 — Views 28



Viewing all articles
Browse latest Browse all 3466

Trending Articles