Docker: Bootloader stuck on "waiting for the bootloader..."

Hello,

I do my first step in developing on the PX4 using Docker.

Therefore I extend the px4io/px4-dev-nuttx image to px4dev with some extra installations.

Dockerfile

FROM px4io/px4-dev-nuttx

RUN apt-get update && \
	apt-get install -y \
	python-serial \
	openocd \
	flex \
	bison \
	libncurses5-dev \
	autoconf \
	texinfo \
	libftdi-dev \
	libtool \
	zlib1g-dev

RUN useradd -ms /bin/bash user
ADD ./Firmware /src/firmware/
RUN chown -R user:user /src/firmware/

Than I run the image/container:

docker run -it --privileged \
	--env=LOCAL_USER_ID="$(id -u)" \
	-v /dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00:/dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00:rw \
	px4dev \
	bash

I also tried:

--device=/dev/ttyACM0 \
--device=/dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00 \

Than I switched to /src/firmware/, build the code. But the upload always results in this error:

make px4fmu-v2_default upload
ninja: Entering directory `/src/firmware/build/nuttx_px4fmu-v2_default'
[0/1] uploading px4
Loaded firmware for board id: 9,0 size: 1028997 bytes (99.69%), waiting for the bootloader...

I use a Pixhawk 2.4.8, my host is an Ubuntu 18.04 64bit.

If it is generally not possible (but on some discussions (Issue #8741 by @dagar) it was said that will work), what is the output file of the build and is it possible to upload this using QGroundControl?

Kind regards,
Alex

1 Like

Normally I wouldn’t bump a 5 year old topic, but we just ran into this at work today. (I’m a different Alex)

The problem exists here: PX4-Autopilot/Tools/px_uploader.py at 69028f37a91b48add269ef699101922e52410446 · PX4/PX4-Autopilot · GitHub

Where it will silently fail if serial isn’t available. If you’re stuck in this message it’s probably because they handles the exceptions too widely.

You should be able to fix this by installing the python3-serial package.

I was having a similar issue uploading firmware from a terminal and from matlab where I’d get the same waiting for bootloader. I installed pyserial 3.5 onto my computer but I’m still getting the same results. Do you know if the solution may have changed?