LEDE on WNDR3700v4 (available flash size)

Hi. This is my first post on this forum :slight_smile:

I had tp-link 740n it has 4 MB flash storage and 32 MB RAM. My network became big so this router could not handle and connection was slow and i needed to reboot the router frequently. I was choosing cheap and good router for openwrt and for my needs. I chose Netgear WNDR3700v4. Here (https://wiki.openwrt.org/toh/netgear/wndr3700) i saw it had 128 MB Flash and 128 MB RAM. 4 MB was not enough to install some packages that i needed so i bought this version.
I installed openwrt 15.05.1 on it yesterday and when i looked in menu it show me 13.96 MB free space 100%. I bought it because of 128 MB Storage. I have not installed any packages yet. I just configured wan and wifi that's it. So what is the problem? Did seller fool me and this is not v4? I bought it on ebay. Please answer me what's going wrong so i can contact seller.

I found info about LEDE and updated to it's 17.01.1 version from openwrt. Free space is same. :frowning:
Here is a pic
http://www.picz.ge/img/s1/1706/2/c/c968fe828258.jpg
Thank you in advance for help and sorry for my english.

Go to Status -> Overview -> Memory
How much is shown at Total Available?

If you have console access: post the output of df -h

1 Like

By default only a subset of the total storage is used (I think often 8 MB or 16 MB).

Your device is defined in target/linux/ar71xx/image/nand.mk afaik, which has some other devices with an IMAGE_SIZE setting ranging from 16MB to 32MB. So it looks like 8 MB is default.

I have no idea though if it's sufficient to specify an IMAGE_SIZE for your device or if you need to turn some other knobs. Either way, to have more of the flash available by default you'll have to compile yourself.

1 Like

http://www.picz.ge/img/s3/1706/3/f/fa5ae7976ace.jpg

Compilation is not a problem. When i had tp link 740n i had to compile myself to have more empty space then by default. Just the thing is i do not know what to change to get more space.

I am interested if lede os is released specifically for 3700v4 why it does not use whole memory? Why use only 8 or 16 MB?

I was searching guide to mount USB drive on my router and accidentally found solution to my problem. It seems this problem existed in OpenWRT era and exists now in LEDE era too. It's very sad that by default this problem is not fixed.

Here is solution, but it's kind of risky. https://bugs.lede-project.org/index.php?do=details&task_id=146

@Simpy (me, the person who reported this under LEDE git originally) just adding in that i still have no had any issues with this personally on my wndr3700v4. i side build this with a wndr4300v1 with no issues from the patch in the link in my tag. here is a picture of the patch currently on my wndr3700v4 router:

in regards to reverting to stock:
i've tested with this patched from LEDE <-> Netgear <-> DD-WRT back and forth every way.
there is trouble getting it to switch from LEDE -> DD-WRT but that can still be done if you go from (lede -> netgear -> ddwrt via netgear gui) but there is something odd with it, umm.. i can't explain this because i don't know how the netgear firmware is made/wrote but.. if you are having trouble getting back to stock from lede with this patch, make sure something is connected on the wan port when the stock netgear firmware is booting up (i dont know if this is required but in testing this helped usually).

this might not make much sense but here. this might help getting back to stock if you dont use wan port:

flash stock netgear firmware -- i used version 1.0.1.32
wait till it reboots and plug in wan port (if not) -- if for some reason you aren't using a wan line, connect it to a computer just to pass data, i can't explain this part but testing this helped. i can not begin to say why at all. i have no idea why this helps.
seems to be loaded but you can't access the website/webgui then turn router off and back on
visit router ip after its back on (whatever router ip: usually 192.168.1.1) with the wan line (if you are using it from a computer instead of wan line) -- this is the part that helps get it back onto stock firmware when you dont use wan port normally. again: no idea why..
wait a minute or so, then switch line back to lan, then revisit (whatever router ip: usually 192.168.1.1) it should load fine -- for me anyways, it always worked following these steps..
1 Like

Thank you for your info.
Can you please share your patched version of LEDE 17.01.1. I could not compile i followed steps but my laptop was compiling like 1 hours or so and still did not finish. Also i am not sure i did everything correctly :smiley:

I do not want to go back to stock. I run openvpn server on my router, adblocker, transmission (I have attached USB flash drive to it which is mounted in router and in my laptop with nfs), sqm scripts.
I bought this version V4 of this router because it had 128 MB flash and when i realized it did not use whole space i was sad :frowning:

When/if you give me that patched version will it be sysupgrade package or will i need to reinstall from stock or what?

P.S. stupid question. What is theme name that you have in your router? I upgraded from openwrt 15.05.1 to lede 17.01.1 and it was the same just name changed
http://www.picz.ge/img/s3/1706/5/5/55d63ccdec8d.jpg

Can you please share your patched version of LEDE 17.01.1

mine is not a patched version of LEDE 17.01.1 it is a patched version of trunk at LEDE Reboot SNAPSHOT r4179-c454fab0f2 currently (i haven't updated it in maybe a week or something).

i would share mine but it's not setup for what you want, it's not a community build, and it's not supported. so for those reasons no but i can give you the steps to build it.

** those aren't the only reasons though. there are two more i can think of: mine has a modded kernel driver in it for a wifi adapter i use on mine and anyways, if i was to share mine, not all packages would install from lede's repo. the only way to do that would be for me to build and host my own repo. which i haven't and don't plan on doing. :frowning2:

see how to build lede here:
https://lede-project.org/docs/guide-developer/build-system
https://lede-project.org/docs/guide-developer/install-buildsystem
https://lede-project.org/docs/guide-developer/use-buildsystem

before you compile it, patch it with the code from the link i posted above at comment2165 (the path to the file you need to edit is given, this may still be different in 17.01.1 and trunk but i don't know.. if that's the case, i can't tell you the old path because i don't know it)

steps:

  1. pull from git
  2. update feeds
  3. apply that patch
  4. make menuconfig # set target;
  5. make defconfig
  6. make menuconfig # configure how you want (what packages etc);
  7. make # You can speed it up by using make -j4 (for 4 compilation threads) or -j8 (for 8 core CPUs) but it may fail and you won't know why, in that case go back to just make.

as for the theme: im using luci-theme-material in the screenshot and the themes available (from here {assuming you have ssl luci and the hostname is lede like mine}: https://lede/cgi-bin/luci/admin/system/packages?display=available&query=theme) currently are:

  • luci-theme-bootstrap
  • luci-theme-freifunk-generic
  • luci-theme-material
  • luci-theme-openwrt

EDIT: I'm going to be sharing a LEDE 17.01.1 for WNDR3700v4 soon, with only luci package preinstalled, with this patch.

2 Likes

It is not a "problem", but a cautious design decision that preserves the other parts of the flash intact except the designated "firmware" partition.

The original reason is bad flash memory partition design by Netgear. See the following article about the sister device 4300. I am not 100% sure that it is quite identical in 3700v4 but that is very likely.
https://wiki.openwrt.org/toh/netgear/wndr4300#visual_representation1

Netgear has decided to place a backup of the wifi calibration data "caldata_backup" between the "firmware" and the unused 96 MB space at the end of the flash.

Openwrt and LEDE write the "firmware" partition (kernel, rootfs, rootfsdata), but do not touch the other partitions.

The patch linked above changes that partition structure to have a consistent larger firmware partition (old firmware + caldata_backup + most of unused/reserved) and defines a new caldata_backup at the end. But it does not copy/reflash the existing contents of caldata_backup to the new place. Instead the existing caldata_backup will be overwritten (inside the firmware partition). If you ever need those contents, I hope that you have saved a backup copy of it and re-flashed that with mtd to the new caldata_backup partition.

Yes, it is possible that things will work ok without copying/re-flashing that, but if the main caldata gets damaged, you might lose wifi completely.

(It would likely be safer to mount the unused part separately like arjendekorte says on that bug).

1 Like

Yes, it is possible that things will work ok without copying/re-flashing that, but if the main caldata gets damaged, you might lose wifi completely.

(It would likely be safer to mount the unused part separately like arjendekorte says on that bug).

thanks hnyman for clearing this up :slight_smile:
(also i 100% agree with what you said).

if you still want to go against what they suggest and do it anyways like i did :dizzy_face: then here is a build v17.01.1 for wndr3700v4 with luci preinstalled :skull:

you can backup the partitions first like this but when you do move them somewhere else and save them.

dd if=/dev/mtdblock2 of=/tmp/caldata.backup
dd if=/dev/mtdblock10 of=/tmp/caldata_backup.backup

cat diffconfig:

simpy@simpy:~/Build/v17.01.1/source-17.01.1# cat diffconfig
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_nand=y
CONFIG_TARGET_ar71xx_nand_DEVICE_WNDR3700V4=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y

patching: ~/Build/v17.01.1/source-17.01.1/target/linux/ar71xx/image/legacy.mk

-wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
+wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),120832k(ubi),122880k@0x6c0000(firmware),256k(caldata_backup),-(reserved)

before installing packages from Software tab, make sure your Distribution feeds match this (you dont have to copy/paste, just make sure they show releases/17.01.1) the feeds can be found under luci/admin/system/packages/ipkg

src/gz reboot_core http://downloads.lede-project.org/releases/17.01.1/targets/ar71xx/nand/packages
src/gz reboot_base http://downloads.lede-project.org/releases/17.01.1/packages/mips_24kc/base
src/gz reboot_luci http://downloads.lede-project.org/releases/17.01.1/packages/mips_24kc/luci
src/gz reboot_packages http://downloads.lede-project.org/releases/17.01.1/packages/mips_24kc/packages
src/gz reboot_routing http://downloads.lede-project.org/releases/17.01.1/packages/mips_24kc/routing
src/gz reboot_telephony http://downloads.lede-project.org/releases/17.01.1/packages/mips_24kc/telephony

Link to patched firmware [USE THIS AT YOUR OWN RISK] (I TAKE NO RESPONSIBILIY FOR WHAT YOU DO WITH, OR USE, THESE FILES FOR)
Making this not-clickable, so visiting this link suggests you are willing to take the risk(s) associated with this patched firmware and will not hold me, any one who has posted here, or any of the lede developers accountable for the files held here. https://mega.nz/#F!91tFRKjZ!SQfylZY8_ggUbPZW6Mffgw

if you choose to do so: after you flash, as Mauro Mozzarelli suggests, copy caldata to the new caldata_backup or restore caldata_backup from the partition you saved (i mention this earlier in this post).
if you want to copy caldata to the new caldata_backup location do this:
dd if=/dev/mtdblock2 of=/dev/mtdblock10

Other than that, good day :slight_smile:
Final thanks to hnyman and arjendekorte for their input on this issue. :blue_heart:

1 Like

Thank you all for helping. Of course i understand that risk and i'll decide it myself wether install or not. Thank you for the info. I will backup that partitions. So as i understand if i backup them i can have wifi working without problems if i revert to stock. What if i do not want to revert to stock? Then it's not a problem right?
And why are everybody talking about 4300 router.

Cutepally
Did you have any issues with wifi when getting back to stock. If i need to go back to stock to flash any other firmware do i have to have those partitions backup? I understand that this patch is bad for 4300 router and it needs backup but is it bad for 3700v4 too? I do not ask because i want to get back to stock. I do not want and never will, but as you said about transition from lede->ddwrt it's easier through stock. How did you flash stock? did you restore that partition?

P.S. stupid question. Can i post here without replying to someones post?

Sure. Just click on "New Topic".

I am sorry but is not that "New Topic" button for creating new topics?

I asked if i can post here without hitting reply button on someones post.

There is a general 'Reply' button at the bottom of the thread. Use that one.

1 Like

Of course it's my risk :slight_smile: When i have moments like this whatever happens it's on me. :slight_smile:
I ran this commands
dd if=/dev/mtdblock2 of=/tmp/caldata.backup
dd if=/dev/mtdblock10 of=/tmp/caldata_backup.backup
and saved those files on my laptop and on google drive too.
Just one thing. I did flash your sysupgrade image but it did not give me more storage it just reinstalled lede.

here is a pic after flashing your sysupgrade image
http://www.picz.ge/img/s1/1706/6/6/65b4cd020a8f.jpg

Oh and now i frequently get errors when installing packages.
"Collected errors:

  • satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-ext4:
  • kernel (= 4.4.61-1-7163756290c10ef7734df504f3a8958b) * kernel (= 4.4.61-1-7163756290c10ef7734df504f3a8958b) * kernel (= 4.4.61-1-7163756290c10ef7734df504f3a8958b) * kernel (= 4.4.61-1-7163756290c10ef7734df504f3a8958b) *
  • opkg_install_cmd: Cannot install package kmod-fs-ext4."

Is this snapshot image or latest version which you compiled with the patch.

Probabaly this image is without patch can you please check if you accidantly linked wrong version? Thanks in advance for helping.

You can't install kmod packages from release repos to private build. There is strict kernel options checksum system. The packages need to be from the same compilation as the firmware itself.

For that reason most people wanting any special source modifications compile own builds, so that needed add-on packages are compiled right into the image.

2 Likes

Thanks, so i need to compile this build myself with patch mentioned above and all the packages i need.
If i want to add package i will need to recompile with that package included right?

Then i have one question. When choosing packages is any package included by default? I mean the packages i get by installing official image from this site are they included by default in file which is used to include packages when compiling or do i have to choose all that stuff myself?

The build system automatically selects all needed packages and their dependencies, when you select the target device.
That is how buildbot snapshots are built.
The releases include also Luci GUI, which you need to select manually (in make menuconfig).

1 Like

thanks again hnyman! :blue_heart: :slight_smile:

i spoke about the issues with "Cannot satisfy the following dependencies" before but maybe i didnt explain clearly, sorry for this. :frowning:
this is one of the reasons i said sharing it wouldn't be okay for you, without me hosting the rest of the packages which is why i gave you the steps to build.. but i went ahead and flashed the same build just now before this post (via sysupgrade) and this is what i got:

http://i.imgur.com/FxCPzUB.png
http://i.imgur.com/O0kYhXB.png

now to answer your questions..

If i need to go back to stock to flash any other firmware do i have to have those partitions backup?

no, but it's a good idea

I understand that this patch is bad for 4300 router and it needs backup but is it bad for 3700v4 too?

yes, technically it's bad for either, it can overwrite the caldata_backup (which you saved)

How did you flash stock?

by putting the router into recovery mode and sending it over tftp

Did you restore that partition?

nah, :skull: i only copy caldata to caldata_backup after when using this patch :skull_crossbones:

:slight_smile: stay safe :sunflower:

1 Like

thank you. now i understood that issue with dependencies. i will build it myself, but now i am curious why it does not work for me. i downloaded your packages and flashed sysupgrade package from the gui and also i had checked to save settings?

i am not sure if i build my version it will work. i guess i have to solve this issue first.
again thank you for help.

okay cool! :slight_smile: i am not sure as you see it worked for me, try to flash the (.img) over tftp in recovery mode or sysupgrade -v /tmp/lede-ar71xx-nand-wndr3700v4-squashfs-sysupgrade.tar

i did sysupgrade like this and mine was okay, so i am unsure :frowning:

that's how i always upgrade mine but just so you know "checked to save settings" is bad when you are using trunk sometimes (this build is a release but it's worth knowing anyhow) so you can do sysupgrade -n which means dont save config. :stuck_out_tongue:

goodnight matemana2608 and goodluck! :smile:

1 Like