This project is written in Python, and tested with pytest.
After building your CLSLab:Light demo and testing it per the tutorial instructions*, edit your main.py
file and replace these lines:
my_id = hexlify(unique_id()).decode()
my_encrypted_id = encrypt_id(my_id, verbose=True)
with:
my_id = "<your_id_here>"
my_encrypted_id = my_id
where <your_id_here>
is the GitHub Classroom course identifier you chose. Then, edit course_identifier.py
and replace the string with your course identifier. For example, if your course identifier is funky-zebra
, then you would replace:
course_id = "<your_id_here>"
with
course_id="funky-zebra"
If your CLSLab:Light demo is up-and-running, the tests will pass and a full optimization campaign will run on your device.
*NOTE: Recently, HiveMQ Cloud changed such that
hivemq-com-chain.der
(a Certificate Authority (CA) file) is not transferrable across different broker instances. The latesthivemq-com-chain.der
file fromself-driving-lab-demo
will be hard-coded to theself-driving-lab-demo
public test credentials (i.e., what is used in Module 1 - Running the Demo). However, this assignment requires you to create your own HiveMQ Cloud broker instance, so you will need to generate ahivemq-com-chain.der
file specific to your instance and upload it to your microcontroller.
You can also view the full workflow interactively. First, navigate to 4.2-paho-mqtt-colab-sdl-demo-test.ipynb and replace the string value for PICO_ID
with the one corresponding to your device. For example, if you PICO_ID
is a1b2c3
, then you would replace PICO_ID = "test"
with PICO_ID = "a1b2c3"
. Then, run each cell in the notebook to see the full optimization campaign, including visual comparisons between grid search, random search, and Bayesian optimization.
pip install -r requirements.txt
pytest
For context about how or when to edit main.py
, see step 14 of the build instructions