-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Ultrasonic Plugin _P013_HCSR04.ino broken with last commit of plugin #1518
Comments
Same here .... |
Is it so hard to fix this? I use this pretty heavily and I am stuck with an old version. |
I will revert it to an older version and do fix it later. |
Thanks for the quick reply. |
its also the same issue: #1575 |
ok, I think I found the reason: the module is killing itself. There is a temporary oject created and inserted into a std::map. But the object is deleted on leaving the PLUGIN_INIT:
so the constructor is called and after that the destructor. A copy of the struct is still in the map but pointing to an deleted NewPingESP8266 object. That caused also firmware reboots. |
That sounds plausible. |
here is the construction of a temporay object: Line 110 in 30f5c5c
I have uncommented the delete call in Line 24 in 30f5c5c
Maybe it is better to call delete in the PLUGIN_EXIT before the erase. Or not using a temporary object for inserting in the map. |
this will fix it in PLUGIN_INIT:
in PLUGIN_EXIT, the erase is called and this will call the destructor, so memory will be cleaned correctly. I've created a PR for this fix. |
Fixed by #1809 |
I use a self compiled version.
Commit dcf8e86 (Jun. 9th) broke plugin _P013_HCSR04.ino
Build with tag mega-20180606
_ works and shows valid values like
"ULTRASONIC : Distance: 167.00"
.Build with tag mega-20180611 doesn't work and shows
"ULTRASONIC : TaskNr: 2 Distance: No reading!"
.Expected behavior
The values should be retrieved again.
Actual behavior
No values are retrieved making the sensor useless.
Steps to reproduce
System configuration
Hardware: H801 (ESP 8266)
Log of working version (mega-20180606)
Log of defective version (mega-20180611)
The text was updated successfully, but these errors were encountered: