-
Dear all, I do have an ESP32 with Tasmota flashed (with MCP23017 support for Mode 1 and 2)
and three connected MCP23017 in a chain which are fine from HW perspective and addresses (0x21; 22; and 23) are also recognized by Tasmota
No more I2C devices are used (just the three MCP ones), with an Atmel uC I could access them with same physical setup.
and stored in on the file system.
It seems to detect the mcp23x.dat file, but switching to Mode 1 anyways. And the MCP on 0x22 and 0x23 are ignored, instead 0x23 is detected as an BH1750 sensor. What am I doing wrong? How could I get the two other MCP working? |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 12 replies
-
maybe just a part of the interessting solution: what´s about command "I2Cdriver" to find aditional blocking I2C-Driver for I²C Adresses 0x21,0x22,0x23 in file "my_user_config.h" One the BH1750 is found as driver Nr.11 registrated and use I²C Adress 0x23 and 0x5C and can be deactivated by command "I2Cdriver11 0" An additional way is not to allow unwanted drivers in your build. and now one more compile and install. Oberfränkische Grüße |
Beta Was this translation helpful? Give feedback.
-
While I've not used those chips, to me it looks like your config file is broken, not being valid JSON - looks more like you expected the JSONL format with multiple lines. AFAIK, a single template can cross multiple chips. For readability do wrap text blocks in triple backtick, instead of single backtick. |
Beta Was this translation helpful? Give feedback.
-
Hi, I did too much and disabled all, now the I2C seems to be broken...
Went back to just eliminating only the 11, but still the same. Could neither scan the bus, nor get any I2C communication (and no, no HW was changed in the meantime). Need to cehck it tomorrow more deeply.
I took the examples from here https://tasmota.github.io/docs/MCP230xx/#mode-2 therefore I just for every MCP one line.
And I used the code tag the HMI here is offereing, now changing manually to three and looking much better. Thanks (even if it's now completely broken...) |
Beta Was this translation helpful? Give feedback.
-
OK, I2C is up an running again. After disabeling modules via I2CDriver, the device config is changed: Tasmota has re-assigned GPIO21 and 22 to none, hence SCL and SDA were not assigned any longer. Assigned them back and I2C is working again:
However: still no MCP is recognized, nothing is working on I2C (beside address scanning)
If I re-enable the 11, I do get again back the BH1750. But still no MCP |
Beta Was this translation helpful? Give feedback.
-
You made it: yes, its the module 77 for Mode 2 and hence needs to be activated. Great one, wasn't checking that. Thanks a lot for the quick help!!!
|
Beta Was this translation helpful? Give feedback.
-
Why disabling all I2Cdrivers ? take a look to file "my_user_config.h" to find blocking I²C drivers with I²C Adress 0x21,0x22,0x23 This is the Driverlist I allow. Oberfränkische Grüße |
Beta Was this translation helpful? Give feedback.
-
As I need to make custom build anyways for having the MCP inside, for me it's good to not have dead code inside. It's just never used and could cause only trouble. And no, on this device no other sensors or actors will be used, in fact I only need a I2C MQTT bridge. Even the ESP32 IOs are not needed (as I do need 5V tolerant inputs = one level shifter for the I2C instead of multiple for each ESP GPIOs) |
Beta Was this translation helpful? Give feedback.
-
Hello |
Beta Was this translation helpful? Give feedback.
-
With these defines
will get these logs:
I'm missing the seconds MCP23xxx with address 0x27, any idea? Thanks |
Beta Was this translation helpful? Give feedback.
-
With these defines
I get these logs
How have the defines to be to get access to the second MCP23xxx with address 0x27? Thanks again |
Beta Was this translation helpful? Give feedback.
-
I'm using these defines
it seems, that the loop at doesn't support two devices with 0x26 and 0x27maybe it shall be (mcp23xxx_address <= MCP23XXX_ADDR_END)
|
Beta Was this translation helpful? Give feedback.
-
There is a device that uses the two addresses 0x26 and 0x27. With these defines both MCP23017 are found.
Is there a way to override these defines using the user_config_override.h script? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Changed
and
but 0x27 will not be found. Any idea? Thanks! |
Beta Was this translation helpful? Give feedback.
Maybe disable I2CDriver 22, as mode 2 is I2CDriver 77 instead. When that driver initializes, you should see a MCP: message if you have log level enabled for debug.