Hi ,
I am writing a code for raspberry pi which makes the Pi's bluetooth visible to everyone and it would connect automatically to your phone without connecting the pi to your monitor .
1)Could you tell me if the code is correct
2) I got an error for installing the library . Can you tell me what is the mistake . i tried to install it still stating the same problem .I will attach the screenshot
[from bluezero import peripheral
import time
# Configuration (Customize these)
DEVICE_NAME = 'bChaturunga'
SERVICE_UUID = '0000ffff-0000-1000-8000-00805f9b34fb' # Change this UUID
# Create BLE Peripheral
pi = peripheral.Peripheral()
# Add GATT Service
pi.add_service(srv_id=1, uuid=SERVICE_UUID, primary=True)
# Start Advertising
pi.advertise(name=DEVICE_NAME, services=[SERVICE_UUID], appearance=0x00)
print(f"BLE Server Running - Advertising as {DEVICE_NAME}")
try:
while True:
time.sleep(10)
except KeyboardInterrupt:
pi.stop_advertise()
print("\nBLE Server Stopped")
Screenshot[Since i cannot directly open the screenshot using the img on the edior]:
https://drive.google.com/file/d/1MJJgEi ... sp=sharing
I am writing a code for raspberry pi which makes the Pi's bluetooth visible to everyone and it would connect automatically to your phone without connecting the pi to your monitor .
1)Could you tell me if the code is correct
2) I got an error for installing the library . Can you tell me what is the mistake . i tried to install it still stating the same problem .I will attach the screenshot
[from bluezero import peripheral
import time
# Configuration (Customize these)
DEVICE_NAME = 'bChaturunga'
SERVICE_UUID = '0000ffff-0000-1000-8000-00805f9b34fb' # Change this UUID
# Create BLE Peripheral
pi = peripheral.Peripheral()
# Add GATT Service
pi.add_service(srv_id=1, uuid=SERVICE_UUID, primary=True)
# Start Advertising
pi.advertise(name=DEVICE_NAME, services=[SERVICE_UUID], appearance=0x00)
print(f"BLE Server Running - Advertising as {DEVICE_NAME}")
try:
while True:
time.sleep(10)
except KeyboardInterrupt:
pi.stop_advertise()
print("\nBLE Server Stopped")
Screenshot[Since i cannot directly open the screenshot using the img on the edior]:
https://drive.google.com/file/d/1MJJgEi ... sp=sharing
Statistics: Posted by AlenHazard — Sat Mar 29, 2025 1:37 pm