Allow BLE inside a Docker container for a custom app

I am currently testing the DSGW-210 for the company I work for and looking forward to working with Dusun!

I have created a custom python app that runs inside a container.
I want to allow BLE inside my docker to use hardware (specifically BLE) on the device. I tried using the common practices as “–privaleged” setting, and didn’t succeed.
Will Bleak python package work?
Does the Dusun DSGW-210 work with bluez library as a standard?

You goal requires ble working in RCP mode. Refer to this to upgrade it to RCP mode.
And then you need to close the corresponding dusun host program.

mv /usr/bin/bul /usr/bin/bul-b
mv /usr/bin/bflash /usr/bin/bflash-b

Then you may need to manually install bluez and other packages you need.
And if necessary, specify the ble communication port /dev/ttyUSB0 in your docker configuration file.

1 Like

Hey Yan,

I managed to replace NCP to RCP, update the BLE FW, and expose my docker container to the BLE module on the host Dusun DSGW-210 device with your help following that URL, Thanks!

Both from docker or directly from the Dusun gateway, I get a very slow chunk transfer speeds - something between 1~2 chunks of 244 bytes per second (for one device).

On my PC, other gateways like ASUS Tinker and other peoples PCs, I get around 40 chunks of 244 bytes per-second - Which is what i need for streaming data from my IoT devices to the gateway (expecting multiple devices to stream data in the future).

Both cases i described used the exact same code.

That is the command I use to assign the device (unfortunately, every time i start the Dusun GW - if there is something i can do about that? That will be helpful…):
hciattach /dev/ttyUSB0 any 115200 noflow
I tried using “flow” which didn’t affect the result.
I tried changing the baud rate to 921600 ( ← which is the boud rate i use if i want to connect my iot device via serial port directly to log the data), or actually to any other setting following: https://linux.die.net/man/8/hciattach
^ But it seems like different baud rates are incompatible (?) - So i’m really having trouble figuring out what is the issue. So only 115200 works for me.
Then i run from the terminal: bluetoothctl power on.

How exactly do I get the Bluetooth transfer speeds hooked up properly?

And, some questions that have popped while following the link that you previously pasted:

  • What is the difference between NCP and RCP, and why do I need RCP?
  • Is the file for the Bluetooth firmware update is the most updated? (on the product site there’s only the NCP driver listed for BLE)
  • Where can i download BLE2MQTT? The link is broken on the products page.