Control the I/O (like a lamp through a relay) pin of Raspberry Pi from a Client-Server Bluetooth application
-
Python 2.7 or 3.6 Download Python interpreter here.
-
Raspberry Pi 3 Model B Learn more about RasberryPi project.
-
PyBluez and Bluetooth support
sudo apt-get install python-pip python-dev ipython bluetooth libbluetooth-dev
And then:
sudo pip install pybluez
-
Clone the repo (In your PC and RaspberryPi)
$ git clone https://github.com/NomiProject/LampByBluetoothPi.git $ cd LampByBluetoothPi/
-
In your RasberryPi, with bluetooth enabled, run:
$ python server.py
- Note: Opening
server.py
, you can change GPIO pin
- Note: Opening
-
In your PC, with bluetooth enabled, run:
$ python client.py -s OPTION
- Note 1: OPTION can be: on, off or exit;
- Note 2: Opening
client.py
, you can change Raspberry MAC address or uncomment some lines to search new devices
Developed by Allex Lima, Daniel Bispo, Paulo Moraes and Renan Barroncas with ❤️ using Python.