-
Make sure MIMIC MQTT Simulator is installed by verifying that MQTT is
listed in MIMICview with the Help->About Mimic... menu item.
-
Python 3.6.8 or later should be installed and verified as follows
from a command prompt:
% python3 --version
Python 3.6.8
-
Invoke Wizard->Update menu and install the
Bosch sensor
package from the MQTT section, and the
Python API
package from the MIMIC API Language Bindings section, if not done so
already. See details on the
Update Wizard
page.
-
Invoke shell terminal on Linux or Windows command prompt using Right-Click "Run as Administrator"
menu and install the Azure iothub SDK.
pip install azure-iot-hub
-
Copy MimicAzureIoTHubDeviceConfig-sample.xml in the
scripts/azure folder to scripts/iot/MimicAzureIoTHubDeviceConfig.xml.
-
Sign up or Log in to Microsoft's
Azure portal
,
create an IoT Hub as detailed in this Microsoft
tutorial page
,
and get the keys & connection string needed for the
MimicAzureIoTHubDeviceConfig.xml file related to your IoT Hub
from the Shared Access Policies Security settings page.
-
Copy/paste the primary key, secondary key and connection string into
that file in the azure section. Other fields can be customized,
such as IP addresses, device identifier, etc.
-
Invoke MIMICView IoT->Azure IoTHub->Add... to add sensors.
Each of the added devices will have it's own authentication via
SAS. NOTE: The SAS token has a limited validity, expiring after
one day. If you want to change this, change the expiration time
in scripts/azure/MimicAzureIoTHubDeviceConfig.py.
-
Invoke MIMICView IoT->Azure IoTHub->Remove... to remove sensors.
-
Invoke MIMICView IoT->Azure IoTHub->Status to get current status.
-
Invoke MIMICView IoT->Start to start sending telemetry.
You should be able to see events from the Azure bash shell with this
command:
az iot hub monitor-events --hub-name mimic-demo --output table
Optionally:
-
Install Node.js version 4.x or higher
-
Run below command in command prompt with admin privileges
npm install -g iothub-explorer
-
Verify via iothub-explorer monitor-events command without quotes in
command prompt.
iothub-explorer monitor-events --login 'connect string'
(Note: You may refer to the MimicAzureIoTHubDeviceConfig.xml for
deviceid and connect string).
-
Also, you will see MIMIC sensors sending the MQTT packets in the Azure
Portal's Overview or Monitoring->Metrics section.
This shows MIMIC in action adding devices to Azure: