Connect Gateway to your network using WebSocket integration
The WebSocket integration path lets you connect the Gateway to your enterprise network. This is done using a network.json
file with your network's credentials, and a websocket.json
file containing your WebSocket integration settings.
The easiest way is to enter all details directly in the INSIGHT webportal while creating your Device Configuration. This allows you to add and define all the relevant parameters in a single place, and automatically create fully functional files that are ready for immediate use. You can then apply the configuration by transferring the files to your Gateway device, or using the option INSIGHT offers and applying your configuration by simply scanning a custom QR code.
If you prefer the manual process, you can still create your own network.json
and websocket.json
files and add any relevant details using the main fields and examples provided below. Zip both files with any required certificates together in a .zip
archive file, and upload it to your Gateway as a mass storage device.
Note
Read more about uploading files to the Gateway while in Mass storage mode.
provision.zip
file structureprovision.zip
websocket.json
network.json
File 1 (e.g.,
ca_cert.pem
)*File 2 (e.g.,
cert.pem
)*File 3 (e.g.,
key.pem
)*
*This is required only for self-signed certificates or certificates that were signed by an unrecognized authority.
WebSocket.json file configuration
To configure the WebSocket integration, add relevant information to the websocket_client
namespace using the fields described below. For a better understanding of how to configure the websocket.json
fields, see examples.
Create the websocket.json file
Open a text editor (E.g. Notepad, Sublime Text, VS Code)
Copy the snippet below into the editor.
{ "websocket_client": { "domain": "proglove.de" } }
Under
domain
, type in the URL or the IP address of the server you want to connect to.Save the file as
websocket.json
.
Note
For additional configuration, see the fields below.
Apply the websocket.json file
Connect the Gateway's USB cable to your desktop.
The Gateway boots up in about 1 minute. The USB LED on the Gateway glows green constantly.
Scan the barcode on the Gateway with your scanner.
The scanner connects to the Gateway and the Scanner LED on the Gateway glows green.
Scan the barcode below to enable the Gateway as a mass storage device.
The Gateway displays as a mass storage device on your desktop.
Upload the zipped
websocket.json
file to your Gateway.Note
If the Gateway is not connected to the network, upload the zipped network.json file too.
Eject the Gateway as a mass storage device from your desktop.
The upload takes a few seconds. All three LEDs flash green when done. The Gateway automatically connects to your network and INSIGHT, and the Cloud LED on the Gateway glows green.
Note
Ejecting a mass storage device may vary depending on your operating system.
Make sure to use the Safely Remove / Eject option to remove the Gateway as the Mass storage device on your desktop but do NOT disconnect the Gateway’s USB cable during upload.
Main fields
Field | Type | Description | Required | Default |
---|---|---|---|---|
| object (see Protocol) | Use the protocol to connect to the server (plaintext or encrypted with SSL). This defines which protocol the Gateway will use: | No | Plaintext |
| string | The domain or address of the server. (e.g., 192.168.0.1 or proglove.de.) | Yes | / |
| string | The path on the server serving the WebSocket. | No | / |
| integer | The port number to connect to the server. | No |
|
| object (see Credentials) | The credentials to use in case the connection requires an authentication. | No | / |
Protocol
Field | Type | Description |
---|---|---|
| object | Uses plaintext to talk to the server. |
| object (see SSL) | Uses an encrypted connection with SSL to talk to the server. |
SSL
Field | Type | Description |
---|---|---|
| object (see Basic authentication) | Authenticate with the server using basic authentication. |
| string | The path to the Root Certificate Authority file in the archive.* |
*This is required only for self-signed certificates or certificates that were signed by an unrecognized authority.
Credentials
Field | Type | Description |
---|---|---|
| object (see Basic authentication) | Authenticate with the server using basic authentication. |
Basic authentication
Field | Type | Description | Required |
---|---|---|---|
| string | The username used to authenticate with the server. | Yes |
| string | The password used to authenticate with the server. | Yes |
Examples
Unencrypted
The examples in this section describe how to connect using an unencrypted connection.
Simple unencrypted connection
Connect to a WebSocket server on port 80
at address proglove.de
on path /
.
WebSocket URI: ws://proglove.de:80/
{ "websocket_client": { "domain": "proglove.de" } }
Unencrypted connection with specific path and port
Connect to a WebSocket server on port 4242
at address proglove.de
on path /websocket
.
WebSocket URI: ws://proglove.de:4242/websocket
{ "websocket_client": { "domain": "proglove.de", "port": 4242, "path": "/websocket" } }
Encrypted
Encrypted connection with default settings.
Connect to an encrypted WebSocket server on port 443
at address proglove.de
on path /
.
WebSocket URI: wss://proglove.de:443/
{ "websocket_client": { "domain": "proglove.de", "protocol": { "ssl": { } } } }
Encrypted connection with specific path and port
Connect to an encrypted WebSocket server on port 4242
at address proglove.de
on path /websocket
.
WebSocket URI: wss://proglove.de:4242/websocket
{ "websocket_client": { "domain": "proglove.de", "port": 4242, "path": "/websocket", "protocol": { "ssl": { } } } }
Encrypted connection with a root certificate
Connect to an encrypted WebSocket server on port 443
at address proglove.de
on path / using a root certificate located at ca.pem
* in the archive.
*This is required only for self-signed certificates or certificates that were signed by an unrecognized authority.
WebSocket URI: wss://proglove.de:443/
{ "websocket_client": { "domain": "proglove.de", "port": 4242, "path": "/websocket", "protocol": { "ssl": { "ca_cert_path": "ca.pem" } } } }
Basic Authentication
Simple unencrypted connection with credentials
Connect to a WebSocket server on port 80
at address proglove.de
on path /
using Basic Authentication with username foo and password bar.
WebSocket URI: ws://foo:bar@proglove.de:80/
{ "websocket_client": { "domain": "proglove.de", "credentials": { "basic_auth": { "username": "foo", "password": "bar" } } } }
Encrypted connection with credentials
Connect to a WebSocket server on port 443
at address proglove.de
on path /
using Basic Authentication with username foo and password bar.
WebSocket URI: wss://foo:bar@proglove.de:443/
{ "websocket_client": { "domain": "proglove.de", "credentials": { "basic_auth": { "username": "foo", "password": "bar" } }, "protocol": { "ssl": { } } } }