Bugfix and add Low Power Mode#12
Bugfix and add Low Power Mode#12johanstokking merged 12 commits intoTheThingsNetwork:feature/low-power-modefrom
Conversation
hallard
commented
Feb 12, 2018
- Created Low Power Battery Monitor example enabling lora module sleep mode
- Added Hard reset of Lora module at startup (with IO pin)
- Fixed issue The Things Node button release does not provide time pressed #9
- Enable Low Power of Lora Module of other examples sketches
- Added Hardware Reset of lora module at startup - Fixed push button duration bug - Set IRQ var to be volatile
|
This new pull request #12 should fix your issue, just let me know |
johanstokking
left a comment
There was a problem hiding this comment.
Thanks @hallard !! Looks good. Few changes, mostly styling. I'd like to keep this repository clean and consistent.
library.properties
Outdated
| @@ -1,5 +1,5 @@ | |||
| name=TheThingsNode | |||
| version=2.0.2 | |||
| version=2.0.3 | |||
There was a problem hiding this comment.
We're bumping versions in the master branch after merging – sometimes we combine PRs in a version
src/TheThingsNode.cpp
Outdated
| uint8_t trigger = getPinChangeInterruptTrigger(digitalPinToPCINT(TTN_BUTTON)); | ||
| if (trigger == FALLING) | ||
| { | ||
| //Serial.println(F("IPRESS")); |
src/TheThingsNode.cpp
Outdated
| // Don't go to sleep mode while button is still pressed | ||
| // because if so, timer of ms will be stopped and duration | ||
| // of pressed button will not work | ||
| if ( this->buttonPressed ) { |
| setColor(TTN_BLACK); | ||
|
|
||
| // set pin mode every time to avoid constraining the user about when the pin is initialized | ||
| #ifdef TTN_LORA_RESET |
docs/TheThingsNode.md
Outdated
| } | ||
| ``` | ||
|
|
||
| Pay attention, this internal sleep method of the library does not put the Lora module (RN2483) into sleep mode and thus your node may consume 3mA even in sleep mode. You need to manually set the lora module to sleep and wake. |
There was a problem hiding this comment.
Lora -> LoRa
lora -> LoRa
There was a problem hiding this comment.
RN2483 can also be RN2903
examples/Basic/Basic.ino
Outdated
| ttn.sendBytes(payload, sizeof(payload), port); | ||
|
|
||
| // Set RN2483 to sleep mode | ||
| ttn.sleep( 60000 ); |
| ttn.sendBytes(lpp.getBuffer(), lpp.getSize(), port); | ||
|
|
||
| // Set RN2483 to sleep mode | ||
| ttn.sleep( (uint32_t) (CONFIG_INTERVAL*1000) ); |
| @@ -0,0 +1,172 @@ | |||
| // ********************************************************************************** | |||
There was a problem hiding this comment.
Although useful, we're not using these headers in examples.
Please add the concerning comments in code, if necessary.
|
|
||
| // Set RN2483 to sleep mode | ||
| ttn.sleep( (uint32_t) (CONFIG_INTERVAL*1000) ); | ||
| ttn.sleep( CONFIG_INTERVAL*1000 ); |
There was a problem hiding this comment.
I meant to say no spaces in the parentheses 😊
|
Can you also fix the CI? |
|
I've done all modifications, travis should be fine on next check |
|
@hallard you're using the Please change .travis.yml#L14 to version |
|
It's done, sorry wrong comments |
|
Thanks, this is now part of https://github.com/TheThingsNetwork/arduino-node-lib/releases/tag/v2.0.5 |