Scaleway IoT Hub is a resilient message broker which supports multiple communication protocols and displays export capabilities. It is a PaaS (Platform-as-a-Service) enabling device-to-device and device-to-Scaleway communication.
When connecting to a Hub, devices can exchange messages, granting them access to various cloud services. Hub routes also allow devices to send messages to other services that do not use MQTT (Message Queuing Telemetry Transport). MQTT is the most commonly used messaging protocol in IoT applications for its lightweight property and Publish/Subscribe model. Allowing interaction with services that do not use MQTT is an essential feature that increases flexibility and interoperability of the system.
Scaleway IoT Hub is thus versatile and can easily adapt to the various use cases, requirements, and constraints of a given IoT project. IoT Hub features include :
- Pub/Sub architecture
- MQTT protocol, with or without TLS, with or without WebSockets
- Mutual authentication available on TLS connections
- High Availability and Scalability
- Routes to Scaleway's ecosystem for data ingestion
- Multiple other IoT Networks such as SigFox or LoRa
- Usage metrics
Concepts
Refer to our dedicated concepts pageOpen in new context to find definitions of the different terms referring to IoT Hub.
Quickstart
Set up your IoT Hub
-
Configure your environment variables.
Note
This is an optional step that seeks to simplify your usage of the APIs. Since there is only one Availability Zone for IoT Hub, we have already set the value to the region for you.
Code -
Edit the POST request payload that we will use in the next step to create an IoT Hub.
CodeParameter Description project_idID of the Project to create your flexible IP in. nameName of the Hub. product_planProduct plan for your IoT Hub. Three product plans are currently available for Hubs: plan_shared,plan_dedicatedandplan_ha. To find which plan is better suited to your needs, you can consult the IoT Hub Quickstart pageOpen in new context. -
Create a Hub. Run the following command to create the Hub. Make sure you include the payload you edited in the previous step.
Note
We will save the output in a file called .
Code -
Get your Hub's information. Run the following command to pull your Hub's information from the
myhub.jsonfile.CodeYou should get an output similar to the following. The status should be indicated as
ready.Note
This is a response example, the UUIDs displayed are not real.
Code
Set up your IoT device
-
Edit the following POST request payload to create your first device.
Note
For the sake of simplicity, the following payload allows the device to connect using insecure protocols (such as plain text MQTT or MQTTs without mutual authentication). In production, you should always deny insecure connections to ensure the highest level of security. This would be done by setting the field to .
CodeParameters Description nameDevice name descriptionA description of your device. allow_insecureWhether or not you allow insecure connections. Values are either trueorfalse. -
Create your first device. Run the following command to create your first device.
Note
The response output will be saved in a file called and then piped to to pretty-print the output in your terminal.
CodeYou should get an output similar to the following, providing information about your device.
Note
This is a response example, the UUIDs displayed are not real.
Code -
Create your second device. Run the following command to create your second device.
Code
Subscribe and publish
In the next part, you will simulate two devices to indicate how to set them up as publishers and subscribers.
-
Set up the subscriber. Open a new terminal window and run the following command to subscribe to an MQTT topic.
Code -
Set up the publisher. Open another terminal window and run the following command to publish a
Hello, world!message to an MQTT topic.CodeWhen you open the terminal window you used to set up the subscriber, you should see that the
Hello, world!message has successfully been received.
Requirement
To perform the following steps, you must first ensure that:
- You have a Scaleway accountOpen in new context
- You have created an API keyOpen in new context and that the API key has sufficient IAM permissionsOpen in new context to perform the actions described on this page
- You have installed
curlOpen in new context - You have installed
mosquittoOpen in new context - You have installed
jqOpen in new context
Technical information
Availability Zones
Hubs can be created in the following Availability Zone:
- Paris
fr-par
Going further
For more help using Scaleway IoT Hub, check out the following resources:
- Our main documentationOpen in new context
- The #iot-hub channel on our Slack CommunityOpen in new context
- Our support ticketing systemOpen in new context.