I2C expander pca9685 driver install?

GarrickG

New member
After the expander is connected the app starts a driver install that gets stuck in a loop.
loop.png
The only way I've found out of the loop is to change the value of 'new' to 0 in phpmyadmin.
i2cdevices.png
Afterwards, it seems to have created a driver but I'm not able to find those pins?
drivers.png
I noticed that the old ac powerbar pins are still listed in the 'pins available'. Can I delete those lines?
pinsavailable.png
Is there a fix for this? Thanks
 
Last edited:
Today I triple checked I2C wires/connections and tried a fresh install on a different sd card. During the setup process, the same thing happened only going to black screen... Maybe I got a bad board..?
 
After the expander is connected the app starts a driver install that gets stuck in a loop.
View attachment 804
The only way I've found out of the loop is to change the value of 'new' to 0 in phpmyadmin.
View attachment 803
Afterwards, it seems to have created a driver but I'm not able to find those pins?
View attachment 806
I noticed that the old ac powerbar pins are still listed in the 'pins available'. Can I delete those lines?
View attachment 805
Is there a fix for this? Thanks
Hi Garrick, sorry this is a bug in the app, here's what you need to do to fix it. Start by deleting those records that were added in your pictures.

Try the following steps in the database.
  1. Log into the database and click the robotank database on the left side of the page to expand it.
  2. Click on the drivers table, you should see 3 records. Click the copy link on the 3rd record PCA9685. Change the driverName to PCA9685 External and save the new record.
  3. Next, click on the i2cDevices table on the left side of the page, you should have 6 records in the list. Look at the decAddress column and verify the 6 records have 112, 64, 104, 87, 99 and the last should be 98 for the external pH circuit. If you have a 7th record with decAddress 80 that'll be the external pca9685. If you do have this delete that record.
  4. Look at the 2nd record, this is the onboard pca9685, click the copy link to create a copy. Change the i2cDriverID field using the dropdown to PCA9685 External that you just created. Also change the decAddress to match the external pca9685. It should be 80. Leave all the other fields as is and save the new record.
  5. Next, go to the pinsAvailable table, you should have 39 records total. Here you need to add 16 records for each of the outputs on the pca9685. Here's the steps to do that.

  1. Along the top of the page click the Insert tab.
  2. A form will open showing all the columns for the table. By default it will allow you to add 2 new records. If you scroll to the bottom of the page you'll see Continue insertion with rows change it to 16 and the page will update with 16 blank records.
  3. Scroll back to the top of the page and fill out each record with the following details. Below is all the fields for each record, set them accordingly.
  • pinID (leave blank for all records)
  • driverID (select the PCA9685 External driver from the dropdown that you added previously for all records.
  • gpio (the first record will be 0, the 2nd record 1, 3rd record 2 etc until you get to 15)
  • assigned (leave as default 0 for all records)
  • pinTypeID (for now set each record as AC Outlet from the drop down, you can change this later in the interface on the configure ports page)
  • name (this is the custom name you give it on the configure ports page, you can type anything here and change it later in the interface
  • portName (this can only be changed in the database, it's so you always know what port it is. Name this something like PCA9685 GPIO 0 and change the 0 to 1 for 2nd record etc until you get to 15)
  • iconID (set this to 0 for all records)
  • invert (leave this at the default 0 for all records)
  • manual (leave this at the default 0 for all records)
  • manualStatus (leave this at the default 0 for all records)
After you complete this reload the webpage in the browser and go to configure ports page and click the Advanced tab at the top of the page. You should have 3 sections, top section will say Raspberry Pi, the 2nd section will say PCA9685 and the bottom section should say PCA9685 External. It'll have 16 outputs that you just added to the pinsAvailable table. If this happens unplug power from the controller, connect the pca9685 extension and power back up and hopefully everything work. You can configure the ports on the Advanced tab of the Configure Ports page after.

Let me know how it goes.
 
Still having trouble... I'm able to set everything up in the database, but when I try to make changes in the app, it won't save to the database. When I plug the expander into the I2C bus it goes offline. Maybe it's rebooting? I can't tell. It seems like the app isn't able to communicate with the database for these pins, but the database is able to update the app..? If I plug in the expander with the robo-tank controller running, I am able to access the app, but when I try to change the status of those pins it goes offline for a minute or so. What's my next step? Thanks
 
Still having trouble... I'm able to set everything up in the database, but when I try to make changes in the app, it won't save to the database. When I plug the expander into the I2C bus it goes offline. Maybe it's rebooting? I can't tell. It seems like the app isn't able to communicate with the database for these pins, but the database is able to update the app..? If I plug in the expander with the robo-tank controller running, I am able to access the app, but when I try to change the status of those pins it goes offline for a minute or so. What's my next step? Thanks
I wonder if something went wrong adding those files, I know this works in the app as someone recently ran those instructions I posted and it worked for him. You might have to try adding it again. If you delete the record in devices table it should remove the records in i2cdevices and pinsAvailable table.

It looks like the pca9685 is working as you got that popup when you installed it, when the controller powers up it scans the i2c bus for any new devices and it did add it to the i2cdevices table with address 80. Maybe run i2cdetect -y 1 in the SSH terminal window to verify, you should see address 50 in the list which is the hex address, that equals 80 in decimal form which goes in the database.
 
Ahoj Rob, stále mám problém, vrátil som sa na verziu 5.3 a keď sa pokúšam pripojiť expandér k ovládaču, zobrazí sa chybové hlásenie: nepodarilo sa vytvoriť vzdialenú chybu I/O. Expandér vidím na adrese 50. Túto adresu zadávam aj do ovládača. Zabudol som, ako si mi to povedal minule.
 
I wonder if something went wrong adding those files, I know this works in the app as someone recently ran those instructions I posted and it worked for him. You might have to try adding it again. If you delete the record in devices table it should remove the records in i2cdevices and pinsAvailable table.

It looks like the pca9685 is working as you got that popup when you installed it, when the controller powers up it scans the i2c bus for any new devices and it did add it to the i2cdevices table with address 80. Maybe run i2cdetect -y 1 in the SSH terminal window to verify, you should see address 50 in the list which is the hex address, that equals 80 in decimal form which goes in the database.
I don't see that address when I reboot the controller.
i2cdetect.png
Also, it seems to switch the enable to 0 when rebooted...

i2cdevices b.png
I've redone the process a few times now to the same effect... When trying to configure these pins in the app it won't save changes. When the expander is plugged in it acts up. I've tried different ribbon cable and rechecked the connections. The pca9685 expander led does light up green when plugged in. When the 'new' is enabled it does go to the setup routine (and loops). I'll email my database to you...
 
Hi Rob, I still have the problem, I went back to version 5.3 and when I try to connect the expander to the controller, I get an error message: failed to create remote I/O error. I see the expander at address 50. I also enter this address in the controller. I forgot what you told me last time.
Hi Loksik, it's looking like you installed the bookworm version of the OS, reef-pi also isn't compatible with it, you need to install the Bullseye OS. That should solve it. You also want to use 80 as the address.
 
I don't see that address when I reboot the controller.
View attachment 811
Also, it seems to switch the enable to 0 when rebooted...

View attachment 812
I've redone the process a few times now to the same effect... When trying to configure these pins in the app it won't save changes. When the expander is plugged in it acts up. I've tried different ribbon cable and rechecked the connections. The pca9685 expander led does light up green when plugged in. When the 'new' is enabled it does go to the setup routine (and loops). I'll email my database to you...
Hmm, it's looking like it's a problem with the pca9685, when did you get that from me?

The database looks ok, one more thing to try. Delete all those records in the drivers, i2cDevices and pinsAvailable table related to the expansion. Then reboot the controller and verify everything is working as it should. Then unplug power from controller and connect the pca9685 again and power up. If it's seen on the I2C bus you'll get that wizard. If you do get that wizard run through it then go to the database base and set "new" to 0 in the i2cDevices table. Then reboot the controller again and run the i2cdetect command to see if it still appears in the list.
 
I deleted the driver (Accidentally deleted the dummy driver too. Will that matter?) and the associated pinsavailable. Rebooted and things looked okay. I unplugged the controller and plugged in the pca9685... After plugging it back in the wizard does not appear and the i2cdetect table doesn't include 50...
2025-02-10.png
Hmm... I've also lost my ph probe... Was this the dummy driver I deleted or maybe I've damaged the I2C buss with all the plugging and unplugging? I tried the restore database option in the app, but it didn't seem to work. The dummy driver is still missing...

I just got the pca9685 last month... Order Id # 1967
 
I deleted the driver (Accidentally deleted the dummy driver too. Will that matter?) and the associated pinsavailable. Rebooted and things looked okay. I unplugged the controller and plugged in the pca9685... After plugging it back in the wizard does not appear and the i2cdetect table doesn't include 50...
View attachment 816
Hmm... I've also lost my ph probe... Was this the dummy driver I deleted or maybe I've damaged the I2C buss with all the plugging and unplugging? I tried the restore database option in the app, but it didn't seem to work. The dummy driver is still missing...

I just got the pca9685 last month... Order Id # 1967
Did the pH appear again (63), I see it in the picture. The UU is the RTC and the 40/70 is the onboard pca9685.

It shouldn't be possible to damage the I2C bus by continually connecting things, it is best to power off the controller when connecting things to the I2C.

I think you can get by without the dummy driver but it is referenced in the i2cDevices table and you will need it for next update. You can add it back, click "insert" along the top and set driverID to 1.

If you deleted the expansion driver you will definitely need it but that shouldn't be causing the I2C address not to appear in i2cdetect.

I'm confused, I've had a lot of issues with these lately, basically same as you are experiencing. I was hoping it was possibly from an older batch that maybe had a problem but this one should work. I sent a couple others out recently and they work ok. I don't understand, it's the exact circuit I have on the controller and I've never had an issue with it. Another strange thing, the first time you connected it it was definitely active on the I2C bus otherwise you would have never gotten that setup wizard. At that time if you ran i2cdetect you would have seen 50.

For whatever it's worth, if you solder add some to a few of those jumper pads along the left side. Those change the I2C address. Then run i2cdetect again to see if it's still missing.

Sorry this is causing so much grief for you, if we can't solve it I will send you another one however I don't have any right now, it would take about 10 days to get some.
 
Back
Top