LinkIt Remote is a tool to easily create an iOS/Android remote UI for your LinkIt 7697 Arduino projects. It consists of two software:
- The Arduino LRemote library for LinkIt 7697, which allows you to declare remote UI controls in your Arduino project.
- The LinkIt Remote iOS/Android application, which allows you to scan and connect to nearby LinkIt 7697 devices running the LRemote library, and send commands to them.
Visit https://docs.labs.mediatek.com/resource/linkit7697-arduino/en/developer-guide/using-linkit-remote for more detail.
It provide a LRemote Python library for RPi (any platform use Bluez stack should works too.)
So that you can control your RPi use the same iOS/Android App, save you a lot of effort to write Mobile app.
- Follow this Toturial from Adafruit to make sure latest Bluez is installed and has "--experimental" enabled
- Install python library:
dbus-python
pip3 install dbus-python
- Note. It depends on
libdbus-1-dev
andlibglib2.0-dev
, so pleaseapt-get install
them if necessary
- Install python library:
PyGObject
pip3 install PyGObject
- Note. It depends on
libcairo2-dev
andlibgirepository1.0-dev
, so pleaseapt-get install
them if necessary
- Copy the
LRemote
folder into your source folder - add
from LRemote import LRemote
to your python file - call
LRemote.xxx
apis, check below example
In this example there will be 1 button and 1 label, when the button is pressed, it will update the label to be "ok", and back to "..." when released
import time
from LRemote import LRemote, LRemoteLabel, LRemoteButton
from LRemote import LRemoteLogger
if __name__ == '__main__':
# enable this line for more log
# LRemoteLogger.setLevel(logging.DEBUG)
label = LRemoteLabel(1, 0, 2, 1, "pink", "...")
btn = LRemoteButton(0, 0, 1, 1, "orange", "ok")
def handler(obj, event, value):
if obj == btn:
print("btn state = {}".format(value))
if value:
label.updateText("ok")
else:
label.updateText("...")
LRemote.setName("MyRPI")
LRemote.setOrientation("portrait")
LRemote.setGrid(3, 5)
LRemote.addControls([label, btn])
LRemote.begin(handler=handler)
try:
while True:
time.sleep(1)
except:
pass
LRemote.stop()
- Hardware: RaspberryPi Zero W 1.1
- OS Image: Rasbian Stretch
- Python: Python 3.7.0 (build from source)
- Make it a python package to support pip installation
- Python 2.X support check
- setName() is not working yet, It will still use hostname for BLE advertising
- Only support Label/Button now, welcome to help contributing
- Tutorial from Adafruit
- Bluez usage from Github/WIStudent
- Linkit Source code, Arduino part, iOS part
- Color logger from stackoverflow/sorin