CookieCrumbler123
Posts: 3
Joined: Fri Dec 07, 2018 10:41 am

Bluetooth stopped working after messing with serial0 and serial1

Fri Dec 07, 2018 11:02 am

Good day everyone,

I am using Hassbian which is a version of Raspbian with Home Assistant installed. I hope posting here is still okay.

I had my Bluetooth radiator thermostat connected to my Pi and everything worked fine. Yeserday I used my Pi to flash a Shelly 1 device over UART. To do that I followed this tutorial. Linked in that article is another older version of the same article.

It tells you to stop and disable the serial-getty@ttyS0.service. I had some trouble because serial0 was not visible for me (solution to that found in this forum: viewtopic.php?t=148713). That is why I tried to follow the old tutorial as well, which tells you to disable a different service.

At this point I had stopped and disabled serial-getty@ttyS0.service and serial-getty@ttyAMA0.service. After applying the aforementioned solution I was able to flash the device and everything worked perfectly fine. But now I am not able to use my bluetooth anymore :?

I already enabled and started both serial-getty services and reverted both the /boot/cmdline.txt and the /boot/config.txt to their original states but bluetooth just does not seem to work.

In pstree I can see that bluetoothd is running. Restarting it has no effect. Running

Code: Select all

$ bluetoothctl
[bluetooth]# power on bluetoothd...
No default controller available
Just tells me that no default controller is available. Running

Code: Select all

$ bluetoothd
D-Bus setup failed: Connection ":1.32" is not allowed to own the service "org.bl                                                                                                                                                             uez" due to security policies in the configuration file
Shows this error message. I am not sure what to do about it because I have already changed the config.txt back to its original state.


I would appreciate every hint and every bit of information :)
Thank you in advance
CookieCrumbler


PS: This is my complete /boot/config.txt

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
dtoverlay=w1-gpio,gpiopin=4

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

#enable_uart=1

User avatar
bensimmo
Posts: 4073
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Bluetooth stopped working after messing with serial0 and serial1

Fri Dec 07, 2018 4:29 pm

None of that original tutorial touches the Bluetooth part.

You enable and start the service
ttyAMA0 is Bluetooth.
You could just use /dev/ttyS0 if no serial0 is there.

Anyway, no idea if it'll work as I've not messed it up before (yet ;-))

sudo systemctl enable hciuart

And maybe a reboot.

If that doesn't work, then stop/disable the ttyAMA0 Getty , and try again.

And if that doesn't work, hope somebody more knowledgeable comes alone :-)

CookieCrumbler123
Posts: 3
Joined: Fri Dec 07, 2018 10:41 am

Re: Bluetooth stopped working after messing with serial0 and serial1

Mon Dec 17, 2018 5:27 pm

Thanks for your very quick response. Please apologize me taking so long, I was waiting for some e-mail that my post has been accepted.

I am not too sure about what you are suggesting me to do, sorry. Could you please clarify? I didn't mean to get into this whole mess and don't understand/know much about it.

Some more information about my systems status:

Code: Select all

lrwxrwxrwx 1 root root          7 Dec 14 01:23 serial1 -> ttyAMA0
This is the only serial that is listed with 'ls -l /dev'. There also is 'tty', lots of 'ttyXX' with numbers ranging from 0 to 63, 'ttyprintk' and 'ttyAMA0'.

Furthermore this are the service's status:

Code: Select all

pi@hassbian:/sys/class/tty $ sudo systemctl status /dev/ttyAMA0
● dev-ttyAMA0.device - /dev/ttyAMA0
   Follow: unit currently follows state of sys-devices-platform-soc-3f201000.serial-tty-ttyAMA0.device
   Loaded: loaded
   Active: active (plugged) since Fri 2018-12-14 01:23:14 CET; 3 days ago
   Device: /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0

Dec 14 01:23:14 hassbian systemd[1]: Found device /dev/ttyAMA0.

pi@hassbian:/sys/class/tty $ sudo systemctl status /dev/serial1
● dev-serial1.device - /dev/serial1
   Follow: unit currently follows state of sys-devices-platform-soc-3f201000.serial-tty-ttyAMA0.device
   Loaded: loaded
   Active: active (plugged) since Fri 2018-12-14 01:23:14 CET; 3 days ago
   Device: /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0

Dec 14 01:23:14 hassbian systemd[1]: Found device /dev/serial1.

pi@hassbian:/sys/class/tty $ sudo systemctl status hciuart
● hciuart.service - Configure Bluetooth Modems connected by UART
   Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-12-14 01:23:22 CET; 3 days ago
 Main PID: 425 (hciattach)
   CGroup: /system.slice/hciuart.service
           └─425 /usr/bin/hciattach /dev/serial1 bcm43xx 3000000 flow - b8:27:eb:67:67:6e

Dec 14 01:23:15 hassbian systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Dec 14 01:23:22 hassbian btuart[306]: bcm43xx_init
Dec 14 01:23:22 hassbian btuart[306]: Flash firmware /lib/firmware/brcm/BCM4345C0.hcd
Dec 14 01:23:22 hassbian btuart[306]: Set BDADDR UART: b8:27:eb:67:67:6e
Dec 14 01:23:22 hassbian btuart[306]: Set Controller UART speed to 3000000 bit/s
Dec 14 01:23:22 hassbian btuart[306]: Device setup complete
Dec 14 01:23:22 hassbian systemd[1]: Started Configure Bluetooth Modems connected by UART.
I ran the status command for serial0 and ttyS0 as well although they are not listed by 'ls -l /dev' and these are the results:

Code: Select all

pi@hassbian:/sys/class/tty $ sudo systemctl status /dev/serial0
● dev-serial0.device
   Loaded: loaded
   Active: inactive (dead)
pi@hassbian:/sys/class/tty $ sudo systemctl status /dev/ttyS0
● dev-ttyS0.device
   Loaded: loaded
   Active: inactive (dead)

Dec 14 01:24:53 hassbian systemd[1]: dev-ttyS0.device: Job dev-ttyS0.device/start timed out.
Dec 14 01:24:53 hassbian systemd[1]: Timed out waiting for device dev-ttyS0.device.
Dec 14 01:24:53 hassbian systemd[1]: dev-ttyS0.device: Job dev-ttyS0.device/start failed with result 'timeout'.
Could that timeout be a problem?

Also my /boot/cmdline.txt still ends with 'enable_uart=1'. Do I maybe want to remove this line or change it to 0?

Return to “Raspbian”