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

Receive "scan_evt timeout" on serial monitor #58

Closed
redakker opened this issue Nov 20, 2023 · 48 comments
Closed

Receive "scan_evt timeout" on serial monitor #58

redakker opened this issue Nov 20, 2023 · 48 comments
Labels
bug Something isn't working

Comments

@redakker
Copy link
Owner

Recently I met with this problem (never seen before). Probably it is the reason for the device stops and BLE devices are gon even if they are presented.

I found an open issue about this topic:
espressif/arduino-esp32#5860

Unfortunaltely it is quite old issue, but 1technophile
/
OpenMQTTGateway has a solution for that.

Related commit:
1technophile/OpenMQTTGateway@6e8b463

Implement this Watchdog to the BLEcker too.

@redakker redakker added the bug Something isn't working label Nov 20, 2023
@Seinuh
Copy link

Seinuh commented Nov 20, 2023

Im on 1.11.144 at the moment with a few drops a day

@Goodwillson
Copy link
Contributor

The drop of all online devices time to time is the only issue I currently have after long time use. I even restarted the device every 30 minutes, but the drops still happen. I had running without issue for like 2 months with restarts once a week for example. I thought more frequent restarts will eliminate the issue, so I set it to restart every day now. It seems the problem is independent on the restart frequency. I have it setup to monitor cars in garrage, so I see both cars going away in same time and then reappear in few minutes later, sometimes it repeats several times in short time. After that it runs for weeks without such error.

@redakker
Copy link
Owner Author

I hope when I solve this issue, you both can use this without any issues.
Give me some time, and I'll come back to you with the solution.

@redakker
Copy link
Owner Author

@Goodwillson @Seinuh
I've read all related issues, and I met open tickets everywhere.
It looks to me like it is a timing issue, so I made some changes around the scanning process.
You can find the latest artifact here (click on the latest successful build):
https://github.com/redakker/blecker/actions

Every test and feedback is appreciated.
Thanks!

@Seinuh
Copy link

Seinuh commented Nov 20, 2023

@Goodwillson @Seinuh I've read all related issues, and I met open tickets everywhere. It looks to me like it is a timing issue, so I made some changes around the scanning process. You can find the latest artifact here (click on the latest successful build): https://github.com/redakker/blecker/actions

Every test and feedback is appreciated. Thanks!

Up and running

@redakker
Copy link
Owner Author

Okay, I made a mistake, selfclean mechanism and update process set the statuses to false.
Fixed in a version 1.11-162

@Seinuh
Copy link

Seinuh commented Nov 20, 2023

Okay, I made a mistake, selfclean mechanism and update process set the statuses to false. Fixed in a version 1.11-162

Up and running 👍

@redakker
Copy link
Owner Author

Unfortunately, it stopped for me yesterday.
I got an answer here:
espressif/arduino-esp32#5860

Soon I commit this solution and we will see

@Seinuh
Copy link

Seinuh commented Nov 21, 2023

Unfortunately, it stopped for me yesterday. I got an answer here: espressif/arduino-esp32#5860

Soon I commit this solution and we will see

Up and running since yesterday 19:00 boot time 2 hours

@redakker
Copy link
Owner Author

Unfortunately, it stopped for me yesterday. I got an answer here: espressif/arduino-esp32#5860
Soon I commit this solution and we will see

Up and running since yesterday 19:00 boot time 2 hours

Yes, I've tried with no reboot timer

@Seinuh
Copy link

Seinuh commented Nov 22, 2023

Unfortunately, it stopped for me yesterday. I got an answer here: espressif/arduino-esp32#5860
Soon I commit this solution and we will see

Up and running since yesterday 19:00 boot time 2 hours

Yes, I've tried with no reboot timer

With a boot time of 2 hours it still runs great. for me this is the most stable v1.11

@redakker
Copy link
Owner Author

@Seinuh
Interesting fact, if I run 2 devices (productive, lab), I have issues.
Currently, one device (productive) is running, and I have no issues.
It seems there is an interference between the two devices. But it is only a guess, I have no proof for that.

@Seinuh
Copy link

Seinuh commented Nov 22, 2023

@Seinuh Interesting fact, if I run 2 devices (productive, lab), I have issues. Currently, one device (productive) is running, and I have no issues. It seems there is an interference between the two devices. But it is only a guess, I have no proof for that.
I have connected 3 devices so far no problems

@redakker
Copy link
Owner Author

The scan task is moved to another CPU core. Hope it helps to solve the issue.

@Seinuh
Copy link

Seinuh commented Nov 22, 2023

The scan task is moved to another CPU core. Hope it helps to solve the issue.
please let me know when the test is online

@Seinuh
Copy link

Seinuh commented Nov 22, 2023

@redakker v1.11 177 up and running

@Seinuh
Copy link

Seinuh commented Nov 23, 2023

@redakker v1.11 177 up and running

@redakker unfortunately this version drops again

@redakker
Copy link
Owner Author

@redakker v1.11 177 up and running

@redakker unfortunately this version drops again

@Seinuh
Are you running two devices next to each other?

I run one device only and I have had no issues till now. Almost one day now

@Seinuh
Copy link

Seinuh commented Nov 23, 2023

@redakker v1.11 177 up and running

@redakker unfortunately this version drops again

@Seinuh Are you running two devices next to each other?

I run one device only and I have had no issues till now. Almost one day now

@redakker 6 Observed devices

@redakker
Copy link
Owner Author

@redakker v1.11 177 up and running

@redakker unfortunately this version drops again

@Seinuh Are you running two devices next to each other?
I run one device only and I have had no issues till now. Almost one day now

@redakker 6 Observed devices

I meant, one or more BLEcker (ESP32) device

@Seinuh
Copy link

Seinuh commented Nov 23, 2023

@redakker v1.11 177 up and running

@redakker unfortunately this version drops again

@Seinuh Are you running two devices next to each other?
I run one device only and I have had no issues till now. Almost one day now

@redakker 6 Observed devices

I meant, one or more BLEcker (ESP32) device

@redakker 2.... one stable v1.9 and a bèta version 1.11 same Observed devices and reboot time

@redakker
Copy link
Owner Author

@Seinuh I changed back the scanning mechanism similar to v1.11-177
It runs another CPU core, but in "1.11-177 style" :)

@Seinuh
Copy link

Seinuh commented Nov 23, 2023

@redakker v1.11.179 lets go.. up and running

@Seinuh
Copy link

Seinuh commented Nov 24, 2023

@redakker Unfortunately, devices drop again only come "home" after a reboot

@redakker
Copy link
Owner Author

Found another opened ticket on this topic:
espressif/esp-idf#9384

It looks to me it is not depend on my code. It is totally random, just we think it is because of different versions :(
At night I also had issues.
It is because BLE and Wifi do not like each other, need to be fixed by espressif.

I'll go deeper and try to find a proper workaround.
Thank you for your patient

@Seinuh
Copy link

Seinuh commented Nov 24, 2023

Found another opened ticket on this topic: espressif/esp-idf#9384

It looks to me it is not depend on my code. It is totally random, just we think it is because of different versions :( At night I also had issues. It is because BLE and Wifi do not like each other, need to be fixed by espressif.

I'll go deeper and try to find a proper workaround. Thank you for your patient

no problem, good luck

@redakker
Copy link
Owner Author

In the ticket above I found a library. I've changed it on my computer and compile with it.
Find this binary in the folder "dev_binary"
https://github.com/redakker/blecker/tree/main/dev_binary
blecker_v1.11-180.bin

It is up and running on my side, if it helps then I'll find out how to use this in the future

@Seinuh
Copy link

Seinuh commented Nov 24, 2023

In the ticket above I found a library. I've changed it on my computer and compile with it. Find this binary in the folder "dev_binary" https://github.com/redakker/blecker/tree/main/dev_binary blecker_v1.11-180.bin

It is up and running on my side, if it helps then I'll find out how to use this in the future

Up and running 👍

@redakker
Copy link
Owner Author

The board stops, it was not a good build

@Seinuh
Copy link

Seinuh commented Nov 24, 2023

The board stops, it was not a good build

Same here

@redakker redakker reopened this Nov 24, 2023
@redakker
Copy link
Owner Author

Will try the passive mode for scan, somebody mentioned it solved the issue.
Come back to you with that build soon

@redakker
Copy link
Owner Author

@Seinuh
build is ready, check the latest artifact

@Seinuh
Copy link

Seinuh commented Nov 24, 2023

@Seinuh build is ready, check the latest artifact

@redakker lets go ! Up and Running

@redakker
Copy link
Owner Author

It looks like the scan performance has not changed for me.
Hope the best

@Seinuh
Copy link

Seinuh commented Nov 24, 2023

It looks like the scan performance has not changed for me. Hope the best

Fingers crossed

@Seinuh
Copy link

Seinuh commented Nov 25, 2023

@redakker so far so good 🤞

@redakker
Copy link
Owner Author

@redakker so far so good 🤞

On my side too 😊

@Seinuh
Copy link

Seinuh commented Nov 25, 2023

@redakker im on .188 Lets go

@Seinuh
Copy link

Seinuh commented Nov 27, 2023

@redakker .192 up and runnning

@Seinuh
Copy link

Seinuh commented Nov 29, 2023

@redakker last night a spontaneous disconnect connect with one device... im on .192

@redakker
Copy link
Owner Author

@redakker last night a spontaneous disconnect connect with one device... im on .192

Are you talking about BLE device? Is the battery is okay in it?

@Seinuh
Copy link

Seinuh commented Nov 29, 2023

@redakker last night a spontaneous disconnect connect with one device... im on .192

Are you talking about BLE device? Is the battery is okay in it?

Yes it is, just a little drop battery ok 3.3v

@redakker
Copy link
Owner Author

Seinuh

Interesting, I also checked the HA logs, strange what I found:
image

@Seinuh
Copy link

Seinuh commented Nov 29, 2023

Seinuh

Interesting, I also checked the HA logs, strange what I found: image

here it was also a short "home away" switch... with my platform (homey) a variable changes. it switched back immediately. only problem is that it opened my front door.

@Seinuh
Copy link

Seinuh commented Nov 29, 2023

@redakker Unfortunately I can't recall the moment here, but the bug is 100% in the wrong message 1>

@Seinuh
Copy link

Seinuh commented Nov 29, 2023

@redakker I have now made an adjustment that the message from the topic must be exactly present or not_present. my variable will never switch when there is a strange entry

@redakker
Copy link
Owner Author

I create a ticket for this. Maybe the message processing has bug

@Seinuh
Copy link

Seinuh commented Nov 29, 2023

I create a ticket for this. Maybe the message processing has bug

thanks, but thanks to your ha log I have now been able to build in extra security 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants