stefanbode / Sonoff-Tasmota

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE, enhanced with I2C options
GNU General Public License v3.0
127 stars 41 forks source link

Can't get pcf_8574A to be recognized #154

Closed MadDoct closed 5 years ago

MadDoct commented 5 years ago

<<<<<<< HEAD

IMPORTANT NOTICE If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED

8f585b7f5354b19aff4bc6d1f238df4588d5693f Describe the bug A clear and concise description of what the bug is.

Also, make sure these boxes are checked [x] before submitting your issue - Thank you!

To Reproduce Steps to reproduce the behavior: Trying to use pcf8574 that uses the address 0x27

Expected behavior A clear and concise description of what you expected to happen. Recognize the pcf and configure it

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. I changed the address in the code to 0x20 (which I know means that it will test from 0x20 to 0x27), to no avail. I2CScan recognized an I2C device conected at address 0x27...

(Please, remember to close the issue when the problem has been addressed)

stefanbode commented 5 years ago

When the device boots there are some messages about the pcf search and the results. Please also check if the option is enabled in the compiler. Not sure about the current default.

MadDoct commented 5 years ago

I don't have it with me right now, but I'm pretty sure there weren't any messages besides the usual tasmota startup messages... It isn't enabled by default but I added the #define to the config... Could it be some kind of conflict with display support? LCD displays use, very often, the pcf and those addresses might be reserved...?

stefanbode commented 5 years ago

If you take a look in the pcf.ino file you can see some messages during bus testing and pcf probing. If correctly enabled you must see at least messages like pcf.... found = 0. if you see nothing the define does not work for whatever reason.

MadDoct commented 5 years ago

There are no messages... Do I need anything else besides adding #define USE_PCF8574 in my_user_config.h? Strange Could you test, please?

MadDoct commented 5 years ago

Just found out the problem, from reading the code...

Why did you make enabling mqtt mandatory? That should be, at least, documented... ;)

stefanbode commented 5 years ago

Hm, good question. Let me check if there are requirements. If not I will change the code to remove this dependency

stefanbode commented 5 years ago

I double check, but where do you see the MQTT dependency? Required is:

ifdef USE_I2C

ifdef USE_PCF8574

and for sure for configuation, it makes sense that #ifdef USE_WEBSERVER should also be defined.

Oh, sorry. I see it. This is really nonsense.

MadDoct commented 5 years ago

Glad I could help. It took me a while to figure it out... That was a strange "mistake", but happens to everybody... ;)

Anyway, thanks for the AMAZING work you did, providing support for this expander...