Oak devices firmware uploading / building tool
2.6K
This setup will start a docker container with platformio installed, compile the code in src and flash to the device. Currently there are two devices:
oak-lights - Our USB SAM21D based 24v lighting boardoak-rfid - Impinj RS500 based USB 5v UHF RFID boardYou need to have Docker installed, on a linux eystem.
docker login)input group by running groups. If you arent, Run sudo usermod -aG input $(whoami) and then close your terminal or log out and log back in.Do the docker install
curl -sSL https://get.docker.com/ | sh
Add your linux user to the docker group, and then logout + login to your machine (or just reboot)
sudo usermod -aG docker ${whoami}
If you are planning to use this tool without having the git repository clones, make sure to login to hub.docker.com in the CLI with docker login. This will let you pull the image remotely instead of building it here.
/rootfs
└─ /projects
└─ /device-folder
├─ platformio.ini
├─ board.json
├─ /lib
└─ /src
└─ main.cpp
run.sh has two commands. You can use build to make the container, and then flash to upload to a device
$ ./run.sh
Usage:
# If you want to compile local changes, and don't care about the remote version in Dockerhub:
./run.sh build <version>
# If the build exists, or you want to get the latest image:
./run.sh pull <version>
./run.sh flash <version> <port> <type> <profile>
Default: ./run.sh flash 2.0.0 ttyACM0 oak-lights prod
Docker (no git repo)If you not using this git repo, you can run the docker container for firmware-tool without having to clone this repository.
Pull the latest image
docker pull oaklabs/firmware-tool:latest
Do a docker run _(note the ttyACM0 and oak-lights in this example)
docker run -it --rm --privileged -v /dev/bus/usb:/dev/bus/usb oaklabs/firmware-tool:latest ttyACM0 oak-lights prod
Sometimes on systems, especially with multiple oak devices, it can be initially difficult to identify which device is which.
Start out by finding which ACM devices exist (using cdc_acm driver usually), here is an example:
$ ls /dev/tty* | grep ACM
/dev/ttyACM0
/dev/ttyACM1
Pull the udev info from each device, this is an example of what the lights might look like on your system. udev output will vary between systems, but at the very least you will see ID_VENDOR matching OAK, and ID_MODEL matching the device name.
$ udevadm info /dev/ttyACM0 | grep -e MODEL -e VENDOR -e SERIAL
E: ID_MODEL=LIGHT
E: ID_MODEL_ENC=LIGHT
E: ID_MODEL_ID=8d21
E: ID_SERIAL=OAK_LIGHT_EC4295E7514D3937394A2020FF101F3B
E: ID_SERIAL_SHORT=EC4295E7514D3937394A2020FF101F3B
E: ID_VENDOR=OAK
E: ID_VENDOR_ENC=OAK
E: ID_VENDOR_ID=1b4f
Content type
Image
Digest
Size
473.6 MB
Last updated
almost 8 years ago
docker pull oaklabs/firmware-tool