Gpio not allocated with ADC hat

Hi
I am using a waveshare adc hat with an ADS1256 chip that used SPI. (Board info here)

i'm getting inconsistent results from this - sometimes the Pi says gpio not allocated and sometimes there's just a generic comms failure and sometimes it just works. there's no logical difference between each state that I can see.

the error I'd like help debugging is this one

lgpio.error: 'GPIO not allocated'

When I check gpioinfo i get the following

gpiochip0 - 58 lines:
	line   0:     "ID_SDA"       unused   input  active-high 
	line   1:     "ID_SCL"       unused   input  active-high 
	line   2:      "GPIO2"       unused   input  active-high 
	line   3:      "GPIO3"       unused   input  active-high 
	line   4:      "GPIO4"       unused   input  active-high 
	line   5:      "GPIO5"       unused   input  active-high 
	line   6:      "GPIO6"       unused   input  active-high 
	line   7:      "GPIO7"   "spi0 CS1"  output   active-low [used]
	line   8:      "GPIO8"   "spi0 CS0"  output   active-low [used]
	line   9:      "GPIO9"       unused   input  active-high 
	line  10:     "GPIO10"       unused   input  active-high 
	line  11:     "GPIO11"       unused   input  active-high 
	line  12:     "GPIO12"         "lg"   input  active-high [used pull-up]
	line  13:     "GPIO13"       unused   input  active-high 
	line  14:     "GPIO14"       unused   input  active-high 
	line  15:     "GPIO15"       unused   input  active-high 
	line  16:     "GPIO16"       unused   input  active-high 
	line  17:     "GPIO17"         "lg"  output  active-high [used bias-disabled]
	line  18:     "GPIO18"       unused  output  active-high 
	line  19:     "GPIO19"       unused   input  active-high 
	line  20:     "GPIO20"       unused   input  active-high 
	line  21:     "GPIO21"       unused   input  active-high 
	line  22:     "GPIO22"         "lg"  output  active-high [used bias-disabled]
	line  23:     "GPIO23"       unused   input  active-high 
	line  24:     "GPIO24"       unused   input  active-high 
	line  25:     "GPIO25"       unused   input  active-high 
	line  26:     "GPIO26"       unused   input  active-high 
	line  27:     "GPIO27"         "lg"  output  active-high [used bias-disabled]
	line  28: "RGMII_MDIO"       unused   input  active-high 
	line  29:  "RGMIO_MDC"       unused   input  active-high 
	line  30:       "CTS0"       unused   input  active-high 
	line  31:       "RTS0"       unused   input  active-high 
	line  32:       "TXD0"       unused   input  active-high 
	line  33:       "RXD0"       unused   input  active-high 
	line  34:    "SD1_CLK"       unused   input  active-high 
	line  35:    "SD1_CMD"       unused   input  active-high 
	line  36:  "SD1_DATA0"       unused   input  active-high 
	line  37:  "SD1_DATA1"       unused   input  active-high 
	line  38:  "SD1_DATA2"       unused   input  active-high 
	line  39:  "SD1_DATA3"       unused   input  active-high 
	line  40:  "PWM0_MISO"       unused   input  active-high 
	line  41:  "PWM1_MOSI"       unused   input  active-high 
	line  42: "STATUS_LED_G_CLK" "ACT" output active-high [used]
	line  43: "SPIFLASH_CE_N" unused input active-high 
	line  44:       "SDA0"       unused   input  active-high 
	line  45:       "SCL0"       unused   input  active-high 
	line  46: "RGMII_RXCLK" unused input active-high 
	line  47: "RGMII_RXCTL" unused input active-high 
	line  48: "RGMII_RXD0"       unused   input  active-high 
	line  49: "RGMII_RXD1"       unused   input  active-high 
	line  50: "RGMII_RXD2"       unused   input  active-high 
	line  51: "RGMII_RXD3"       unused   input  active-high 
	line  52: "RGMII_TXCLK" unused input active-high 
	line  53: "RGMII_TXCTL" unused input active-high 
	line  54: "RGMII_TXD0"       unused   input  active-high 
	line  55: "RGMII_TXD1"       unused   input  active-high 
	line  56: "RGMII_TXD2"       unused   input  active-high 
	line  57: "RGMII_TXD3"       unused   input  active-high

the pins that are used (or should be) are the standard SPI pins (GPIO9-11), a ready alert (GPIO7), a reset on gpio18 and the chip select on gpio 22..

the library (here appears to have the right pin allocations and the config python file should set the pin allocations correctly. but somehow I'm getting the "not allocated" error and cant see why not!

can anyone shed any light or recommend a better behaved ADC hat?

How are you accessing it from node red?

using the node package that I linked to (I referenced it as the library, but it is both a palette node and lib in fact)

I should add that this is on an RPi4b with bookworm installed.
spidev is installed and spi enabled in raspi-config.

When you linked and said it was a library I assumed that was a python library or similar rather than a node red node.

I think there were changes for gpio access via bookworm so it may be that the node needs updating.

You could try contacting the author for help via its gitlab page Spring City Solutions LLC / waveshare-shield-adda-11010 · GitLab

apologies - it was both the lib and the node.

i don't think it is a lib compat issue. my working guess at the moment is that another palette node that uses python is leaving a zombie process and keeping the gpio allocations. deleting other gpio related nodes from the editor resolves the "not allocated" error and now leaves me with a library error stating that there is a ID Read fail. which translates to a communication issue.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.