Fanstel OpenSource LEW840X Series User manual

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
IP65 Gateway, Market Ready Enclosure !
LEW840X Series gateways are developed for commercial,
industrial, and agriculture applications. Enclosure has either
Ingress Protection IP65 or IP51. An IP65 gateway can be
deployed outdoor.
Multiple Network, Radio Gateways!
LTE, WiFi, and Ethernet interfaces are supported
simultaneously. One gateway can be deployed globally to
interface with networks available locally. Operation and
maintenance supports are simplified. When multiple
networks are available, back-up routing can assure of cloud
connection during one or more networks failures.
• nRF9160: LTE-M and NB-IoT module with GPS receiver
• ESP32M16 WiFi module: WiFi, Ethernet with Power over
Ethernet
• BT840F(nRF52840): BLE 5, Thread, Zigbee (IEEE
802.15.4) module; supports mesh.
• BT40F(nRF5340): BLE5.1, Thread, Zigbee (IEEE
802.15.4) module; supports mesh, directional finding.
• LR62E (SX1262): LoRa supporting cloud connection.
Demonstration quality source codes for connecting
sensors to AWS, Google, or MicroSoft cloud servers are
available. They can reduce your development time and
cost, allowing shorter time to market.
Nordic nRF52840, nRF5340 and nRF9160 have CryptoCell
coprocessor embedded. Secure connection can be
established from Bluetooth mesh to cloud server.
Private label and custom hardware can be supported.
Some BLE 5 Gateways will be upgraded to BLE 5.1 in the
near future.
"
1
MultiNetwork, MultiProtocol Gateways with Ingress Protection
Ingress protect/
color
IP51/black
IP51/black
IP51/black
IP51/black
IP65/white
IP65/white
IP65/white
Gateway
EW840F5
EW840F5P
LEWR840E5P
EE840XE5P
EW840F6P
LEE840E6P
LEWR840E6P
Size, mm
107x141x40
107x141x40
107x141x40
107x141x40
107x141x40
107x141x40
107x141x40
WiFi/Ethernet
ESP32M16
ESP32M16
ESP32M16
ESP32E16.
ESP32M16
ESP32E16.
ESP32M16
LTE Module
nRF9160
nRF9160
nRF9160
BLE Module
BT840F
BT840F
BT840E
BT840XE
BT840F
BT840E
BT840E
LoRa module
LR62E
LR62E
External antenna
0
0
3
2
0
3
3
PoE
No
Yes
Yes
Yes
Yes
Yes
Yes
Optional power
USB, included
USB, not included
USB, not included
USB,not included
48V, not included
48V, not included
48V, not included
Operating temp.
0oC to +40oC
-40oC to +80oC
-40oC to +80oC
-40oC to +80oC
-40oC to +85oC
-40oC to +85oC
-40oC to +85oC
Mounting
Desk, wall, pole
Desk, wall, pole
Desk, wall, pole
Desk, wall, pole
Wall, pole
Wall, pole
Wall, pole
Certifications
QDID
108621
108621
108621
108621
108621
108621
108621
1K price, each
$50.59
$54.82
$108.31
$72.38
$76.69
$125.00
$139.89
Availability
Non-stock
Sample 03/20
Sample 03/20
Sample 03/20
Non-stock
Non-stock
Non-stock

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Table Of Contents
IP65 Gateway, Market Ready Enclosure 1...........................................................................................................................
Multiple Network, Radio Gateways 1....................................................................................................................................
1. Introduction 3......................................................................................................................................................
2. Specifications 4...................................................................................................................................................
LEW840X Part Numbers 5...................................................................................................................................................
LTE-M/NB-Iot Interfaces 5....................................................................................................................................................
WiFi or Ethernet Interfaces 6................................................................................................................................................
Bluetooth 5, Thread, Zigbee Interfaces 7.............................................................................................................................
Bluetooth 5.1, Thread, Zigbee Interfaces 8..........................................................................................................................
LoRa Interfaces 9.................................................................................................................................................................
Power Supply and Power over Ethernet 10..........................................................................................................................
Operating Temperature Range 10........................................................................................................................................
Private Label and Custom Hardware 10...............................................................................................................................
PK-LEW840X Programming Kit 10.......................................................................................................................................
3. Firmware Development and Programming 11.....................................................................................................
Ethernet and WiFi 11............................................................................................................................................................
Programming the nRF52840 Module. 17.............................................................................................................................
Programming the nRF9160 Module 20................................................................................................................................
Revision History 22.................................................................................................................................................
Contact Us 23.........................................................................................................................................................
2

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
1. Introduction
One LEW840X Series gateway can be deployed globally to interface with networks available locally. Operation
and maintenance supports are simplified. When multiple networks are available, back-up routing can assure
of cloud connection during one or more networks failures.!
!
Alternatively, your can select a single network interface to reduce product cost.!
LEW840X Series supports LTE-M, NB-IoT, WiFi, and Ethernet interfaces. It supports Bluetooth 5, 5.1, Thread,
Zigbee, and LoRa on the device side."
3

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
2. Specifications
At the heart of LEW840X Series gateway is an ESP32M16 module with an ESP32 D0WD SoC. It has an
Xtensa dual core 32 bit LX6 microprocessors, up to 600 MIPS. A Microchip LAN8720 is the Ethernet PHY
interface.!
ESP32 communicates with nRF9160 LTE-M/NB/IoT module using an UART interface. It also communicates
with BT840F BLE 5 module using a second UART. BT840F controls LoRa module LR62E through an SPI
interface.!
BT840F supports 802.15.4 Thread and Zigbee radio protocols. It can be replaced with BT40F, an RF5340
module supporting BLE 5.1, Thread, and Zigbee.!
Gateway can be powered by a 5V micro USB AC adapter, a 48V DC power supply, or powered through
Ethernet cable!
4

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
LEW840X Part Numbers!
Possible part numbers of LEW840X Series are listed below.
• LTE-M/NB-IoT interface needs an external antenna. It is an optional feature.
• Ethernet interface is always supported.
• Bluetooth interface is supported by one of 4 BLE 5 modules or 4 BLE 5.1 modules. Module can be with an integrated
antenna, with an external antenna, and with an integrated power amplifier to boost TX power to +21 dBm. IEEE 802.15.4
Thread and Zigbee interfaces are supported by BLE modules.
• WiFi interface is supported with an integrated antenna or an external antenna.
• LoRa interface is an optional feature. An external antenna is required.
• Enclosure can be IP65 or IP51 rated.
• Power over Ethernet (PoE) can be supported for all gateways. IP51 gateway without PoE is powered by a micro USB AC
adapter. IP65 gateway without PoE is powered by 48V DC.
• Up to 3 external antennas can be supported. LTE and LoRa interfaces need external antennas. Integrated antenna and
external antenna can be supported for both BLE and WiFi.
LTE-M/NB-Iot Interfaces!
LEW840X gateway uses a Nordic nRF9160 SICA module supporting LTE-M, NB/IoT and with GPS receiver.
An external LTE antenna is used. GPS receiver amplifier and antenna is integrated.!
Microcontroller:
•ARM® Cortex® -M33
•1 MB flash, 256 kB low leakage RAM
•ARM® Trustzone®
•ARM® Cryptocell 310
•Up to 4x SPI master/slave
•Up to 4x I2C compatible two-wire master/slave.
•Up to 4x UART (CTS/RTS)
•I2S
•Digital microphone interface (PDM)
•4x pulse width modulator (PWM) unit
•12-bit, 200 ksps ADC - 8 configurable channels with programmable gain
•3x 32-bit timer with counter mode
•2x real-time counter (RTC)
•Programmable peripheral interconnect (PPI)
•32 general purpose I/O pins
LTE modem:
•Transceiver and baseband
5

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
•3GPP LTE release 13 Cat-M1 and Cat-NB1 compliant
◦3GPP release 13 coverage enhancement
•3GPP LTE release 14 Cat-NB2 compliant
•GPS receiver
◦GPS L1 C/A supported
◦GPS antenna and amplifier integrated
•RF transceiver for global coverage
◦Up to 23 dBm output power
◦-108 dBm sensitivity (LTE-M) for low band, -107 dBm for mid band
◦An u.FL connector for external LTE antenna
•LTE band support in hardware:
◦Cat-M1: B1, B2, B3, B4, B5, B8, B12, B13, B14, B17, B18, B19, B20, B25, B26, B28, B66
◦Cat-NB1/NB2: B1, B2, B3, B4, B5, B8, B12, B13, B17, B18, B20, B25, B26, B28, B66
•Nano SIM card connector on-board.
•Power saving features: DRX, eDRX, PSM
•IP v4/v6 stack
•Secure socket (TLS/DTLS) API
WiFi or Ethernet Interfaces!
ESP32M16 WiFi module with an Expressif ESP32 D0WD, dual core Xtensa 32 bit processor establishes and
maintains connection to a cloud server.
Mongoose OS OpenSource codes for connecting to Fanstel development server and to Google Cloud IoT
Core, AWS, and Microsoft cloud servers are available. They can be used as a base to develop interface with
other servers.
Link to download additional document and source codes:!
http://www.fanstel.com/download-opensource/
Brief descriptions of WiFi module ESP32M16:
• Expressif ESP32 D0WD, Xtensa dual core 32 bit LX6 microprocessors, up to 600 MIPS.
• 448KB ROM, 520KB SRAM, 16 MB flash
• 16KB SRAM in RTC
• 802.11 b/g/n, 802.11n (2.4 GHz), up to 150 Mbps
6

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Bluetooth 5, Thread, Zigbee Interfaces!
Bluetooth 5 module supports Bluetooth 5, Thread, and Zigbee radio interfaces. It also manages LoRa module
LR62E. One of four Bluetooth 5 modules can be installed.
• BT840F, an nRF52840 module. It is FCC certified with max. TX power of +8.46 dBm.
• BT840E, an nRF52840 module with an u.FL connector, panel mounted SMA connector for an external
antenna. It passes FCC certification testing with ANT060, a 6 dBi antenna.
• BT840X, an nRF52840 module with SKY66112 power amplifier. It passes FCC testings at +21 dBm TX.
• BT840XE, an nRF52840 + SKY66112 module with an u.FL connector, panel mounted SMA connector for an
external antenna. It passes FCC testings with ANT000, a 0 dBi antenna.
Maximum TX power of BT840X is about 13.8 dB higher than that of BT840F. The receiver gain of SKY66112 is
measured at 1.5 dB. Comparing to BT840F, BT840X has 15 dB more link budget. In
free space (antenna high above ground and without obstruction), 15 dB link budget
can more than quadruple range. Or, it is enough to penetrate 2 dry walls in typical
house in the U.S.A.
If you are developing a mesh network or sensor using BT840X/XE, a gateway with
BT840X/XE will provide the longest possible Bluetooth, Thread or Zigbee range.
If this gateway is to receive data from various (Fanstel and non Fanstel) sensors, beacons, BT840E with
ANT060 antenna will provide the best receiver sensitivity if antennas are deployed in parallel (horizontal
polarization).
Brief specifications of BT840F Series modules.
• nRF52840 QIAA, ARM Cortex M4F, 64 MHz
• ARM® TrustZone® Cryptocell-310 co-processor
• BLE 5 data rate: 2Mbps, 1Mbps, 500kbps,125kbps.
• IEEE 802.15.4 Thread and Zigbee data rate: 250 Kbps
• 2.4 GHz proprietary data rate: 2 Mbps, 1 Mbps
• Serial Wire Debug (SWD)
• Nordic SoftDevice Ready
• Over-the-Air (OTA) firmware update
• Flash/RAM: 1MB/256KB.
• 48 General purpose I/O pins
• Type 2 NFC-A tag with wake-on field, Touch-to-pair support
• Integrated PCB trace antenna or u.FL connector
module
BT840F
BT840E
BT840X
BT840XE
SoC
nRF52840-QIAA
nRF52840-QIAA
nRF52840-QIAA
nRF52840-QIAA
Size
15x20.8x1.9mm
14x16x1.9mm
15x28.0x1.9mm
15x28.0x1.9mm
BT Antenna
PCB trace
ANT060
PCB trace + PA
PA+ANT000
Max TX includes antenna gain
+8.8dBm
+14.4 dBm
+22.6 dBm
+21.0 dBm
32.768 sleep crystal
External
External
Integrated
Integrated
BT range,1 Mbps, LMPI
1000 meters
1170 meters
1170 meters
BT range, 1Mbps, 1.52m
390 meters
900 meters
1170 meters
BT range, 125 Kbps, LMPI.
2300 meters
3400 meters, est.
>4500 meters
>4500 meters
BT range, 125 kBps, 1.52m
640 meters
1240 meters
1920 meters
FCC ID
X8WBT840F
X8WBT840F
X8WBT840X
X8WBT840X
IC ID
4100A-BT840F
4100A-BT840F
4100A-BT840X
4100A-BT840X
CE
Certified
Certified
Certified
Certified
RCM
Certified
Certified
Certified
Certified
TELEC
201-190710/00
201-190710/00
Availability
Production
Production
Production
Production
7

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Bluetooth 5.1, Thread, Zigbee Interfaces!
Bluetooth 5.1 module supports Bluetooth 5, Thread, and Zigbee radio interfaces. It also manages LoRa module
LR62E. One of Bluetooth 5.1 modules can be installed.
• BT40F, an nRF5340 module.
• BT40E, an nRF5340 module with an u.FL connector, panel mounted SMA connector for an external antenna.
• BT40X, an nRF52840 module with nRF21540 power amplifier.
• BT40XE, an nRF52840 + nRF21540 module with an u.FL connector, panel mounted SMA connector for an
external antenna.
Nordic nRF5340 SoC has a dual core ARM CortexTM M33 MCU. BT40F Series modules are footprint
compatible with BT840F series. Firmware configuration of GPIO pins is required.
The application core ARM CortexTM M33 can operate at 128 MHz. It has a Floating Point Unit (FPU) and
hardware DSP instruction sets. It can handle Bluetooth profiles needing processing power, e.g., BLE 5.1
directional finding, audio.
Brief Specifications BT40F Series modules.
nRF5340 QKAA, dual core ARM®Cortex M33
Application Core
• 128/64 MHz Cortex M33 with FPU and DSP instructions
• 1MB flash, 512KB RAM
• 8KB 2-way set associate cache
• ARM® TrustZone® Cryptocell-312 co-processor
Network core:
• 64 MHz Cortex M33 with 2KB instruction cache
• 256KB flash, 64KB RAM
• 2.6 mA in RX and 3.2 mA in 0dBm TX
• Receiver Sensitivity: -97.5 dBm at 1Mbps
• TX power: programmable +3dBm to -20dBm
• BLE 5.1 data rate: 2Mbps, 1Mbps, 500kbps, 125kbps.
• EEE 802.15.4 data rate: 250 Kbps
• 2.4 GHz proprietary data rate: 2 Mbps, 1 Mbps
Serial Wire Debug (SWD)
Nordic SoftDevice Ready
Over-the-Air (OTA) firmware update
Type 2 NFC-A tag with wake-on field, Touch-to-pair support
module
BT40F
BT40E
BT40X
BT40XE
SoC
nRF5340
nRF5340
nRF5340
nRF5340
Size
15x20.8x1.9mm
14x16x1.9mm
15x28.0x1.9mm
15x28.0x1.9mm
BT Antenna
PCB trace
u.FL
PCB trace + PA
PA + u.FL
Max TX
Operating temp.
-40oC to +105oC
-40oC to +105oC
-40oC to +105oC
-40oC to +105oC
Availability
Sample 03/20
Sample 04/20
Sample 3Q20
Sample 3Q20
8

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
LoRa Interfaces!
•LR62E module with Semtech SX1262 transceiver, u.FL connector. !
•Up to +22 dBm transceiver (USA version) at 902 to 928 MHz.!
•Panel mounted SMA connector for external antenna!
•LoRa stacks for cloud connection are managed by BT840F Series or BT40F Series BLE modules.!
9

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Power Supply and Power over Ethernet!
• Most of USB AC adapter has operating temperature range of 0oC to +40oC. AC adapter included in non-PoE IP51 gateway
has this operating temperature range.
• A gateway with PoE can be powered by an PoE switch at up to 328 feet or 100 meters away.
• Fanstel single line PoE power injector, POE048 can power a gateway from 100 meters or 328 feet away. POE048 includes
an AC adapter operating from -20oC to +60oC.
• IP65 enclosure has a barrel type, IP67 DC jack.
Operating Temperature Range!
BLE 5 Gateways
Electronic components used in BLE 5 gateways has minimum operating temperature range of -40oC to +85oC. The followings
limit operating temperature of gateways.
• Operating temperature range of USB AC adapter is 0oC to +40oC. Non PoE IP51 gateway includes an USB AC adapter.
Operating temperature range is 0oC to +40oC.
• The enclosure material (ABS) used in IP51 gateway has operating temperature range, -40oC to +80oC. PoE IP51 gateway
has operating temperature range of -40oC to +80oC.
• Operating temperature range of 48V DC power supply is -20oC to +60oC. Non PoE IP65 gateway has operating
temperature range of -20oC to +60oC.
• The enclosure material (Sabic EXL9330) used in IP65 gateway has operating temperature range to over 125oC. PoE IP65
gateway has operating temperature range of -40oC to +85oC.
BLE5.1 Gateways
ESP32M16 and BLE 5.1 modules have operating temperature range of -40oC to +105oC. LTE module, LoRa
module, and LAN8720 Ethernet PHY has operating temperature range of -40oC to +85oC. It is possible to develop
limited feature gateway to operate to 105oC.
Private Label and Custom Hardware!
Logo and button names are printed on a membrane. They can be customized.
Custom enclosure design and electronic hardware are available. Please contact Fanstel.
PK-LEW840X Programming Kit!
To load firmware into LEW840X Series gateway, a Programming Kit PK-LEW840X is required. In addition, you need the
following hardware:
• nRF52840-DK, Development Kit for nRF52840 modules. Or, nRF5340-DK, Development Kit for nRF5340 modules.
• nRF9160-DK if you have LTE interface
10

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
3. Firmware Development and Programming
LEW840X gateways is pre-loaded with WiFi+Ethernet+LTE M (Optional) demonstration codes.!
When connected to internet, LEW840X gateway sends temperature and humidity sensor data to Fanstel
MQTT server. You can use Fanstel MQTT PC tool or mobile APP to monitor data.!
MQTT tool or MQTT APP<->MQTT broker <->LEW840F<->BLE Sensor!
It is easier to test gateway and load firmware by removing gateway PCBA from enclosure.!
Ethernet and WiFi!
Check the Ethernet.
•Connect UART_Bridge Board “TO WIFI(ESP)” into the JS1 of LEW840X PCBA.!
•Make sure the switch on Bridge board is turn off.!
•Connect micro USB to PC and open the teminal tool.!
11

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
•Plug in the Ethernet and reset the board.!
•Gateway should get DHCP IP address.!
Check WiFi, setup network first.
•Hold SW1 when resetting.!
•The LEW840X will enter AP mode.!
•Use a smartphone and into the Setup-WiFi ..!
•FanstelGW_XXXXX appear.!
•Connect it and open browser goto 192.168.4.1.!
12

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Setup the SSID and password for your router.
13

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Check the log.
The WiFi should be got ID and connected.
Check MQTT
Connect UART_Bridge Board “To Log” into the JS1.
Open the MQTT PC tool and type the ID.
The ID is esp32_XXXXXX and same as AP name.
You should able see the ID in the log.
The temperature and humidity was send to MQTT broker and publish to PC tool.
14

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Build and programming ESP32 firmware.
Open mos.yml in folder mqtt_sensorWiFi_Ethernet_esp32
Change the SSID and password to match your router.
- ["wifi.sta.ssid", "FanstelSystems"]
- ["wifi.sta.pass", "1234567890"]
Save the file and go to command line tool.
use command “mos build - -platform esp32”
15

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Programming the ESP32.
Connect UART_Bridge Board “TO WIFI(ESP)” into the JS1.
Make sure the switch on Bridge board is turn on.
Type command “mos flash - -port COM9”
The port number is up to your PC.
16

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Programming the nRF52840 Module.!
Connected nRF52 DK debug out to LEW840F JS2
Download and install Nrf5x-Command-Line Tools
https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF5-Command-Line-Tools
Download the nRF Connect desk top version
https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Connect-for-desktop
17

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Open nRF connect /programmer and load the softdevice and application.
Erase and write.
Nordic Development Environment
Nordic Semiconductor provides a complete range of hardware and software development tools for the nRF52
Series devices. nRF52840 DK board is recommended for firmware development. Document and Software
development tools can be downloaded by the following links.
-'.%/.#".%01.2%34"516%6217%#85%#99%48918'%546:;'8./)%
http://infocenter.nordicsemi.com/index.jsp?topic=/com.nordic.infocenter.nrf52/dita/nrf52/
development/nrf52_dev_kit.html&cp=1_1
34"516%<!=%01.2%;#8>%'?#;79'%7"4@'6./)%
https://developer.nordicsemi.com/nRF5_SDK/
34"516%5'A'947;'8.%B48')%C4:%6#8%/'#"62%4"%#/D%#%E:'/F48%.2'"')%
https://devzone.nordicsemi.com/tutorials/b/getting-started/posts/development-with-gcc-and-
eclipse
Programming the Nordic chip
Download and install Nrf5x-Command-Line Tools
https://www.nordicsemi.com/eng/nordic/Products/nRF52840/nRF5x-Command-Line-Tools-
Win32/58850
18

LEW840X, OpenSource Multiple Network Gateways !"#$%&'"%()*+%%,#")%*(*(
Programming the nRF9160 Module!
Connected nRF9160 DK debug out to LEW840F JS3
Open nRF connect /programmer and load the softdevice and application.
Erase and write.
The MQTT ID for nRF9160 is always started at “91”.
20
This manual suits for next models
7
Table of contents
Other Fanstel Gateway manuals