I know that questions are supposed to involve code but coming from someone who has never used a pi, the linux environment, or python before, is there a way to write a python script using pybluez to make the raspberry pi zero w's Bluetooth visible on other devices like a phone, answer pair requests, store the devices paired and connect the to the devices paired? Thanks. A written tutorial would help out a lot. I updated with code to allow the pi to be discover-able, but I am unsure on how to use the command "sudo bluetooth-agent 1234" so that it listens for a pair request.
import subprocess from bluetooth import * print "performing inquiry..." cmd = 'sudo hciconfig hci0 piscan' subprocess.check_output(cmd, shell = True) cmd = 'sudo bluetooth-agent 1234' nearby_devices = discover_devices(lookup_names = True) print "found %d devices" % len(nearby_devices) for name, addr in nearby_devices: print " %s - %s" % (addr, name)