Skip to content
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

new sketch using the Lowpower mode with LoraWan connection #32

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Sep 14, 2023

This new sketch is configuring the stm32wl55 nucleo board to enter lowpoer (stop2) mode after a lorawan connection
An Alarm (ALARM_A) is programmed to go to sleep mode for a period of time (atime value in milliseconds).
On wakeup a packet is sent and goes to sleep again.

@FRASTM
Copy link
Contributor Author

FRASTM commented Sep 14, 2023

Once the connection is done (after the modem.joinOTAA), the AlarmMatch callback function is called

18:15:10.903 -> Start
18:15:31.902 -> Joined
18:15:31.902 ->   Alarm Match: 0 times.
18:15:46.187 -> Queued packet
18:15:46.187 -> Sent packet
18:15:46.187 ->   Alarm Match: 3 times.
18:15:56.584 -> Queued packet
18:15:56.616 -> Sent packet
18:15:56.616 ->   Alarm Match: 5 times.
18:16:04.584 -> Queued packet
18:16:04.584 -> Sent packet
18:16:04.584 ->   Alarm Match: 7 times....

@FRASTM
Copy link
Contributor Author

FRASTM commented Oct 6, 2023

After LoraWan joined, the nucleo_wl55 is entering low power deep sleep mode (STOP2) for 60 seconds (TX_INTERVAL) and send a packet with current RTC calendar.

13:56:16.927 -> Start
13:56:25.178 -> Joined
13:56:25.178 ->   Alarm Match: 0 times. deepSleeping now ! 
13:57:25.201 -> 09/04/2023 - 15:31:58
13:57:33.198 -> Sent packet
13:57:33.198 ->   Alarm Match: 1 times. deepSleeping now ! 
13:58:33.202 -> 09/04/2023 - 15:33:06
13:58:39.596 -> Sent packet
13:58:39.596 ->   Alarm Match: 2 times. deepSleeping now ! 
13:59:39.627 -> 09/04/2023 - 15:34:12
13:59:46.014 -> Sent packet
13:59:46.014 ->   Alarm Match: 3 times. deepSleeping now ! 
14:00:46.025 -> 09/04/2023 - 15:35:18
14:00:51.226 -> Sent packet
14:00:51.226 ->   Alarm Match: 4 times. deepSleeping now ! 
14:01:51.239 -> 09/04/2023 - 15:36:24
14:01:56.442 -> Sent packet
14:01:56.442 ->   Alarm Match: 5 times. deepSleeping now ! 

Measuring power consumption of the nucleo_wl55jc (on JP1 with STLInk USB plug) --> LED is blinking on one period

stm32wl55 lorawan and deepsleep 60s with RTC

@FRASTM FRASTM force-pushed the lowpower_sketch branch 3 times, most recently from dfb07e3 to d04e90a Compare October 6, 2023 15:21
This example is configuring the stm32WL for LoraWan connection and
low power mode.
After LoraWan is connected, it periodically goes to low power
deep sleep mode (stop 2) and wakes Up to send a packet

Signed-off-by: Francois Ramu <[email protected]>
@fpistm fpistm added the enhancement New feature or request label Oct 12, 2023
@fpistm fpistm added this to the 0.2.0 milestone Oct 12, 2023
@fpistm fpistm self-requested a review October 12, 2023 09:40
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fpistm fpistm merged commit 1434993 into stm32duino:main Oct 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

2 participants