Logo Logo en
  • iRidi Pro
    Основные компоненты
    • Приложение i3 Pro
    • iRidi Pro Server
    • iRidi Studio
    • iRidium studio v. 1.3.8 (устаревшая версия)
    Java Script в iRidi
    • Руководство
    • Справочник
    • Примеры
    • JS драйвера
    другие
    • Личный Кабинет
    • iRidium Cloud
    • iRidium Transfer
    • Push-уведомления
    • Лучшая практика
    Лицензирование
    • Лицензирование и передача проекта
    • Оффлайн-лицензирование
    • Активация iRidi Pro Server
  • Продукты
    i3 lite
    • Приложение i3 lite
    • Регистрация и лицензирование
    • Сервер
    • Модули
    KNX Home Server
    • Приложение i3 KNX
    • KNX Home Server
    BUS77 HOME SERVER
    • Приложения Bus77 Home и Bus77 Lite
    • Bus77 Home Server
    Решения
    • BYOD - решение для гостиниц
    • Портал жителя - решение для МКД
    iRidi SCADA
    • iRidi SCADA
  • Bus77
    НАСТРОЙКА BUS77
    • Основы Bus77
    • Приложения Bus77 Home и Bus77 Lite
    • Работа с драйвером Bus77 в iRidi Studio
    • Настройка шины Bus77 в iRidi Studio
    ПРОТОКОЛ BUS77
    • Характеристики CAN (Bus77)
    • Описание протокола
    • Исходники на GitHub
    ОБОРУДОВАНИЕ BUS77
    • Каталог Bus77 Pro
    • Каталог Bus77 Lite
  • Поддерживаемое оборудование
    Драйверы
    • Список драйверов
    • ProAV драйвера
    • AV & Custom Systems
    • JS драйвера
    • Сторонние драйвера и фриланс
    Протоколы и интерфейсы
    • Голосовое управление
    • 1-Wire
    • BACnet IP
    • Bus77
    • KNX
    • KNX IP BAOS
    • Weinzierl kBerry
    • Microsoft Exchange
    • Modbus
    • MQTT
    • NFC
    • ODBC
    • Onvif
    • SIP
    • SNMP
    • Wake On Lan
    • Z-Wave
    • ZigBee
    Производители
    • AMX
    • AVCiT
    • Beckhoff ADS
    • Biamp Tesira
    • Bluesound
    • Casambi
    • BSS Harman
    • Clipsal
    • ControlArt 7Port
    • Crestron
    • DigiBird
    • Domintell
    • Duotecno
    • EIDE
    • EPSNET
    • Global Cache
    • HDL Buspro
    • Helvar
    • IEAST
    • INELS BUS
    • INELS Wireless
    • Intesis
    • Kleger
    • Kramer VIA
    • Kramer 3000
    • Larnitech
    • Legrand Netatmo
    • LG TV
    • Lutron
    • Lutron Homeworks QS
    • MyHome
    • Nest
    • Novastar
    • Panasоnic PTZ
    • Philips Dynalite
    • PJLink
    • Satel
    • SamsungTV
    • Sonos
    • Somfy
    • SpinetiX
    • Televic Conference
    • TIS
    • Tion
    • URRI
    • Velbus
    • Velocio
    • Vinteo
    • WyreStorm
    • WiiM
    • Xicato
    • Yamaha
    • ZONT
    • Z-Wave.me
    Протестированное оборудование
    • Панель HDL S57
    • Панель HDL S10
    • SIP-домофон
    • Akuvox
    • Arlight
    • Divus
    • QBic TD-1050 PRO
    • QBic TD-1060 Slim
    • QBic TD-1070
    • Sigur
    • Uni-Ubi
    • Velocio
  • Оборудование iRidi

    Серверы
    • HS Сервер
    • ProAV Control Processor Basic
    • ProAV Control Processor Advanced
    • Спецификация контроллеров UMC
    • Настройка контроллера UMC C2
    • Настройка контроллера UMC C3
    • Настройка контроллера HDL IntelliCenter 2 (UMC C4)
    Модули расширения
    • I-PX-RS1
    • I-PX-RS4
    • I-PX-IR3
    KNX
    • KNX Home Server
    • KNX IP Interface
    Панели управления
    • iRidium Panel 7
    • Touch Panel P3
    • Touch Panel P6
    • Touch Panel P8
    • Touch Panel P10
    • Tabletop Touch Panel 10
    • AV Remote Control
    ОБОРУДОВАНИЕ BUS77
    • Каталог Bus77 Pro
    • Каталог Bus77 Lite
    • Differences
iRidium mobile web-site
Содержание
    Инструменты‌
    • Сведения о странице
    • Постоянная ссылка
    • Версия для печати
    • Спецстраницы
    • Связанные правки
    • Ссылки сюда
    Login / Create Account
    Материал из for iRidium developers
    Перейти к: навигация, поиск
    Эта страница является переводом страницы IBM Cloud IoT. Перевод выполнен на 100%.

    Other languages:
    English • ‎русский

    Содержание

    • 1 Connecting iRidium server to IBM Watson IoT
      • 1.1 Description of example
      • 1.2 Setting IBM Watson IoT
        • 1.2.1 Creating IBM Watson IoT instance
        • 1.2.2 Adding devices
      • 1.3 Setting iRidium server
        • 1.3.1 Setting MQTT driver
        • 1.3.2 Setting Modbus TCP driver
        • 1.3.3 Modbus/MQTT gateway
      • 1.4 Testing connection to IBM Watson IoT
      • 1.5 Setting IBM Cloudant
      • 1.6 Setting analytics in IBM Watson IoT
      • 1.7 Testing

    Connecting iRidium server to IBM Watson IoT


    IBM Cloud is a variety of different services. In this example we'll require only two services that allow to store in the cloud hystory of data from smart home controlled by iRidium software. These services also allow to view the archive in the form of trends, charts and other types of visualization items. Other interesting features of the services may also be necessary.

    The first service is Watson IoT, an Internet of Things service, the other is Cloudant NoSQL, a database working on the basis of JSON requests. IBM Cloud allows to integrate these two services quite easily.


    Description of example


    Download a project example

    In the given example iRidium server reads data from Modbus devices and sends them to IBM Cloud via MQTT protocol in JSON format. Data are stored in the Cloudant data base in real time. Data saved via the cloud web-interface can be viewed and analized by Watson IoT analytics.

    IBM Cloud IoT scheme.png


    Free (Lite) plan of "Watson IoT" can be used for testing. It includes:

    • up to 500 devices,
    • up to 500 connections,
    • monthly limits
      • up to 200 Mb of traffic,
      • up to 200 Mb of analized data
      • up to 200 MB of locally analized data (Edge).


    Free Lite plan of Cloudant service:

    • no time limit,
    • max 256 Мb of used memory in Cloud Foundry,
    • 1 instance (1 database),
    • autosleep of the app (the app is off after a 3-day pause of a development).


    More:

    • Watson IoT (in English)
    • Cloudant (in English)
    • Buying plans of Cloudant (in English)


    Setting IBM Watson IoT

    To connect to IBM Watson IoT platform, it is required: to get IBM Cloud (IBMid) account.

    More about controlling IBM Cloud account (in English)


    Creating IBM Watson IoT instance

    1 Enter your account and go to Dashboard. Click «Create Resource» button.

    IBM Cloud IoT a01.png

    2 Select Internet of Things category and click Internet of Things Platform.

    IBM Cloud IoT a02.png

    3 Select a region in the parameters, for example, US South (more functions are available for this region).

    IBM Cloud IoT a03.png

    4 Select buying plan (for example, Lite) and click «Create» button:

    IBM Cloud IoT a04.png

    5 The added service is displayed in the list on the dashboard. Click «Launch» button in the window that appears.

    IBM Cloud IoT a05.png

    6 A panel to control IoT Platform opens in a new window.

    IBM Cloud IoT a06.png


    Adding devices

    1 Go to Devices tab on the dashboard of IoT Platform.

    IBM Cloud IoT a07.png

    2 Click «Add Device» buttom to add a device.

    IBM Cloud IoT a08.png

    3 Set Device Type and Device ID in the window that appears and click «Next».

    IBM Cloud IoT a09.png

    4 Enter information about the device and click «Next».

    IBM Cloud IoT a10.png

    5 Add a group (you can skip this step), click «Next».

    IBM Cloud IoT a11.png

    6 Create a token in Security window for authentification (if the fields is left empty, the token is generated automatically). Click «Next».

    IBM Cloud IoT a12.png

    7 See the result of creating a device and click «Done».

    IBM Cloud IoT a13.png

    8 A message appears that a device was registered and you'll get information to connect the device to the platform. It the token field was left empty, you'll get an automatically generated token.

    IBM Cloud IoT a14.png

    Authentification token (password) is given only once. Save it.


    Setting iRidium server

    Setting MQTT driver

    1 Create a server project.

    2 Add MQTT driver to a project.

    3 When devices are added to Watson IoT platform, information is give to connect to MQTT-broker. Enter it in the driver settings.

    IBM Cloud IoT b01.png
    • Host - address of the IoT cloud interface, it is coded the following way:

    <your_orgID>.messaging.internetofthings.ibmcloud.com

    • Port - port
      • 1883 (unshielded connection; it is turned off in iRidium server by default)
      • 8883 (encrypted connection using TLS or SSL)
      • 443 (WebSocket encrypted connection; not supported by iRidium server)
    • Login - login, use-token-auth fixed value must be entered here
    • Password - created or generated Authentication Token
    • MQTT Version - MQTT version has to be 4
    • Client ID - client identificator is coded this way:

    d:<your_orgID>:<your_Type>:<your_Device>

    • Keep Alive - time to hold connection in seconds
    • Clean - Cleaning a session (deleting all subscriptions) when disconnected
    • SSL - encrypting method to connect ot the cloud


    4 Add a command to MQTT driver. Set it this way:

    IBM Cloud IoT b02.png
    • Topic - topics of messages for IBM Bluemix broker unlike Mosquitto broker can not contain any data. They are encypted by definite rules:
      • The format of the topic to publish data (writing): iot-2/evt/<event_id>/fmt/<format_string>
      • Format of the topic to subscribe to data (reading): iot-2/cmd/<command_id>/fmt/<format_string>
        • <event_id> - ID of event. Event ID can be any string that is valid in MQTT.
        • <command_id> - ID of command. Command ID can be any string that is valid in MQTT.
        • <format_string> - a string that defines the type of message contents. In the described example only json format is used.

    An example of publication topic iot-2/evt/status/fmt/json

    An example of subscription topic iot-2/cmd/read/fmt/json

    • Value type - must be String, to send data in JSON-format successfully.
    • QoS and Retain can be selected as a task requires.


    Setting Modbus TCP driver

    1 Add Modbus TCP driver.

    2 Set connection parameters.

    3 Create the required number of commands and tags in the driver.

    4 Set each command and tag according to the task.


    Modbus/MQTT gateway

    1 Add a script to the project:

    var driver1 = IR.GetDevice("MQTT");       // Name of MQTT driver
    var driver2 = IR.GetDevice("Modbus TCP"); // Name of Modbus driver
    var command = "MQTT_Command";             // Name of a command in MQTT driver
    var taglist = {
      "Door_switch"         : 1,              // List of Modbus tags to send via MQTT
      "Ring_button"         : 1,
      "Outdoor_temperature" : 1,
      "Indoor_temperature"  : 1
    }; 
     
    IR.AddListener(IR.EVENT_TAG_CHANGE, driver2, function(name, value) {
      if (taglist[name]) {
        var json_obj = {};
        json_obj[name] = value;
        var json_str = JSON.Stringify(json_obj);
        driver1.Set(command, json_str);
      }	
    });

    2 Remember to give correct names of drivers, between which a gateway is created, as well as command name in the MQTT driver and a list of tag names in Modbus network that you want to send to IBM cloud. You can add tags to the list (taglist variable).

    This script can send data only in one direction: from Modbus TCP to the cloud.


    Testing connection to IBM Watson IoT

    1 Start a server project.

    2 Go to "Device" tab in the dashboard of IBM Watson IoT Platform.

    3 Select a device set earlier

    4 Go to Logs. If the connection is successful, there will be a message about it in the connection log.

    IBM Cloud IoT b03.png


    Setting IBM Cloudant

    In general IBM Watson IoT platform is an independent service. But IBM Cloudant NoSQL DB connection to IBM Watson IoT gives more capabilities: data from devices can be stored for a long time and data can be displayed in analytics tools of IBM Watson IoT.

    1 Go tp IBM Cloud dashboard. Click «Create resource».

    2 Select Data & Analytics category and click Cloudant NoSQL DB service.

    IBM Cloud IoT c01.png

    3 Select Region in the window that appears, for example, US South.

    IBM Cloud IoT c02.png

    4 Select buying plan (for example, Lite) and click «Create» button:

    IBM Cloud IoT c03.png

    5 Cloudant NoSQL DB added driver is displayed in the dashboard of IBM Cloud together with IoT Platform. Click «Launch» button.

    IBM Cloud IoT c04.png

    6 A panel to control the database opens in a new window.

    IBM Cloud IoT c05.png

    Initially Cloudant service is empty (there are no databases or documents). Necessary databases and documents will be later on created automatically when services are integrated.

    7 Go to dashboard of IoT Platform. Go to Extensions tab. Click «Setup» in Historical Data Storage section.

    IBM Cloud IoT c07.png

    8 All available services are displayed in the configuration section. Select a service that you want to connect.

    IBM Cloud IoT c08.png

    9 Set the configuration of Cloudant NoSQL server in the section that appears, click the «Done» button.

    IBM Cloud IoT c09.png
    • Bucket Interval - a time interval during which one document of the database is written; all database are devided into several documents.
    • Time Zone - time zone is indicated to correct date and time.
    • Database Name - name of the database; enter any name for further identification.

    Full name of the database will look this way:

    iotp_<Org ID>_<Database Name>_<Current Date>

    10 A popup must appear with a request to allow connection to Cloudant service. Click "Confirm".

    IBM Cloud IoT c10.png

    If popups are blocked by a browser, a popup will not appear.

    11 A message must appear about successful authorization. When setting Cloudant NoSQL DB is successfully completed, the connected service is displayed in the status field.


    Databases and documents are automatically created in Cloudant service. Now data that come from iRidium server are stored in Cloudant NoSQL DB.

    More about connecting Cloudant to IoT Platform


    Setting analytics in IBM Watson IoT

    1 Select Boards in the dashboard of IoT platform and click «Create New Board».

    IBM Cloud IoT d01.png

    2 Fill in information about a new dashboard and click «Next».

    IBM Cloud IoT d02.png

    3 Fill in information about participants and click «Submit».

    IBM Cloud IoT d03.png

    4 Go to the created dashboard

    IBM Cloud IoT d04.png

    5 Click «Add New Card».

    IBM Cloud IoT d05.png

    6 Select Card Type from the list, for example, «Line Chart».

    IBM Cloud IoT d06.png

    7 Select the required device in the list of displayed ones and click «Next».

    IBM Cloud IoT d07.png

    8 Click «Connect new data set» and fill in required data. Click "Next".

    IBM Cloud IoT d08.png

    Take Event and Property parameters from the Devices > State tab of IoT Platform service.

    IBM Cloud IoT b04.png

    9 A window of map preview is displayed. Go to settings, the installed instance of the database must appear in Cloudant instance field. Change required settings and click «Next».

    IBM Cloud IoT d09.png

    Enter a name, select a color scheme and click «Submit» in the information window of the map.

    IBM Cloud IoT d10.png

    11 Several cards can be added this way.


    Testing

    1 Start a server project.

    2 Connect power to Modbus devices.

    Modbus emulator can be used instead of real devices, for example, this free one Modbus PLC Simulator.

    3 Now data from iRidium server can be analyzed - simply go to Watson IoT dashboard and see the data change in real time.

    IBM Cloud IoT d11.png
    Источник — «https://dev.iridi.com/index.php?title=IBM_Cloud_IoT/en&oldid=66096»
    About us
    Company
    Team
    History
    Philosophy
    Rewards
    Partnership
    Our partner
    Partnership Programs
    Apply for partnership
    products
    iRidium pro
    iRidium lite
    iRidium gate
    iRidium server
    Loads
    iRidium pro
    iRidium lite
    Other version
    Marketing materials
    Support
    On-line courses/Video
    Recommended equipment
    Other version
    iRidium pro
    Documentation
    FAQ
    Forum
    iRidium lite
    Documentation
    Forum
    Projects
    Standart projects
    Smart buildings
    Smart house
    Special solution
    Find a dealer
    News
    Youtube
    Twitter
    VK
    Logo
    contact@iridi.com
    +7 (499) 322-73-29

    Privacy policy