Lora-net / LoRaMac-node

Reference implementation and documentation of a LoRa network node.
Other
1.89k stars 1.09k forks source link

Start transmitting only if User Button is pressed #334

Closed griphi closed 6 years ago

griphi commented 7 years ago

Hi,

currently, I am using STM32 Nucleo-64 board with Semtech SX1272 and the Multitech Conduit Gateway. I have a problem with my code. If I push the button, the STM32 Board is starting the transmission. But only once. If I try to push the button after 10 sec, the STM32 Board is transmitting nothing to the Gateway.

here my code:

`

while(BSP_PB_GetState(BUTTON_KEY) != GPIO_PIN_RESET)
{
  HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);
  /* Insert delay 100 ms */
  HAL_Delay(100);
}

while(BSP_PB_GetState(BUTTON_KEY) != GPIO_PIN_SET)
{
  BSP_LED_Off(LED2);
  lora_fsm( );
  DISABLE_IRQ( );
 //      /* if an interrupt has occurred after DISABLE_IRQ, it is kept pending 
 //      * and cortex will not enter low power anyway  */
  if ( lora_getDeviceState( ) == DEVICE_STATE_SLEEP )
  {
  #ifndef LOW_POWER_DISABLE
     LowPower_Handler( );
  #endif
  }
    ENABLE_IRQ();
}

`

Thanks

mirzafahad commented 7 years ago

How does your device wake up from sleep?

mluis1 commented 6 years ago

No activity we close the issue.