Closed es-ka closed 1 year ago
ok why you want to set gpio used by i2c?
OK, it should not crash, but I think this is also something you really should not want to do. You don't want to mess with pins assigned to any plugin other than a switch plugin.
At least this command should check for valid pins and those are pins present in the monitoring struct.
ok why you want to set gpio used by i2c?
I don't want. i2c is set up to use D5/GPIO-14 and D6/GPIO-12.
The command GPIO,5,0
should set GPIO-5 which is called D1.
Is there any problem to use D5 and D6 for i2c instead of D1 and D2?
I did some more testing:
http://ESP_IP/control?cmd=GPIO,5,0
-> i2c crash
http://ESP_IP/control?cmd=GPIO,4,0
-> i2c crash
http://ESP_IP/control?cmd=GPIO,2,0
-> OK
http://ESP_IP/control?cmd=GPIO,0,0
-> OK
Is there any problem to use D5 and D6 for i2c instead of D1 and D2?
Finally I changed the board layout for my project to use D1 and D2 for i2c to make it work again. If it's not reliable to use other GPIOs than D1 and D1, the config should not be changeable in Web UI to avoid confusing the user, I think.
It depends on the used I2C devices whether it will work on other ports. Also on some boards the on-board I2C devices are routed to other pins.
For example a board with OLED display I bought about 2 years ago, that one has the I2C pins swapped. And on some boards (like some Sonoff and Shelly devices) these pins are already used for other purposes. So then you should at least have the option to disable I2C, but like I said not all I2C devices are that timing critical and thus may work on other pins too.
OK, thanks for clarification! I didn't notice the hidden (but detailed) documentation on GPIO pins.
This issue is no longer relevant, and can be closed.
Summarize of the problem/feature request
Immediately after receiving a HTTP GPIO command the I2C bus with attached PN532 RFID reader crashes.
Steps to reproduce
http://ESP_IP/control?cmd=GPIO,5,0
The problem does persists after powering off and on. Without sending HTTP commands the connection to PN532 is stable and RFID tags are read as expected.
System configuration
Hardware: WeMos D1 mini ESP Easy version: ESP_Easy_mega-20190803_test_core_252_ESP8266_4M.bin
The PN532 is the only device connected to the WeMos, wires are about 15 centimeters long.
ESP Easy settings/screenshots:
Rules
Log data
Web Log Level: debug dev unfortunetly no messages about incomming HTTP request...