I am trying to detect if my bluetooth speaker is connected to my rpi3 with my python code, executing this command
status = subprocess.call('ls /dev/input/event0 2>/dev/null', shell=True)
if the directory /dev/input/event0 exists, then it will pass the check. However, the directory is never created even after I connect my bluetooth speaker and have already tested it by playing smth from it. Below is the output when I run the command
How else can I check if the speaker is connected using a python script?
- rpi3 os version: jessie
- python: python 3.4