Initial Setup GL-MT300N-00a

I usually have a DHCP server upstream, such as on the router. I can look up its IP based on the MAC address.

OK. I justed tested and I didn’t got any errors!

My settings:

The only config file I made is files/etc/config/network and files/etc/config/shadow

here is my content of network. Don’t use “eth1”, as there is no such device in MT300N

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd44:c484:394f::/48'

config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'dhcp'

 

Steps I did:

wget http://downloads.openwrt.org/snapshots/trunk/ramips/mt7620/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64.tar.bz2
tar -jxvf OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64.tar.bz2
cd OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64

I modified repositories.conf and used my own repo. Not openwrt. 

make image PROFILE=GL-MT300N PACKAGES="vnstat libstdcpp ca-certificates libpthread bash curl -wpad-mini -wireless-tools -kmod-ipv6 -firewall -iptables -ip6tables -odhcp6c -odhcpd -dnsmasq -kmod-ath9k -uboot-envtools -ppp -ppp-mod-pppoe -kmod-ppp -kmod-pppoe -kmod-usb-core -kmod-usb2 -kmod-ledtrig-usbdev -kmod-usb-ohci -kmod-usb-hid" FILES=files/
.....[ommit a lot]
[==============================================================================================\] 611/611 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments, no xattrs
	duplicates are removed
Filesystem size 2391.63 Kbytes (2.34 Mbytes)
	34.76% of uncompressed filesystem size (6880.87 Kbytes)
Inode table size 9278 bytes (9.06 Kbytes)
	24.45% of uncompressed inode table size (37947 bytes)
Directory table size 11186 bytes (10.92 Kbytes)
	47.26% of uncompressed directory table size (23670 bytes)
Number of duplicate files found 62
Number of inodes 1014
Number of files 602
Number of fragments 14
Number of symbolic links  346
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 65
Number of ids (unique uids + gids) 1
Number of uids 1
	unknown (0)
Number of gids 1
	unknown (0)
dd if=/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/root.squashfs of=/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/bin/ramips/openwrt-ramips-mt7620-root.squashfs bs=128k conv=sync
18+1 records in
19+0 records out
2490368 bytes (2.5 MB) copied, 0.00199488 s, 1.2 GB/s
cp /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n
/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/linux-4.4.7/scripts/dtc/dtc -O dtb -o /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/GL-MT300N.dtb ../dts/GL-MT300N.dts
Warning (reg_format): "reg" property in /pcie@10140000/pcie-bridge/mt76@0,0 has invalid length (20 bytes) (#address-cells == 2, #size-cells == 1)
Warning (avoid_default_addr_size): Relying on default #address-cells value for /pcie@10140000/pcie-bridge/mt76@0,0
Warning (avoid_default_addr_size): Relying on default #size-cells value for /pcie@10140000/pcie-bridge/mt76@0,0
/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/staging_dir/host/bin/patch-dtb /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/GL-MT300N.dtb
/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/staging_dir/host/bin/lzma e /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n -lc1 -lp2 -pb2 /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n.bin.lzma

LZMA 4.65 : Igor Pavlov : Public domain : 2009-02-03
mkimage -A mips -O linux -T kernel -C lzma -a 0x80000000 -e 0x80000000 -n "MIPS OpenWrt Linux-4.4.7" -d /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n.bin.lzma /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n.uImage
Image Name:   MIPS OpenWrt Linux-4.4.7
Created:      Thu May  5 11:26:18 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1326278 Bytes = 1295.19 kB = 1.26 MB
Load Address: 80000000
Entry Point:  80000000
cat /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-gl-mt300n.uImage /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/root.squashfs > /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin
/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/staging_dir/host/bin/padjffs2 /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin 4 8 16 64 128 256
padding image to 0039a000
padding image to 0039c000
padding image to 003a0000
padding image to 003c0000
if [ stat -c%s "/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin" -gt 16121856 ]; then echo "Warning: /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin is too big" >&2; else cp -fpR /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/bin/ramips/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin; fi
( cd /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/bin/ramips ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs md5sum --binary > md5sums )
( cd /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/bin/ramips ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs openssl dgst -sha256 > sha256sums )
make[3]: Leaving directory `/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/target/linux/ramips/image'

So, no any errors and I got the bin file in bin/ramips/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin

I flashed it to the router via uboot UI and every thing works as expected: Got DHCP from main router, can ssh to the mini router using the preset password.

About failsafe:

After the device is powered on, wait for at least 5 seconds (until uboot finished booting), then keep pressing (don’t hold) the reset button for some time, the device will enter failsafe mode. If you just hold the reset button, it will not enter failsafe mode. In failsafe mode, the IP is 192.168.1.1, you need to set your computer’s IP address to 192.168.1.2 if you want to ssh to the router. Otherwise your computer will get DHCP from your main router. SSH should use your pre-set password. I didn’t try telnet because I already set the password and telnet is refused.

About your oversize error:

I have to say that I have no idea why you have this error because I don’t have. I suggest you to start over, e.g. remove all files, repeat the steps.

One question: are you using a 64big Linux system, right?

About your other errors:

you have errors that the password is not what you set. As I said, please trust computer, not yourself. Everytime you generate an image, you can try to remove the old images in bin/ folder, just to make sure the new image is generated and you are not using the old image. This may related to your “oversize” error.

 

 

Yes, I do remove all of the files first otherwise, I cannot know if something was actually biutt or not.
Looks more closely to the log you just posted, you are getting the exact same error as I am ‘too big’.

These are the steps I took also, mind you, with my own files and using openwrt repos for the extra repos I need.

My flashed unit is all messed up so I’m not sure why/how yours could be working fine. I even tested this by running simply a normal build, ‘make image PROFILE=GL-MT300N’ no extra files or anything and still get the error.

 

I’m going to try one more time, this time with the network file error fixed (thanks) and with my usual files. I hope I don’t lose the device but I have no other way of knowing at this point what will happen since you are getting the same error.

By the way, I took the case off to try and repair the reset button. I don’t suppose you have a picture of an open case showing how those buttons go in there? It simply popped off when I was resetting.

 

I built the new image and flashed the device. It seems to work, my files are there. I’ll have to try it in bridged mode when I get a chance.
The only thing I don’t understand which I need to talk with our programmer about is why a program that runs fine on other ramips based devices won’t on this one.

opkg install ssam_latest_ramips.ipk

Installing ssam (1.33.094-1) to root…
Configuring ssam.
root@OpenWrt:/tmp# ssam
-ash: ssam: not found

So, the error doesn’t seem to affect anything? Can you confirm if this will be a software or hardware bridge set up as it is?

I also need to optimize the nics for the fastest throughput possible but am not sure what needs to be done.

PS: I can see how the buttons go back in so will put the case back together.

 

After read carefully, I confirm it is not “too big” error. Just read the text. It is in “if … then …” clause.

Also about “ssam”, again, this seems another easy problem. You just check if the ipk is good, and the “ssam” is installed in your PATH

Yes, the package is good, it runs on other ramips based devices, more specifically the A5-V11 I am testing.

So, do you have any thoughts on my other questions?

>Is this a hardware bridge now? I was told that the 6416 only does a software bridge.
>I also need to optimize the nics for the fastest throughput possible but am not sure what needs to be done.

 

@projects, it should be a software bridge. For MT300A and MT300N, it should be hardware bridge.

No idea about nics

Just to confirm 100%. The network setup we just did, this is a hardware bridge? This is as fast as we can make this bridge between the two ports right?

Yes. For MT300N and MT300A, with the following settings, the two Ethernet port is bridged, because they belong to the same hardware switch actually.

config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'dhcp'

Perfect, thanks very much for all the help. No one has said much about the error found in image builder so not sure anyone cares.

Very odd.

@project, pls check my previous reply. I didn’t find any error in image builder. Show me the text.

Well, I see it in your logs also.

Look for the warnings then near the end look for;

"Warning: /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/
build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/
openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin is too big"

it is NOT. It is in if … then . It means if it is too big, then it will tell you, but it it is not.

If the image is too big, you will not get the final image at all.

if [ stat -c%s "/data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin" -gt 16121856 ]; then echo "Warning: /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin is too big" >&2; else cp -fpR /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin /data4/openwrt-imagebuilder/OpenWrt-ImageBuilder-ramips-mt7620.Linux-x86_64/bin/ramips/openwrt-ramips-mt7620-gl-mt300n-squashfs-sysupgrade.bin; fi

 

That’s a good point. I wonder why no one in the forums caught that. Guess it explains why it works then.

So, why is it saying this at all then?

 

it is nature of Make. It displays the code, not only output.

Also for your “ssam”, you need some basic Linux skills to find out the reason.

I think more than just basic, more like programming skills. Our programmer is on vacation and I like to look into things to see if I might be able to find answers now and then.

I just noticed I am still asking one question :).

 

>I also need to optimize the nics for the fastest throughput possible but am not sure what needs to be done.