BIO Uploader
Use the Python script in this repo to upload a BIO program to a Dabao
Prerequisites
You'll need Python 3.9+ and pipx.
Install pipx
macOS
brew install pipx pipx ensurepath
Windows
pip install pipx pipx ensurepath
Linux
pip install pipx pipx ensurepath
After running pipx ensurepath, restart your terminal.
Install
pipx install git+https://github.com/baochip/bio-loader.git
or if cloned locally:
pipx install /path/to/your/local/repo
Windows users will also need to manually pip install pyreadline3 as that does not ship as a standard library in windows.
Usage
Plug a Dabao into your computer and run the following script:
bio-loader --port /dev/ttyACM0 --code mycode.bin --quantum 10MHz --pads PC0,PC2
The .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.
Updates
pipx install --force git+https://github.com/baochip/bio-loader.git
Finding Your Serial Port
The Dabao shows up as a serial device when plugged in via USB. Here's how to find the port name on various OSes.
Linux
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.
Permissions - avoiding sudo
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:
groups
You 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
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/null
You 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.
Permissions
macOS does not require any special group membership - the port should be accessible to your user account without any extra steps.
Windows
- 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,PC2
Tip: 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.