NanoPi NEO4 installation problem

this is the first time I tried to install DietPi.
I’m using a NanoPi NEO4 with a 8GB SD-Card.
After downloading, unpacking and writing the image to SD-Card the NEO4 starts as expected.
The NEO4 gets the correct IP from my DHCP server (IP is assigned to MAC address), and I can connect via ssh to start inital configuration.
No errors so far.
After about 30 minutes of updating I get this screen.

NanoPi M4/T4/NEO4 (aarch64) | IP:                                                                                                               
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ DietPi-Set_software β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    
                   β”‚                                                                                                                      β”‚                    
                   β”‚ Do you want to adjust the default global software password for DietPi-Software installations? We especially          β”‚                    
                   β”‚ recommend to change the default password "dietpi". This does not affect any existing software passwords.             β”‚                    
                   β”‚                                                                                                                      β”‚                    
                   β”‚ NB: This password will be saved and encrypted within "/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin" to be useable  β”‚                    
                   β”‚ by DietPi scripts for e.g. web application and database logins. We highly recommend to apply individual passwords    β”‚                    
                   β”‚ for each software title after first login.                                                                           β”‚                    
                   β”‚                                                                                                                      β”‚                    
                   β”‚                                   <Ok>                                       
Connection to closed by remote host.         
Connection to closed.                                                                                                   

While reading this text connection is dropped :frowning:
And afterwards the connection can’t be reestablished. Regardless of just waiting about one hour, or after reboot.

I have verified the whole procedure 3 times. But everytime the same problem.
I also checked if there are any problems with the SD-Card…

dietpi-firstboot.log.txt (6,1 KB)
dietpi-firstrun-setup.log.txt (4,6 KB)
dietpi-ramlog.log.txt (215 Bytes)
dietpi-update.log.txt (53,1 KB)
fs_partition_resize.log.txt (921 Bytes)

I did an additional test. This time I’m using a HDMI monitor and a USB keyboard and Beta 8.11.
This way I was able to do a complete setup.

I guess that there is a problem with the headless setup via ssh…

both setups are identical. There is no difference if you do it via SSH or connected via keyboard.

Best would be to have the device connect to screen and keyboard while trying to run the setup via SSH. Once the setup stop on SSH, login locally and check SSH server logs.

Both setups (console / ssh) are in fact not identical !

When doing a setup via ssh (without monitor and keyboard), the setup stops as described in my first post.
There is no network connection anymore!
Even if I disconnect power and connect monitor and keyboard and power on again after the network stops working, I get a blinking cursor only, no network, nothing usable …
β†’ looks like a corrupted incomplete configuration.

When doing s setup via console the system reboots at the same point, but after reboot the setup contuinues and I’m able to finish the configuration…

They are identical. Have a look to our source code. There is just a single first boot setup.

However, try to follow my request as stated above and go with the SSH setup and once failed, connect via local console to perform further checks.

If you SSH into it after the finished setup, is the SSH connection stable or does it also disconnect randomly?

After complete setup ssh was stable. No temporary disconnects.
Since I never wrote it… I’m using the ethernet connection only.

After broken setup via ssh.: There is no network. I can’t even ping the device.
Both LED’s at the RJ45 connector are flickering from time to time.
But my router did not report any dhcp requests…

can you check logs locally once connection is failing?


But how to do that ???
The only thing I get is a blinking cursor !
No command line !
No network β†’ no ssh

Hmm, you could connect keyboard and monitor again, login without continueing the setup and use dmesg -w (to follow the recent dmesg output), and then SSH into it from another machine, finish the setup until the connection drops and have a look onto the monitor for the dmesg output.
With journalctl you had to use journalctl -f to follow the recent output.

It would be interesting for debugging, but I can understand if you don’t want to put so much effort into it, since it’s working when you finish the setup locally, instead of using SSH.

@Joulinar: Do you think this could be tested with my spare M4v2 (hardware is a bit different)?
Otherwise I have to shutdown my NEO4 doing my house automation for a while :frowning:

My NEO4 runs and reboots perfect since many months (and has an actual DietPi system running), but the firstboot was executed about 0,5-1 year ago. So a short test with an actual image would be my investigation step.

I have a suspicion …

To verify that the installation via console works as expected I tried to install DietPi again. And it failed.
But why?
Because i had 3 sd cards here, i checked them again with h2testw and all cards are ok. At the first glance all the cards from manufacturer Intenso are identical. But thats not true. One of the cards a little bit bigger in size. Don’t know if there are more internal differences.

After fiddeling around I found that all cards are booting with the Neo4 image as axpected. But only the bigger card is booting after reboot request after β€œset survey”.

So I resized the booting one to only 4GB. And the NEO4 still boots. Fine.

But when I clone the booting card to one of the other cards, I found that the clones are not booting.

To verify my clonig procedure is ok. I tried clonig to a bigger Sandisk card. And …
The system boots as expected.

Looks like there is a incompatibility (timing problem ?) with some SD-cards :frowning:

I will do some more tests tomorrow.

Could be, especially on ridiculously cheap SD cards something like this might happen. But still strange that it did not happen if you complete the install via local console, right?

Since I’m in the flow from yesterday evening, I’ll generate new NEO4 images with our build script/pipeline :slightly_smiling_face:.

Images ready for testing: Index of /downloads/images/testing
Probably this solves the mystery with first run setup via SSH as well.

So, I now know where the boot process gets stuck.
The cause is the interaction of the SD-Card U-Boot and of course hardware.

U-Boot message

Card did not respond to voltage select

This results in a missing SD-Card and because of that U-Boot tries to load an image via tftpd.

The β€œtesting” NEO4 image works without problems on known good SD-Cards in 2 scenarios.

  1. via console / monitor.
  2. headless via ssh. (Monitor and keyboad disconnected)

I had run bot tests with β€œmaster” (8.10.) and β€œbeta” (8.11.).
Connection was made via cable. WiFi not tested.

I also tested the 2 problem SD-Cards with the NEO4 testing image.
One card works without problems.
The other card stucks while first boot. Thats ok for me, since I get a clearly message on console and the inital system did not boot.