mkr1200 stazione meteo

Salve a tutti,
sto provando a realizzare una piccola stazione "meteo" che per ora legge solo umidità e temperatura con la board mkr1200.

Il codice che utilizzo è il seguente :

#include "SigFox.h"
#include "ArduinoLowPower.h"
#include "DHT.h"

// Connect pin 1 (on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
// to 3.3V instead of 5V!
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

#define DHTPIN        1                // What digital pin we're connected to
#define DHTTYPE       DHT11
#define DEBUG         true             // Set DEBUG to false to disable serial prints
#define SLEEPTIME     15 * 60 * 1000   // Set the delay to 15 minutes (15 min x 60 seconds x 1000 milliseconds)

#define UINT16_t_MAX  65536
#define INT16_t_MAX   UINT16_t_MAX/2

typedef struct __attribute__ ((packed)) sigfox_message {
        int16_t moduleTemperature;
        int16_t dhtTemperature;
        uint16_t dhtHumidity;
        uint8_t lastMessageStatus;
} SigfoxMessage;

// Stub for message which will be sent
SigfoxMessage msg;


void setup() {
        if (DEBUG) {
                // We are using Serial1 instead than Serial because we are going in standby
                // and the USB port could get confused during wakeup. To read the DEBUG prints,
                // connect pins 13-14 (TX-RX) to a 3.3V USB-to-serial converter
                while (!Serial1) {}

        if (!SigFox.begin()) {
                // Something is really wrong, try rebooting
                // Reboot is useful if we are powering the board using an unreliable power source
                // (eg. solar panels or other energy harvesting methods)

        // Send module to standby until we need to send a message

        if (DEBUG) {
                // Enable DEBUG prints and LED indication if we are testing


void loop() {
        // Reading temperature or humidity takes about 250 milliseconds!
        // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
        float h = dht.readHumidity();
        // Read temperature as Celsius (the default)
        float t = dht.readTemperature();
        // Check if any reads failed and exit early (to try again).
        if (isnan(h) || isnan(t)) {
                Serial.println("Failed to read from DHT sensor!");

        msg.dhtTemperature = convertoFloatToInt16(t, 60, -60);
        msg.dhtHumidity = convertoFloatToUInt16(h, 110);

        if(DEBUG) {
                Serial.print("Humidity: ");
                Serial.print(" %\t");
                Serial.print("Temperature: ");
                Serial.print(" *C ");
        // Start the module
        // Wait at least 30ms after first configuration (100ms before)

        // We can only read the module temperature before SigFox.end()
        t = SigFox.internalTemperature();
        msg.moduleTemperature = convertoFloatToInt16(t, 60, -60);

        // Clears all pending interrupts

        SigFox.write((uint8_t*)&msg, 12);

        msg.lastMessageStatus = SigFox.endPacket();

        //Sleep for 15 minutes

void reboot() {
        while (1) ;

int16_t convertoFloatToInt16(float value, long max, long min) {
        float conversionFactor = (float) (INT16_t_MAX) / (float)(max - min);
        return (int16_t)(value * conversionFactor);

uint16_t convertoFloatToUInt16(float value, long max) {
        float conversionFactor = (float) (UINT16_t_MAX) / (float)(max);
        return (uint16_t)(value * conversionFactor);

Il problema è che non carica sul portale sigfox un messaggio ogni 15 min.
Se provo con l'esempio first configuration il messaggio arriva correttamente.

Qualcuno ha qualche idea?