Open dakowals opened 2 months ago
The latest Raspberry Pi OS kernel changed how GPIO works. I reverted back to 6.1.x kernel and it's working again.
How do I revert back from 6.6.28 to 6.1.x?
Here's what I found: https://forums.raspberrypi.com/viewtopic.php?t=365677
And the commands that I used to get back to 6.1.x:
sudo rpi-update 5fc4f643d2e9c5aa972828705a902d184527ae3f
sudo reboot
Here's what I found: https://forums.raspberrypi.com/viewtopic.php?t=365677
And the commands that I used to get back to 6.1.x:
sudo rpi-update 5fc4f643d2e9c5aa972828705a902d184527ae3f sudo reboot
You Rock.... this fixed it!
To get around this on Bookworm, see https://github.com/rstrouse/relayEquipmentManager/pull/65. Specifically, changes to boards/Constants.ts and pinouts/raspi-4b-bookworm.json. After you have these, update your controllerConfig.json with
"controllerType": "raspi-4b-bookworm"
You might need to remove everything below in "pins": [...] to get it to start again.
As mentioned in #65, the 6.6 Kernel re-mapped the GPIO pins - effectively adding 512 to each GPIO value - gpio-0 (ID_SDA) got remapped to gpio-512 (ID_SDA), gpio-1 to gpio-513 etc...
I ended up editing pinouts/raspi.json and remapping the gpioIds in the config file:
{ "id": 3, "name": "BCM 2", "type": "gpio", "gpioId": 514 }, { "id": 4, "name": "5v Power", "type": "power5" }, { "id": 5, "name": "BCM 3", "type": "gpio", "gpioId": 515 }, <....>
To get around this on Bookworm, see #65. Specifically, changes to boards/Constants.ts and pinouts/raspi-4b-bookworm.json. After you have these, update your controllerConfig.json with
"controllerType": "raspi-4b-bookworm"
You might need to remove everything below in "pins": [...] to get it to start again. I updated my boards/Constants.ts and added pinouts/raspi-4b-bookworm.json, and then updated my controllerConfig.json to { "controllerType": "raspi-4b-bookworm", "gpio": { "pins": [] }, "spi0": { "isActive": false, "busNumber": 0, "channels": [] } }
And I still get the same error. Error: EINVAL: invalid argument, write 0|REM | at Object.writeSync (node:fs:929:3) 0|REM | at Object.writeFileSync (node:fs:2328:26) 0|REM | at exportGpio (/home/Admin/relayEquipmentManager/node_modules/onoff/onoff.js:18:8) 0|REM | at new Gpio (/home/Admin/relayEquipmentManager/node_modules/onoff/onoff.js:172:36) 0|REM | at GpioController.initPin (/home/Admin/relayEquipmentManager/gpio/Gpio-Controller.ts:103:36) 0|REM | at GpioController.initPins (/home/Admin/relayEquipmentManager/gpio/Gpio-Controller.ts:142:28) 0|REM | at GpioController.init (/home/Admin/relayEquipmentManager/gpio/Gpio-Controller.ts:22:14) 0|REM | at /home/Admin/relayEquipmentManager/app.ts:22:38 0|REM | at processTicksAndRejections (node:internal/process/task_queues:95:5)
What am I missing?
To get around this on Bookworm, see #65. Specifically, changes to boards/Constants.ts and pinouts/raspi-4b-bookworm.json. After you have these, update your controllerConfig.json with
"controllerType": "raspi-4b-bookworm"
You might need to remove everything below in "pins": [...] to get it to start again. I updated my boards/Constants.ts and added pinouts/raspi-4b-bookworm.json, and then updated my controllerConfig.json to { "controllerType": "raspi-4b-bookworm", "gpio": { "pins": [] }, "spi0": { "isActive": false, "busNumber": 0, "channels": [] } }And I still get the same error. Error: EINVAL: invalid argument, write 0|REM | at Object.writeSync (node:fs:929:3) 0|REM | at Object.writeFileSync (node:fs:2328:26) 0|REM | at exportGpio (/home/Admin/relayEquipmentManager/node_modules/onoff/onoff.js:18:8) 0|REM | at new Gpio (/home/Admin/relayEquipmentManager/node_modules/onoff/onoff.js:172:36) 0|REM | at GpioController.initPin (/home/Admin/relayEquipmentManager/gpio/Gpio-Controller.ts:103:36) 0|REM | at GpioController.initPins (/home/Admin/relayEquipmentManager/gpio/Gpio-Controller.ts:142:28) 0|REM | at GpioController.init (/home/Admin/relayEquipmentManager/gpio/Gpio-Controller.ts:22:14) 0|REM | at /home/Admin/relayEquipmentManager/app.ts:22:38 0|REM | at processTicksAndRejections (node:internal/process/task_queues:95:5)
What am I missing?
I'm an idiot, updated the wrong config file. up and working thank you!
Unfortunately, the rpi foundation really messed this up. There is not currently any libgpiod capabilities for node or python projects that include interrupt processing. I could write my own lib but why... don't they know that a huge amount of software for Raspberry Pi interacts with the GPIO? They really are making Espressif look like the adults in the room. They even assigned a different chip id to the pi5. Not a problem but they left no clear way of determining what hardware you are on that I can find anywhere.
The fix described here is simply including the chip id in the pin id which will work fine until a Pi5 rolls around. </end rant>
If we leave the onoff library as is, I think we just need a new hardware .json file for each device type -- I assume all of the Pi5 will run Bookworm and not previous builds?
Up and running just fine. Updated my pi yesterday. Today I notice REM is not running. This is the error I get:
I am not proficient in programming. Any help would be appreciated. I have update REM and installed. PC and dashPanel still running