Entware (software packages) for R7500

95 posts / 0 new
Last post
pepsinio
pepsinio's picture
Voxel,

Voxel,

no problem. Vacation is important :)

atleast from my understanding this snippet :

echo "1000000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq  
echo "1000000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq 
makes the on-demand freq up to 1ghz only. Unsless 1000000 is 100% ? 
 
That is taken from powerctl from the latest firmware.
 
Bw,
Peter
 
Voxel
Voxel's picture
Peter,

Peter,

I did some investigation with this. Initially I also was sure (checking this script by my eyes) that these two lines limit R7500 CPU to 1GHz. I found somewhere similar settings for Krait CPU on Android phone. But after some tests I got a conclusion that this limitation just does not work. Maybe because of specific of this concrete ipq806x.I suppose that Netgear people just re-used existing script for Krait from Open Source codes w/o intensive checking. But resulting behaviour is OK (see below).

Just see the following with not modified powerctl on my router:
 

root@nighthawk:/# ls -l /sys/devices/system/cpu/cpufreq/ondemand/
total 0
-rw-r--r-- 1 root root 4096 Oct 13 22:41 down_differential
-rw-r--r-- 1 root root 4096 Oct 14 10:04 ignore_nice_load
-rw-r--r-- 1 root root 4096 Oct 14 10:04 io_is_busy
-rw-r--r-- 1 root root 4096 Oct 14 10:04 powersave_bias
-rw-r--r-- 1 root root 4096 Oct 13 22:41 sampling_down_factor
-rw-r--r-- 1 root root 4096 Oct 13 22:41 sampling_rate
-r--r--r-- 1 root root 4096 Oct 14 10:04 sampling_rate_min
-rw-r--r-- 1 root root 4096 Oct 13 22:41 up_threshold
root@nighthawk:/#
 
as you can see: there are no "optimal_freq" and "sync_freq" in this directory. So no limits on 1GHz are set.

Benchmark berformed by me with this original powerctl in auto mode:

 
 
root@nighthawk:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
800000
root@nighthawk:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1400000
root@nighthawk:~# echo Now CPU is idle, let us see current frequency:
Now CPU is idle, let us see current frequency:
root@nighthawk:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
800000
root@nighthawk:~# echo Let us load CPU by sysbench and check current frequency:
Let us load CPU by sysbench and check current frequency:
root@nighthawk:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1400000
root@nighthawk:~#
 
 

Self explanatory, right?

So, IMO stock powerctl works OK for most cases. In iddle state its freq is 800, when CPU is loaded by calculations it is switched to 1400.

Important comments in this script (auto mode):

 

# Change the CPU load threshold above which frequency is up-scaled to
# turbo frequency,to 50%
It means that if CPU load is more that 50% then freq is switched to 1400
# Change the CPU load threshold below which frequency is down-scaled to
# 10% (down_threshold = up_threshold - down_differential)
echo 40 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
 

It means that if CPU load is less than 40% then freq  from 1400 is decreased by steps in 10% until it will be 800MHz.

I think this behaviour is optimal (especially during hot summer time)

Regards,
Voxel.

 

 

pepsinio
pepsinio's picture
Sweet!

Sweet!

Thanks for the detailed investigation Voxel.

Bw,

Peter

pepsinio
pepsinio's picture
Voxel,

Voxel,

indeed when under load, the current_freq goes up to 1400.

Just tho share a nice addition:

an addition inside the start() of powerctl i have added " ledcontrol -n power -c amber -s off" .

This way if you switch off the LED's from the button, all lights are off, in case they disturb you during the night. :)

Bw,

Peter

Voxel
Voxel's picture
Peter, thanks for info.

Peter, thanks for info.

 

You are right. I this correction practically immedistely after unboxing my R7500. My nighthawk works in "stealth mode" too. Too bright LEDs. The only difference is that I used "green", not amber :-)

Part of my startup script:
 

#!/bin/sh
 
# Start services from /opt/etc/init.d
/opt/etc/init.d/rc.unslung start
 
. . .
 
# Memory tweaks
/bin/echo 524288 > /proc/sys/net/core/rmem_max
/bin/echo 524288 > /proc/sys/net/core/wmem_max
/bin/echo 8192 > /proc/sys/vm/min_free_kbytes
 
# LED control
/sbin/ledcontrol -n power -c green -s off
 
(BTW, you can try to use these memory tweaks above)

And what else: IMO it is better to use your own startup script from /etc/init.d keeping minimal changes in stock FW. See

http://myopenrouter.com/comment/38454#comment-38454

for details.

 

Regards,
Voxel.

pepsinio
pepsinio's picture
Voxel,

Voxel,

I need to investigate it further, but on first sight it seems that those memory tweaks improove read/write speed from usb drive via Wireless. 

I tried today with usb hub and few Harddrives and it seems to work without any issues :) 

Bw,

Peter

Voxel
Voxel's picture
 
 
/bin/echo 524288 > /proc/sys/net/core/rmem_max
/bin/echo 524288 > /proc/sys/net/core/wmem_max
/bin/echo 8192 > /proc/sys/vm/min_free_kbytes
 
First and second: TCP tweaks, third: memory tweak. It is not my invention. Used for routers with similar configuration. You can google for details.
 
Regards,
Voxel.
pepsinio
pepsinio's picture
Voxel, 

Voxel, 

i have probably a rather silly question. 

How do you set the PATH on each ssh login to be the correct one?

Bw,

Peter

Voxel
Voxel's picture
pepsinio,

pepsinio,

You can modify the file /etc/profile to set global PATH. Change the line:
 

export PATH=. . .

Regards,

Voxel.

Voxel
Voxel's picture
Peter,

Peter,

Strange forum. Sometimes my posts are blocked. So I repeat:

you can modify the file /etc/profile, line with PATH setting. This will work after each your login.

Regards,
Voxel.

pepsinio
pepsinio's picture
Thanks Voxel!

Thanks Voxel!

Indeed there is something funny with the message posts. I saw now your previous reply regarding this .

Bw,

Peter

pepsinio
pepsinio's picture
Voxel,

Voxel,

what speeds do you get if you try to read/write from usb 3.0 attached disk via wireless? Do you have a consistent connection?

In my case the file transfer drops to 0b/s every 30seconds or so via wireless and the max speed is no more than 30MB/s and 60MB/s when connected with a wire.

Bw,

Peter

Voxel
Voxel's picture
Peter,

Peter,

 

You did not clarify what service. I suppose you mean samba. I have similar values. But I use samba server working under Debian,not from stock firmware. I do not have drops, but I have some problems during write: pause up to 20-30 sec before write progress bar for big files (10-20GB). Probably even not pause, but delayed information got by computer that actual transfer is started. I already can see in SSH session that file exist, but computer does not show progress yet (0%).

 

Regardsing speed IMO it is OK. Limited by disk performace. I have abot the same values (but w/o write pause) when I connect my USB3 2.5" HDD to computer.

Also, my eSATA 2.5" HDD is a bit faster according to my benchmarks. Bit maybe because of more fast disk itself connected to eSATA port.

 

Regards,

Voxel.

pepsinio
pepsinio's picture
Voxel,

Voxel,

Thanks for the info. I may try different samba server as well i guess. The HDD which i connect to the router has Read speed of 110MB/s and in my case there seems to be a huge bottleneck on the router (especially the drop-outs). Additionally i get 'permission-denied' in some cases and it seems like that the HDD disconnects itself occasionaly and when it reconnects i get this error. Tried to speak with NETGEAR support, but they seem to have a hard time reaching me via phone :) 

Tried to persuade NETGEAR Support to show a tutorial of the image compilation so that we can pre-build our own images. No response from them yet unfortunately.

Thank you for the useful information once again!

Bw,

Peter

 

 

 

onlinespending
onlinespending's picture
for some reason I can't get

for some reason I can't get another computer to ssh into the R7500 using the dropbear installation guide found on the first page of this thread. The first laptop that I used to ssh into the R7500 can still ssh into it just fine. But when I generate rsa keys (and tried dss as well) on a different client and add the public rsa key to the /root/.ssh/authorized_keys. But when I try to log in to the R7500 from this second client it says 'Connection closed by 192.168.1.1' (192.168.1.1 being the ip-address of my router). Is there some other set to get a client to be able to ssh into the R7500? Or a way to see a verbose logging output from dropbear? Thanks

Voxel
Voxel's picture
Try to renew SSH server. I

Try to renew SSH server. I already compiled dropbear especially for R7500 from latest dropbear codes. My initial installation guide was based on  dropbear taken from ASUS router. Now it is compiled using R7500 firmware chaintools. Maybe initial ASUS version is not very suitable for R7500...

See my short instruction (starting from the words "If you are interested in dropbear") in topic:

 

http://myopenrouter.com/comment/38452#comment-38452

and also check my next post (add-ons).

Regards,
Voxel.

onlinespending
onlinespending's picture
beautiful. Updating to your

beautiful. Updating to your latest dropbear worked fine. For some reason I could only get one client to connect with the old one. Thank you much!

Voxel
Voxel's picture
Fine. I am glad that problem

Fine. I am glad that problem is solved.

This new version is really good. I use it 24/7 with SSH reverse tunnel, set by two R7500, so it is tested intensively. I changed a bit default compilation options of dropbear to get maximum performance (speed vs size of binary).BTW, FYI: ECDSA keys will work faster than RSA.

Did you succeed with Debian?

 

Regards,

Voxel.

pepsinio
pepsinio's picture
Zdenkod,

Zdenkod,

after reflash i have the same issue. How did you manage to fix it?

Bw,

Peter

pepsinio
pepsinio's picture
Voxel,

Voxel,

i reflashed my router and now for some reason i am not able to connect via SSH.

What i did was :

/usr/bin/dropbearkey -t rsa -f dropbear_rsa_host_key
mkdir /etc/dropbear
cp dropbear_rsa_host_key /etc/dropbear
chmod 600 /etc/dropbear/dropbear_rsa_host_key
 
Then imported dropbear_rsa_host_key in puttygen and created 1024 ssh2 RSA private key. What am i missing?
 
Bw,
Peter
Voxel
Voxel's picture
Peter,

Peter,

The same suggestion: try to renew dropbear. See my previous post #78.

 

Regards,
Voxel.

Voxel
Voxel's picture
Small addon:

Small addon:

Don't forget to add your public key (generated by puttygen) to authorized_keys file.

Voxel.

pepsinio
pepsinio's picture
Thanks Voxel,

Thanks Voxel,

indeed i have forgotten the authorized_keys! :) Works fine now.

Bw,

Peter

clvk07
clvk07's picture
Hi

Hi

I get this after the install:

root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin#
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin# which wget
/usr/bin/wget
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin#
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin# /opt/opt/opt/opt/bin/opkg list
-ash: /opt/opt/opt/opt/bin/opkg: Permission denied
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin#
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bi

PATH
/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin:/bin:/sbin:/usr/bin:/usr/sbin

clvk07
clvk07's picture
Same error:

Same error:

oot@R7500v2:~/mnt/sda1/Download2/entware.arm/bin# ls
bmtemp locale.new mcdiff wget
chroot localedef.new mcedit wget-ssl
find mc opkg xargs
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin#
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin# /mnt/sda1/Download2/entware.arm/bin/opkg list
-ash: /mnt/sda1/Download2/entware.arm/bin/opkg: Permission denied
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin#
root@R7500v2:~/mnt/sda1/Download2/entware.arm/bin#

Voxel
Voxel's picture
clvk07:

clvk07:

You should mount your disk (/dev/sda1) with execution permissions. By default R7500 mounts external disk with "noexec" option. And my advice to use HFS+ filesystem (case sensitive).

Just try to umount /mnt/sda1 and mount /dev/sda1 again from console.

Voxel.
 

clvk07
clvk07's picture
HI Voxel that worked fine.

HI Voxel that worked fine. Thanks. I created a startup script which dismount and mounts the usb every time the rooter reboots, all working great.

I also set up transmission working great. Can I ask you how did you get openvpn server to work? After installing the package, how can I create the keys etc.. top allow clients to connect to my router?

P.S. (your mailbox is full)

Thanks!!

Voxel
Voxel's picture
Hi clvk07,

Hi clvk07,

Regarding OpenVPN: too much to explain step-by-step. Try to google, there are a lot of articles. Note: I use OpenVPN under chrooted Debian. So if you will use Debian then google install OpenVPN under Debian. 

Somewhere in this topic I described a trick with Netgear firewall which is needed for OpenVPN. Seek "net-wall" here.

Debian Jessie I put there: https://yadi.sk/d/LYPJSlRxkQ6ot
Mailbox - too many questions from R7500 owners :-)

Voxel.

P.S.

Debian installation:
 

1) Do not forget to mount "dev" "proc" "sys" directories to corresponding directories in Debian before actual chroot.
2) You should nave external USB HDD with HFS+ casesensitive partition. The only this type of partition keeps the file permissions w/o changing their attributes to 777 (full access). My debian contains hfs+ programs (fsck.hfsplus, mkfs/hfsplus etc). Casesensitive HFS+. You can temporary install this debian to small USB stick with EXT2 for example and try to chroot Debian on this stick for goal to create casesensitive HFS+ on second external HDD using this Debian. After this you can use HFS+ from second HDD for Debian permanently.
3) If you plan to use debian seriously, with daemos which need RAM, you should create the swap file and add swap before running your daemons. Swap tools are available from Entware,
 
Example of my script to chroot to Debian with swap enabled and mounting necessary directories (plus two external HDD: /mnt/optware and /mnt/storage to be accessible from Debian, debian directory is /tmp/mnt/optware/debian):
 
------------------------------------------
#!/bin/sh
 
CHROOT_DIR=/tmp/mnt/optware/debian
 
for dir in dev dev/pts proc sys; do
mount -o bind /$dir $CHROOT_DIR/$dir
done
 
mount -o bind /tmp/mnt/optware $CHROOT_DIR/mnt/optware
mount -o bind /tmp/mnt/storage $CHROOT_DIR/mnt/storage
 
swapon /tmp/mnt/optware/swapfile
chroot $CHROOT_DIR /bin/bash
swapoff /tmp/mnt/optware/swapfile
 
umount $CHROOT_DIR/mnt/storage
umount $CHROOT_DIR/mnt/optware
 
for dir in dev/pts dev proc sys; do
umount $CHROOT_DIR/$dir
done
_________________________
onlinespending
onlinespending's picture
I'm going to finally attempt

I'm going to finally attempt to get Debian chroot working again, but I want to start fresh, since I've noticed some inconsistencies with my router. So I've tried doing a 30-30-30 reset, and restoring factory defaults throug the web gui. And even though the configuration is clean, all of the files that I've edited/added under /root, /etc, and other locations are still there. How in the world do I truly reset this router to get it to its virgin state?

onlinespending
onlinespending's picture
looks like simply downgrading

looks like simply downgrading to an earlier firmware does the trick. I suppose it recognizes that it's the same firmware and doesn't do a complete reflash. Downgrading and then upgrading back to the latest worked.

Pages