Use this library to communicate as a Powered UP (PUP) Device with LEGO smart hubs. It has a basic PUPDeviceEmulator and a higher-level PUPRemote library that acts more like RPC (Remote Procedure Calling).
- load lpf2.py in flash
- load pupremote.py in flash
- copy demo_esp32.py to main.py and reset or run manually from REPL
- import pupremote.py
- import demo_pybricks_inventorhub or _technichub
If you get checksum errors it could be due to a known issue with 32 byte packet size in Pybricks. Pass max_packet_size=16 when instantiating PUPRemoteHub and PUPRemoteSensor classes to work around this issue.
Please fork and streamline the protocol. There are also some TODOs below you can help with. Please notify us of projects you made with this and share the code!
- Emulate generic sensors
- Support SPIKE2 and Robot Inventor platforms (Only Pybricks is currently supported)