hamwaves.com
;

miniVNA PRO
Bluetooth with GNU/Linux

Serge Stroobandt, ON4AA

Copyright 2017–2019, licensed under Creative Commons BY-NC-SA

  1. Home
  2. Linux Ham
  3. miniVNA PRO Bluetooth

Before proceeding, please, complete the steps for USB connectivity using GNU/Linux. Below instructions depend on those steps being completed first.

Below information is applicable to Ubuntu LTS based systems.

Blueman manager

First, ensure that the blueman package is properly installed:

$ sudo apt install blueman

If this is the first time using blueman, remove the Bluetooth dongle and reinsert it, or alternatively reboot your system.

  1. Start the Bluetooth manager either from the menu or by right clicking the task bar icon and selecting Devices. Hit the Search button to discover Bluetooth devices in the neigbourhood. Hit the search button to discover Bluetooth devices in the neigbourhood.

  2. The miniVNA PRO was discovered, but is still not connected. The miniVNA PRO was discovered, but is still not connected.

  3. Click with the right mouse button on the discovered device, and select Pair. Click with the right mouse button on the discovered device, and select Pair.

  4. Now, pair the miniVNA PRO using the PIN sequence 1234. Pairing of the miniVNA PRO using the PIN sequence 1234.

  5. The miniVNA PRO is now paired as evidenced by the small telephone icon on top of the Bluetooth icon. Trusting the device is not necessary and does not influence the bug described in the next section. The small telephone icon on top of the Bluetooth icon indicates that the miniVNA PRO is now paired.

  6. Once more, right click on the device and select Connect To: Serial Port. Right click on the device and select Connect To: Serial Port.

  7. The miniVNA PRO is now connected to a serial port, which /dev/rfcomm port number is indicated at the bottom of the Bluetooth Manager window. Signal strengths are also shown with bar graphs. The miniVNA PRO is now connected to a serial port, which /dev/rfcomm port number is indicated at the bottom. Signal strengths are also shown with bar graphs.

Caveat

When the Bluetooth connection gets interrupted, a new /dev/rfcomm port number will be assigned upon reconnecting. Using Blueman Manager, at least you will be notified about this new /dev/rfcomm port number. That way at least you will know what is happening.

This stands in contrast to the automatic connection method described by K. Gopa Kumar, VU2XTO, and used for his stand-alone VNA using a Raspberry Pi. However, that method does not always leave clear which port number is in use after a reconnection.

Bluetooth class & version

The miniVNA PRO specifications indicate Class 1 Bluetooth, implicating transmitted power is 20 dBm or 100 mW. Provided a clear line of sight, good antennas and Class 1 devices at both ends, the range could extend up to 100 m.

Whereas class indicates power, the Bluetooth version indicates its modulation scheme and thereby its data rate throughput. The Bluetooth version is not stated in the specifications. However, this can easily be determined by employing the GNU/Linux hcitool command.

First, determine the MAC address of the connected device:

$ hcitool con
Connections:
    < ACL 00:12:6F:21:C1:25 handle 71 state 1 lm MASTER

Requesting information about the connected device, reveals the miniVNA PRO runs a link manager protocol (LMP) of version 2.0 which corresponds to Bluetooth version 1.2 (see Table 1).

$ hcitool info 00:12:6F:21:C1:25
Requesting information ...
    BD Address:  00:12:6F:21:C1:25
    OUI Company: Rayson Technology Co., Ltd. (00-12-6F)
    Device Name: PRO SN 0955
    LMP Version: 2.0 (0x3) LMP Subversion: 0x10b7
    Manufacturer: Cambridge Silicon Radio (10)
    Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
        <3-slot packets> <5-slot packets> <encryption> <slot offset> 
        <timing accuracy> <role switch> <hold mode> <sniff mode> 
        <park state> <RSSI> <channel quality> <SCO link> <HV2 packets> 
        <HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme> 
        <power control> <transparent SCO> <broadcast encrypt> 
        <EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan> 
        <interlaced iscan> <interlaced pscan> <inquiry with RSSI> 
        <extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave> 
        <AFH class. slave> <3-slot EDR ACL> <5-slot EDR ACL> 
        <AFH cap. master> <AFH class. master> <EDR eSCO 2 Mbps> 
        <EDR eSCO 3 Mbps> <3-slot EDR eSCO> <extended features>
Line management protocol and corresponding Bluetooth version
LMP version Bluetooth version
0 1.0b (withdrawn)
1 1.1 (withdrawn)
2 1.2 (withdrawn)
3 2.0 + EDR
4 2.1 + EDR
5 3.0 + HS
6 4.0
7 4.1
8 4.2
9 5.0
10 5.1

Blueman bug

Now comes the less elegant, tricky part… Normally, whilst running vna/J, one would select now the newly created rfcomm port by entering the AnalyzerSetup … menu. However, if one runs vna/J as a normal, unprivileged user, any attempt to connect to the newly created /dev/rfcomm port by hitting the Test is welcomed with a red Failed to open port! notification. This is sometimes followed by a rather obscure purejavacomm.PortInUseException.

Red Failed to open port! notification

Red Failed to open port! notification

purejavacomm.PortInUseException error

purejavacomm.PortInUseException error

The issue at hand is caused by a confirmed Blueman bug that is currently being worked on.

Launching vna/J with pkexec

On GNU/Linux, only the .jar Java™ archive file is required. Personally, I find it convenient to keep this file in the directory /home/opt/ham/vna-j/.

Below bash script helps with always launching the latest version of vna/J, even when more than once version is available in the /home/opt/ham/vna-j/ directory. The script is stored in my /home/bin/ham/ custom scripts folder under the filename vna-j. It should be made executable with chmod +x vna-j. Adding the /home/bin/ham/ path to the $PATH environment variable might come handy for debugging Java™ errors.

# !/usr/bin/env bash

INSTALLDIR='/home/opt/ham/vna-j'

# Run the latest version of vna/J.
java -jar $(ls -1v $INSTALLDIR/vnaJ*.jar |tail -n 1) &

Because of the previously mentioned very annoying Blueman permission issue, the script vna-j needs to be launched using pkexec.

To successfully run the program using the Polkit infrastructure (Archlinux info), a krause.vna.gui.policy file needs to created in the /usr/share/polkit-1/actions/ directory. This policy file refers to my /home/bin/ham/vna-j launcher script.

sudo nano /usr/share/polkit-1/actions/krause.vna.gui.policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
    <action id="org.freedesktop.policykit.pkexec.vna-j">
    <vendor>Dietmar Krause, DL2SBA</vendor>
    <vendor_url>https://vnaj.dl2sba.com/</vendor_url>
    <description>Run vna/J program</description>
    <message>Authentication is required to run vna/J</message>
    <defaults>
        <allow_any>auth_admin</allow_any>
        <allow_inactive>auth_admin</allow_inactive>
        <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/home/bin/ham/vna-j</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
    </action>
</policyconfig>
$ pkexec vna-j
Authentication when launching vna/J using pkexec

Authentication when launching vna/J using pkexec

The same command may also be launched from a custom desktop launcher button. The method to create desktop launchers differs with each desktop environment. To the left of this paragraph, one can find the official vna/J icon.

Launch vna/J using the above script and enter the AnalyzerSetup … menu. Click the Test button and wait for a brief moment. If the correct rfcomm port number was selected, the Bluetooth connection should work now, indicated by a green coloured notification. Sometimes, two connection attempts are required. On the second Test button click, the connection should be established almost immediately. If indeed successful, do not forget to click on Update.

The selected port works now. Do not forget to click the Update button.

The selected port works now. Do not forget to click the Update button.

You should now be able to perform miniVNA PRO measurements wirelessly, using Bluetooth. Personally, I have found the miniVNA PRO Bluetooth connection set up in this way to be very stable, fast and replicable.

5
Creative Commons Licence
This work is licensed under a Creative Commons Attribution‑NonCommercial‑ShareAlike 4.0 International License.
Other licensing available on request.
GNU GPL v3
Unless otherwise stated, all originally authored software on this site is licensed under the terms of GNU GPL version 3.
cookie
This static web site has no backend database.
Hence, no personal data is collected and GDPR compliance is met.
Moreover, this domain does not set any first party cookies.

All Google ads shown on this web site are, irrespective of your location,
restricted in data processing to meet compliance with the CCPA and GDPR.
However, Google AdSense may set third party cookies for traffic analysis and
use JavaScript to obtain a unique set of browser data.
Your browser can be configured to block third party cookies.
Furthermore, installing an ad blocker like EFF's Privacy Badger
will block the JavaScript of ads.
Google's ad policies can be found here.
This page employs a Python Bottle server‑side script.
This page includes an open-source client-side script, written in Python and
transcoded by Brython to make it run as secure JavaScript in the browser.
Static XHTML generated from Markdown by Pandoc and
the GNU/Linux make, sed and gpp commands.
LaTeXmath markup rendered with MathJax.
BibTeX references are best read with JabRef.
Unattended CSS typesetting with Prince.
This work is published at https://hamwaves.com/minivna.pro.bt/en/.
profile for Serge Stroobandt on Stack Exchange, a network of free, community-driven Q&A sites
GnuPG
Use my OpenPGP public key to encrypt messages for:

echo c2VyZ2VAc3Ryb29iYW5kdC5jb20K |base64 -d
Last update: Wednesday, September 1, 2021.