Help Bluetooth module with raspberry pi

Thread Starter

Chrisio

Joined May 22, 2023
1
Hi, I have stacked.. Im trying to connect my Bluetooth module ZS-040 (HC-06) to raspberry pi 3 model b+ for receiving data from mobile phone. I have tried everything but can’t connect. I need python code. I m using serial Bluetooth terminal app on my android phone.
I have this code. My code runs ok and from my phone and app I connect to module successfully but when I type something it doesn’t print to my terminal. Please any help?

import serial
ser = serial.Serial('/dev/ttyAMA0', 9600)
while True:
received_data = ser.readline().decode().strip()
ser.close()
 
Top