P064 APDS 9960. ESPeasy hangs when too close to Proximity

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

P064 APDS 9960. ESPeasy hangs when too close to Proximity

#1 Post by joost d » 14 Mar 2022, 15:55

I am using "ESP32 mega-20211224" with the "Gesture - APDS 9960" and plugin P064.
This works fine until an object comes close to the APD9960. Then the EASeasy hangs and resumes when the object is placed further away.
For instance: the log on the USB (Putty) stops and my display displaying the time with second value, stops changing the time.
Attachments
Knipsel.JPG
Knipsel.JPG (70.67 KiB) Viewed 8859 times

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#2 Post by Ath » 14 Mar 2022, 16:10

That is a 'feature' of that sensor, as it seems to block the entire ESP in that case. And the original reason I added extra configuration options for sensitivity to the device. So you could play with that to get the optimal for your situation.
/Ton (PayPal.me)

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#3 Post by joost d » 18 Mar 2022, 07:59

A feature??? I don't understand the sence of that feature....
It is the plugin64 that makes the ESPeasy to hang if you get too close to the sensor.....In my opinion, a plugin should never do that!

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#4 Post by Ath » 18 Mar 2022, 08:35

Well, that's why I quoted 'feature', the plugin only reads from the sensor, but it gets blocked while reading the data, not much the plugin can do about that.

I'll have a look at the library code for the APDS9960, to see if it can be unblocked (adjust any loop that doesn't exit within a reasonable time-frame).
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#5 Post by Ath » 20 Mar 2022, 22:43

I've found that loop, but trying to use the non-blocking version of the same call hasn't been successful yet (reporting incomplete reads only), so it will take some more investigation and experimenting.

For now you should set 'Gesture Gain' to 1x and 'Gesture LED Drive' to 50mA (or even lower), to avoid blocking, at least that's what mine is set to, though I can still get it to block by getting really close to the sensor ( < 10cm). I've read that this behavior is reported quite often for this sensor. This was the reason I initially started changing the plugin code to add these settings, as the settings where fixed at Gain = 4x and LED Drive = 100 mA, resulting in a not responding ESP when this task was enabled.

Another suggestion that was given, is to add an electrolytic capacitor of ~47 uF between VCC (3V3) and GND, using short wires, close to the sensor board (check polarity, as when incorrectly connected the capacitor will explode!).
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#6 Post by Ath » 21 Mar 2022, 23:27

I've opened PR #3974 that should unblock the gesture sensor, as it limits the number of consecutive reads when an object is close to the sensor.

You can download the binaries from the Gihub actions page once the build is completed.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#7 Post by Ath » 06 Apr 2022, 20:22

joost d wrote: 14 Mar 2022, 15:55 This works fine until an object comes close to the APD9960. Then the EASeasy hangs and resumes when the object is placed further away.
Not sure if you missed previous messages, but a fresh build of this PR is available here (as soon as the build is finished ;))
/Ton (PayPal.me)

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#8 Post by joost d » 27 Apr 2022, 17:41

Hello Ton,
I'm very busy right now. Later I will implement and test your changes.

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: P064 APDS 9960. ESPeasy hangs when too close to Proximity

#9 Post by Ath » 09 Jul 2022, 23:06

joost d wrote: 27 Apr 2022, 17:41 Hello Ton,
I'm very busy right now. Later I will implement and test your changes.
Hi Joost, any update on this?
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests