Use the Python script in this repo to upload a BIO program to a Dabao
You'll need Python 3.9+ and pipx.
macOS
brew install pipx
pipx ensurepathWindows
pip install pipx
pipx ensurepathLinux
pip install pipx
pipx ensurepathAfter running pipx ensurepath, restart your terminal.
pipx install git+https://github.com/baochip/bio-loader.gitor if cloned locally:
pipx install /path/to/your/local/repoWindows users will also need to manually pip install pyreadline3 as that does not ship as a standard library in windows.
Plug a Dabao into your computer and run the following script:
bio-loader --port /dev/ttyACM0 --code mycode.bin --quantum 10MHz --pads PC0,PC2The .bin file produced by bio-sim is directly compatible with this script.
| Flag | Description |
|---|---|
--port |
Serial port, e.g. /dev/ttyACM0 (Linux), /dev/tty.usbserial-* (macOS), COM3 (Windows) |
--code |
Path to your code |
--pads |
I/Os to map into the BIO (expects a string description of the pad label) |
--quantum |
Setting for the quantum divider (accepts a number with MHz (or mhz), KHz (or khz), Hz (or hz), or bare number for Hz). Examples: 350MHz 48KHz 1000 3.5MHz. Max: 350 MHz. |
--clear |
Clears the current code, stops the BIO and exits (other arguments are ignored) |
--delay |
Delay between chunks in seconds (default: 0.2) |
Don't know how to find your serial port? see the guide below.
pipx install --force git+https://github.com/baochip/bio-loader.gitThe Dabao shows up as a serial device when plugged in via USB. Here's how to find the port name on various OSes.
Plug in the Dabao, then run:
ls /dev/ttyACM*It will most likely appear as /dev/ttyACM0. If you have multiple devices plugged in you might see /dev/ttyACM1, /dev/ttyACM2, etc. - try unplugging and replugging to see which one appears and disappears.
You can also get more detail with:
dmesg | tail -20Look for a line mentioning ttyACM0 or cdc_acm near the bottom.
On most Linux distros, serial ports are owned by the dialout group (sometimes uucp). By default your user may not be in this group, which means you'd need sudo to access the port. To fix this permanently:
sudo usermod -aG dialout $USERThen log out and log back in (or reboot) for the change to take effect. You can verify it worked with:
groupsYou should see dialout in the list. After that, bio-loader will work without sudo.
Note: On some distros (e.g. Arch) the group is called
uucpinstead ofdialout. If thedialoutcommand has no effect, check the port's actual group withls -l /dev/ttyACM0and substitute that group name in theusermodcommand above.
macOS does not use ttyACM - the device will appear under a different name depending on the USB serial chip it uses. Plug in the Dabao, then run:
ls /dev/tty.usbmodem* /dev/tty.usbserial* 2>/dev/nullYou should see something like /dev/tty.usbmodem101 or /dev/tty.usbserial-0001. Use whichever appears.
If nothing shows up, try:
ls /dev/cu.*And look for anything that wasn't there before you plugged in.
macOS does not require any special group membership - the port should be accessible to your user account without any extra steps.
- Plug in the Dabao.
- Open Device Manager - press
Win + Xand select it from the menu, or search for it in the Start menu. - Expand the Ports (COM & LPT) section.
- Look for an entry like USB Serial Device (COM3) - the
COMnumber is what you need.
If nothing appears under Ports, try the Other devices section; you may need to install a driver. Check the Dabao documentation for the specific driver if so.
Use the port name exactly as shown, e.g.:
bio-loader --port COM3 --code mycode.bin --quantum 10MHz --pads PC0,PC2Tip: If you're on Windows and using WSL, the port won't be directly available inside WSL. Either run
bio-loaderfrom a regular Windows terminal (PowerShell or CMD), or look into usbipd-win to forward USB devices into WSL.