One of the most versatile LoRa / LoRaWAN gateways on todays market is Multitech Conduit with LoRa module. This nice blue boxes comes in 2 flavours; mLinux with everything driven from the command line and standard config files and the AEP version with a web based UI. The AEP version is intended for private LoRaWan deployments and where quick and easy configuration is required. I am not going to discuss benefits of Multitech gateway, there is another post coming where I will compare gateways from several vendors one of them being Multitech.

AEP lorawan

I will focus now on how to configure your AEP box to talk to TTN with PolyPacket Forwarder.

To begin, you need to install the Poly Packet Forwarder on your box. I suggest to download the package to another system and then use scp to move it to your Conduit:

Keep in mind, that this example is for SubBand 7 of North American flavour of Lora.
The local_conf.json will overwrite respective portion go global_conf.json with your site specific information

local_conf.json{
/* Put there parameters that are different for each gateway (eg. pointing one gateway to a test server while the others stay in production) */
/* Settings defined in global_conf will be overwritten by those in local_conf */
"gateway_conf": {
/* you must pick a unique 64b number for each gateway (represented by an hex string) */
"gateway_ID": "008000000000XXXX",
/* Email of gateway operator, max 40 chars*/
"contact_email": "YOUR_CONTACT_EMAIL",
/* Public description of this device, max 64 chars */
"description": "DESCRIPTION_OF_YOUR_GATEWAY",
/* Enter VALID GPS coordinates below before enabling fake GPS */
"fake_gps": true,
"ref_latitude": YOUR_GPS_LAT,
"ref_longitude": YOUR_GPS_LON,
"ref_altitude": YOUR_GPS_ALT
}
}

There is one more thing, since the UI controls switching between Packet forwarder mode and Network server mode, you will have no logging for the packet forwarder. In order to enable it, you need to issue the following command from your console:curl 127.0.0.1/api/loraNetwork -X PUT -d '{"log":{"syslog":false}}' -H "Content-Type: application/json"

At this point you can restart you lora service /etc/init.d/lora-network-server restart and your log should confirm that everything is in order:tail -f /var/log/lora-pkt-fwd-1.log
# Invalid gps time reference (age: 1464959181 sec)
# Manual GPS coordinates: latitude ....., longitude ...., altitude 111 m
##### END #####
INFO: [down] for server router.us.thethings.network PULL_ACK received in 106 ms
INFO: [up] PUSH_ACK for server router.us.thethings.network received in 108 ms
INFO: [up] PUSH_ACK for server ott1.iothub.ca received in 35 ms
INFO: [down] for server 127.0.0.1 PULL_ACK received in 1 ms
INFO: [down] for server ott1.iothub.ca PULL_ACK received in 34 ms
INFO: [down] for server router.us.thethings.network PULL_ACK received in 105 ms
INFO: [down] for server 127.0.0.1 PULL_ACK received in 1 ms
INFO: [down] for server ott1.iothub.ca PULL_ACK received in 34 ms
As you can see, we are also connecting to the localhost, so Conduit’s network server. I used that for some tests and find it very helpful.

At this point you can start your node-red (on the Conduit) and configure it to connect to TTN to retrieve and process your packets:

ttn

node-red & lorawan

From the node-red, processed packets are send to InfluxDB and then Grafana provides nice user interface:

SenseInAir over lorawan

Please let me know if you are interested in any write-ups on Node-Red and TTN (or other LoRaWan networks), but for now enjoy your AEP Conduit communicating flawlessly with The Things Network and LoRaWan.

As indicated in our previous post, affordable Air Quality Index (AQI) measurements could help to establish a better view and understanding on what is really happening around you as far as Air Quality. Having a consolidated view and data provided in a consistent way by many sensors, will provide a single source of accurate indication of trends as well as historical data. Different technologies could be used to transmit data to the Cloud, low power and long range being preferred. With increasing penetration of LoRaWan, design of such sensor became feasible. After several long discussions, we have decided to create one. The main objective was a affordability. Virtual everyone should be able to afford it. At the same time, we do not want to “cut any corners” and we decided to measure all relevant parameters necessary to calculate Air Quality Index, just like the local Governments would do.

gases: NO2, SO2, CO and O3

particles condensation at PM2.5 and PM10.

The clean power was our secondary objective. After researching available energy sources, we have decided that solar power combined with good rechargeable battery was the most reliable source of energy for our project.

The prototypes are already collecting data across 3 continents, well still only 3 cities :). The product will be available soon through SensorsConnect web site. The product, collects all necessary variables required to establish Air Quality Index; In addition, temperature, humidity and GPS location are also measured. Collected measurements are sent over LoRaWan, operating in either private or public mode on European or North American bands of LoRaWan. In North American flavour, users can connect via full 64+8 mode gateway or hybrid mode gateway limited to one of the 8 sub-bands configurable via our provisioning interface. Each node will ship factory pre-calibrated and will provide a mechanism to self-calibrate in a clear Air. Configuration of measurement cycle duration, GPS mode of operation and LoRaWan specific parameters is available over LoRaWan and/or BLE (future perhaps). The GPS sensor provides location information and accurate clock for the unit. By default, GPS operates in a Mobile mode, collecting location information as often as a measurement cycle is called. In order to improve battery life, or simple if your device is mounted permanently at one location, GPS activity can be limited. SenseInAir® (SIA) can be re-configured to operate in a stationary or fixed position mode where only a single GPS lookup is performed in order to establish location and set unit’s internal Real Time Clock. However, having the Mobile GPS mode presents an interesting opportunity for Cities fully covered by LoRaWan. Driving around in an electric car (with the unit on your dash), could generate a virtual map of a region, indication AQI factors for all critical parts of the City. Areas and factories causing higher pollution could be easily identified and monitored.

The node will be ready for expansion. Optional (future) Zigbee interface and matching future firmware releases will accommodate additional sensors and turn it into a smart Zigbee/LoRaWan bridge. We are still contemplating if that makes sense, as it will obviously increase the unit cost. The SenseInAir® is based on STMicroelectronics STM32 series MCU designed for the Ultra-Low power mode of operation. During idle time, MCU and sensors together, consume below 1uA. With our carefully crafted hardware design and power saving algorithms, the SensorsConnect device can operate for a long time on a single battery charge, even when sun is not cooperating. For special cases, where solar charging is not suitable as energy source, the SenseInAir® could utilize a industrial grade Lithium battery strong enough to provide several years of maintenance free operation. As I mentioned before, an optional Bluetooth LE can help with initial provisioning and/or field provisioning of the unit, however full provisioning can also be performed over LoRaWan. Units, can also be ordered with custom configuration or pre-provisioned for one of the existing LoRaWan networks, ready to be plugged in and connect without any configuration. The default profile will connect via The Things Network. Affordable cost should allow ordinary citizens to install those units in their backyards. Cities will be able to install hundreds of units per municipality. Such array of those sensors will provide accurate map indicating changes and trends in air quality and pollution across a City. This information could be valuable for different applications, for instance, cars could be re-directed to alternate roads should the primary roads be over polluted. For areas without LoRaWan coverage BLE could be used to access the data locally from the single node. Additional sensors for SenseInAir® such as inside VOC ( Volatile Organic Compound), CO2 and radiation (alpha, beta and gamma) will be available at later time. The SenseInAir® will be followed by SenseInWater® and SenseInSoil® devices.

Stay tuned, in the next couple of posts, we will present SenseInAir® dashboard and will discuss sensors calibration and methods to obtain accurate data.