rpi_export icon indicating copy to clipboard operation
rpi_export copied to clipboard

Doesn't seem to be working on Raspberry Pi 5

Open jzucker2 opened this issue 1 year ago • 3 comments

Not quite sure what's going on yet. I set this up on both Raspberry Pi 4 and 5 instances, more than 1 of each. But all the RPi 5 boxes are failing with this. The same error.

I figured out how to turn on logging, had to modify docker-compose.yml like so:

version: "3.5"

services:
    rpi_exporter:
       container_name: rpi_exporter
       image: d3vilh/rpi_exporter-arm64:latest
       privileged: true
       ports:
           - "9110:9110/tcp"
       restart: always
       entrypoint: ["/opt/rpi_exporter", "-addr=:9110", "-debug=true"]

And I got this result:

rpi-exporter  | 2024/03/06 01:22:27 Listening on :9110
rpi-exporter  | TX:
rpi-exporter  |   00: 0x00000080
rpi-exporter  |   01: 0x00000000
rpi-exporter  |   02: 0x00000001
rpi-exporter  |   03: 0x00000004
rpi-exporter  |   04: 0x00000000
rpi-exporter  | RX:
rpi-exporter  |   00: 0x00000080
rpi-exporter  |   01: 0x80000000
rpi-exporter  |   02: 0x00000001
rpi-exporter  |   03: 0x00000004
rpi-exporter  |   04: 0x80000004
rpi-exporter  |   05: 0x653FDD96
rpi-exporter  |   06: 0x00000000
rpi-exporter  |   07: 0x00000000
rpi-exporter  |   08: 0x00000000
rpi-exporter  |   09: 0x00000000
rpi-exporter  |   10: 0x00000000
rpi-exporter  |   11: 0x00000000
rpi-exporter  |   12: 0x00000000
rpi-exporter  |   13: 0x00000000
rpi-exporter  |   14: 0x00000000
rpi-exporter  |   15: 0x00000000
rpi-exporter  | TX:
rpi-exporter  |   00: 0x00000080
rpi-exporter  |   01: 0x00000000
rpi-exporter  |   02: 0x00010001
rpi-exporter  |   03: 0x00000004
rpi-exporter  |   04: 0x00000000
rpi-exporter  | 2024/03/06 01:22:39 Error: invalid argument
rpi-exporter  | 2024/03/06 01:22:39 http: superfluous response.WriteHeader call from main.main.func1 (main.go:26)
rpi-exporter  | TX:
rpi-exporter  |   00: 0x00000080
rpi-exporter  |   01: 0x00000000
rpi-exporter  |   02: 0x00000001
rpi-exporter  |   03: 0x00000004
rpi-exporter  |   04: 0x00000000
rpi-exporter  | RX:
rpi-exporter  |   00: 0x00000080
rpi-exporter  |   01: 0x80000000
rpi-exporter  |   02: 0x00000001
rpi-exporter  |   03: 0x00000004
rpi-exporter  |   04: 0x80000004
rpi-exporter  |   05: 0x653FDD96
rpi-exporter  |   06: 0x00000000
rpi-exporter  |   07: 0x00000000
rpi-exporter  |   08: 0x00000000
rpi-exporter  |   09: 0x00000000
rpi-exporter  |   10: 0x00000000
rpi-exporter  |   11: 0x00000000
rpi-exporter  |   12: 0x00000000
rpi-exporter  |   13: 0x00000000
rpi-exporter  |   14: 0x00000000
rpi-exporter  |   15: 0x00000000
rpi-exporter  | TX:
rpi-exporter  |   00: 0x00000080
rpi-exporter  |   01: 0x00000000
rpi-exporter  |   02: 0x00010001
rpi-exporter  |   03: 0x00000004
rpi-exporter  |   04: 0x00000000
rpi-exporter  | 2024/03/06 01:22:54 Error: invalid argument
rpi-exporter  | 2024/03/06 01:22:54 http: superfluous response.WriteHeader call from main.main.func1 (main.go:26)

(It just repeats on a loop after this)

I also noticed there's no pipeline for building images here. Is that done manually? I'd be happy to help get that working too, if you're interested in helping with the RPi 5 issue.

Thanks! This is a really cool project.

jzucker2 avatar Mar 06 '24 01:03 jzucker2

The issue appears to be related to the GetBoardModel funcion, for which the error invalid argument is returned from the subsequent getUint32 function, which in turn gets it from the subsequent Do function, which in turn turns it at err := ioctl.Ioctl(m.f.Fd(), uintptr(mbIoctl), uintptr(unsafe.Pointer(&m.buf[0]))).

I didn't dive deep enough into the code and the Raspberry documentation to understand why exactly this one request throws an error, but as a temporary fix you can alter the GetBoardModel function in the following way:

// GetBoardModel returns the model number of the system board.
func (m *Mailbox) GetBoardModel() (uint32, error) {
        //return m.getUint32(TagGetBoardModel)
        return 0, nil
}

After that run go build -o . ./... and you're good to go.

@cavaliercoder maybe you know what the issue might be right away from experience? Thank you!

mrusme avatar Sep 18 '24 14:09 mrusme