User Tools

Site Tools


iot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
iot [2020/05/20 16:12] – [Cloud analytics with Amazon] emozolyakiot [2020/09/22 14:02] (current) atolstov
Line 1: Line 1:
 ======= IoT  =======  ======= IoT  ======= 
 Nowadays, the number of devices from which you can get various data is growing.  Nowadays, the number of devices from which you can get various data is growing. 
-The solution to the problem of their interaction is the concept of the Internet of Things (IoT).  The concept is to unify devices into a network for some reason and then integrate them into larger networks+The solution to the problem of their interaction is the concept of the Internet of Things (IoT). The concept is to unify devices into a network for a particular reason and then integrate them into larger networks.
-===== MQTT Protocol ===== +
-MQTT today has become an intermediary in IoT communication.  +
-It is supported by integration controller WebHMI and 7bit brand products such as Synapse, AirPoint and AirGate. +
-==== What is MQTT? ==== +
-It is a lightweight, open and affordable protocol.  +
-It was designed for severe operating conditions, so it is ideal for devices with low power and limited autonomous. Such as smartphones, sensors and other devices, the number of which is constantly growing.  +
-MQTT has extremely low overhead publish/subscribe model, and bidirectional capabilities of MQTT are uniquely suited to meet the demands of industrial control systems. +
-To understand, look at this diagram+
  
-{{ :wiki:mqtt:mqtt_diagram.png?nolink |}}+__There are several articles that concern IoT and can be found by clicking on the following links:__ \\  
 +The survey article with an example of data utilisation using Amazon Web Services with ElasticSearch instance and Kibana dashboard as visualisation, storing data in the database.\\  
 +  * [[iot:aws:integration-review|WebHMI AWS Integration review article]]
  
-There is no need in direct connection which is quite fragile and entails overhead. Sothe broker is the gamechanger  +There is a tutorial which in the final will eventually lead to upload data in a suitable approach to Amazon Web Serviceso it will allow making any analysis that you needThe purpose of the tutorial is to put data to Amazon Web Services storage, the further analysis will no be considered here as well as data analysis approaches.\\  
-Any device can be both publisher and subscriber. Publishing of message is triggered only by some event, e.g. time condition. After that, the data packet is received by the broker and then sent to subscribers, which subscribed to that topic which data was published.  +  * [[:iot:tutorial:aws-integration|AWS Integration tutorial]] 
-In that way, the subscriber can get the data about events that happened on distant objects, collected from different publishers and collect it in a database to obtain further analytics.  +
-Therefore, it would be suitable to apply for electricity consumption monitoring, but also measuring non-electrical quantities+
-====== MQTT using WebHMI ====== +
-WebHMI is able to communicate using MQTT. Using this protocol WebHMI can act as a subscriber and a broker.  +
  
-===== WebHMI as MQTT Broker ===== +When you understand the goalsthe tool you need is the knowledge about technical details about data channels and conversion.\\  
-To startfirstly go to “Settings” to make sure that “MQTT Server” is turned on.+  * [[:iot:tutorial:mqtt|MQTT Protocol]]\\  
 +  * [[:iot:aws:json|JSON formatted payload]]
  
-{{ ::wiki:mqtt:server:webhmi_as_server_1.png?nolink |}} 
  
-[[mqtt|About MQTT you can find more here]] 
- 
- 
-===== WebHMI as MQTT Publisher (Client) ===== 
-There is a possibility to create a WebHMI connection to subscribe or publish MQTT messages. 
-This allows WebHMI register mapping with certain topics on any broker. So editing register value will trigger WebHMI to publish MQTT message and vice versa: if you have an active register, receiving the message from the broker will trigger changing the value. 
- 
-==== Publish to WebHMI from (the same or another) WebHMI ==== 
-Acting as a client, WebHMI can connect to any broker, i.e. its own MQTT broker. 
- 
-Let’s post something to the WebHMI MQTT Broker from a WebHMI MQTT Client. 
-It is convenient to stay subscribed to the topics in "MQTT.fx", but this time publish with a WebHMI. 
-To start publish something to broker it is necessary to become a client, so need to create a connection to it. 
- 
-Click on “New connection” and configure it with: 
- 
-    Device Model: MQTT 
-    Address: 192.168.1.1 (it is your IP of WebHMI with Broker ) 
-    TCP Port: 1883 
- 
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_client_connection_settings.png?nolink |}} 
-After that, create a new register into that connection which will represent MQTT topic related to MQTT broker. 
-Click "New register" and fill in the following settings: 
-When the **connection** is created and active it means that connection is established with the **broker**, let’s create a __register__ with “Address” filled with the same topic name “__iot-test__”.  
-Also it would be useful to add //Lua script alias//, e.g. “//mqtt_publish//”. It will be used in the script later. 
- 
-    Connection: MQTT WebHMI Client (that one, that created before) 
-    Address: iot-test (any name, it is MQTT topic to subcribe and to publish) 
-    Script alias: mqtt_publish   
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_client_register_settings.png?nolink |}} 
- 
-Go to “Value” tab to change its type to “String”      
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_client_register_settings_value.png?nolink |}} 
-And click "Add" button. 
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_client_register_settings_value_string.png?nolink |}} 
- 
-Now, it is time to change registers value manually and check the result response on another client such as Android app, PC clients such as "MQTT.fx" or another WebHMI. 
- 
-Let's check the response in MQTT.fx PC client. How to configure it will be shown later. 
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_client_register_value_manual_change.png?nolink |}} 
- 
-In the MQTT.fx will be shown caught changes in the subscribed topics. 
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_mqttfx_subscribed_catch.png?nolink |}} 
- 
-===== Connect to WebHMI MQTT Broker with external client ===== 
-==== From PC client to WebHMI ==== 
-Using any MQTT client it is possible to be connected to WebHMI MQTT Broker. 
-For example, freeware MQTT client “MQTT.fx” will be used. 
----- 
-{{:wiki:mqtt:client:pc:mqttfx_icon_256.png?nolink&200 |MQTT.fx}} 
-\\  
-\\  
-\\  
-[[https://mqttfx.jensd.de/|Official site download link]] 
----- 
-To do this, let’s create a new connection with the following settings: 
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_1.png?nolink |IMG}} 
-Click on “+” in the lower left corner and set: 
- 
-    Profile Type: "MQTT Broker 
-    Profile Name: e.g. “WebHMI” 
-    Broker Address: 192.168.1.21, this is the IP of the WebHMI. 
-    Broker Port: 1883 
- 
-Press “Apply” and then “OK”.\\  
-Let’s connect to WebHMI Broker by pressing the “Connect” button. 
- 
-{{ :wiki:mqtt:client:pc:протокол_связи_mqtt_на_webhmi_2.png?nolink |IMG}} 
-If everything is fine than connection will be established, so that indicator became green. 
-==== From Android client to WebHMI ==== 
-In the Google Play Market, there is a lot of MQTT Client apps. For example, it would be shown the connection with [[https://​play.google.com/​store/​apps/​details?​id=com.app.vetru.mqttdashboard|MQTT Dashboard]]. 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app.jpg?nolink&300 |}} 
- 
- 
- 
-After first run it looks like this: 
-\\  
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_add_broker.png?nolink&300 |}} 
- 
-So, let’s add WebHMI Broker by click “Add first broker” button. 
- 
-Fill in the following settings. 
-In the address form your WebHMI IP address. 
-In our case, it is 192.168.1.21.  
- 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_add_connection.png?nolink&300 |}} 
- 
-Then, click the “Save” button in the bottom centre position. 
- 
-Now, we have an empty connection.  
-It is time to subscribe to a topic. It is also an option to publish to it. 
-To do this, let’s click the “+” button in the bottom centre part of the screen. 
- 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_add_topic.png?nolink&300 |}} 
- 
-To demonstrate how the function works, the "Standard" format will suffice. 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_edit_topic.png?nolink&300 |}} 
-Pick the “Text” type. 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_select_topic_payload_format.png?nolink&300 |}} 
- 
-Fill in the “Subscribe topic” form the “iot-test” value and then press “Copy” symbol near “Publish topic” to copy the topics name to this form also. 
-In the end, click the “Save” icon in the bottom centre position. 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_select_topic_payload_type.png?nolink&300 |}} 
-To test the connection, you can try to change the register’s value and check the smartphone's screen for the result. 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_test_receive.png?nolink |}} 
- 
-The text message was sent through the MQTT protocol to WebHMI broker and the sent to the Android app. 
- 
- 
-{{ :wiki:mqtt:client:android:протокол_связи_mqtt_на_webhmi_android_app_test_subscribe.png?nolink&300 |}} 
-It also works in another direction and can be published from the smartphone.  
- 
- 
- 
- 
-===== Useful Applications ===== 
-Sharing links, strings, etc.  
-There are a lot of mobile apps to connect with, etc. 
- 
-====== AWS Integration ====== 
-Amazon Web Services also are known as AWS has a platform for the Internet of Things [[aws.amazon.com/iot-core|IoT Core]]. 
-\\  
-\\  
-AWS IoT Core is a managed cloud platform that lets connected devices easily and securely interact with cloud applications. AWS IoT Core can support billions of devices and trillions of messages, and can process and routethose messages to AWS endpoints and to other devices and services reliably and securely. 
-{{ :wiki:iot:aws:AWS_IoT_core.png?nolink |}} 
- 
- 
-==== Cloud analytics with Amazon ==== 
-The simplest example of AWS application can be meter's derivative visualisation. 
-{{ :wiki:iot:aws:kibana_analytics_dashboard.png?nolink |}} 
- 
-The conprehensive step-by-step tutorial about Kibana running on Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud you can find [[aws-integration|here]] 
iot.1589991132.txt.gz · Last modified: 2020/05/20 16:12 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki