Developer Blog

14/11/2019 by Lars-Göran Fredriksson

How to connect multiple Kvaser BlackBirds

In this document I will show the different methods available for connecting one or more BlackBirds to a single computer. I will also investigate issues related to disturbance and unexpected delays when using multiple BlackBirds.

Writer: Lars-Göran Fredriksson, Field Application Engineer, Kvaser AB

Version: V1.01 2019

An Introduction to the Kvaser BlackBird v2

Kvaser BlackBird v2 is a high performance wireless (WLAN) communication link for the CAN bus. The BlackBird v2’s ability to leverage existing wireless infrastructure makes it ideal for replacing cumbersome cable, accessing hard-to-reach CAN networks, or for monitoring a CANbus while in motion.

You can read more about the Kvaser BlackBird v2 on our homepage.

Abbreviations
  • BlackBird Kvaser BlackBird v2 (EAN: 73-30130-00671-3)
  • WLAN Wireless local area networking
  • Wi‑Fi –  Trademark of the Wi-Fi Alliance
  • WHN Wireless Hosted Network
Useful Documents

Before you try to use your BlackBird, download the two documents: 

Table of Contents
  • 1 Using Kvaser BlackBirds (Jump to section >>)
    • 1.1 Infrastructure mode (WLAN access point)
    • 1.2 WiFi direct/Windows Hosted Network (Soft access point)
  • 2 Connecting single BlackBirds, Infrastructure mode (Jump to section >>)
    • 2.1 How do I connect my BlackBird to a WLAN?
      • 2.1.1 Start the Kvaser Device Guide
      • 2.1.2 Select Wireless Network (SSID)
      • 2.1.3 Set the Encryption (Passphrase)
      • 2.1.4 Set the Device Name
    • 2.2 APPLY SSID Passphrase and Name
    • 2.3 Binding BlackBird to a computer
      • 2.3.1 Using “Network Device Selector”
  • 3 Connecting single BlackBird, WiFi direct (Jump to section >>)
    • 3.1 BlackBird and Wi-Fi Direct
      • 3.1.1 Kvaser Wi-Fi Pairing tool
    • 3.2 BlackBird and WHN
      • 3.2.1 (VHN) Display wireless LAN global settings
      • 3.2.2 Enabling the WHN soft AP
      • 3.2.3 Start (and Stop) the wireless Hosted Network
  • 4 Multiple BlackBirds (Jump to section >>)
    • 4.1 Start the WiFi Direct Soft AP separately
    • 4.2 Connecting Multiple BlackBirds to existing Wi-Fi Direct SoftAP

1 Using Kvaser BlackBirds

Questions I am often asked include:

  • Do I need a WiFi access point when using a BlackBird?
  • Can I use two BlackBirds at the same time?
  • How many BlackBirds can I use on the same computer?
  • Can the BlackBird be disturbed by other units?

Some of the questions are easy to answer, but in some cases, the answer is not so obvious. In many cases, you do not need an access point, you can connect the BlackBird directly to your computer. And if you have many BlackBirds running at the same time, yes, there will be some interference between the units. If they share the same resources (e.g. the same WiFi channel), they cannot transfer information at the same time but need to wait until the channel is free. Also, if they are too close to each other, the RF signals can cause blackouts in the receivers.

There are different ways to connect your BlackBird/s, with different results to be expected:

1.1 Infrastructure mode (WLAN access point)

This is most probably the most common method of using the BlackBird.

When I use my BlackBird in this way, I get a typical transfer delay of 1.2ms. If we compare this with a Kvaser Leaf Light v2 (USB connected), then we find out that the BlackBird adds apps 0.8ms in transfer delay. (Kvaser Leaf Light needs appr 0.4ms to send one CAN message).

If I use two BlackBirds at the same time, then transfer delay is almost the same, sometimes 0.1ms longer.

Do they disturb each other? When I test the interfaces, I cannot say that they disturb each other. I am prepared to say that other traffic on the WLAN net causes more problems (my colleagues’ iPhones and some laptops use the WLAN).

1.2 WiFi direct/Windows Hosted Network (Soft access point)

This facilitates a direct connection between theBlackBird and the computer via aWiFi adapter. There is no need need for a router or physical access point.

It is possible to connect more than one BlackBird at the same time, but be careful, the SoftAP available in Windows is not as fast as an external WLAN AP.

When I use one BlackBird, I get a delay of appr 2ms. When using two BlackBirds at the same time, I get a delay in the region of 2.5ms. (Please note that the variance is quite high, approximately ±1ms).This is most probably caused by the SoftAP. In a comment from Microsoft, we can read: ”… this SoftAP is not designed to replace hardware-based wireless AP devices.”In many applications when you just want to listen to many CAN networks, this delay will probably not cause any problems.

Before we can connect multiple BlackBirds, we must learn how to connect one. 

I will show how to do this in section2: “Connecting a single BlackBird”

2 Connecting single BlackBirds, Infrastructure mode

By using a WLAN Access Point (AP), the BlackBird can communicate with any computer inside the AP’s visibility.

The computer can be connected to the LAN either via a physical LAN (Ethernet) cable, or via the wireless WLAN (Wi-Fi).

2.1 How do I connect my BlackBird to a WLAN?

There are four major steps that you must perform:

  • Connect the BlackBird to your computer via the USB interface.
  • Start Kvaser Device Guide – Configure Remote Settings.
  • Remove the USB, and power the BlackBird via the DB9 connector.
  • Binding the BlackBird to our computer. (I will explain this step later).
2.1.1 Start the Kvaser Device Guide
How to connect multiple Kvaser BlackBirds - Device Guide

We can now see that the BlackBird is on CANlib channel 0 and has the serial number 10541. Yes, that is my interface!

How to connect multiple Kvaser BlackBirds - channel 0 visible

If we right click on “Kvaser BlackBird v2”, we will find two very important commands:

  • “Configure Remote Settings”
  • “Pair via Wi-Fi”

In this section, we will use “Configure Remote Settings”, and in the next section we will use “Pair via Wi-Fi”.

Select “Configure Remote Settings”.

Now we must follow some very important steps:

  • Select Wireless Network (SSID)
  • Set the Encryption (Passphrase)
  • Set the Device Name
2.1.2 Select Wireless Network (SSID)

In the tab “Configuration”, you will find a button:”Browse Networks”. If we select that button, this dialog box appears:

How to connect multiple Kvaser BlackBirds - browser networks dialog box

Select “your” network from the list; I will select the Kvaser network.

pasted image 0-4

What happens now? This SSID field has been filled in for us. (if appropriate, edit the ‘Geographical Region.)

2.1.3 Set the Encryption (Passphrase)

In the tab “Security”, you will find a button:”Passphrase”. If we press that button, we can see this dialog:

How to connect multiple Kvaser BlackBirds - passphrase dialog box

Add a passphrase*, and press OK.

* Now we need some basic information on how the AP is setup. The most common setup today (2019-10-03) is the WPA2-PSK mode. Please check with your IT department as to how your AP is setup.

pasted image 0-6

This has filled in a WPA2 key for us.

2.1.4 Set the Device Name

In the tab “Network” we can see an edibox named “Device Name”, let us change the name of the interface to something we can remember (instead of “Kvaser Remote #10541”).

How to connect multiple Kvaser BlackBirds - changing device name

I select the name “BlackBird_Helge_1”.

2.2 APPLY SSID Passphrase and Name

We are now ready to press the magic button “APPLY”, but before we do that, (no problem if you have already done it), select the tab “Status”.

Press “APPLY”

If we wait a few seconds, we hopefully can see the following dialog box, showing that the interface managed to connect the BlackBird to the AP:

pasted image 0-7
2.3 Binding BlackBird to a computer

I have selected the word BIND for this procedure. In the “Network Device Selector” it says “Connect”. The purpose with this step is to BIND a resource (in this case our beautiful BlackBird) to a channel on a specific computer. 

Before we can use the BlackBird, let us disconnect the USB and connect the BlackBird to a powered CAN network. The BlackBird must be powered via the DSUB9 connector to be able function properly (via WLAN).

If you don’t have a powered CAN network, you can use the Kvaser T-Cannector v2 or the Kvaser DB9-Power Inlet.

When we open the Kvaser Device Guide, we can see that the BlackBird has disappeared from the list (we disconnected the USB, and powered it via the DSUB-9 connector).

pasted image 0-8

Select MENU/TOOLS/Network Device Selector

2.3.1 Using “Network Device Selector”
pasted image 0-9

If we are lucky, we can now see that our computer has detected the BlackBird.

Select the BlackBird and press the button “Connect”. 

Now, the tool will BIND the selected BlackBird to our computer and the Kvaser Drivers for Windows will attach it to a CAN channel.

pasted image 0-10

Something happens, “Service: State=6 (CONNECTION UP)” … it seems to work.

pasted image 0-11

We can now see that we have a new interface attached to CANlib Channel 0, via the Wi-Fi network.


3 Connecting single BlackBird, WiFi direct

There are three methods of connecting a BlackBird directly to a laptop (computer with WLAN network).

All have the same key functions:

  • The virtualization of a physical wireless adapter into more than one virtual wireless adapter, sometimes referred to as ‘Virtual Wi-Fi’.
  • A software-based wireless access point (AP), sometimes referred to as a SoftAP that uses a designated virtual wireless adapter.

Wireless Ad Hoc is no longer supported by Microsoft (2019-10-01) and so I will not show how to use it.

3.1 BlackBird and Wi-Fi Direct
pasted image 0-12

In the Kvaser Device Guide, we can select “Pair via Wi-Fi”

This will startup a guide that helps you to connect your BlackBird directly to your laptop using  “Wi-Fi Direct”.

Please note, there is an unwanted feature in how Windows handles the Wi-Fi Direct feature. If your WLAN card is connected to a 5Ghz network, it will open a 5GHz Wi-Fi Direct Soft AP. The BlackBird can only handle 2.4 GHz networks. Make sure that your WLAN card is in disconnected state or connected to a 2.4 GHz network.

3.1.1 Kvaser Wi-Fi Pairing tool

This tool helps us to setup the Wi-Fi Direct connection.

pasted image 0-13

If we do not need any special settings, then we just select “Pair Device and PC”.

The tool does 5 important things:

  • Starting AP
  • Configuring AP
  • Configuring BlackBird
  • Restarting BlackBird
  • Connecting BlackBird
pasted image 0-14
3.2 BlackBird and WHN

There might be situations when we not can use Wi-Fi Direct. One of my laptops does not support Wi-Fi Direct, but it does support VHN.

To use VHN, we must use the classical “Command Prompt”.

pasted image 0-15

We will use the command: “netsh wlan”

For more information regarding NETSH, please read:

Netsh Commands for Wireless Local Area Network (WLAN) in Windows Server 2008

We will try to:

  • Display wireless LAN global settings
  • Enable or disable the wireless Hosted Network.
  • Start and Stop the wireless Hosted Network
3.2.1 (VHN) Display wireless LAN global settings

Command: netsh wlan show drivers

Response:

Interface name: Wi-Fi

    Driver                    : DW1520 Wireless-N Half-Mini Card
    Vendor                    : Broadcom
    ...
    ...
    Hosted network supported  : Yes
    ...
    ...

Please note the line “Hosted network supported  : Yes”. This line indicates that my interface supports WHN.

3.2.2 Enabling the WHN soft AP

We enable the WHN soft AP by setting three parameters:

  • MODE
  • SSID
  • KEY

We can run three commands:

NETSH WLAN SET HOSTEDNETWORK MODE=ALLOW 
NETSH WLAN SET HOSTEDNETWORK SSID=MyHostedNetwork 
NETSH WLAN SET HOSTEDNETWORK KEY=My1SecretKey!

Or, we can combine them into one command:

NETSH WLAN SET HOSTEDNETWORK MODE=ALLOW  SSID=MyHostedNetwork  KEY=My1SecretKey!

Example

C:\WINDOWS\system32>NETSH WLAN SET HOSTEDNETWORK MODE=ALLOW
The hosted network mode has been set to allow.

C:\WINDOWS\system32>NETSH WLAN SET HOSTEDNETWORK SSID=MyHostedNetwork
The SSID of the hosted network has been successfully changed.

C:\WINDOWS\system32>NETSH WLAN SET HOSTEDNETWORK KEY=My1SecretKey!
The user key passphrase of the hosted network has been successfully changed.

OR

C:\WINDOWS\system32>NETSH WLAN SET HOSTEDNETWORK MODE=ALLOW  SSID=MyHostedNetwork  KEY=My1SecretKey!
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.

Now we have ENABLED the WHN soft AP.

Our computer will now provide a wireless network named “MyHostedNetwork”.

3.2.2 Start (and Stop) the wireless Hosted Network

To connect to the WHN, we must start it.

netsh wlan start hostednetwork Start the wireless Hosted Network.
(netsh wlan stop hostednetwork Stop the wireless Hosted Network.)

C:\WINDOWS\system32>netsh wlan start hostednetwork
The hosted network started.

We have created a WLAN named “MyHostedNetwork” and started it.

It is now possible to connect one or more BlackBirds using Infrastructure mode described in section “2 Connecting single BlackBirds, Infrastructure mode”.


4 Multiple BlackBirds

It is possible to connect multiple BlackBirds to one computer in all the different modes.

In infrastructure mode and WHN mode, just add as many BlackBirds as you like, following the instructions in section  “2 Connecting single BlackBirds, Infrastructure mode”.

When using WiFi Direct mode, then we need to do some tweaking when setting up the WiFi Direct AP.

  • Start the WiFi Direct Soft AP separately
  • Add one or many BlackBirds to the Soft AP
  • Press the “Change Passphrase” button

(Please note, the passphrase must fulfill the security policy of your computer)

Start the Kvaser Wi-Fi Pairing Tool

4.1 Start the WiFi Direct Soft AP separately
pasted image 0-16

Now we must save the settings, as we will need them later.

pasted image 0-17

Save the settings…

pasted image 0-18
pasted image 0-19

We can now start the tool:”Advanced/Configure PC Only”.

After one minute, it will time out and say that it failed to find a BlackBird. This is totally correct, because we have not yet configured the BlackBird.

But, most important, we can see that it has started the SoftAP.

What happened? Well, the tool removed all earlier SoftAP and started a new SoftAP with the name “MyWiFiDirectAP” and the Passphrase “!1Qaz2wsx3edc” (I happened to use that passphrase, now you know one of my most secret passwords☺)

4.2 Connecting Multiple BlackBirds to existing Wi-Fi Direct SoftAP

We now have a Wi-Fi Direct SoftAP with the following parameters:

  • SSID “KV-WiFiDirect-LAGUR”  (You will have a different name)
  • Passphrase “!1Qaz2wsx3edc”

We also have an INI file named “MyBBGuideSettings.ini”

[Config]
Version=1
SSID=KV-WiFiDirect-LAGUR
Passphrase=337A33736E6E4A62B7C6624A3BEF6BD892F1065BC5
Region=1
Deviceaccess=1
Configprot=0
ForceHostedNet=0

Start the Kvaser Wi-Fi Pairing Tool, open then INI file with “File/Open Configuration”, then start the tool “Advanced/Configure Device Only”.

pasted image 0-20
pasted image 0-21

It seems to be working!

You can repeat this step with all your BlackBirds.

Author Image

Lars-Göran Fredriksson

Lars-Göran Fredriksson is a Field Application Engineer for Kvaser AB. His background is in geographic information system (GIS) and Remote Sensing and his current focus is on connecting the deep knowledge of Kvaser's developers with the practical questions of our end users. If you doubt his passion for CAN, just know that his first week in the office he created an interactive CAN Trivia game that sent the office scouring the halls for the correct answers. He is a passionate fisherman who would like to develop new environmentally friendly fishing methods. Biggest catch and release fish is for the moment a Bluefin Tuna at appr 325kg / 715lbs.

Debug on...