Upload and log script for the makeblock halocode MFF-K00-01
Source code has been extracted from this project
# on linux
./upload.py samples/test.py
# on windows
python upload.py samples\test.py
Copy .vscode\python.code-snippets
to directory .vscode/
of your project. Generate code snippets with api/transform.awk.
- Download Python embedded: https://www.python.org/downloads/release/python-3104/
- Unzip to
halocode-tools/python
- Download Serial module:
- Install Serial module to halocode-tools/python/Lib/site-packages:
python\python.exe setup.py install
- Add
Lib
andLib/site-packages
tohalocode-tools/python/pythonXX._pth
- Run
python\python.exe upload.py samples\test.py
halocode uses MQTT (Message Queuing Telemetry Transport) to broadcast messages:
Broker -> Server
Client -> Send and receive
Subscribe -> Topic
# install server
apt install mosquitto
# edit /etc/mosquitto/mosquitto.conf:
---------------------
allow_anonymous true
listener 1883 0.0.0.0
---------------------
# start server
systemctl status mosquitto
systemctl start mosquitto
# install clients
apt install mosquitto-clients
# subscribe to test
mosquitto_sub -t "test"
# publish message
mosquitto_pub -t "test" -m "test
samble script: samples/wlan.py