Page 1 of 1

SDS011 not visible

Posted: 15 Mar 2020, 16:02
by haplm
Hi, I'm trying to attach SDS011 dust sensor, which should be supported. I'm running ESP_Easy_mega-20200310_test_ESP32_4M316k.bin image, which says this in the firmware section:

Build:⋄ 20104 - Mega32
System Libraries:⋄ ESP32 SDK v3.2.3-14-gd3e562907
Git Build:⋄ mega-20200310
Plugin Count:⋄ 76 [Normal] [TEST ESP32]
Build Time:⋄ Mar 10 2020 01:33:00
Binary Filename:⋄ Self built!

This is what I see when I try to add the sensor:
Screenshot 2020-03-15 at 13.13.52.png
Screenshot 2020-03-15 at 13.13.52.png (792.04 KiB) Viewed 10878 times
Can someone tell me what's going on, please? Thanks!

Re: SDS011 not visible

Posted: 15 Mar 2020, 18:32
by ThomasB

Code: Select all

Build Time:⋄ Mar 10 2020 01:33:00
Binary Filename:⋄ Self built!
It appears you are running a self built binary instead of an official [TESTING] release. So revise your build flags in the define_plugin_sets.h; Make sure P056 is included before rebuilding.

- Thomas

Re: SDS011 not visible

Posted: 15 Mar 2020, 18:53
by haplm
Yeah, that message puzzles me, because I'm not running a self-built image. I've tried, yes, but this is my last flash command which is using official release:

Code: Select all

esptool.py --chip esp32 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x10000 ~/Downloads/ESPEasy_mega-20200310/bin/ESP_Easy_mega-20200310_test_ESP32_4M316k.bin
Anyway, you have pointed me to the right direction, as define_plugin_sets.h says:

Code: Select all

/******************************************************************************\
 * Remove incompatible plugins ************************************************
\******************************************************************************/
#ifdef PLUGIN_SET_TEST_ESP32
 ....
//  #undef USES_P056   // SDS011-Dust     (doesn't work yet on ESP32)
That's really sad, is there a possibility that this can be solved somehow?

Re: SDS011 not visible

Posted: 15 Mar 2020, 19:32
by ThomasB

Code: Select all

//  #undef USES_P056   // SDS011-Dust     (doesn't work yet on ESP32)
This build exception is fully commented out. So P056 should be included in the compile.

Code: Select all

Yeah, that message puzzles me, because I'm not running a self-built image.
I suspect that the "official" build is using a different define_plugin_sets.h than what we see in the zip package. It's time turn on the Bat-Signal because this issue needs assistance from @TD-er.

- Thomas

Re: SDS011 not visible

Posted: 15 Mar 2020, 20:15
by TD-er
The marking for "self build" is displayed when the default keys are still found in the binary file.
So that sounds like the Python script we use to mark the binary after build is not working properly. (calculate CRC, store build filename, etc)

I never noticed this myself as I only flash directly from the IDE.

When moving plugins to the ESP32 build, I mainly looked at "what does compile".
In the beginning the plugins in need of serial (UART) connectivity were excluded.
Later I introduced the "ESPEasySerial" wrapper which does add support for HW serial on ESP8266/ESP32 and software serial (ESP8266) so that made it possible to have those added to the ESP32 build also.

Maybe I overlooked the SDS011???

Re: SDS011 not visible

Posted: 15 Mar 2020, 20:18
by TD-er
Ah found the cause....

In the P056 code is the following:

#ifdef ESP8266 // Needed for precompile issues.

Not sure why though, but apparently it was causing some issues with ESP32.

Re: SDS011 not visible

Posted: 15 Mar 2020, 20:28
by TD-er
If you remove the #ifdef ESP8266 (and the closing #endif) in these files:
jkSDS011.cpp
jkSDS011.h
_P056_SDS011-Dust.ino

Then you can compile it for ESP32.
I will make a PR for it. ( https://github.com/letscontrolit/ESPEasy/pull/2946 )

In the mean time, you can test if it is working: https://www.dropbox.com/s/q13cnc1tugwwa ... k.bin?dl=0

Re: SDS011 not visible

Posted: 15 Mar 2020, 21:59
by haplm
Thanks! I will check tomorrow

Re: SDS011 not visible

Posted: 15 Mar 2020, 22:52
by haplm
Actually - I've tried, and it works :-). Thank you so much for such a fast response!

Re: SDS011 not visible

Posted: 15 Mar 2020, 23:18
by TD-er
Thanks for testing.
I merged it.

Still have to 'fix' the test build for ESP8266, as it does no longer fit :(
If that's fixed, I can make a new nightly.