MKRFOX1200 cycle through loop only once

Hi everybody,

I'm fairly new in arduino's world and i began with the Sigfox powered nano board that I purchased on the arduino's official store.

I managed to send some message with a relative ease but now I'm stuck on something I absolutely don't have any idea about.

I'm putting this (realy) simple code in my board :

#include <SigFox.h>
#include <ArduinoLowPower.h>

const int PinCLK=7;

void isr ()  {
}

void setup() {
  pinMode(PinCLK,INPUT);
  LowPower.attachInterruptWakeup (digitalPinToInterrupt(7),isr,FALLING);
}

void loop()
{
  // Sleep until an event is recognized
  LowPower.sleep();

  SigFox.begin();
  SigFox.beginPacket();
  SigFox.print("DDP_" + SigFox.ID());
  SigFox.endPacket();
  
}

The "sensor" which I'm watching the falling on is a rotary encoder (i'm searching for any rotation, CW or CCW does'nt matter, nor the "distance" of the rotation).

So once the code is on the board, I turn the rotary encoder and everything works... or almost.
The message is sent to the sigfox backend without a flinch but the board should return to sleep after that but it's not ! And furthermore, no matter what I do, it won't detect any rotation at all until I reset it.

If anyone sees something wrong or is able to explain to me this behavior, my ears (or eyes in this case) are wide open !

Tanks in advance :slight_smile:

Luneski

Hi everybody,

I'm still stuck on this :confused: Any help ?

Luneski

I haven't used your hardware or your libraries, so I can't be much help. I suspect that many others are in the same place, hence the lack of replies.

Can you get sleep mode to work if you drop all the sigfox stuff and just send a message to serial in loop?

Is Pin seven used by the sigfox library? Can you try another one for the encoder interrupt? Are all pins usable for interrupts? They're not on an Uno for example.