SSSICK/BUOY/Connection/Linux Mint

From WWWIKI
< SSSICK‎ | BUOY‎ | Connection

There are a few different ways to connect from Linux Mint depending on which sub-distro you are using: XFCE, Mate, Cinnamon, etc. But connecting through the command line will work with any of these. This should also work for most major Debian-based distros. This is performed in a clean installation of Linux Mint, which is based on (but far superior to) Ubuntu. Ubuntu is based on Debian and shares many commonalities.

Blueman

Some Linux Mint distros come with Blueman, a very functional bluetooth connection manager that can handle the connection entirely through the GUI.

  1. Open Blueman either by clicking the bluetooth icon in your system tray, or by running "blueman-manager" manually.
    • Blueman 1.png
  2. Find your kit, right click and select "trust" and then select "pair".
    • Blueman 2.png
  3. Once you select "pair" it will ask for the pin. By default this is "1234".
    • Blueman 3.png
  4. Once paired, you will connect the kit to a serial port. Right click and select "Serial Port".
    • Blueman 4.png
  5. You can see that it is now connected to port "rfcomm0".
    • Blueman 5.png
  6. Now you can see "rfcomm0" in the port list. Select "connect" to connect.
    • Blueman 6.png
  7. Connected and running!
    • Blueman 7.png


Command Line

Start by entering the bluetoothctl terminal by opening a terminal and typing bluetoothectl

Once entered, you will start a scan of nearby devices by running: scan on

Bluetooth scan.png

Allow the scan to run for a few seconds. A number of devices will be detected. After a few seconds, run scan off to stop scanning.

To show devices that were found, run devices

Find the "SSSMCK", select and copy the devices BT address (in this case 98:DA:50:00:BF:05). You will need this address for a few further steps. Paste it into an empty document if you need to.

Scan on off devices.png

Now we will trust and pair the device so that we do not need to enter the PIN code each time. Do this by running trust [BT address]

Then we will pair the device by running pair [BT address]

At this point you will be asked for the PIN. By default this is 1234.

Pair and connect.png

If Buoy does not recognize the device you may need to create a com port. We do this by using the rfcomm application. It may or may not be installed on your system.

Run sudo rfcomm connect [device #] [BT address]

In this example we assign it to #5 -- you will want to use any available rfcomm devices. This is likely any number between 0-99 unless you have previously assigned ports. You can view which ports are in use by running ls /dev/rfcomm*. Any devices that are returned are currently in-use and cannot be assigned.

Rfcomm connect.png

We can make this connection permanent by running sudo rfcomm bind [device #] [BT address] and it will automatically connect and bind when detected.

We can now see the device listed in Buoy.

Rfcomm in buoy.png

Troubleshooting

If you are unable to communicate with the kit or you are getting this error when trying to connect:

Permission denied.png

It means that you do not have appropriate permissions to open the port. You can either run the app as root sudo ./Buoy.sh or you can fix this by continuing to read below:

While this is shown in Linux Mint, this is a nearly universal configuration for most every Debian-based Linux distro (as well as a few others).

First, we want to see what group the device is being assigned. By default this should be either the "tty" group or the "dialout" group. However, if you have very strict security settings, your computer may assign this device to the group "root". In this case, you will only be able to access the device if you belong to the root group. We can find out what group the device is assigned by running ls -al /dev/ttyUSB* (or whatever device identifier your SSSMCK is being assigned, this can by ttyACM[#], ttyrfcomm[#], or similar).

TtyUSB showing root.png

We can see here that the device is being assigned to the "root" group. If it belongs to another group, such as "tty" or "dialout", we just need to add our user to that group and you can skip modifying any device rules. If it belongs to root, we need to take a few extra steps.

First we need to find out what groups our user belongs to. Do this by running groups

Then we need to find out which groups are available by running cat /etc/group.

Showing tty group.png

Here we see that the group "tty" is available. This is the best choice to use. If it is not available, you can use the group "dialout" instead. Since this user does not belong to this group, we need to add this user to the group. Do this by running sudo usermod -a -G tty [your username]

User groups.png

Finally we need to modify the rules file that assigns the SSSMCK to a group. Do this by running sudo [your favorite text editor] /lib/udev/60-serial.rules. In this case we will edit the file with "nano", but you can use vim or xed or whatever you have installed.

Nanoudevrule.png

We will look for a line that starts with SUBSYSTEMS=="usb and append the following text: , GROUP="tty". Please note that the COMMA is VERY IMPORTANT! Now save the file (with nano use "Ctrl + x" and then confirm the save).

Add group tty to udev rule.png

Now the next time that we connect to the SSSMCK we will see that it has been assigned to the "tty" group:

Showing device group is tty.png