Support for Waveshare NAS double deck #33

Closed
opened 2023-04-11 09:59:59 +02:00 by PeterSurda · 6 comments
Owner

Manufacturer page: https://www.waveshare.com/wiki/CM4-NAS-Double-Deck

  • can be detected (for example for purposes of uci-default) by checking if the output of lspci -d ::106 isn't empty (this detects a PCI(e) SATA controller, which then you can use with opkg install kmod-ata-ahci)
  • needs an RTC driver, looks like it's the same as the official IO board / dualeth
  • needs an additional boot option to support the LCD, but probably no extra dtbo or driver
  • a demo app for controlling the LCD, fan and detect the button presses can be downloaded at https://www.waveshare.com/w/upload/7/73/CM4-NAS-Double-Deck_Demo.zip . It's in python. It needs two pip packages. Unfortunately one of them needs to be compiled with C so I can't install it directly. It would be nice if we has a package for these two (spidev, RPi.GPIO). Alternatively, the GPIO can also be accessed using the python's gpiozero package, but then the code in the demo needs to be refactored to use this library instead. I haven't investigated this in detail but the code doesn't seem to be complex.
  • I need to auto-install a couple of extra packages, but this can be done with uci-defaults and they don't need to be built into the rootfs.
    • smartmontools
    • hdparm
    • fdisk
    • parted
    • kmod-hwmon-drivetemp
    • btrfs-progs
    • kmod-fs-btrfs
    • cryptsetup
Manufacturer page: https://www.waveshare.com/wiki/CM4-NAS-Double-Deck - [ ] can be detected (for example for purposes of uci-default) by checking if the output of `lspci -d ::106` isn't empty (this detects a PCI(e) SATA controller, which then you can use with `opkg install kmod-ata-ahci`) - [x] needs an RTC driver, looks like it's the same as the official IO board / dualeth - [ ] needs an additional boot option to support the LCD, but probably no extra dtbo or driver - [ ] a demo app for controlling the LCD, fan and detect the button presses can be downloaded at https://www.waveshare.com/w/upload/7/73/CM4-NAS-Double-Deck_Demo.zip . It's in python. It needs two pip packages. Unfortunately one of them needs to be compiled with C so I can't install it directly. It would be nice if we has a package for these two (`spidev`, `RPi.GPIO`). Alternatively, the GPIO can also be accessed using the python's `gpiozero` package, but then the code in the demo needs to be refactored to use this library instead. I haven't investigated this in detail but the code doesn't seem to be complex. - [x] I need to auto-install a couple of extra packages, but this can be done with uci-defaults and they don't need to be built into the rootfs. - [x] smartmontools - [x] hdparm - [x] fdisk - [x] parted - [x] kmod-hwmon-drivetemp - [x] btrfs-progs - [x] kmod-fs-btrfs - [x] cryptsetup
lee.miller was assigned by PeterSurda 2023-04-13 09:33:34 +02:00
Author
Owner

RTC driver is the same as "dualeth", just needs slightly different boot config as it's wired to I2C bus 1 instead of 10. The solution is described here as the board in that post appears to be wired the same way: https://forums.raspberrypi.com/viewtopic.php?t=293632#p1845336

Instead of

dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi

it should be

dtoverlay=i2c-rtc,pcf85063a

It doesn't look like there is a way to override it from within the OS once the system has booted.

Not sure how to integrate it the best, should this really be a separate image?

RTC driver is the same as "dualeth", just needs slightly different boot config as it's wired to I2C bus 1 instead of 10. The solution is described here as the board in that post appears to be wired the same way: https://forums.raspberrypi.com/viewtopic.php?t=293632#p1845336 Instead of `dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi` it should be `dtoverlay=i2c-rtc,pcf85063a` It doesn't look like there is a way to override it from within the OS once the system has booted. Not sure how to integrate it the best, should this really be a separate image?
Collaborator

RTC driver is the same as "dualeth", just needs slightly different boot config as it's wired to I2C bus 1 instead of 10. The solution is described here as the board in that post appears to be wired the same way: https://forums.raspberrypi.com/viewtopic.php?t=293632#p1845336

Instead of

dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi

it should be

dtoverlay=i2c-rtc,pcf85063a

It doesn't look like there is a way to override it from within the OS once the system has booted.

Not sure how to integrate it the best, should this really be a separate image?

Maybe edit on first boot? Your task description implies a lot of actions to do on the first boot.

> RTC driver is the same as "dualeth", just needs slightly different boot config as it's wired to I2C bus 1 instead of 10. The solution is described here as the board in that post appears to be wired the same way: https://forums.raspberrypi.com/viewtopic.php?t=293632#p1845336 > > Instead of > > `dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi` > > it should be > > `dtoverlay=i2c-rtc,pcf85063a` > > It doesn't look like there is a way to override it from within the OS once the system has booted. > > Not sure how to integrate it the best, should this really be a separate image? Maybe edit on first boot? Your task description implies a lot of actions to do on the first boot.
Author
Owner

Maybe edit on first boot?

I think this is a good backup option. However I'm starting to think a separate image may make it easier to manage the devices, assuming the build time doesn't increase. too much.

Your task description implies a lot of actions to do on the first boot.

Yes, I'm starting to think a separate image may be a better choice.

> Maybe edit on first boot? I think this is a good backup option. However I'm starting to think a separate image may make it easier to manage the devices, assuming the build time doesn't increase. too much. > Your task description implies a lot of actions to do on the first boot. Yes, I'm starting to think a separate image may be a better choice.
Author
Owner

I ticked all the checkboxes that work now. Only thing left to do is support for the LCD.

I ticked all the checkboxes that work now. Only thing left to do is support for the LCD.
Author
Owner

LCD works on ubuntu 22.04. This needs installing:

apt install python3-rpi.gpio python3-spidev
pip3 install pillow

LCD works on ubuntu 22.04. This needs installing: ``` apt install python3-rpi.gpio python3-spidev pip3 install pillow ```
Author
Owner

I'll use this with ubuntu, not needed anymore.

I'll use this with ubuntu, not needed anymore.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Sysdeploy/openwrt#33
No description provided.