Several of my IoT projects use WiFi, and its range is quite limited, too short to be practical for some projects.
There are several alternatives, but the emerging LoRaWAN concept looks interesting and is worth a visit. LoRaWAN is capable of up to 20km range under ideal conditions, km range should be reliable in most cases.
The first trial is to adapt an existing project functional requirement to LoRaWAN connectivity.
Above is a block diagram of the working trial.
The top row is the client equipment, an Arduino Zero with sensors and radio module and using arduino-lmic library for the LoRaWAN implementation. The library derives from IBM's LMIC.
The middle row is the shared / public infrastructure based around The Things Network (TTN) (a community network), and in this case I have provided a commercial LoRaWAN gateway (which becomes part of TTN and is publicly accessible). Some format conversion takes place in the TTN world, the 8 octet binary sensor data carried over LoRaWAN is transformed to a JSON object.
The bottom row is the application part. A Node-Red flow running on a private server on my internal network subscribes to a MQTT feed from TTN, and reformats it to a REST request to a Thingspeak channel where is plotted on charts. (Node-Red in IBM's Watson IoT platform was tried but it was intermittently unreliable and was abandoned.)
Above, the Node-Red flow. A TTN timestamp is copied to the Thingspeak request.
Node-Red is not the only possibility here, Mosquitto with bash script could work, a Python script etc.
URL: https://api.thingspeak.com/update Body: api_key=xxxxxxxxxxxxxxxx&field1=2572&field2=-12.1&field3=53.2&field4=1652&created_at=2018-10-12T02:08:01.095243438Z
Above is the detail of the POST request to Thingspeak.
Above, the four variables plotted on Thingspeak. (The data is test data.)
The LoRaWAN gateway under trial is a Laird Sentrius RG191 from Core Electronics. The trial module is a SparkFun Pro RF – LoRa, 915MHz (SAMD21) and an example from the LMIC library modified for the Arduino Zero context, ttn-otaa-dragino-lorashield-au915.ino .