Flash Openwrt Attitude Adjustment on jjPlus JA76PF2

Preparation and installation of OpenWrt on the router jjPlus JA76PF02

Installing from console with serial connection

You should:

  • Shut down  the board
  • Connect the Ethernet cable to the router’s (WAN port) and the other end to your computer
  • Set the address of the network card on your computer to 192.168.1.1
  • Run a TFTPD server and put in its root the files openwrt-ar71xx-generic-ja76pf2-kernel.bin and openwrt-ar71xx-generic-ja76pf2-rootfs-squashfs.bin
  • Start the tftpd server
  • Connect the serial cable to the board
  • Start a serial terminal with parameters 8 n 1 115200
  • Turn on the board
  • and hit Ctrl-C to stop at the bootloader’s command line.  Now you are in RedBoot

Simply run the following commands:

    fis init
    load -r -b 0x80060000 openwrt-ar71xx-generic-ja76pf2-kernel.bin
    fis create linux
    load -r -b %{FREEMEMLO} openwrt-ar71xx-generic-ja76pf2-rootfs-squashfs.bin
    fis create rootfs
    fis load -l linux
    exec -c "board=JA76PF2" 

You should also remember to check the startup script (command fconfig-l bootloader) it should be as follows:

fis load -l linux
exec -c "board=JA76PF2" 

NOTE: The default IP address of the plate in the boot loader is 192.168.1.2. After installing OpenWrt address is normally set to 192.168.1.1

Setting up RedBoot Startup Script

If this is the first time you are setting up this board then you need to do the following

The default board settings are:
RedBoot> fconfig -l
Run script at boot: true
Boot script:
.. fis load -d vmlinux
.. exec
Boot script timeout (1000ms resolution): 3
Use BOOTP for network configuration: false
Gateway IP address: 0.0.0.0
Local IP address: 192.168.1.2
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.1
Console baud rate: 115200
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Default network device: ag7100_eth1
You should change them to:
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -d vmlinux
.. exec
Enter script, terminate with empty line
>> fis load -l linux
>> exec -c "board=JA76PF2"
>>
Boot script timeout (1000ms resolution): 10
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.2
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.1
Console baud rate: 115200
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Default network device: ag7100_eth1
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .

Installation by sysupgrade

Just as in normal OpenWrt sysupgrade upload a file to the router and issue the command sysupgrade-n image_name.

The temperature sensor

Please install i2c-tools package, kmod-i2c-core as well as their dependencies.

After this you will be able to read the temperature:

root@OpenWrt:/# i2cdetect -l
    i2c-0	i2c	i2c-gpio0	I2C adapter
    root@OpenWrt:/# i2cdetect i2c-gpio0
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will probe file /dev/i2c-0.
    I will probe address range 0x03-0x77.
    Continue? [Y/n] y
        0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --                         
    root@OpenWrt:/# i2cget i2c-gpio0 0x48 0xaa w
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will read from device file /dev/i2c-0, chip address 0x48, data address
    0xaa, using read word data.
    Continue? [Y/n]
    0x0133
    root@OpenWrt:/# 

and decode the resulting value.
You can also install kmod-hwmon-LM75 and LM75. Load the module with the parameter force = 0,0 x48. Temperature reading:

    # echo lm75 0x48 > /sys/devices/platform/i2c-gpio.0/i2c-0/new_device
    # cat /sys/devices/platform/i2c-gpio.0/i2c-0/0-0048/temp1_input

Comments are closed.