Docker run arguments

Ah great that you’re looking into it. For the more information:

  • I tried it on both an upboard as well as an upsquared
  • The bluetooth is a dongle (the built-in bluetooth on the UP^2 returned mac address all 0, but thats for a different thread perhaps :wink: )
  • I updated the BalenaOS versions to 2.39
  • The code is exactly the same as the one in the drive, with the mentioned changes.

Thanks again for the support!

Tim

Thanks for the details @tresink, will be trying it out.

  • Have any info what dongle are you using? (just in case it is relevant)
  • You mention “I updated the BalenaOS versions to 2.39” - what version the original issue was observed? As 2.39.0, for example, have bluetooth service in the host OS - that host service does work, as checked, but interferes with the bluetooth service in the container. At least that’s what I’ve seen, hence the question what is the version it was first seen? (as 2.39.0 I cannot see what you’ve seen, but hit other complication, and want to get back to reproduction first).

We are using this simple dongle from laird. I think we encountered the issue only on 2.39, but cant tell for sure. Before that we had v2.29.2 running on the devices.

Thanks for the info, we are checking this out, and will keep you posted as we we test the hardware.

Hey @tresink, might have gotten to the bottom of it, at least have something that works for me (tested on an UP^2 and seems to work fine)

Some notes:

  • looks like networ_mode: host is indeed required for bluetooth (got some hint from this github issue, it now vaguely rings a bell, but we’ll need to take a note of
  • three’s bluetooth service in the host OS on this version of the OS, thus the container does not need to run the bluetooth.service
  • bluetoothctl communicates with the bluetooth daemon over DBUS, and thus have to add the label to have that available in the container, and directly use the system DBUS, as per our documentation:
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket bluetoothctl

I’ve checked in your initial code into git (hope you don’t mind, you were sharing it publicly here anyways, but let us know if you do mind), and my modifications are added on top of it in this PR (all the things we discussed above):

When I try this out, here’s the container, and bluetoothctl works, can find the dongle, scans successfully:

After container restart (the “SSH session disconnected part”, used the dashboard to restart the container) bluetoothctl continues to work:

What do you think, is this what you were looking for? Or am I still misunderstanding anything?

When we get to a working version that you are happy with, we’ll probably redo that project into a bluetooth-in-container or ROS demo project, so that it’s more useful for everyone.

Makes sense! It is what i’ve been looking for, i’ll test it after the weekend on our own setup!

Also, I think a ROS demo project is a great idea :slight_smile: Most ROS projects need bluetooth to hook up controllers to the robots, e.g http://wiki.ros.org/joystick_drivers get these to work. I think it could be a cool intro to balena for many in the robotics community.

Thanks for the great support, i’ll be sure to test this soon and if I run into something then I will let you know.

Cheers,
Tim