MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.79k stars 494 forks source link

Image | ROCK Pi S #3365

Closed lwqcz closed 4 years ago

lwqcz commented 4 years ago

Creating an image request

Formal device information

Is the SBC officially supported by the Debian installer?

If not, is a reliable 3rd party Debian image available for this SBC?

If not, are there install instructions for Debian available?

Vote for this image on FeatHub: https://feathub.com/MichaIng/DietPi/

I've got nothing ... https://feathub.com/MichaIng/DietPi/+95

My DietPi image & notes

MichaIng commented 4 years ago

@lwqcz Many thanks for your request.

Which kernel version does the Radxa image ship? Linux 4.4 like the Armbian ones? https://dl.armbian.com/rockpi-s/

Fully unattended firstrun setup is currently not possible. The update and installs on firstrun can be automated via dietpi.txt, but you need to do one manual login. Related request: #2520. However this can be done via SSH (enabled by default), as long as you configured dietpi.txt/dietpi-wifi.txt with correct network info/credentials. Serial console is an alternative as well of course, and DietPi-PREP should enable it as well for first boot automatically, if the serial/UART device is available/enabled on the board at time of running the script + the serial device needs to be ttyS0/ttyAMA0/ttySAC0 one of this naming schemes to be recognised.

lwqcz commented 4 years ago

I've tried to use dietpi.txt file to configure first boot, but the process stuck on some kernel/HW related error. Radxa is using kernel 4.14-rockpi based on https://github.com/radxa/rockchip-bsp AFAIK.

I need to finish a review regarding this HW so I'm going to skip the DietPi test on this HW for now.

Any timeframe, when ROCKPis would be supported? Can I help somehow - maybe to try some alpha builds?

BTW: Fully unattended boot including first-boot is going to be supported anytime soon?

MichaIng commented 4 years ago

@lwqcz Okay I downloaded the Radxa image and had a look inside. The kernel is 4.4 like the one from Armbian, no reason to use the Armbian image for this device. Also Armbian does not (yet?) officially support it.

I'll create an image from this and upload for testing.

lwqcz commented 4 years ago

@MichaIng yeah, you are correct - it's 4.4.143-34-rockchip-g3c9d2019dba7, sorry for wrong info.

Wifi and Bluetooth is working fine so far. I'm going to test 1wire and I2C.

Thank you for new image anyway. No need for my prepared image? I can upload it...

MichaIng commented 4 years ago

Thanks for the offer. I'll this build it myself since I did some closer review in case and update DietPi-PREP if required. Also I'll e.g the new hardware definition directly, so banner shows device name, our scripts know correct CPU etc.

MichaIng commented 4 years ago

@lwqcz Image ready for testing: https://dietpi.com/downloads/images/DietPi_ROCKPiS-ARMv8-Buster.7z Based on official Radxa Debian Buster as suggested. Let's see if this works fine so far.

lwqcz commented 4 years ago

@MichaIng I've didn't noticed your last comment here, sorry. I'll test it tonight and I'll let you know.

lwqcz commented 4 years ago

@MichaIng I've tested that image for few days and played with dietpi-config + dietpi-software + WIFI and found no issues at all. But bluetooth seems not to be working. And I've not tried I2C and 1wire as there are no overlays ready, or am I wrong?

MichaIng commented 4 years ago

Many thanks for testing and feedback.

Probably there is some Bluetooth package available in the Radxa repo. How did you test it, currently not sure if it's enabled for ROCK Pi S in dietpi-config, probably it requires to listen on a different tty.

Similar thing on I2C and 1wire. If there is no overlay, probably it can be installed or enabled via kernel module. Basically the Radxa forum/docs might also help on this.

MichaIng commented 4 years ago

For Bluetooth according to docs:

apt install rtl8723ds-firmware bluez
systemctl start bluetooth

And at least on ROCK Pi 4 1wire works by enabling the kernel modules manually: https://forum.radxa.com/t/how-to-use-w1-gpio-rockpi4/1322/6

lwqcz commented 4 years ago

BTW: If you would like to have SSH access to my RockPiS running dietpi, just ask - it is no problem 😎

MichaIng commented 4 years ago

@lwqcz Perfect with Bluetooth.

Regarding 1wire:

lwqcz commented 4 years ago

@MichaIng Maybe I am wrong, but kernel module is not enough configuration - the HW needs to be setup somehow, for instance - GPIO PIN needs to be specified and so on: Overlays are only available with Mainline ... ... and more about this topic here.

MichaIng commented 4 years ago

@lwqcz You can add module options via modprobe (/etc/modprobe.d/*.conf) as well. But it depends on kernel + modules code.

See some old PR here with the intention to add options to RPi 1-wire module: https://github.com/raspberrypi/linux/pull/457/files This has not been added, instead the device tree overlay allows it now, which generally is the modern approach of course.

Probably we can open some request at Radxa to add an official ROCK Pi S dtoverlay for 1-wire with pin options, else I guess you'd need to bump the topic on Radxa forum... btw. isn't this one working already, as it looks quite complete: https://forum.radxa.com/t/temperature-from-ds18b20/1997/33 (Ah, UART/PINs match ROCK Pi 4 only I guess?)

MichaIng commented 4 years ago

@lwqcz I added ROCK Pi S Bluetooth support to DietPi-Config: https://github.com/MichaIng/DietPi/commit/7e1feb7b1bc6713bf707616cf2f50051543fc9db

lwqcz commented 4 years ago

RockPi and RockPiS uses different SoCs - RK3399 vs 3308 - so I assume that the approach to overlays and 1w can be rather different or am I wrong?

MichaIng commented 4 years ago

@lwqcz Yes that's true, so playing around with the .dtso is only something when you can quickly plug and edit the SDcard + ext4 file system somewhere else, if it doesn't boot πŸ˜„. However a request to Radxa for adding the overlay to their APT package would be the most sustainable thing.

Btw, I just checked the Armbian packages: https://apt.armbian.com/pool/main/l/linux-4.4.207-rockpis/ I cannot find any hint or overlay for 1wire there as well πŸ€”.

lwqcz commented 4 years ago

@MichaIng :ok: I'm going to ask Radxa to provide some clue about how to solve this at least. These buses didn't work even in their own Linux image.

EDIT: Done https://forum.radxa.com/t/temperature-from-ds18b20/1997/42

MichaIng commented 4 years ago

New image uploaded based on current DietPi v6.30 with some other minor fixes: https://dietpi.com/downloads/images/DietPi_ROCKPiS-ARMv8-Buster.7z

@lwqcz We btw have overseen the second source for device tree overlays, respectively the better maintained source. The kernel package itself comes with all that is needed and more:

root@DietPi:~# ls -Al /boot/dtbs/4.4.143-47-rockchip-g495ff574976c/rockchip/overlay/
total 56
-rwxr-xr-x 1 root root 4373 Apr 21 02:39 README.rockchip-overlays
-rwxr-xr-x 1 root root 1290 Apr 21 02:39 i2c1-hym8563.dtbo
-rwxr-xr-x 1 root root  546 Apr 21 02:39 rk3308-console-on-uart0.dtbo
-rwxr-xr-x 1 root root  788 Apr 21 02:39 rk3308-console-on-uart1.dtbo
-rwxr-xr-x 1 root root  669 Apr 21 02:39 rk3308-console-on-uart2.dtbo
-rwxr-xr-x 1 root root  505 Apr 21 02:39 rk3308-i2c0.dtbo
-rwxr-xr-x 1 root root  262 Apr 21 02:39 rk3308-i2c1.dtbo
-rwxr-xr-x 1 root root  383 Apr 21 02:39 rk3308-i2c2.dtbo
-rwxr-xr-x 1 root root  504 Apr 21 02:39 rk3308-i2c3.dtbo
-rwxr-xr-x 1 root root  262 Apr 21 02:39 rk3308-pwm1.dtbo
-rwxr-xr-x 1 root root  383 Apr 21 02:39 rk3308-pwm2.dtbo
-rwxr-xr-x 1 root root  383 Apr 21 02:39 rk3308-pwm3.dtbo
-rwxr-xr-x 1 root root  881 Apr 21 02:39 rk3308-spi-spidev.dtbo
-rwxr-xr-x 1 root root  382 Apr 21 02:39 rk3308-uart0.dtbo
-rwxr-xr-x 1 root root  624 Apr 21 02:39 rk3308-uart1.dtbo
-rwxr-xr-x 1 root root  384 Apr 21 02:39 rk3308-uart2.dtbo
-rwxr-xr-x 1 root root  491 Apr 21 02:39 rk3308-w1-gpio.dtbo
-rwxr-xr-x 1 root root 1814 Apr 21 02:39 rockchip-fixup.scr
-rwxr-xr-x 1 root root 2480 Apr 21 02:39 rockpis-v11-spi2-waveshare35b-v2.dtbo
-rwxr-xr-x 1 root root 2512 Apr 21 02:39 rockpis-v11-spi2-waveshare35c.dtbo
-rwxr-xr-x 1 root root 2480 Apr 21 02:39 rockpis-v12-spi2-waveshare35b-v2.dtbo
-rwxr-xr-x 1 root root 2512 Apr 21 02:39 rockpis-v12-spi2-waveshare35c.dtbo

And there is the 1wire overlay. To enable it (as well mentioned in the readme) add rk3308-w1-gpio to the overlays line in /boot/uEnv.txt.

The rockpis-dtbo package ships the overlays in /boot/overlays which basically match the ones above but are fewer and older. And those would need to be added/enabled via /boot/hw_intfc.conf. So we have two implementations that likely conflict with each other, hence I removed the rockpis-dtbo package from the new image, which is also true for the current official Radxa image.

lwqcz commented 3 years ago

Unfortunately, 1wire still does not work. On DietPi or even on armbian-focal. I want to use different that the default PIN (to be PIN compatible with RPi) and uEnv or armbianEnv w1 PIN configs have no effect. Every time PIN number 17 is seen open for w1 module... And sorry for the delay 🀦

MichaIng commented 3 years ago

Is the device path available? ls /sys/bus/w1/ And are the kernel modules enabled: lsmod | grep w1 In case enable them manually: modprobe w1-gpio; modprobe w1-therm

Generally, since we use the official Radxa bootloader, kernel (+overlays) and repo, I think we'll have more success checking things there. Found a similar thread, although it seems the device tree overlay has not been enabled there: https://forum.radxa.com/t/enable-1wire-for-ds18b20/3521?u=michaing

lwqcz commented 3 years ago

Device path is available. Modules are enabled and loaded.

I have spent some time trying and testing. Everything is working using default GPIO PIN 17 called GPIO0_C1. I have no luck getting other PINs to work, if I configured it that way, I was getting only "noise" pretending that there is some sensor, but nothing really worked.

MichaIng commented 3 years ago

Little hint about the recent fixes and repacked image: #3925 This includes a new Linux meta package as Radxa renamed it and the new one points to a little newer kernel. If you want to test:

dietpi-backup 1
G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' /boot/dietpi.txt
dietpi-update 1

Probably it contains a fix for the noisy GPIO pin as well.

lwqcz commented 3 years ago

I've tested the stable version for more than a week and it seems to be working πŸ‘

Anyway - can you add 1wire enable/disable the option to dietpi-config or it would be better when I'll make an MR? It is rather simple:

  1. add to /boot/uEnv.txt - rk3308-w1-gpio option:
    overlays=rk3308-uart0 rk3308-w1-gpio
  2. add to /etc/modules file 1wire modules:
    w1-gpio
    w1-therm
MichaIng commented 3 years ago

Many thanks for testing πŸ‘. Jep, let's make a new issue for this. Along with 1wire, we can switches for other hardware features that are available via overlays.

Btw, adding the modules to the list is definitely required? As I know from other cases that those might be loaded automatically, when the overlay is enabled.

I'd add those via /etc/modules-load.d/dietpi-1wire.conf or similar, to make it more transparent and easier to revert.