[Smart router] openwrt platform for beginners

Source: Internet
Author: User
Tags bitmask raspi

[Smart router] openwrt platform for beginners

From the beginning of this article, the subsequent articles will be converted into openwrt development, rather than development on a Linux kernel. Therefore, most of the articles are based on openwrt.

In my spare time, I have been focusing on openwrt and ffmpeg.
A MT7620 board at hand, the previous figure

Dual-band (2.4G and 5G)
8 M FLASH
64 M SRAM
CPU: MIPS24KEc
USB2.0
SD: SD-HC class10 (32 GB)

For other examples: I will not introduce it much. I have taken a fancy to two points. Both the SD interface and the USB interface are printed and the card holder and USB mother header are welded. you can insert an SD card, it is enough to store general data, web pages, and so on. There is only one USB port, which is a bit of a pity. However, I took a USB one by one, and a USB camera and a mobile hard disk can be mounted on the outside.Push the camera data to multicast or RTMP servers for video monitoring. Mobile hard disks are used to store videos. They are mounted to the web server and made an interface for users in the LAN to watch videos on the hard disk.

You are welcome to make some suggestions.

Previously, I used the sdks provided by MTK. There was only one Linux kernel and a few applications transplanted with MTK, which had a weak function.

Since then, I have privately started to toss openwrt and recorded it. This series of articles maintain the style of [smart router] practice, and strive to release every article after actual practice.
[Smart router] the practical process of openwrt begins.

Get the mtksdk-openwrt-3.10.14-20150311-d021c937.tar compressed package. The SDK and openwrt code package are not much different. They just remove some irrelevant platform code and compile it in the fedora environment, of course, in the virtual machine.

For non-root users (the root user does not pass the condition check and has already tried it ):
Decompress the package to generate the openwrt-3.10.14 directory, enter, execute make defconfig, and then make menuconfig a few eyes, the default MT7620 target board, and then start make V = 99, after compilation, an error occurs. The system prompts that a software version is too low. If you forget the software version, you can run the yum install-y xxx command.

The components required for installation and compilation are as follows, but I did not perform this step to install the components before the above problem occurs. You can also follow this step to install or upgrade these components before compiling:
These are the commands in Ubuntu (fedora and centos are yum install xxxx)
Sudo apt-get install gcc
Sudo apt-get install g ++
Sudo apt-get install binutils
Sudo apt-get install patch
Sudo apt-get install bzip2
Sudo apt-get install flex
Sudo apt-get install bison
Sudo apt-get install make
Sudo apt-get install autoconf
Sudo apt-get install gettext
Sudo apt-get install texinfo
Sudo apt-get install unzip
Sudo apt-get install sharutils
Sudo apt-get install subversion
Sudo apt-get install libncurses5-dev
Sudo apt-get install ncurses-term
Sudo apt-get install zlib1g-dev
Sudo apt-get install gawk
Sudo apt-get install asciidoc
Sudo apt-get install libz-dev

The installation process is smooth. The installation process will automatically download the corresponding meta-code package from the Internet, but it takes 7 hours to complete the installation because the company's network is too slow! The eggs are broken...

After the compilation from/binfile home out of the firmware openwrt-ramips-mt7620-uImage.bin, tftp imported to flash found that the startup is not up, the error is as follows:

LINUX started... THIS IS ASIC[    0.000000] Linux version 3.10.14 (cjpthree@F12) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 unknown) ) #3 Tue Jan 12 18:40:44 CST 2016[    0.000000] [    0.000000]  The CPU feqenuce set to 580 MHz[    0.000000] [    0.000000]  MIPS CPU sleep mode enabled.[    0.000000]  PCIE: bypass PCIe DLL....[    1.624000] spidrv_major = 217[    1.632000] deice id : ef 40 17 0 0 (40170000)[    1.640000] W25Q64BV(ef 40170000) (8192 Kbytes)[    1.648000] mtd .name = raspi, .size = 0x00800000 (0M) .erasesize = 0x00000008 (0K) .numeraseregions = 65536[    1.668000] Creating 5 MTD partitions on "raspi":[    1.676000] 0x000000000000-0x000000800000 : "ALL"[    1.688000] 0x000000000000-0x000000030000 : "Bootloader"[    1.700000] 0x000000030000-0x000000040000 : "Config"[    1.712000] 0x000000040000-0x000000050000 : "Factory"[    1.724000] 0x000000050000-0x000000800000 : "firmware"[    1.736000] 0x0000001b4812-0x000000800000 : "rootfs"[    1.744000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only[    1.772000] mtdsplit: no squashfs found in "raspi"[    1.784000] rdm_major = 253[    1.788000] SMACCR1 -- : 0x0000000c[    1.796000] SMACCR0 -- : 0x43762077[    1.804000] Ralink APSoC Ethernet Driver Initilization. v3.1  256 rx/tx descriptors allocated, mtu = 1500![    1.820000] SMACCR1 -- : 0x0000000c[    1.828000] SMACCR0 -- : 0x43762077[    1.836000] PROC INIT OK![    1.844000] Ralink APSoC Hardware Watchdog Timer[    1.852000] TCP: cubic registered[    1.860000] NET: Registered protocol family 10[    1.868000] NET: Registered protocol family 17[    1.876000] 8021q: 802.1Q VLAN Support v1.8[    1.908000] jffs2: Flash size not aligned to erasesize, reducing to 6400KiB[    1.924000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x9cfe instead[    1.940000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0xdd04 instead[    1.960000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xad0f instead[    1.980000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0xfe65 instead[    1.996000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0xf27e instead[    2.016000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x8f1d instead[    2.036000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x4f90 instead[    2.056000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x09de instead[    2.072000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x0189 instead[    2.092000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x0838 instead[    2.112000] jffs2: Further such events for this erase block will not be printed[    2.172000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001b7f0: 0x3d39 instead...[   16.672000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00630038: 0x5253 instead[   16.692000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00630044: 0x0001 instead[   16.712000] jffs2: Further such events for this erase block will not be printed[   16.748000] jffs2: Empty flash at 0x0063b7cc ends at 0x0063b7e4[   16.764000] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes[   16.780000] jffs2: empty_blocks 38, bad_blocks 0, c->nr_blocks 100[   16.796000] VFS: Cannot open root device "mtdblock5" or unknown-block(31,5): error -5[   16.808000] Please append a correct "root=" boot option; here are the available partitions:[   16.828000] 1f00            8192 mtdblock0  (driver?)[   16.836000] 1f01             192 mtdblock1  (driver?)[   16.848000] 1f02              64 mtdblock2  (driver?)[   16.856000] 1f03              64 mtdblock3  (driver?)[   16.868000] 1f04            7872 mtdblock4  (driver?)[   16.876000] 1f05            6445 mtdblock5  (driver?)[   16.888000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,5)

I browsed the last part of the compilation and found the following content:

...cp -fpR /home/cjpthree/study/MTK_SDKopenwrt/openwrt-3.10.14/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/openwrt-ramips-mt7620-mt7620-squashfs-sysupgrade.bin /home/cjpthree/study/MTK_SDKopenwrt/openwrt-3.10.14/bin/ramips/openwrt-ramips-mt7620-mt7620-squashfs-sysupgrade.bin;...

This only found the wrong firmware, the correct file should be a openwrt-ramips-mt7620-mt7620-squashfs-sysupgrade.bin. Therefore, if the "jffs2: Flash size not aligned to erasesize, redirect to 6400KiB" error is printed during vro startup, see if the firmware is downloaded incorrectly.

Openwrt can be started normally. Whether it is a command line interface or a web interface, it is very convenient to use and is proud of its uci and luci management.
Except that the usb interface cannot be used normally, other interfaces are normal. The next article solves the problem of USB interfaces.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.