Get bluetooth mac address with python - python

Anyone know a library in python that get bluetooth mac address?
‌‌‌‌‌Thanks.

Related

Executing code.py on Raspberry PI, from computer via ethernet connection

How could I launch code.py that only exists on a raspberry, from a python command line on a computer connected by an Ethernet cable. Machine A and the raspberry are connected to each other by a simple ethernet cable, and none of those two endpoints are connected to the internet. They only have the latest version of python installed and can't have anything more installed on them.
It looks like subprocess.Popen() could be a way to tackle it. But with the little knowledge I have I can't understand and know for sure if using this method is suitable !
Thank you for your time :)

Pyserial error: could not open port

I've been following this tutorial: https://circuitdigest.com/microcontroller-projects/arduino-python-tutorial
import pyserial didn't return any errors, but when I run my python code, I get the following error:
SerialException: could not open port 'com18': WindowsError(2, 'The system cannot find the file specified.')
Anyone know how to fix this?
I copy what you can read in the tutorial:
ArduinoSerial = serial.Serial('com18',9600)
Note: It is very important to mention the correct COM port name. It can found by using the Device manager on your computer.
When you have plugged your arduino, windows has chosen another COM number.
The port can be found directly in arduino IDE. It detects all devices connected on USB; but the IDE do not know which one is your arduino. In the menu tools / port you will see the list of COM on your computer.
If no COM is proposed, then you miss a driver for your card under windows --> google for it.

Raspberry pi using bluetooth.discover_devices() with python not working

I have installed bluetooth with
sudo apt-get install bluetooth bluez-utils blueman
I can find my mobile phone with
hcitool scan
The problem is when i try to use bluetooth in python file
import bluetooth
works fine. But when I try
nearby_devices = bluetooth.discover_devices()
It's not working. Error is
AttributeError: 'module' object has no attribute 'discover_devices'
Based on some web pages that should work.
P.s. basically I would like to send text file to my mobile device programmatically. And this is begining of that proces.
I have fixed the problem. It was very silly mistake. If I could I would delete the question. I have named my other file bluetooth in the same folder. So when I wrote import bluetooth it was my other python file that was imported not bluetooth module.

Change Bluetooth name Python

I'm using PyBluez on Ubuntu 10.10. I would like to know how is possible to change the bluetooth name of the local device in software. I couldn't find any command related..
Invoke org.bluez.Adapter.SetProperty(u'Name', u'New name here') in the /org/bluez/<pid>/<device> object path on the org.bluez D-Bus bus.

get GPS coordinates via bluetooth with python on OSX

I just bought a GPS bluetooth receiver, which has been correctly paired with my OSX machine. Now I would like to query the device for my position with python. How do I do it?
I assume your GPS receiver works over a virtual COM port, so it's independent of bluetooth.
Probably these libraries will help you:
Python bindings for gpsd (which is available for Mac too)
PyGPS, untested
with a virtual COM port you can use this script with the NMEA 0183 protocol http://miguellopes.net/bluetooth-gps-python/ (it's in portuguese but google translator can give you a help there)

Categories

Resources