-
I have some java code that I've been running for some years now that uses mcp23017 port expander, and the raspberry pi 4 I was using stopped booting recently, so I moved the memory card to a new pi 4 and it boots ok. However when I run the code I always get this exception:
This is the second time I've had to move to a new Pi after it had failed, last time a couple of years back I did have to run the below code to get the script running again, but now it makes no difference on this new pi 4. New pi is using the same java version as the old ones (I did try updating the java version to 11 but no difference.)
I have replaced the two mcp23017 chips in case they also had failed but that also makes no difference. The new Pi is still a Pi4, but I wondered if something has changed in the new boards that means this mcp23017 functionality will no longer work? I did wonder if I needed to downgrade pi4j back to v1 for this to work, however I can't see anything that suggests the user is able to revert to an older version, the install command just gives you the latest version. Appreciate any advice here, Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
(something changed ??) I am not aware of later Pi4 encountering problems. You mentioned down grade to V1, seeing gpio.extension.mcp.MCP23017GpioProvider in the stack I assume you are now running V1.3. You mentioned java levels, this build requires java 8 (https://pi4j.com/1.3/install.html) I no longer have any Pi using V1 code so can only ask some simple questions, don't be upset at their simplicity. On this new Pi did you enable the I2C interface via raspi-config ? Does command i2cdetect -y 1 show the two mcp23017 chips as expected ? PS. You referred to installing wiringpi like a new install and moving the SDCard. I assumed you did a new install of the OS etc on the new PI4. If you only moved the SD card i do not know if any configuration values from the previous Pi might create the problems on this PI |
Beta Was this translation helpful? Give feedback.
(something changed ??) I am not aware of later Pi4 encountering problems. You mentioned down grade to V1, seeing gpio.extension.mcp.MCP23017GpioProvider in the stack I assume you are now running V1.3. You mentioned java levels, this build requires java 8 (https://pi4j.com/1.3/install.html) I no longer have any Pi using V1 code so can only ask some simple questions, don't be upset at their simplicity. On this new Pi did you enable the I2C interface via raspi-config ? Does command i2cdetect -y 1 show the two mcp23017 chips as expected ?
PS. You referred to installing wiringpi like a new install and moving the SDCard. I assumed you did a new install of the OS etc on the new PI4. If you only …