Skip to content

Gateway

Mario Frei edited this page Mar 5, 2020 · 3 revisions

Gateway

The gateway receives the messages from the sensor nodes and router nodes with the XBee radio module and forwards the messages over the cellular network to the webserver. This is done by reading the XBee payload message and calling a PHP script running on the webserver. The XBee payload is sent as a GET parameter in the URL of the PHP script. There are two hardware versions for the Gateway: The Gateway Mega and Gateway Feather. The former is based on an Arduino Mega 2560 and an Adafruit FONA breakout board. The latter is based on an Adafruit Feather 32u4 FONA.
The gateway based on the Adafruit Feather 32u4 FONA exhibited unreliable behavior in situations with not good enough cell reception. In these situations, the Feather 32u4 FONA would continuously reset. This leads to significant data losses in case studies. To address this issue, we created the Gateway Mega. The larger memory of the Arduino Mega allows incorporating an SD card and a real-time clock for offline data storage.

XBee Settings for Gateway

In the current setting, we are using XBee S2c (XB24CZ7WIT-004). We use the Firmware for the product family XB24C with the Function set ZIGBEE TH Reg. The Firmware version is 405E. We use the default settings. Exceptions are listed below:

Parameter Value Comment
ID xxx PAN ID, can be set to anything, but all nodes in the same network must have the same PAN ID
CE 1 Set if this device is a coordinator (1) or not (0)
AP 2 API mode with escaping
SP AF0 SP and SN together regulate after how long an end device is forgotten. We set it to the maximum time so that when waking up, our sensor modules are still in the network and not forgotten.
SN FFFF

The configuration profiles are also available as files. All XBees corresponding to one coordinator needs to be set to the same PAN ID as the coordinator.