Problem for sending a message with Arduino MKRfox 1200

Hi everyone!!

I am a simple beginner with IOT programmation!
I am using for my project the sigfox network and an Arduino MKR Sigfox 1200. I followed the tutorial on how to set the card and how to send the first message.
The problem is I cant have any response on the backend of my message. I checked the coverage and the token by calling Sigfox but they told me everything was fine on their side.

I think the problem comes from the code:

#include <SigFox.h>  // must include the SigFox library

void setup() {
  Serial.begin(9600);
  while (!Serial) {};     //waits for Serial to be available
  if (!SigFox.begin()) {  //ensures SigFox is connected
    Serial.println("Shield error or not present!");
    return;
  }
  Serial.print("sending");
  SigFox.begin();
  SigFox.beginPacket();
  SigFox.write(true);  //content of the packet
  SigFox.endPacket();
  Serial.print("sent");
}

void loop() {
  while (1)
    ;
}

With this code, when I looked into the monitor serie, I can only see the word "sending" displayed on it which means the Arduino is unable to execute the rest of the code after " Serial.print("sending");".

Is there someone who can help me to solve the problem or maybe just to identify the problem?

Thanks for reading this long post ^^

Hi!

I finally fixed my problem.
For those who might encounter the same pb. You have to include in the program in the void set up the ID of the Arduino, the PAC and the sigfox version:

void setup() {
  // put your setup code here, to run once:
  pinMode(capteur, INPUT);

  // initialize the sigfox library
  if (!SigFox.begin()) {
    Serial.println("Shield error or not present!");
    return;
  }
  // Enable debug led and disable automatic deep sleep
  // Comment this line when shipping your project :)
  SigFox.debug();

  String version = SigFox.SigVersion();
  String ID = SigFox.ID();
  String PAC = SigFox.PAC();

  // Send the module to the deepest sleep until we send a message
  SigFox.end();
}

It was also required to add an GSM antenna to the Arduino for us.

1 Like