Networks allow your devices, ranging from embedded systems to server software, to exchange messages with your IoT Hub.
There are currently 4 network types:
Other network types are planned for future versions of the Hub.
The default MQTT network, which is automatically created with your Hub, is a MQTT network. Being a default network, you canât delete it.
To connect to this network:
1 . Create a device if havenât already.
2 . Configure your device / client to connect through the Network, using the following parameters
If you have configured your device to force mTLS (deny insecure connections), youâll also need to provide the Device certificate.
3 . Connect and exchange messages.
There is no topic prefix for default networks, the whole âtopic spaceâ will be available to MQTT clients.
The default Websocket network, which is automatically created with your Hub, is a MQTT-over-Websocket network.
Use it the same way as the MQTT network above except the network endpoint is different and the ports are 80 for HTTP and 443 for HTTPS.
Note: mutual TLS authentication is not yet available on this network.
The Sigfox Network type allows devices communicating with the Sigfox protocol to exchange messages with the IoT Hub. Sigfox will collect messages from your devices, and relay them to your IoT Hub.
The Sigfox network doesnât support downlink messages yet. This will be available soon.
To setup a Sigfox Network, youâll need to have a Sigfox account . If you donât have an account, you may have a look at this page to get started.
1 . On your hubâs page in the Scaleway console, click on the Networks tab.
2 . On the Networks tab, click on the Add network button (the green +) to open the network creation form.
3 . Fill-in the different fields.
4 . Click âCreate Networkâ
The last page will show a summary of the network you just created, and 2 key parameters:
Keep this information, weâll need it in a few minutes.
Now you have successfully created your Sigfox network, itâs time to configure the Sigfox callbacks to relay messages to your Iot Hub.
1 . Login the Sigfox backend here
2 . Go the DEVICE TYPE tab
3 . Click on the CALLBACKS entry in the left menu
4 . Select the Custom callback option
5 . Fill-in the form like the image below.
Letâs go through each field:
DATA
UPLINK
because we do not support BIDIR
callback (but we will soon, stay tuned)URL
.https://sigfox.iot.fr-par.scw.cloud
.POST
.Header | Value |
---|---|
X-Secret | Put here the network secret that was given when you created the network on your Hub |
X-Topic | Choose here the topic that suits your needs. Note that you may use Sigfox-provided variables here if needed. For example, app/{device}/payload . This topic will be prefixed with the network topic. |
In this example, if the device id is A1234B
, the sensor payload is ABCDEF01
, the topic
header is {device}/payload
, and the Network prefix is myapp
, then a message will be received on the myapp/A1234B/payload
topic, containing the following payload:
{
"data": "ABCDEF01",
"id": "A1234B"
}
The Rest Network type allows any HTTP client to send messages to the IoT Hub.
The Rest network only allows publishing messages.
1 . On your hubâs page in the Scaleway console, click on the Networks tab.
2 . On the Networks tab, click on the Add network button (the green +) to open the network creation form.
3 . Fill-in the different fields.
4 . Click âCreate Networkâ
The last page will show a summary of the network you just created, and 2 key parameters:
Keep this information, weâll need it in a few minutes.
You can use any HTTP client to publish a message through Rest Network. Required headers are:
X-Secret
: put here the network secret that was given when you created the network on your HubX-Topic
: choose here the topic that suits your needsHere is an example using curl:
> curl -XPOST -H "X-Secret: <network-secret>" -H "X-Topic: <topic>" -d <payload> <network-endpoint>
using following values:
<network-secret>
: Put here the network secret that was given when you created the network on your Hub<network-endpoint>
: Put here the network endpoint that was given when you created the network on your Hub<topic>
: Choose here the topic that suits your needs. This topic will be prefixed with the network topic.<payload>
: Put here the payload you want to publish (a JSON string as example)Learn more about Scaleway IoT Hub, discover how to add Devices to the hub, check the IoT Hub metrics or get started in a few clicks with the IoT Hub Kickstarts.