ricki-z / SDS011

Arduino library for SDS011 dust sensor
GNU General Public License v3.0
81 stars 54 forks source link

Board manager ver. 2.6.1 for ESP8266 breaks library. #26

Open bill-orange opened 4 years ago

bill-orange commented 4 years ago

A new board manager for the ESP 8266 was released. Among other changes the syntax for Software serial was changed. For the library to compile change the following in SDS011.cpp.

is around line 105: SoftwareSerial *softSerial = new SoftwareSerial(_pin_rx, _pin_tx);

change to:
SoftwareSerial *softSerial = new SoftwareSerial();

is around line 107: softSerial->begin(9600); change to: softSerial->begin(9600,SWSERIAL_8N1,_pin_rx, _pin_tx,false,32);

is around line 126: serial->begin(9600);

change to: serial->begin(9600,SWSERIAL_8N1,_pin_rx, _pin_tx,false,32);

Let me know if this works for you too.

Plo-Koon commented 4 years ago

Your solution does not work for me and I have tried other changes but it is still not working. However, if I use the library from Arduino library manager instead of this one in GitHub, there is no need of changes. It compiles successfully without errors. I'm using Arduino IDE 1.8.11 with NodeMCU v3 ESP8266.

bill-orange commented 4 years ago

I notice that since my post, SoftwareSerial has been revised at least couple of more times. The recent changes probably affected my fix.