Installing UCUq#

The repository referred to on this page is located at https://github.com/epeios-q37/ucuq-python.

On the microcontroller#

For example, UCUq is installed on the Wokwi simulation of the Ravel kit, which can be found in the online demos section.

  1. Install MicroPython on the microcontroller;
  2. place the main.py, ucuq.py, and settings.py files, located in the device directory of the repository, onto the microcontroller;
  3. create a ucuq.json file on the microcontroller with the content below;
  4. restart the microcontroller.

Contents of the ucuq.json file to be placed on the microcontroller:

{
  "Identification": ["<device_token>","<device_id>"],
  "WLAN": {
    "<wlan_name>": ["<wlan_ssid>", "<wlan_key>"]
  },
  "OnBoardLed": [<led_pin>, <led_logic>],
  "version": {
    "format": "2025-09-19"
  }
}
  • <device_token>: the device’s token; choose one that cannot be easily guessed; the same token can be shared among multiple devices;
  • <device_id>: the device’s identifier, which must be unique among devices sharing the same token;
  • <wlan_name>: Wi-Fi network name (value of your choice);
  • <wlan_ssid>: Wi-Fi network SSID;
  • <wlan_key>: Wi-Fi network secret key;
  • <led_pin>: pin of the LED built into the microcontroller (usually an integer, but can be a string, as is the case with the RPI Pico (2) W);
  • <led_logic>: true if the LED turns on when the pin is high, false otherwise.

The OnBoardLed entry is optional.

It is possible to have multiple entries under the WLAN entry; the microcontroller will automatically connect to the first available network. For example, one might be the smartphone’s access point, and the second the home Wi-Fi network.

On the computer#

  1. Download the repository;
  2. run the Config application (python3 Config/ from the demos folder);
  3. fill in the fields based on the contents of the ucuq.json file mentioned above (Identification/device_token and Identification/device_id);
  4. click Save and exit the application.

For example, the following code blinks a LED connected to your microcontroller:

import ucuq

for i in range(20):
  ucuq.GPIO(<led_pin>).high(i & 1)
  ucuq.sleep(0.5)

Replace <led_pin> with the number (or corresponding string) of the onboard LED pin (or that of any LED connected to your microcontroller). Run this program with python3.

The API is detailed here.