serial_console_over_bluetooth
Table of Contents
~~TOC~~
Serial console over Bluetooth
Notes
- The rfcomm process has higher CPU usage when connected.
- The rfcomm utility is deprecated since Bluez 5.44. No alternative found yet, maybe look into PAN.
Configure
Server
- Stop ModemManager from interefering:
systemctl stop ModemManager systemctl disable MomdemManager
- Modify
/etc/bluetooth/main.conf
:[Policy] AutoEnable=true
- Start and enable bluetooth service:
systemctl enable bluetooth systemctl start bluetooth
- Create systemd service
/etc/systemd/system/rfcomm.service
[Unit] Description=RFCOMM service After=bluetooth.service Requires=bluetooth.service [Service] ExecStart=/usr/bin/rfcomm watch hci0 1 setsid /sbin/agetty --8bits --noclear -L rfcomm0 115200 linux [Install] WantedBy=multi-user.target
- Enable and start the rfcomm service:
systemctl enable rfcomm systemctl start rfcomm
Client
- Stop ModemManager from interefering:
systemctl stop ModemManager systemctl disable MomdemManager
- Add user to
dialout
group.
Pairing and connecting
- On the server side:
bluetoothctl discoverable on pairable on
- On the client side:
bluetoothctl scan on -wait to discover server- scan off pair <mac>
- On the server:
bluetoothctl discoverable off pairable off
- Connect to the serial console over bluetooth:
# There should be a rfcomm0 device crw-rw----. 1 root dialout 216, 0 11 jun 08:14 /dev/rfcomm0 # Connect to the serial console: screen /dev/rfcomm0 115200
Troubleshooting
- After resizing your terminal, run:
resize
. - Check bluetooth is not disabled:
rfkill list
serial_console_over_bluetooth.1497192753.txt.gz · Last modified: 2017/06/11 14:52 by admin