How to expand (use) all available flash? (openwrt shows 4MB instead of 16MB)

Hi there !
I have a buffalo WCR-1166-DS with openwrt 18.06.2.
I use it has a dumb AP only til now.

Today I wanted to play a bit and add some packages.
I checked available memory in Luci (System/software) it shows:

Free space: 87% ( 3.57 MB )

Woaw, that's not a lot :sweat_smile:

I had in mind the HW should have more, so I checked on internet and this router is supposed to have 16MB. See tech data here:
https://openwrt.org/toh/hwdata/buffalo/buffalo_wcr-1166ds

Also, I tried a dmesg and found this:
m25p80 spi0.0: w25q128 (16384 Kbytes)
(I assume this is the flash memory).

Is there any simple not too risky way to "expand" the system memory from 4 to 16MB ?

I really think you forgot that the firmware is flashed to the device too. So it's impossible that having 3.57 MB free means it's only recognizing 4MB.

Can you run df -h on the command line?

1 Like

The commit message for the WCR-1166-DS states

So you're looking at 8 MB of which, after firmware, you have roughly 4 MB available -- and that number is perfectly reasonable. Also, while it's not "a lot", it's also not "very little." A selection of all but the very expansive packages should fit fine, especially since you can't make huge leaps with 64 MB of RAM either.

5 Likes

Hi !


root@Buffalo:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    29.5M    588.0K     28.9M   2% /tmp
/dev/mtdblock6            4.1M    564.0K      3.6M  13% /overlay
overlayfs:/overlay        4.1M    564.0K      3.6M  13% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@Buffalo:~#

I think you are right regarding firmware...
I'm discovering this:
https://openwrt.org/docs/techref/flash.layout

I must admin I don't understand it all, but I assume there are some other partitions for firmware or whatever.

Following this link, I also see this, in dmesg:

[    1.064671] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    1.074062] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.086651] Creating 7 MTD partitions on "spi0.0":
[    1.096138] 0x000000000000-0x000000030000 : "u-boot"
[    1.106985] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.118397] 0x000000040000-0x000000050000 : "factory"
[    1.129306] 0x000000050000-0x000000810000 : "firmware"
[    1.143115] 2 trx-fw partitions found on MTD device firmware
[    1.154399] 0x00000005001c-0x0000001af28c : "kernel"
[    1.165147] 0x0000001af28c-0x000000810000 : "rootfs"
[    1.175829] mtd: device 5 (rootfs) set to be root filesystem
[    1.188602] 1 squashfs-split partitions found on MTD device rootfs
[    1.200907] 0x0000003f0000-0x000000810000 : "rootfs_data"
[    1.212516] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.223772] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.234537] 0x000000fe0000-0x000000ff0000 : "board_data"

And:

root@Buffalo:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 007c0000 00010000 "firmware"
mtd4: 0015f270 00010000 "kernel"
mtd5: 00660d74 00010000 "rootfs"
mtd6: 00420000 00010000 "rootfs_data"
mtd7: 007c0000 00010000 "firmware2"
mtd8: 00010000 00010000 "glbcfg"
mtd9: 00010000 00010000 "board_data"
root@Buffalo:~#

does it mean there's nothing I can do ?

ha, just saw @takimata answer after sending my previous message...seems there is not so much to be done :slight_smile:

Got to check if I can do the job with 4MB

If you don't intend to run a web and database server or a torrenting box, you should be fine. Like I amended above, you will probably hit the RAM limit earlier than the flash limit.

3 Likes

If you do run into space problems, building packages into the ROM with either the image builder or from source compresses them by around a factor of two.

I agree that RAM is likely a concern running anything "big".

not a webserver :slight_smile:
I wanted to add bluetooth BLE support (usb dongle) (~1MB) and a python (1.5MB) + a few libs to run script that handle a sensor.
my ram is currently 61% full (idle, 2 stations connected on wifi).

:thinking: I wanted to use this device because it's close to the sensor, but maybe it's not a good choice...

(@takimata...greetings from France :wink: my router is Japanese, but I'm not, got it from ebay :yum:)

@jeff: I planned to use Luci to install software...or "opkg install" ...

"building packages into the ROM with either the image builder" => does it mean something like building my own image and reflash the router ?

Yes, exactly that. Don't be afraid, using the imagebuilder is easier than you think. :slight_smile:
And it's worth the effort, since you will "gain" precious flash space compared to installing via opkg.

1 Like

You are likely to have RAM exhaustion problems as well as not being able to fit it on even a 16 MB device (with an Archer C7v2 and 16 MB of flash, I could not get a "reasonable" Python install to fit).

Guys, I base all this discussion thinking about plugging a USB bluetooth dongle on the router.
In my mind, there was a usb port on it...but while trying to plug the dongle....Well....there is no USB on this device :sob::sob::sob::sob: (so stupid from me...)

Anyway, I learned several things here about memory! I think I will keep this device as dumb ap for the moment and consider a different one for my bluetooth playing...(with USB port!!! and with much better knowledge about RAM/flash size to consider)

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.