Device Type
tab on the top, and then click on the device type name you want fo configure. Alternatively, you can go to the Device
tab, and click on the Device type
column of your device.Callbacks
on left menu, and then create a new one. Custom Callback
, as we need to call an endpoint that is not directly supported by the Sigfox back-end.Type
is DATA
with UPLINK
, as we want to send our device data.Channel
is of type URL
, as we will be calling an HTTP endpoint.Send duplicate
as disabled to avoid writing duplicate messages received by different base station.Custom payload config
will completely depend on the payload sent by your device. In our case, our device will be sending the temperature and humidity as 32 bit floats, so we have configured the payload as temp::float:32:little-endian hum::float:32:little-endian
, where we define the temp
and hum
parameters as 32 bit floats in little endian. Notice that Sigfox only supports 12 bytes of payload per message, so you must optimize this space, like sending temperature and humidity as integers if it is not required decimal accuracy. For the example, this will work.Url pattern
must be configured according to your Thinger.io user id, and our bucket name.https://api.thinger.io/v1/users/{user_id}/buckets/{bucket_id}/data
. {user_id}
and {bucket_id}
according to your account. In our example, the final url pattern will be https://api.thinger.io/v1/users/alvarolb/buckets/SmartEverything/data
.https://api.thinger.io/v1/users/alvarolb/buckets/{device}/data
. HTTP Method
should be set to POST.Headers
we must include an Authorization
header with our device token in order to authenticate the bucket write request.Authorization
Bearer {access_token}
, where the {access_token}
is the token you have generated in the previous stems.Bearer
word and the token itself.Body
and its Content type
. For content type, we well set application/json
as de bucket can store arbitrary JSON data. The body then will contain all the information we want to store formatted in JSON format. In Sigfox you can define your body according to available variables, both defined by the platform itself (like device id, link quality, or device location), or defined by your payload config. In our case, we defined variables temp
, and hum
, that will be included with other Sigfox variables. For this example, our payload will look like the following:{device}
, with our own custom data in the payaload, like {customData#temp}
. This body is then processed on every message reception, and the variables will be replaced with the current values. So, the server will receive a JSON payload with the device identifier, device temperature, humidity, coarse location (km accuracy), and signal quality.mrk
, and selecting the Arduino SAMD Boards.Arduino SigFox for MKRFox1200
library that is available from the Library Manager, and it is also NECESSARY to install the Arduino Low Power
, and the RTCZero
libraries.struct
that holds two floats. Obviously, you can define your own structs with different data types (but take care of structure padding, and architecture), but the Sigfox payload must be reconfigured to properly decode the fields you are sending.SigFox.internalTemperature()
, and setting the humidity value to zero or any other value.LowPower.sleep
function call and comment the sleep
one if you want to deep sleep your Arduino MRKFOX1200, i.e., when running from batteries. You can also avoid using the Serial
, and the SigFox.debug()
that is there just for debugging purposes. In sleep mode, the device requires a manual reset before flashing it again.smarteverything
, and selecting the Arrow Boards by Axel Elettronica.struct
that holds two floats. Obviously, you can define your own structs with different data types (but take care of structure padding, and architecture), but the Sigfox payload must be reconfigured to properly decode the fields you are sending.Messages
section that is on the left panel. We should see something like the following screenshot, where some messages have been received. You can also see the payload being sent (in hexadecimal), and some other information like link quality, timestamp, or callback result.