To connect to the RPi3 through the Bluetooth Terminal App, I have to run this command first:

sudo rfcomm watch hci0

How to execute this command automatically during startup of the Rpi?

I found this link, Serial Bluetooth Communication

It does help me connect without running the command after reboot. But Once the device is disconnected, I'm not able to reconnect.

  • If I understood correctly, you should find some help on the Raspberry Pi forum with this link: Raspberry Pi Forum - Run a command on start up.
    – not here
    May 30, 2019 at 15:17
  • tl;dr; the link you have given. How is that command started at boot up? And why do you can't reconnect?
    – Ingo
    May 31, 2019 at 18:53

1 Answer 1


edit your /etc/rc.local file and add

sudo rfcomm watch hci0 

if it does not work try putting the command inside a script then make the script executeable. then run the script from rc.local like so...

sudo nano startfile.sh

and put in contents


sudo rfcomm watch hci0 

Press Ctrl+X then Y to save and Enter to exit

then make it executeable

chmod +x startfile.sh

finally in the rc.local just put in the file name


Should work...little rusty on the details but it goes something like that.

  • Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it.
    – Ingo
    May 31, 2019 at 18:49
  • adding sudo rfcomm watch hci0 & to /etc/rc.local file worked just fine! 👍 Jun 2, 2019 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.