golemparts / rppal

A Rust library that provides access to the Raspberry Pi's GPIO, I2C, PWM, SPI and UART peripherals.
MIT License
1.24k stars 97 forks source link

Raspberry Pi5 #127

Closed ukscone closed 1 year ago

ukscone commented 1 year ago

I'm not sure if I can be of any use to you but I have a Raspberry Pi5 already in my hands as I was part of the test group for it. If you'd like any testing done on it i'm happy to help. I did try to get things running today from your github repo but i'm still a very newbie rust user so didn't get past the ''' Error: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }) ''' running the examples which i believe is an error on how i built the library rather than the library itself

golemparts commented 1 year ago

Great to hear! I wasn't expecting any problems, but it's always good to check.

It looks like rppal is ready for the Pi 5. I'll get 0.15.0 out the door within the next day or two. Thanks again for all the help!

ukscone commented 1 year ago

great. i'm looking forward to the release as then i'll be able to try porting one of my last python programs left to rust (& tauri) Pity we don't seem to have a rust equivilent of the python module luma but we can't have everything :)

golemparts commented 1 year ago

RPPAL v0.15.0 with Raspberry Pi support is now available!

Jezorko commented 2 months ago

@golemparts I'm getting the same error in most recent version :(

jezor@raspberry:~$ git clone https://github.com/golemparts/rppal.git
Cloning into 'rppal'...
remote: Enumerating objects: 5079, done.
remote: Counting objects: 100% (824/824), done.
remote: Compressing objects: 100% (120/120), done.
remote: Total 5079 (delta 746), reused 725 (delta 704), pack-reused 4255 (from 1)
Receiving objects: 100% (5079/5079), 1.51 MiB | 6.33 MiB/s, done.
Resolving deltas: 100% (3496/3496), done.

jezor@raspberry:~$ cd rppal

jezor@raspberry:~/rppal$ cargo run --example spi_25aa1024
    Updating crates.io index
     Locking 21 packages to latest compatible versions
      Adding embedded-hal v0.2.7 (latest: v1.0.0)
      Adding nb v0.1.3 (latest: v1.1.0)
   Compiling libc v0.2.158
   Compiling lazy_static v1.5.0
   Compiling rppal v0.19.0 (/home/jezor/rppal)
   Compiling simple-signal v1.1.1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.30s
     Running `target/debug/examples/spi_25aa1024`
Error: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })
golemparts commented 2 months ago

Hi @Jezorko. The error you're getting likely means your Raspberry Pi doesn't have a /dev/spidev0.0 device. Make sure you have SPI enabled and configured properly. Follow the steps found here.

If you do have a /dev/spidev0.0 and are still getting an error, please open a new issue so we can look into it further.

Jezorko commented 2 months ago

Thank you @golemparts, this worked!

jezor@raspberry:~/rppal$ cargo run --example spi_25aa1024
    Updating crates.io index
     Locking 21 packages to latest compatible versions
      Adding embedded-hal v0.2.7 (latest: v1.0.0)
      Adding nb v0.1.3 (latest: v1.1.0)
   Compiling libc v0.2.158
   Compiling lazy_static v1.5.0
   Compiling rppal v0.19.0 (/tmp/rppal)
   Compiling simple-signal v1.1.1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.58s
     Running `target/debug/examples/spi_25aa1024`
Bytes read: [0, 0, 0, 0, 0]
johansmitsnl commented 2 months ago

I found this issue after I reported mine #154

Was the HW pwn tested and where there OS settings I might have missed that where not documented?