-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I dont want to sleep.... #84
Comments
/LoraWan Class, Class A and Class C are supported/ |
Class C leaves the radio on for receiving. If I want to do some datalogging instead of sleeping after sending a packet, I would'n want the device to keep the radio on as it wastes battery life. Sadly I don't find any way of disabling this sleepy behavior in code. |
If you call The pins that are being configured as inputs are 4 (OLED_SDA), 5 (LoRa_SCK), 14 (LoRa_RST), 15 (OLED_SCL), 16 (OLED_RST), 17 (U2_TXD), 18 (LoRa_CS), 19 (LoRa_MISO), 26 (LoRa_DIO0), and 27 (LoRa_MOSI). For reasons unknown, they don't also set 35 (LoRa_DIO1) or 34 (LoRa_DIO2) to inputs (sure, they're already inputs, but so was LoRa_DIO0, so either do none or do all...) It's not clear if you NEVER want to go into deep sleep yet still power down the radio, or if you want to do a few fata logging things before you do enter deep sleep. If you never want to go into deep sleep, you can write your own code to set the pins to inputs, and at some point or another have to basically re-run this code:
or, create yourself a variable called something like
Normally leave
(so it recalculates the wake-up time correctly), then it'll enter deep sleep and behave as normal class A sleeping. Remember to set |
I agree with this, the only reason I find for this decision would be to enforce the use of the license number and prevent the user from bypassing this. Even if that's the case, I think there are better ways to achieve it.
In this point I don't want my device to deepsleep at any point, as it would lose all info stored in RAM. I know I can store it in non volatile storage and then recover it but I want to avoid that, as it is slower and sketchy.
I've just set it to just CLASS_C and it seems to work fine, except for the active radio listening. Something strange that I noted is that with CLASS_A you can cycle like 5 consecutive times without entering deepsleep (I've set the app duty cycle to 3000 ms), then it behaves as spected. |
I am using the following code for the wireless stick, it seems to be the only workable example for uploading to the helium network.
It seems a bit over complex and must sleep. I want to do the following:
Join...
Loop updating the display with sensor data..
Every 10 mins
Send sensor data
But the following code, must sleep otherwise it doesnt work.
Does anyone have a better example?
void loop()
{
switch( deviceState ){
case DEVICE_STATE_INIT:
{
LoRaWAN.init(loraWanClass,loraWanRegion);
break;
}
case DEVICE_STATE_JOIN:
{
Display.clear();
Display.drawString(2, 0, "Joining...");
Display.display();
LoRaWAN.join();
break;
}
case DEVICE_STATE_SEND:
{
Display.clear();
Display.drawString(2, 0, "Sending...");
Display.display();
prepareTxFrame(appPort);
LoRaWAN.send(loraWanClass);
deviceState = DEVICE_STATE_CYCLE;
break;
}
case DEVICE_STATE_CYCLE:
{
// Schedule next packet transmission
txDutyCycleTime = appTxDutyCycle + randr( -APP_TX_DUTYCYCLE_RND, APP_TX_DUTYCYCLE_RND );
LoRaWAN.cycle(txDutyCycleTime);
deviceState = DEVICE_STATE_SLEEP;
break;
}
case DEVICE_STATE_SLEEP:
{
getData();
LoRaWAN.sleep(loraWanClass,debugLevel);
break;
}
default:
{
deviceState = DEVICE_STATE_INIT;
break;
}
}
}
The text was updated successfully, but these errors were encountered: