Application Note:
How to Connect FOX3-2G/3G/4G
to the Telenor MIC Platform

Part Number APP-0126
Revision A November 2022

Intellectual Property© 2022 Lantronix, Inc. All rights reserved. No part of the contents of this publication may betransmitted or reproduced in any form or by any means without the written permission ofLantronix.
Lantronix is a registered trademark of Lantronix, Inc. in the United States and other countries.
Patented: https://www.lantronix.com/legal/patents; additional patents pending.
All trademarks and trade names are the property of their respective holders.

Contacts
Lantronix, Inc.
48 Discovery, Suite 250
Irvine, CA 92618, USA
Toll Free: 800-526-8766
Phone:
949-453-3990
Fax:
949-453-3995
Technical Support
Online: https://www.lantronix.com/technical-support/
Sales Offices
For a current list of our domestic and international sales offices, go to the Lantronix web site athttps://www.lantronix.com/about-us/contact/.

Disclaimer
All information contained herein is provided “AS IS.” Lantronix undertakes no obligation to
update the information in this publication. Lantronix does not make, and specifically disclaims,
all warranties of any kind (express, implied, or otherwise) regarding title, non-infringement,fitness, quality, accuracy, completeness, usefulness, suitability, or performance of theinformation provided herein. Lantronix shall have no liability whatsoever to any user for any
damages, losses and causes of action (whether in contract or in tort or otherwise) inconnection with the user’s access or usage of any of the information or content contained
herein. The information and specifications contained in this document are subject to change
without notice.

Revision History
DateRev.

Comments

November 2022A

Initial document.

For the latest revision of this product document, please check our online documentation atwww.lantronix.com/support/documentation.

How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

2Overview
This application note provides guidance to setup and use FOX3 on Telenor MIC Platform.

What is Needed for this Setup•

A FOX3 model with BLE and activated LUA license•Workbench software tool•

Telenor MIC Platform accountInitial Setup
Upgrading FOX3 Firmware
Upgrade the FOX3 series device AVL firmware to the latest version. It must be version 3.12.0or later.
These instructions are specific to updating your LANTRONIX AVL device via COM interface(Serial Port).
Download the latest released firmware version for the FOX3 device from the Lantronix
Tech Support page and extract the file you downloaded into a folder on your PC.
Download and install the Workbench software if it is not installed on your PC. Run theWorkbench software.

Begin the firmware update process (refer to the figure above).
Connect the AVL device to your PC either directly using the programming cable or thecorresponding evaluation board.
How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

3

Click Port (1) icon. Select the COM1 port settings from the PortView 1 (2) and click thePlay button next to the COM1 to open the selected COM port.
Click Terminal icon (3). Select the Terminal1 (4) and go to the ConnectionView (5).
Connect it to the Serial Port COM1.
Click Firmware (6) icon. Select SERIAL from the Transmission Options (7) and go toConnectionView (8). Connect it to the Serial Port COM1.
Click Browse (9) button and select the firmware file *.frp from the temporary folder
where the firmware was expanded.
Click Play (10) button to start the firmware update. This button appears only if thefirmware file has already been selected.
Wait until the update process completes. While the update is running, do not send any
command to the device and do not manually reboot it until the device restarts itself.
After the update process successfully completes, a success message will appear. ClickOK button to restart the AVL device.
Open an Editor by clicking the Editor icon (1) (refer to the figure below). Click Editor 1(2) and go to the ConnectionView (3). Connect it to the Serial Port COM1.
Upload or copy and paste your device configuration into the Editor 1 (2). Go to theEditor 1 menu and click start sending device configuration.

Setting up FOX3 in MIC
Log into MIC with your username and password.
Create a new Thing Type by clicking the +NEW THING TYPE button on the top left
corner.

How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

4

Enter a name and description for the Thing Type.

Create the ThingYour Thing Types will be visible in the panel on the left side of the window. When creating anew Thing it will automatically belong to the selected Thing Type.

To add a new Thing:
Click on the "+ THINGS" button. A pop-up window will appear.
De-select the "Create batch" and then add a Thing Name, a Description and selectyour Domain from the selection menu.
You should be able to see some data coming in. Now create widgets that will display
your data.

View and Edit the Dashboard
Click the name of the created Thing in the list and the dashboard for your Thing willopen. This dashboard is empty until the first data from FOX3 comes in. The dashboard
is configurable. The values are called resources. For example: Temperature andHumidity can be resources.
Click MOVE button to edit the dashboard. You can move things around and create newwidgets.

How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

5

Press the button +WIDGET to create a new widget.

In the Add Widgets page, enter or select the following:•Label•Widget Type•

Resource

Select or enter the resource parameters.
Press Save to save the widget settings.

1. In Workbench Editor 1, do the following:•Enter the Things name ID into the parameter MQTT.CLIENT.ID below.

•Then copy all the configuration lines below and paste them into the Workbench
Editor 1 (2), and double click each line separately to send them to the FOX3:$PFAL,CNF.Set,MQTT.CLIENT.ID=<enter ThingsID>$PFAL,CNF.Set,MQTT.CLIENT.PING=30000,$aws/things/&(ThingID)/shadow/upd
ate@{\'state\':{\'reported\':{\'latlng\':\'&(LatLon)\',\'tcxn\':{\'connection_status\':2}}}, &(ThingToken)}

How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

6

$PFAL,CNF.Set,MQTT.CLIENT.TIMEOUT=90000,30000$PFAL,CNF.Set,MQTT.CLIENT.WELCOME=$aws/things/&(ThingID)/shadow/updat
e@{\'state\':{\'reported\':{\'tcxn\':{\'connection_status\':2,\'imei\':\'&(IMEI)\'}}}}$PFAL,CNF.Set,MQTT.CLIENT.CONNECT=1,<IP>,<Port>

2. Go to your MIC account, download, and unzip the Things certificate.

3. Open each certificate file, copy the content, and then paste it in the following format inthe Workbench Editor 1 (2). Note that each certificate requires CR+LF and a dot (.)
character to terminate it. Otherwise the FOX3 will not store any certificate.

$PFAL,TCP.MQTT.SetRootCA-----BEGIN CERTIFICATE----Add RootCA.pem-----END CERTIFICATE----How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

7.
$PFAL,TCP.MQTT.SetCertificate-----BEGIN CERTIFICATE----Add Cert.pem-----END CERTIFICATE----.
$PFAL,TCP.MQTT.SetPrivateKey-----BEGIN RSA PRIVATE KEY----Add privkey.pem-----END CERTIFICATE----.
4. To send these certificates to the FOX3, first uncheck the CRC (1) at the bottom ofEditor 1. Select the certificates and click Start sending the configuration. The FOX3
will stop output data on the serial port/Terminal 1. Once the certificate is stored in theFOX3, it starts to output the data on serial port/Terminal 1. This will take a bit of time.
In this way you can send and store all other certificates in the FOX3. Once these steps
are successfully completed, send the following commands to the FOX3 to check thecertificates:$PFAL,TCP.MQTT.GetRootCA$PFAL,TCP.MQTT.GetCertificate$PFAL,TCP.MQTT.GetPrivateKey
5. You will see the certificates on the Terminal 1.

How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

86. Insert a SIM card into the FOX3 and specify the SIM’s APN and PIN, and activate theGPRS auto start with:$PFAL,GSM.PIN="Your SIM PIN"$PFAL,Cnf.Set,GPRS.APN=lpwa1.iot.telenor.se$PFAL,CNF.Set,GPRS.AUTOSTART=1
7. Send these settings also to the FOX3 from the Editor 1 view.

ExampleThis is an example how to send the temperature based on a counter:$PFAL,CNF.Set,AL10=SYS.Counter.s0>350:SYS.Counter0.Set=100$PFAL,CNF.Set,AL11=TCP.MQTT.eConnected:SYS.Timer0.Start=cyclic,15000$PFAL,CNF.Set,AL12=SYS.Timer.e0:SYS.Counter0.Add=5&TCP.MQTT.Send,"$aws/things/&(ThingID)/shadow/update@{\'state\':{\'reported\':{\'Temperature\':&(counter0*0.1)}}}"The FOX3 will try to establish a TCP connection to the Telenor MIC platform. If you see any
issue with connecting to the Telenor platform, please check if the FOX3 has a valid date andtime as the used certificates have a validity period. If the date and time is not approximatelycorrect, the verification of the certificates will fail. You can also set the date and time into thedevice with $PFAL,Sys.SetTime,16.02.2021,10:00:00. If FOX3 already has a valid date andtime, this command will return an error.

Sending BLE Sensor Data to Telenor MIC Platform
To be able to send BLE sensor data like temperature and humidity to this platform, you need toget LUA license activated on the FOX3 (Contact Lantronix sales for more information.) andwrite a LUA script that receives, processes, and transmits the advertised temperature andhumidity data from the BLE sensors to the MIC platform.
For information on how to write Lua scripts, refer to the application note, Using LUA Scripts forFOX3-2G/3G/4G and BOLERO40 Series.
Use Cygwin and install the package bash to build .frp file from the .lua files. Finally upload the.frp file to the FOX3 device following the steps in section .
After uploading the Lua script to the FOX3, the data on the Telenor MIC platform may look likethese screenshots below:

How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

9How to Connect FOX3 2G/3G/4G to the Telenor MIC Platform

10