NanoPi R4S-RK3399 is a great new OpenWrt device

@faser, I did search and try a lot of them. The one you linked would not recognize the SD card. Sound like clonezilla or dd is the ticket. Thanks @anon_openwrt and @faser.

I compiled a build today from master that includes the SD card reboot fix, 2.2/1.8ghz overclock, and the following packages:

  • curl
  • nano
  • block-mount
  • shadow-utils
  • dnscrypt-proxy2
  • luci-app-adblock
  • luci-app-banip
  • luci-app-ddns
  • luci-app-dockerman
  • luci-app-minidlna
  • luci-app-sqm
  • luci-app-wireguard
  • docker-compose
  • dockerd with ext4 support
  • uxc
  • kmod-fs-ext4
  • kmod-fs-ksmbd
  • 512MB root
  • version string r18468-4a2cca7824

(4GB model only) squashfs:
https://drive.google.com/file/d/1NqZnC5Z7At42gH5tgZbWfzxi893qtJIE/view?usp=sharing

(4GB model only) ext4:
https://drive.google.com/file/d/1-dpBvA35O07RDKi1NIrtuJxY_1NHy2P7/view?usp=sharing

My R4S is arriving today and I am planning on running this build as my main router + media/file server and trying to run a zoneminder security camera system as a docker container. Might as well put all that ram to good use.

2 Likes

What about 1gb version (is it compatible with your build)?
What is different in your build compared to anaelorlinski?

1 Like

I don't have a 1GB model to test it on, but I compiled from openwrt master which looks like it probably wouldn't work on the 1GB according to recent posts in this thread.

I'm having an issue with the time on my R4S.

After the R4S experiences a power loss and then boots back up the clock is defaulting to 2013. Since OpenWrt believes it's 2013 it won't connect to anything since all the certificates it encounters appear to not be valid yet. Then I have to login to luci and sync the time to the browser to restore connectivity which is obviously sub-optimal.

It has an RTC chip and pins for a battery, but I haven't found a way to fit a battery in the case. Is there any workaround for this in software possibly?

ntpd should sync when it gets a network connection.

anaelorlinski 's builds certainly do which is what i'm using.

in theory its in openwrt... or at least in staging tree. Maybe worth bumping to ask what happened to it.

NTP wasn't running and/or installed. I made the assumption NTP was working since the option was present in Luci and I had enabled it. I'll be more diligent in my troubleshooting next time. I'll probably switch to chrony when I have some time.

Last I read was R4S should be merged next release whenever that might be. It probably wouldn't hurt to ask though.

Thank you

1 Like

if you want some acutal logging btw. make /etc/hotplug.d/ntp/20-ntpd-logger and put the following in it.

#!/bin/sh
[ $ACTION = "step" ]    && logger -t ntpd Time set, stratum=$stratum interval=$poll_interval offset=$offset
[ $ACTION = "stratum" ] && logger -t ntpd Stratum change, stratum=$stratum interval=$poll_interval offset=$offset

Then you get nice little messages like this in your logs.

Wed Jan  5 18:18:54 2022 user.notice ntpd: Stratum change, stratum=2 interval=2048 offset=0.007304
Wed Jan  5 18:18:54 2022 user.notice ntpd: Stratum change, stratum=3 interval=2048 offset=0.009748

Added it to https://openwrt.org/docs/guide-user/services/ntp/client-server#troubleshooting for reference too.

Thank you, I added that and restarted ntpd but it looks like I have another issue:

daemon.err ntpd[21290]: unable to bind to wildcard address :: - another process may be running - EXITING

I'd really like to move to chrony, but I haven't been able to find any good documentation on how to proceed. ntpd is fine though if I can get it working.

check your config. Also there is that troubleshooting post i linked earlier.

Definitely sounds like your client is misconfigured or there are two clients trying to bind to port 123.

If an NTP client or server fails to work as expected, you can check if there is 
another program using the NTP port by calling `netstat -np | grep 123` to search 
for clients, and `netstat -nlp | grep 123` to look for servers.

/etc/hotplug.d/iface/20-ntpclient should contain this and it takes its defaults from /etc/config/system

#!/bin/sh
# Copyright (C) 2006-2014 OpenWrt.org

. /lib/functions.sh

unset SERVER
unset PORT
unset INTERVAL
unset COUNT
unset INTERFACE_GLOBAL

NTPC=$(command -v ntpclient)

check_server() {
	local hostname
	local port
	local interface
	[ -n "$SERVER" ] && return
	config_get hostname $1 hostname
	config_get port $1 port
	config_get interface $1 interface

	[ -z "$interface" ] && interface=$INTERFACE_GLOBAL

	[ -n "$interface" ] && {
		# $INTERFACE is passed from hotplug event
		[ "$interface" = "$INTERFACE" ] || return
	}

	[ -z "$hostname" ] && return
	$NTPC -c 1 -p ${port:-123} -i 2 -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; }
}

set_drift() {
	config_get freq $1 freq
	[ -n "$freq" ] && adjtimex -f $freq >/dev/null
}

start_ntpclient() {
	config_foreach set_drift ntpdrift
	config_foreach check_server ntpserver
	[ -z "$SERVER" ] && exit 0
	logger starting ntpclient
	$NTPC ${COUNT:+-c $COUNT} ${INTERVAL:+-i $INTERVAL} -s -l -D -p $PORT -h $SERVER 2> /dev/null
}

stop_ntpclient() {
	logger stopping ntpclient
	killall ntpclient
}

load_settings() {
	local interval
	local count
	local interface

	config_get interval $1 interval
	config_get count $1 count
	config_get interface $1 interface

	[ -n "$count" ] && COUNT=$count
	[ -n "$interval" ] && INTERVAL=$interval
	[ -n "$interface" ] && INTERFACE_GLOBAL=$interface
}

config_load ntpclient
config_foreach load_settings ntpclient

NTP_RUNNING=$(busybox ps | grep $NTPC | grep -v grep)

case "${ACTION:-ifup}" in
	ifup)
		[ -z "$NTP_RUNNING" ] && start_ntpclient
	;;
	ifdown)
		[ -n "$NTP_RUNNING" ] && stop_ntpclient
	;;
esac

I don't have that file as I don't have ntpclient installed, only ntpd. Do I need both ntpclient and ntpd installed?

Also, this is what I am getting on system log now:

daemon.info ntpd[26918]: kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized
daemon.info ntpd[26918]: kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized
user.notice ntpd: Stratum change, stratum= interval= offset=

Thanks again for taking time to help me.

A word to the wise: that "1-2 month shipping time" from FriendlyARM to the US is no joke. My R4S has been in transit for a month with no tracking updates since 12/10. It's torture! :laughing:

its worth the wait. do yourself a favour thou. get a decent SDCard. If you being ultra cautious? get one of the high wear ones like for dashcams/video cams. Something like SanDisk 32GB High Endurance Micro SD SDHC Card for Video Monitoring,Class 10

I'm using a Kingston Canvas Select Plus microSD Card SDCS2/128 GB SP Class 10 as it was on offer when i bought my R4S. Just make sure it Class 10 so you get the speed from it.

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root              1007.9M    505.0M    486.9M  51% /
tmpfs                     1.9G      2.4M      1.9G   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
cgroup                    1.9G         0      1.9G   0% /sys/fs/cgroup
/dev/root              1007.9M    505.0M    486.9M  51% /opt/docker

Turns out that i never expanded the sdcard. mind you i was swapping sdcards in and out due to early snapshot issues. I guess once i switched to anaelorlinski 's build i never redid it.

1 Like

you using a custom build? Something wierd is definatly up. check if busybox-ntpd is installed.

i'm using https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds for now till OpenWrt fixes their issues. Plus i am still debating using his inbuild docker for a few projects.

I ordered mine 11/29 and it just got here 01/03, so a little over a month. I had also ordered an R2C the same day but canceled it. They refunded the order but shipped it anyway and it showed up along with the R4S.

Free R2C, sweet! May I ask what your tracking history looked like? My last update was something about it being loaded onto an aircraft on the 10th but it's been radio silence ever since. Just hoping it didn't fall into the Pacific or something. :laughing:

mine was fairly short wait. but yes. you get nothing for ages till it passes customs.

2021.05.20 13:54 (GMT-7): Delivered
2021.05.20 05:43 (GMT-7): Package on the way to destination
2021.05.17 05:11 (GMT-7): Received by the delivery company
2021.05.17 05:11 (GMT-7): Arrived at destination country
2021.05.15 00:40 (GMT-7): Departed country of origin
2021.05.14 01:25 (GMT-7): Accepted for linehaul transportation
2021.05.13 23:20 (GMT-7): Dispatched from sorting center
2021.05.13 21:09 (GMT-7): Arrived at sorting center
2021.05.13 16:57 (GMT-7): Parcel dispatched
  • 11/29: ordered
  • 12/02: shipped
  • 12/06: plane left China
  • 12/07: plane landed
  • 12/25: processed through USPS customs facility
  • 01/01: arrived at USPS regional facility
  • 01/03: delivered

So it took about 3 weeks after the plane landed to get through customs

hmm. no r2c entry. so that needs fixing.

https://wiki.friendlyarm.com/wiki/index.php/NanoPi_R2C

should really make a new thread for it too.