Well I am using quite different instalation because I have HA in docker on Raspian.
So I have easy access to my shell
Basically You need to access to shell command on your Raspberry.
I have no access to my system now but there is the addon on HA, which allows you to have shell access. It is called SSH & Web Terminal
There you need to type the: i2cdetect -y 1
It may be you need to install two dependences:
sudo apt-get install -y python-smbus
sudo apt-get install -y i2c-tools
Finished to reinstall but still nothing:
always
âValueError: No Hardware I2C on (scl, sda) = (3, 2)â
At this point I donât know what to do.
I express a few questions dictated by âdespairâ:
The instructions to enable I2C are clear and so I wrote them but I ask you if the words are capitalized like
â new folder called CONFIG
and those in lower case type
â new folder called modules
should they be written like this?
At the end of the instructions is this sentence:
âThe I2C devices should now be present under /dev.â
but on the hassio SD I donât have this / dev but a folder called âoverlaysâ where inside there are a lot of .dtbo files including some for the MCP27013.
I reiterate that the chips all work.
I am really considering giving up.
This is all you have to do in /boot/config.txt file
You can do it removing your SD card from RPI and put to PC/MAC and edit file simple by adding this line at the end of file.
I use the GPIO Header downloaded from the official RPI website:
Pin 03 -> GPIO02 (SDA1)
Pin 05 -> GPIO03 (SCL1)
I reloaded three times from scratch.
The GPIOs all work as both âswitchesâ and âbinary sensorsâ. I also connected a DHT22 with no problems.
sure there is something that escapes me.
Unfortunately I tried with SSH and WEB Terminal but it doesnât read and I donât know how to install the dependencies you suggested.
This is getting absurd !!!
By now I believe the I2C ports are compromised. Maybe they received a 5volt spike during testing, I donât think there is any other explanation.
MCP23017 can by supplied with 3.3V than you are fine with RPI
Are you convinced your expanders are fine?
I have connected couple of them - no problems.
Edit:
I saw couple post ago your statement:
â3 mcp is with address 20. and reset is correctly set.â
I hope you are connecting only one chip in one time? Otherwise it will not work - the same addresses.
/I am sorry I know it is obvoius/.
The chips I use work correctly with a pcb running a wemos d1 and esphome.
I only use one chip to test it and A0, A1, A2 are connected to ground. Reset pin a + vcc. I donât use INTERRUPT.
I remember that I had challenge with this as in the manual to enable I2C using USB stick it was stated that this folder has to have name â/modulesâ - the slash â/â at the beginning of the name âmodulesâ.
From Windows laptop I was not able to make it. Was trying different options as I do not have linux machine either. At the end it was possible to do it on Mac laptop (putting USB stick to Mac and renaming the folder to /modules .
Then applying this configuration via Supervisor and restarting Pi was working fine.
Hi, thanks for your help.
So are you telling me I need to call the â/ modulesâ folder?
How did you manage to write the â/â character with Windows?
@fraygon - I am sorry but now I am confused.
I am 100% sure I have use method with USB stick and I did not remove SD card from RPi.
This method is mentioned in few places (like this) but now on the official Home Assistant page is not described.
With current description (adding data directly on SD card) there seem to be no need to add slash â/â in front of the âmodulesâ folder.
What comes to my mind now is that if you trying to adjust folders using Windows computer - it might be a challenge as I do not think Windows file system can read Lynux one (used by RPi)âŚ
Here is some info: I2c not working on the Pi4
I saw the link you sent me.
Have all users using RPI4 for HA failed to activate the I2C function?
It seems strange to me: the forum would be jammed with requests.
I am perplexed. If RPI4 is truly not compatible, my entire home automation project needs to be reviewed. I created my pcbs to have states and commands from expanders.
In order not to abandon HA I would have to migrate to esphome.
I am not sure if this can help you but when I go to Supervisor, System and then under three vertical dots select Hardware, under the gpio i can see the following:
alleluia!!!
i managed to get my expander to work.
Iâm not sure what happened because I reinstalled hassio a dozen times.
After reading the various forum posts I also deleted the file in
â/config/home-assistant_v2.dbâ and after reboot the entities I had written in configuration.yalm magically appeared.
I donât really understand what happened but Iâm happy with it. I took three snapshots for safety.
And now on with the tests.
Thanks to all who have helped and endured me: you are magnificent.
home-assistant_v2.db file is the main HA database. Strange if this was the reasonâŚ
Ideally it would be good if you have any suspicion what was the problem⌠just for others.
I wish you knew what happened. The attempts were frantic and continuous. Sorry Iâm not useful.
Even now I have problems, yesterday I was driving both inputs and outputs. Today only inputs: switches donât want to know.
Also I always have to restart when it gets confused.
At least it gives a sign of life!
OK. I have also observed once a while strange behaviour. Was planning with some support to adjust the integration to more effective. I believe I will have a time to work with this in next weeks. Will see. If you have any string evidence related to root cause or problems with this chip then please share it.
BTW I am using 4 MCP23017 - after a lot of workaround solutions they are quite usable.
I have two problems which are really annoying:
During every restart of HA the state of all switches goes off - I didnât find solution for that
What is worse sometimes during restart the switches can generate strange behavior like sudden turn on/off and some of them are stuck (hang) /not all/. Which causes I canât use them until next restart. The same for sensors.
The work around is the external python script I run every HA restart to initialize MCP
During every restart of HA the state of all switches goes off - I didnât find solution for that
What is worse sometimes during restart the switches can generate strange behavior like sudden turn on/off and some of them are stuck (hang) /not all/. Which causes I canât use them until next restart. The same for sensors.
The work around is the external python script I run every HA restart to initialize MCP
He does strange things to me too. I have to reboot twice for it to be fully operational. The first reboot properly enables me the binary_sensor ports. The second reboot also enables the switches.
To remedy the bad boot states I am attempting to start the chip after reboot via a physical timer chip.
This integration is making me sweat a lot!