3

Sending information with bluetooth on Raspberry Pi (Python)

 2 years ago
source link: https://gist.github.com/keithweaver/3d5dbf38074cee4250c7d9807510c7c3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Sending information with bluetooth on Raspberry Pi (Python)

When I run this code on my Pi 3B+ I get an empty list [] from bluetooth.discover_devices(). Running the graphic interface or sudo bluetoothctl from the command line I see a whole bunch of devices, including my SiliconLabs BGX13P and my Sensirion Humidity and temperature sensor that I am trying to use as guinea pigs. Any suggestions?

Amitjipathak commented on Nov 5, 2019

edited

print str(bluetooth.lookup_name( bdaddr )) + " [" + str(bdaddr) + "]"
python3.5 shows invalid syntax in this particular line.... with providind bt address and without providing address the error is same

error will look like:
Traceback (most recent call last):
File "/home/pi/bluepy/bluepy/PitoBlutooth1.py", line 11
print "Accepted connection from " + str(address)
^
SyntaxError: invalid syntax

On python3, need to change the print function
print( "Accepted connection from " + str(address) )

On python3, need to change the print function
print( "Accepted connection from " + str(address) )

yes now no errors shows but still shell window is blank no result is showing

Does anyone know how we can setup multiple channels for a socket over bluetooth?

When I run this code on my Pi 3B+ I get an empty list [] from bluetooth.discover_devices(). Running the graphic interface or sudo bluetoothctl from the command line I see a whole bunch of devices, including my SiliconLabs BGX13P and my Sensirion Humidity and temperature sensor that I am trying to use as guinea pigs. Any suggestions?

What guinea pigs? Are you torturing some pigs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK