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

Sleep Mode for CC1101 #211

Closed
pcfritz opened this issue Dec 16, 2024 · 6 comments · Fixed by #218
Closed

Sleep Mode for CC1101 #211

pcfritz opened this issue Dec 16, 2024 · 6 comments · Fixed by #218
Labels
question Further information is requested

Comments

@pcfritz
Copy link

pcfritz commented Dec 16, 2024

Hi I am using BresserWeatherSensorBasic in a project to receive every 15 minutes weather data and to send it to an Influxdb server via mobile network, which works great. But as the esp32 is connected to a LiPo battery, I wonder if it would be possible to not only use deep sleep of esp32 but also sleep mode of CC1101? Would be awesome if you could implement something like this!

@matthias-bs
Copy link
Owner

Hi,
I think this is already available. You can call radio.standby() at the end of each reception cycle before the ESP32 enters sleep mode. You can also have a look at the other examples, which use getData() instead of getMessage():

bool WeatherSensor::getData(uint32_t timeout, uint8_t flags, uint8_t type, void (*func)())

getData() calls radio.standby() after all required messages have been received.
RadioLib also provides a sleep() method for some modules, but not for the CC1101. If CC1101 has a sleep function in addition to the standby function, you might file an issue in the RadioLib project.

@matthias-bs matthias-bs added the question Further information is requested label Dec 17, 2024
@pcfritz
Copy link
Author

pcfritz commented Dec 19, 2024

thanks @matthias-bs, that helped. Issue can be closed

@pcfritz pcfritz closed this as completed Dec 19, 2024
@matthias-bs
Copy link
Owner

@pcfritz See jgromes/RadioLib#1382, maybe sleep mode will be implemented soon.

@pcfritz
Copy link
Author

pcfritz commented Jan 18, 2025

Fingers crossed. If I call ws.sleep(), change the according block in WeatherSensor.cpp to this and move void SPIsendCommand(uint8_t cmd); to public, I still only reach about 1.65ma:

void WeatherSensor::sleep(void) { radio.SPIsendCommand(RADIOLIB_CC1101_CMD_POWER_DOWN); }

@matthias-bs
Copy link
Owner

To which extend did the CC1101 sleep command reduce the current?
Is the 1.65 mA only the CC1101 supply current or anything else? For low power/quiescent current, you have to take the entire circuit into account.
Anyway, I will integrate the CC1101 sleep comand in the next release.

@matthias-bs matthias-bs reopened this Jan 18, 2025
@pcfritz
Copy link
Author

pcfritz commented Jan 19, 2025

Great!

Meanwhile I've changed cc1101.h and cc11011.cpp according to jgromes/RadioLib#1389.
I also found out, that cc1101 current after ws.sleep() was lower compared to to current after beginning of deepsleep. The reason for it might be the CS pin, because after setting CS as input, high and remaining state in deepsleep, the current drops to <0.1ma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants