ESPPWMFanControl icon indicating copy to clipboard operation
ESPPWMFanControl copied to clipboard

not working if esp8266 platform lib is >=3.0

Open burnbabyburn opened this issue 3 years ago • 2 comments

Hey there, thanks for sharing your work. I liked your solution very well and connected an 12V AUB0912VH Fan and flashed an esp8266

Sadly it doesn't matter what speed i set in the webinterface. The fan keeps spinning as if it's always set to 0% speed. I didn't connect a NTC thermistor though, as it should just matter when using temp control. To double check i also enabled simulation_mode temporary, which didn't help either.

I checked the wiring by inserting this loop in the setup() (before analogWriteRange and analogWriteFreq are set) pinMode(0, OUTPUT); for (int i = 5; i <= 255; i+=5) { analogWrite(0, i); delay(1000); Serial.println(i); } which controls the fan just fine. I tried half the day to find the error in the code, but i don't get it. Maybe you read this and are willing to help :) TIA

€ i just flashed your binary(ESPPWMFanControl.1.0beta2.d1_mini.bin), which works fine. As i want to add support for AM2320, it would be nice if we could compile. I try downgrading the other libs now.

SOLUTION: ESP Board/platform library <3.0.0 (16.5.2021) did the trick for me

burnbabyburn avatar Oct 15 '21 19:10 burnbabyburn

Hi, thanks for your comments. I haven't been working on this project in the last months and, obviously and unfortunately, it all doesn't quite work out anymore.

However, I have already been thinking that the best way to cope with all these issues would be to do a complete rewrite. Anyway, as I have to admit, the code isn't written very well, there are lots of things to improve and just have to be implemented better to also be able to easily expand the functionalities such as implementing new sensors and stuff. This project started as one of those "quick and dirty sunday spaghetti code projects" to just get things running and then I decided, regardless of the code quality, it would be nice to publish and share it with others. Yet, as of today, this doesn't help much.

Nonetheless, I'm glad it is working now for you with the older libs! I hope you will be patient, as I really can't tell when I will rework it. I can assure you that I really don't want to let this project die, yet I don't want to upload crap but provide a great solution - finally. :)

faeibson avatar Oct 16 '21 13:10 faeibson

Hi Fabian,

thanks for your response! I think the main problem is a breaking change with the newer platform library for ESP8266. Since 3.0 they ship an i2c lib now, so we could replace brzo_i2c. Don't be so hard with yourself. IMHO the code quality is pretty fine (and much better than i would do it on an evening), in my case the arduino IDE with it's limited capabilities is more of a problem to debug errors. Not writing C++ in like 10 years didn't help much too ^^ It's also rather simple to add new sensors, as all temp readings are returned by one function. I am very glad i didn't have to deal with all the webserver, storage and wifi stuff !!!

Hopefully i can throw some time at it and provide a pull request to contribute. Thanks again for sharing your work. Looking forward for future commits 👍

burnbabyburn avatar Oct 17 '21 02:10 burnbabyburn