Remote library for controlling Pimoroni Display-O-Tron HATs remotly using websockets!
- Data only accessible from a device that isn't your Pi
- Easier debugging/development, using a full IDE/Text editor, and your favorite debugger, keyboard, and whatever you use to code!
- More language support
Connect using websockets to your Pi's IP adress and the port specified in config.py
On connection from a local IP address (this can be changed in the config.py, though I wouldn't recommend it) you should see a message like this
{"type": "welcome", "error": false}
Or, if you're not connecting from a local IP address
{"type": "forbidden", "error": true}
The general command structure is as follows:
{"module": "{module}", "command": "{command}"}
Additional arguments may be added as necessary
You could also add your own internal arguments and they will sent back to you (see below)
An example is as follows:
{"module": "lcd", "command": "set_contrast", "contrast": 30}
This would correspond to
lcd.set_contrast(30)
as shown as in the DotHat documentation
We try to maintain the method names and arguments names as in the docs. Check lcd.py or backlight.py if you're stuck.
The general return structure is as follows
{"type": "response", "return": {return value},"invoker": {the message you sent that corresponded to this action.}}