Score:1

How to make Bluetooth RFCOMM device persistent across restarts

us flag

I am using an HC-06 bluetooth device to communicate from a peripheral to a Ubuntu 20 program using the PCs internal bluetooth device. The Bluetooth desktop manager has paired it. From terminal, I can bind it with:sudo rfcomm bind 0 <mac addr> and then point my Linux program to use device rfcomm0 as the comm port and it works fine...

but the bind is lost upon restart...how can I automatically recreate the bind at startup every time....I have tried using the command as a Startup Application and that does not work

guiverc avatar
cn flag
Ubuntu 20? No such release, so do you mean Ubuntu Core 20? as it's a different product to the more common Ubuntu 20.04 LTS (Ubuntu releases using the *year* format are *snap* only, compared to the more powerful *year.month* format that can use *deb*, *snap* packages are more). Please clarify
Hwurzburg avatar
us flag
shorthand Ubuntu 20.04lts desktop....in older versions you could add an entry in /etc/bluetooth/rfcomm.conf to create the device bind during bluetooth service initialization, but that capability was apparently dropped before the Unbuntu 18.04lts release...
guiverc avatar
cn flag
Ubuntu has used the *year* format for products that are *snap* only since 2016, so Ubuntu 20 implies a *snap* only system that was intended for *headless* operation (ie. cut-down Ubuntu 20.04 LTS server). The *year* format are different products and not a shorthand; a smaller less powerful product, which is beneficial in cloud, device & certain setups (faster to spin up etc). Applications in 20 are run in containerized environments without access to the real file-system (with some exceptions; eg. *classic* confinement) so configs are different between 20 & 20.04
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.