MQTT for Embedded Devices Now Supported by FAVORIOT

June 28th, 2017 Posted by IOT PLATFORM 0 thoughts on “MQTT for Embedded Devices Now Supported by FAVORIOT”

If you aren’t familiar with MQTT, the Message Queuing Telemetry Transport (MQTT) is a publish/subscribe protocol aimed specifically at low-powered embedded devices. MQTT targets low-powered embedded device environments where resources are scarce.

You can either check the section below or see the full documentation here.

This section explains on how to use MQTT protocol to connect to FAVORIOT platform.

The MQTT broker is hosted on the following domain:

Host : mqtt.favoriot.com

The standard ports for MQTT are:

Port : 1883 and 8883 (for secure connection using TLS/SSL)

Use your API-Key as username and password to connect to the platform.

The topics that a user can publish and subscribe to are in the following format:

Publish : {Your-API-Key}/*

Example : {Your-API-Key}/Home/Temperature

Subscribe : {Your-API-Key}/*

Example : {Your-API-Key}/Home/Temperature

FAVORIOT platform accepts JSON data from a MQTT device. The format is in the following format if using mosquitto_pub command from CLI:

"{\"device_developer_id\":\"deviceDefault@mqtttest7\",\"data\":{\"humidity\":\"10\"}}"

MQTT QoS supported by Favoriot platform

  • QoS 0: received at most once
    • The message is delivered at most once, or it is not delivered at all which means the delivery across the network is not acknowledged. The message is NOT stored. The message might be lost if the client is disconnected, or if the server fails.
  • QoS 1: received at least once
    • The message is always delivered at least once. If the sender does not receive an acknowledgment, the message is sent again with the set until an acknowledgment is received. As a result, receiver can be sent the same message multiple times and might process it multiple times.

Establishing secure MQTT connection

In order to establish a secure MQTT connection to the platform, create ca.crt file, copy and paste the following certificate inside it.

-----BEGIN CERTIFICATE----- MIIDmTCCAoGgAwIBAgIJAMPWVA80Rf38MA0GCSqGSIb3DQEBDQUAMGMxGzAZBgNV BAMMElNlY3VyZSBNUVRUIGJyb2tlcjERMA8GA1UECgwIRmF2b3Jpb3QxDDAKBgNV BAsMA0lvVDEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmYXZvcmlvdC5jb20wHhcN MTcwNjIwMDcxMjQyWhcNMzIwNjE2MDcxMjQyWjBjMRswGQYDVQQDDBJTZWN1cmUg TVFUVCBicm9rZXIxETAPBgNVBAoMCEZhdm9yaW90MQwwCgYDVQQLDANJb1QxIzAh BgkqhkiG9w0BCQEWFHN1cHBvcnRAZmF2b3Jpb3QuY29tMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAw6jfao9GPyXR2oIjFseVN2wGHHf321VaOB21NwS9 hobsh7o37mOJUurDon2j2cnwj3PzRLxr5+1jtMlTh18KR7YvtI4QNVC0yZ1kfeYw doTVZ0JMm7kKqcwG75/HYTNehFTnTOKlCHcNG/lALOBUaF0Q8gccuP8w7mKsB/WY Kct7sG3Kom09vHpg14QML/4BqfBso3nMy2UpilmFqkd3iBZOc3OP93wbfoMdv+TY f3NuMC8GvjVj6w3y/ThVT5v9nW0hIOxnH0Z7/Z+StpKf66LEYrVK6wqrE+QOyPbt 7egm7xzufeMFYRG9D8yq1cdkgv91D+d0WZcGJ1WuhGmyGQIDAQABo1AwTjAdBgNV HQ4EFgQU92lSlWRQCgYvnDR+yKqbrJhXH8cwHwYDVR0jBBgwFoAU92lSlWRQCgYv nDR+yKqbrJhXH8cwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOCAQEAA0HF TipnY6COyJX9fPH9ZCW9+FitArf0liTJTOci2Wga6f7AWAvaqgEAYtOEwGmARTK8 i8MkAnf3rncvy/tegHIlklkmVHAnE8DaJIw+GwIQqg+CG+zW96M9ZicE2gP78I2d oMTKznk4POPzZOs5GnsFD50y49TY/gy7YEsmRhsyegnew9Ny45ZvAEsI1CD4QDZN nifCffGE5nNp7gcIlW5u66FvQ32deO9/Ag/83Qzj+MKvXtdkW+2PTG++g8qZnuZ6 51NjwKNY6DApQ5f7QN9WZHRs82s/SrWkMxv9HgIHMyQ6PxiRYZfaLdjTKgwv92P6 cDpPSjaUgpEJwiMvpQ== -----END CERTIFICATE-----

After saving the certificate in ca.crt file, provide the path to the certificate in the programme used to send MQTT data. See the sample code in the right column.

If you are having issues connecting your device to our platform, please contact us at support@favoriot.com.

Tags:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © 2024 All rights reserved