• How to connect to external Bluetooth serial SPP device?


    I just put my first experiment with Antergos on a used gazp9 I found on eBay, and picked Cinnamon. So far I really like it! But one of the things this computer is supposed to do is connect to the microcomputer that runs my off-grid house, via its Bluetooth serial port (for when the ethernet link fails). It paired right up to the external SPP device, but how do I connect?

    All the people I see doing this on the web say rfcomm, or minicom. But those posts are usually many years old… I installed minicom, but it doesn’t see any ports that I know how to request. And rfcomm doesn’t seem to be available at all:

    [[email protected] ~]$ sudo rfcomm bind 0 00:0A:3A:20:D4:C1
    sudo: rfcomm: command not found
    [[email protected] ~]$ sudo pacman -S rfcomm
    error: target not found: rfcomm
    [[email protected] ~]$
    

    Supposedly it was part of bluez-utils: bluetoothctl, rfcomm
    But bluez-utils is already installed, there seems to be no rfcomm in current versions, and no old versions in the AUR repo…

    BUT I see:

    [    8.765347] Bluetooth: RFCOMM TTY layer initialized
    [    8.765370] Bluetooth: RFCOMM socket layer initialized
    [    8.765375] Bluetooth: RFCOMM ver 1.11
    

    What is doing that? How do I connect to that socket if it exists?

    Some queries I see in this forum that might provide clues:

    [[email protected] ~]$ bluetoothctl
    Agent registered
    [bluetooth]# devices
    Device 00:0A:3A:20:D4:C1 FireFly-D4C1
    [bluetooth]# info 00:0A:3A:20:D4:C1
    Device 00:0A:3A:20:D4:C1 (public)
            Name: FireFly-D4C1
            Alias: FireFly-D4C1
            Class: 0x00001f00
            Paired: yes
            Trusted: yes
            Blocked: no
            Connected: no
            LegacyPairing: no
            UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
    [bluetooth]# 
    [bluetooth]# connect 00:0A:3A:20:D4:C1
    Attempting to connect to 00:0A:3A:20:D4:C1
    [CHG] Device 00:0A:3A:20:D4:C1 Connected: yes
    [FireFly-D4C1]# sp
    Invalid command in menu main: sp
    --> {Well, guess that isn't a serial terminal prompt...}
    
    Use "help" for a list of available commands in a menu.
    Use "menu <submenu>" if you want to enter any submenu.
    Use "back" if you want to return to menu main.
    [FireFly-D4C1]# help
    

    –> That just showed the main help again. What can you do there?

    [[email protected] ~]$ sudo systemctl status bluetooth
    ● bluetooth.service - Bluetooth service
       Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
       Active: active (running) since Sun 2018-10-21 22:52:39 PDT; 21h ago
         Docs: man:bluetoothd(8)
     Main PID: 439 (bluetoothd)
       Status: "Running"
        Tasks: 1 (limit: 4915)
       Memory: 2.8M
       CGroup: /system.slice/bluetooth.service
               └─439 /usr/lib/bluetooth/bluetoothd
    
    Oct 21 22:52:39 Gazp9 bluetoothd[439]: Starting SDP server
    Oct 21 22:52:39 Gazp9 bluetoothd[439]: Bluetooth management interface 1.14 initialized
    Oct 21 22:52:41 Gazp9 bluetoothd[439]: Endpoint registered: sender=:1.59 path=/MediaEndpoint/A2DPSource
    Oct 21 22:52:41 Gazp9 bluetoothd[439]: Endpoint registered: sender=:1.59 path=/MediaEndpoint/A2DPSink
    Oct 21 22:53:09 Gazp9 bluetoothd[439]: Endpoint unregistered: sender=:1.59 path=/MediaEndpoint/A2DPSource
    Oct 21 22:53:09 Gazp9 bluetoothd[439]: Endpoint unregistered: sender=:1.59 path=/MediaEndpoint/A2DPSink
    Oct 21 22:53:10 Gazp9 bluetoothd[439]: Endpoint registered: sender=:1.59 path=/MediaEndpoint/A2DPSource
    Oct 21 22:53:10 Gazp9 bluetoothd[439]: Endpoint registered: sender=:1.59 path=/MediaEndpoint/A2DPSink
    Oct 22 20:30:26 Gazp9 bluetoothd[439]: 00:0A:3A:20:D4:C1: error updating services: Input/output error (5)
    Oct 22 20:32:04 Gazp9 bluetoothd[439]: 00:0A:3A:20:D4:C1: error updating services: Input/output error (5)
    ~
    [1]+  Stopped                 sudo systemctl status bluetooth
    

    –> So there are errors with the serial device… Where can I explore those?

    [[email protected] ~]$ lspci
    00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
    00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
    00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
    00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
    00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
    00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
    00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
    00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
    00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
    00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
    00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
    00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
    00:1f.0 ISA bridge: Intel Corporation HM86 Express LPC Controller (rev 05)
    00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
    00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
    03:00.0 Network controller: Intel Corporation Wireless 3160 (rev 83)
    04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411 PCI Express Card Reader (rev 01)
    04:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0a)
    

    –> I believe the Bluetooth is part of the Network controller: Intel Corporation Wireless 3160

    [[email protected] ~]$ lsusb
    Bus 002 Device 002: ID 8087:8000 Intel Corp.
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 002: ID 8087:8008 Intel Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 002: ID 8087:07dc Intel Corp.
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    [[email protected] ~]$
    

    Sorry this is so long, but I suspect it is just that kind of problem… I’d really appreciate clues!

  • @LorenAmelang
    Maybe this could help: https://aur.archlinux.org/packages/bluez-rfcomm

    In AUR there are a couple of deprecated packages for rfcomm. But from that link you could check the link to http://www.bluez.org, there are newer versions available.

    Please note that I have never used those, so I don’t know if they should work or not.

  • @manuel
    Thank you for the clue to get me unstuck! Sorry it has been so long - I didn’t get any notification from this forum. And then it took awhile to work through the rest of the issue…

    Not sure why I didn’t find that AUR package. It installed normally, and could bind the port, but could not connect:

    [[email protected] ~]$ rfcomm show /dev/rfcomm0
    Get info failed: No such device
    [[email protected] ~]$ sudo rfcomm bind 0 00:0A:3A:20:D4:C1
    [[email protected] ~]$ rfcomm show /dev/rfcomm0
    rfcomm0: 00:0A:3A:20:D4:C1 channel 1 clean
    [[email protected] ~]$ sudo rfcomm connect /dev/rfcomm0  00:0A:3A:20:D4:C1 1
    Can't create RFCOMM TTY: Address already in use
    [[email protected] ~]$ sudo rfcomm connect /dev/rfcomm0  00:0A:3A:20:D4:C1 0
    Can't connect RFCOMM socket: Invalid argument
    [[email protected] ~]$ sudo rfcomm connect /dev/rfcomm0  00:0A:3A:20:D4:C1 2
    Can't connect RFCOMM socket: Connection refused
    

    But with the port bound, Minicom can use it:

    sudo minicom
    [set the port to /dev/rfcomm0, it will remember next time]
    
    Welcome to minicom 2.7.1
    
    OPTIONS: I18n
    Compiled on Jun  5 2018, 10:54:41.
    Port /dev/rfcomm0, 16:07:45
    
    Press CTRL-A Z for help on special keys
    
    <live serial connection>
    
    [Ctrl+A, X to close connection]
    

    But it still needs sudo rfcomm bind 0 00:0A:3A:20:D4:C1 after every boot…

    The CuteCom GUI terminal at https://aur.archlinux.org/cutecom.git also builds and installs. But to use the bluetooth /dev/rfcomm0 port, you must be in the proper user group. Lots of people say “dialout”, but not in my Antergos:

    [[email protected] ~]$ stat /dev/rfcomm0
      File: /dev/rfcomm0
      Size: 0               Blocks: 0          IO Block: 4096   character special file
    Device: 6h/6d   Inode: 93516       Links: 1     Device type: d8,0
    Access: (0660/crw-rw----)  Uid: (    0/    root)   Gid: (  987/    uucp)
    Access: 2018-10-30 18:34:49.910983627 -0700
    Modify: 2018-10-30 18:34:49.910983627 -0700
    Change: 2018-10-30 18:34:49.910983627 -0700
     Birth: -
     
    [[email protected] ~]$ gpasswd -a loren uucp
    gpasswd: Permission denied.
    [[email protected] ~]$ sudo gpasswd -a loren uucp
    [sudo] password for loren:
    Adding user loren to group uucp
    [[email protected] ~]$ groups ${USER}
    wheel uucp autologin wireshark loren
    [[email protected] ~]$
    

    But this CuteCom uses a variable space font, and my serial devices make heavy use of monospaced columns.

    https://gitlab.com/cutecom/cutecom/
    Monospace still on ToDo list

    https://github.com/neundorf/CuteCom/pull/62
    Somebody added monospace, but looks like it wasn’t accepted…

    The hacked version is in AUR:
    https://aur.archlinux.org/packages/cutecom-legacy/

    I saw several screens of
    error: failed retrieving file ‘qt4-4.8.7-25-x86_64.pkg.tar.xz’ from mirror…
    but it eventually found one and installed.

    It replaced the previous version, and with the uucp group already set, it worked. The dropdown menu for port only shows tty values, but you can type in /dev/rfcomm0 and it sticks. And it does do monospacing!

bluetooth46 spp1 serial1 rfcomm1 Posts 3Views 142
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.