Async Devices
Mat|r can communicate with different devices which support the MQTT protocol. This new Async function allows the mat|r developers to create mat|r external devices. Such is the case of Arduinos, Raspberry PI and other PCs. This way, it offers a more efficient channel of communication between devices in real time.
How to develop an Async device?
In the Modeler section, while editing the app, select Async on the right panel as shown below.
In such panel, you can find the options for creating channels as well as devices.
Click on the + Add IoT device botton in order to add a new device. After clicking, there will appear a window asking for the following basic information about the device:
Name: The designation your application will receive.
Metadata: These are extra data which identify the device. Access them in the next mat|r|script version.
When clicking OK, a new device will be created and the connection certificates will be downloaded. By default, certificates have the device name.
IMPORTANT: Some browsers may block the downloading process when trying to download 3 files automatically. In case the 3 certificates cannot be download successfully, check the browser bar to enable the remaining files.
Operation with devices
Devices have three available operations:
- Edition: This is managed by clicking on the device name.
- Deletion: This is managed by clicking on the trash bin icon that is next to the device name.
- Regeneration of certificates: In case the device is lost or endangered, regenerate the certificates by clicking on the update icon that is next to the device name. This regeneration enables the previous certificates and automatically downloads the new certificates.
How to connect in order to publish or subscribe in one of the channels created?
To establish connection, the following items are required:
- The device certificates.
- The server URL and channel name.
- The server certificate.
As shown before, the certificates of the devices are automatically downloaded when creating them.
The information on the channel and the server can be found in the information icon located next to the name of each channel:
When clicking on it, there appears a window showing the URL and the server port as well as the channel name from where you can subscribe or publish and the server RootCA certificate.