Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 1.88 KB

README.md

File metadata and controls

77 lines (49 loc) · 1.88 KB

halocode-tools

Upload and log script for the makeblock halocode MFF-K00-01
Source code has been extracted from this project

Upload python scripts and show console log

# on linux
./upload.py samples/test.py 

# on windows
python upload.py samples\test.py 

Code snippets for VS Code

Copy .vscode\python.code-snippets to directory .vscode/ of your project. Generate code snippets with api/transform.awk.

Run with python embedded

  • 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 and Lib/site-packages to halocode-tools/python/pythonXX._pth
  • Run python\python.exe upload.py samples\test.py

Message Broadcasting

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

Links

Picture

halocode