Inkplate 2 motion sensor continuous triggering with deepSleep example error

Customer:

I’m trying to connect a motion sensor to my Inkplate 2 but every guide I find says I need to connect to the CONTROL pinout but I can’t find said pinout on my IP2. I was given a pinout reference sheet but even though the legend has a label for CONTROL, I can’t see it actually labelled against the Inkplate.

Originally submitted via email support on 6 June 2023. Migrated to the forum for community visibility.

Soldered Support:

For the Inkplate 2 pinout, the files are available on GitHub at GitHub - SolderedElectronics/Soldered-Inkplate-2-hardware-design: Hardware design, BOM, gerbers, 3D files and pinout for Soldered-Inkplate-2 designed by Soldered Electronics. · GitHub. Can you provide more details about the motion sensor you’re trying to connect (part number or product link)?

Customer:

Here is a link to the motion sensor I’m trying to connect. I have jumper cables that I can use to connect to the Inkplate, as I’m sure the required pinouts aren’t right next to each other.

Soldered Support:

Connect sensor GND to GND on the Inkplate, 3V3 to the 3V3 pin. OUTPUT pin from the sensor you need to connect to the ESP32 GPIO pin. You can choose any GPIO pin which is free (didn’t use for I2C or UART). You will need to use jumper cables to connect the sensor to the Inkplate board.

Here is a good tutorial for the sensor: Maker Advent Calendar Day #7: Monitoring Motion!

Customer:

I’ve made some progress in that the motion sensor actually detects motion but once it detects motion it won’t stop detecting motion. I currently have the code set up so that it sends me a notification through the Pushover service when it detects any motion but it just sends me non stop notifications, even without any motion being detected.

Attachment omitted in migration: Inkplate2pushover.ino

Soldered Support:

Make sure the section of the code which sends the notification runs only if there was motion detected (so, an ‘if’ condition), and that you should try and detect motion only every-so-often. You can do this in two ways: use a simple millis() timer or check out the deepSleep examples for Inkplate 2 - they use the RTC timer and save a lot of battery by having the device go to deep sleep and wake, for example, every 10 seconds.

Customer:

I’ve just tried your deepSleep example and it doesn’t seem to work. Here’s the exact error: ‘Compilation error: ‘bool Inkplate::setPanelDeepSleep(bool)’ is private within this context’. I’ve also tried the RTC alarm example.

Attachment omitted in migration: Inkplate2_Simple_Deep_Sleep.ino

Soldered Support:

Please update your Inkplate library to the latest version. This includes updating the examples. The examples in the latest version for Inkplate 2 don’t use setPanelDeepSleep, as the functionality of setting the panel to sleep is done every single time after a screen refresh on some Inkplate models (so it’s not necessary to call the function in your own code), Inkplate 2 being one of them. This was changed recently so you may have an older version of the library.