## Team: Kastlunger Anna, Knibbeler Gaelle, Krzyzak Judyta
# Define an IoT architecture

A nationwide gas supplier wants to **monitor its gas pressure** regulation stations.
* The task of these stations is to **reduce the gas pressure** from the distribution network to the supply network for the individual households.
* The central system has the task to **receive and process data** coming from the stations and to store them in a database.
* There are about 5000 gas pressure-reducing stations spread over the country.
* Only a **limited** amount of these stations (<400), mainly in the urban area, is connected to the company’s communication network.
* All other stations have neither power supply nor network connection.
Every station of the system should **send a daily operational signal to the center** in a **predetermined** time, together with the data collected in the preceding 24-hour interval.
* Communication should operate on an **event-oriented basis** – in case of any measured or detected technological parameter **deviates from the specified** (programmed) operational range an **alarm signal** should be sent to the center immediately.
* Measured technological parameters should be **queried** – besides the daily sign of life – upon request launched by the user from field devices, any time.
* The system should be able to maintain **bi-directional direct connection** with the stations. Remote programming of stations and field software updates should be made possible.

:::success
**From the book IoT Fundamentals by Hanes:**

:::


---
### **1) Define and explain the High level IoT architecture for this use case.**
Star of Stars:

Requirements:
* Wireless
* Low power
#### Vertical Specifics Application: SCADA
**Scada:**

> Like many of the other SCADA protocols, DNP3 is **based on a master/slave relationship**.
> * The term *master* in this case refers to what is typically a **powerful computer located in the control center** of a utility, and
> * a *slave* is a **remote device** with computing resources found in a location such as a substation. DNP3 refers to slaves specifically as outstations.
>
> *Outstations* **monitor and collect data** from devices that indicate their state, such as whether a **circuit breaker is on or off**, and take measurements, including **voltage, current, temperature, and so on**.
>
> This data is then **transmitted to the master** when it is **requested**, or **events and alarms** can be sent in an asynchronous manner. The master also issues **control** commands, such as to start a motor or reset a circuit breaker, and logs the incoming data.
*(from D. Hanes, "IoT Fundamentals")*
#
#### IoT Network MGMT: MQTT (TCP) QoS1
* MQTT was specifically introduced as a **protocol to monitor und control sensors** and their **data from a central location**. It is lightweight, cost-effective and reliable.
* QoS1 means data must be **acknowledged** else it is resent (at least once delivery)
---
### **2) Choose a suitable access technology for the remote terminal units in the pressure regulation stations. Explain your choice.**
The most suitable access technology in our opinion is **LoRaWAN**, because of its long **range up to 40 km** in rural areas paired with the **low power consumption** of its **battery powered** devices.
#### LoRaWAN Characteristics:
* Range:
* 2km in urban areas
* up to 40km in rural areas
* Data rate:
* between node and gateway : 0.3 - 50 kbit /s
* Adaptive data rate (ADR) set by the gateway
* Power consumption: 10 mA - 100 nA (idle)
* Maximum payload of a single message : 11 - 242 bytes
#### LoRaWAN - From the book IoT Fundamentals by Hanes (S.138):

For Security we would choose **Activation by personalization (ABP)**:
* Endpoints don’t need to run a join procedure as their individual details, including DevAddr and the NwkSKey and AppSKey session keys, are preconfigured and stored in the end device.
* This same information is registered in the LoRaWAN network server.
---
### **3) Select commercial available remote terminal units for this use case.**
* **Our recommendation:**
http://proesystech.com/wp-content/uploads/2017/03/IPS-1-Industrial-pressure-sensor-datasheet.pdf
This battery powerded gas pressure sensor has a prgrammable Microprocessor inside and can be directly connected to a LoRaWAN network.

* **Other options:**
https://www.thethingsnetwork.org/marketplace/product/pts2-l
http://www.zigbeesolutions.com/lora/index.php