OccupancySensor in JN-AN-1246-Zigbee-3-0 Sensors cannot sleep after occupied move to the unoccupied

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OccupancySensor in JN-AN-1246-Zigbee-3-0 Sensors cannot sleep after occupied move to the unoccupied

1,176 Views
Tome-mbedded
Contributor II

The JN5189DK6 I used is a Release Version: 2.6.12, and I fired the firmware to the JN5189 development board for testing. I tested according to the documentation and found that when the state moved from Occupied to the unoccupied state will not sleep, it will wake up frequently, it will consume a lot of power, which is not normal, why is that? Log as follows

Tomembedded_0-1699932905930.png

Tomembedded_1-1699933075459.png

 

 

 

0 Kudos
13 Replies

1,144 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @Tome-mbedded,

What version of JN-AN1246 are you using?

By any chance, have you modified the base source code of this App Note? Could you please confirm if the same behavior is observed using the pre-built binary file?

Are you simulating the Occupancy Sensor with SW1 from the Generic Expansion Board?

Regards,
Eduardo.

0 Kudos

1,138 Views
Tome-mbedded
Contributor II

hello @EduardoZamora 

Thank you for your reply.

1、The version of JN-AN1246 is 2006

2、In order not to enter deep sleep, I modified bDeepSleep = FALSE in the code. When Delaying Unoccupied time to APP_OCCUPANCY_SENSOR_OCCUPIED_TO_UNOCCUPIED_DELAY (180s), it can't go to sleep and wake up frequently. See the attachment below

Tomembedded_0-1700017059062.pngTomembedded_1-1700017301634.png

Tomembedded_2-1700017649558.png

When I use the pre-built binary file, the phenomenon is different. When the time to delay Unoccupied reaches APP_OCCUPANCY_SENSOR_OCCUPIED_TO_UNOCCUPIED_DELAY (180s), it enters a deep sleep and does not wake up.See the attachment below

Tomembedded_3-1700018032394.png

3、I used the universal expansion board SW1 to simulate occupancy sensors

The sensor project I'm going to work on doesn't require deep sleep. As for the above questions, please help me analyze which step is wrong

thank you 

 

 

 

0 Kudos

1,130 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

Could you please provide more details about the purpose of your development? What are you trying to achieve? Also, there should be a newer version of JN-AN-1246, you can download it from the JN5189 webpage, Documentation section.

According to the modifications you implemented in your code, this should be an expected behavior since bDeepSleep is used by the app_sleep_handler to evaluate if the device can go to sleep; setting this variable to FALSE would prevent the device from going to sleep.

Regards,
Eduardo.

0 Kudos

1,119 Views
Tome-mbedded
Contributor II

Thank you for your reply

1、My project is an all-in-one sensor with infrared and temperature functions. I want the sensor to wake up regularly for 30min and report the temperature. Since deep sleep is not possible, I modified bDeepSleep = FALSE in the code. When the infrared alarm is occupied, unoccupied will be reported delayed. When Delaying Unoccupied time to APP_OCCUPANCY_SENSOR_OCCUPIED_TO_UNOCCUPIED_DELAY (180s), it can't go to sleep and wake up frequently. This is not what I was hoping for. I hope that APP_OCCUPANCY_SENSOR_OCCUPIED_TO_UNOCCUPIED_DELAY(180s) time is up so that the sensor can go to sleep and wake up at a scheduled time (30min) or wake up with an infrared alarm.

2、I downloaded the latest version (2007) of JN-AN-1246 and it was the same phenomenon.

How can I modify it to achieve my functionality?

thank you

 

0 Kudos

1,070 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

If I am understanding correctly, and summarizing, your project does not require Deep Sleep mode, and what you are trying to achieve is change the Sleep mode/level, is this correct?

Regards,
Eduardo.

0 Kudos

1,064 Views
Tome-mbedded
Contributor II

hi @EduardoZamora 

Yes, I want to achieve a regular wake up, such as sleep 30 minutes after waking up, and then report the temperature value, and then continue to sleep

0 Kudos

1,030 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

For more information on attribute report and functionality customization available for this App Note, please refer to JN-AN-1246 ZigBee 3 Sensor Doc. Also, you can take a look at the JN-AN-3132 ZigBee 3 Cluster Library (included in JN5189 SDK > docs > wireless > Zigbee).

You can find some useful information about Power Manager (PWRM) API in JN-UG-3133 Core Utilities (JN5189 SDK > docs > wireless > Zigbee). For Low Power (LPM) Library, you can consult the Connectivity Framework Reference Manual that can be found in JN5189 SDK > docs > wireless > Common.

Regards,
Eduardo.

0 Kudos

987 Views
Tome-mbedded
Contributor II
 

hi @EduardoZamora 

But still the above problem, for this phenomenon, I do not know the reason. when the wake timer 0 is trigger(occupied-> unoccupied 180s), why it often wakes up when PWR_eScheduleActivity(&sWake, u32WakeMs, vWakeCallBack) is call and enters sleep (wake timer 1).I don't want it to wake up too often.I want it to wake up after 97s according to this time

Tomembedded_0-1700463833918.png

 

How do I change it?

Tomembedded_0-1700453159793.png

 

 

0 Kudos

927 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

By default, this application should wake up by pressing SW1 once an Occupied to Unoccupied event has occurred (this delay is defined by APP_OCCUPANCY_SENSOR_UNOCCUPIED_TO_OCCUPIED_DELAY macro).

Also, as the Occupancy Sensor is a sleeping End Device, it will wake up every ZLO_SYSTEM_MAX_REPORT_INTERVAL, which by default is set to 0 seconds, disabling this feature. By any chance, have you modified this macro? Since periodic reporting is disabled by default, when in the unoccupied state the device does not need to keep track of time, meaning it can go into deep sleep and wait for the virtual sensor to trigger an occupancy event.

Regards,
Eduardo.

0 Kudos

917 Views
Tome-mbedded
Contributor II

hi @EduardoZamora   thank you.

By default, this application should wake up by pressing SW1 once an Occupied to Unoccupied event has occurred (this delay is defined by APP_OCCUPANCY_SENSOR_UNOCCUPIED_TO_OCCUPIED_DELAY macro).

1、yes, it will wake up delay(this delay is defined by APP_OCCUPANCY_SENSOR_UNOCCUPIED_TO_OCCUPIED_DELAY macro).But then it won't sleep

2、ZLO_SYSTEM_MAX_REPORT_INTERVAL this macro I did not modify, the code in the default is not used this macro。

Tomembedded_0-1700624511880.png

I just changed bDeepSleep = FALSE; Prevent occupation to Unoccupied event has occurred (this delay is defined by APP_OCCUPANCY_SENSOR_UNOCCUPIED_TO_OCCUPIED_DELAY macro) into a deep sleep. But when it goes to sleep, it wakes up frequently.

Tomembedded_1-1700624588624.png

Tomembedded_3-1700625795015.png

 

3、Do you have this problem when you run OccupancySensor on the development board?
There may be some configurations I didn't modify on that cause this problem

 

 

0 Kudos

890 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

I tested the pre-built binary file from the App Note folder and this was the behavior I observed after the device joined the network:

EduardoZamora_0-1700775776533.png

The device goes inactive after APP_OCCUPANCY_SENSOR_OCCUPIED_TO_UNOCCUPIED_DELAY, and it does not show activity until SW1 from Generic Expansion Board is pressed again.

By any chance, are you using the 'keep alive' feature of this application? Occupancy Sensor can be configured to be kept awake in 'keep-alive' mode by pressing the SW2 button on the Generic Expansion Board. For more information on this, please refer to JN-AN-1246 documentation, Section 4.3.5 Sleep Options.

Regards,
Eduardo.

0 Kudos

877 Views
Tome-mbedded
Contributor II

hi @EduardoZamora   thankyou

You tested the pre-built binary from the App Note folder and observed that the behavior was correct.It fell into a deep sleep

But I don't want it to go into a deep sleep. So i modified  bDeepSleep = TRUE;

and then tested it again and it didn't go to sleep, I am not used 'keep alive' feature of this application.

I want it to go to sleep and wake up periodically

Tomembedded_0-1700792221992.png

You can modify it like I did and then test it

Thank you very much.

 

 

0 Kudos

851 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

This Application Note is intended to work as a sleeping End Device, so it should designed to go into low-power mode. If you do not want your device to go to sleep, you can use the 'keep-alive' mode.

If your goal is to configure a different low-power mode/level, you can find more information on the available low-power modes in Low Power (LPM) Library Section from the Connectivity Framework Reference Manual and Power Manager (PWRM) API from JN-UG-3133 Core Utilities.

Regards,
Eduardo.

0 Kudos