User Tools

Site Tools


toh:kankun:kk-sp3

Kankun KK-SP3

  • similar hardware as the TL-WR703N.
  • Features:
    • Atheros AR9330 rev 1 at 400MHz
    • 4 MB flash memory
    • 32 MB RAM
    • 802.11 b/g/n
    • Powered via AC line power
    • 10A OMRON relay controlling AC power plug
    • No native ethernet or USB ports

Pictures

Kankun KK-SP3

Boot log (OpenWrt)

Dec 16 01:17:49.338904 ÿ Dec 16 01:17:49.339410 Dec 16 01:17:49.342535 U-Boot 1.1.4 (Aug 27 2011 - 10:39:39) Dec 16 01:17:49.342572 Dec 16 01:17:49.344905 AP121-2MB (ar9330) U-boot Dec 16 01:17:49.344943 Dec 16 01:17:49.346382 DRAM: 32 MB Dec 16 01:17:49.348243 led turning on for 1s... Dec 16 01:17:50.348558 id read 0x100000ff Dec 16 01:17:50.351751 flash size 4194304, sector count = 64 Dec 16 01:17:50.353169 Flash: 4 MB Dec 16 01:17:50.356481 Using default environment Dec 16 01:17:50.356518 Dec 16 01:17:50.358721 In: serial Dec 16 01:17:50.360130 Out: serial Dec 16 01:17:50.361122 Err: serial Dec 16 01:17:50.367798 Net: ag7240_enet_initialize... Dec 16 01:17:50.370928 Fetching MAC Address from 0x81ff41b8 Dec 16 01:17:50.374099 Fetching MAC Address from 0x81ff41b8 Dec 16 01:17:50.376317 : cfg1 0x5 cfg2 0x7114 Dec 16 01:17:50.378632 eth0: xx:xx:xx:xx:xx:xx Dec 16 01:17:50.380057 ag7240_phy_setup Dec 16 01:17:50.381024 eth0 up Dec 16 01:17:50.879055 : cfg1 0xf cfg2 0x7214 Dec 16 01:17:50.881333 eth1: xx:xx:xx:xx:xx:xx Dec 16 01:17:50.883204 athrs26_reg_init_lan Dec 16 01:17:50.885045 ATHRS26: resetting s26 Dec 16 01:17:50.887332 ATHRS26: s26 reset done Dec 16 01:17:50.889967 ag7240_phy_setup Dec 16 01:17:50.898962 eth1 up Dec 16 01:17:50.899995 eth0, eth1 Dec 16 01:17:50.902337 Autobooting in 1 seconds Dec 16 01:17:51.901695 ## Booting image at 9f020000 ... Dec 16 01:17:53.177513 Uncompressing Kernel Image ... OK Dec 16 01:17:53.178153 Dec 16 01:17:53.179834 Starting kernel ... Dec 16 01:17:53.179870 Dec 16 01:17:53.190949 [ 0.000000] Linux version 3.10.26 (zhaoyuanbiao@ubuntu)(gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r39365) ) #44 Tue Jul 29 11:44:32 CST 2014 Dec 16 01:17:53.196388 [ 0.000000] bootconsole [early0] enabled Dec 16 01:17:53.201059 [ 0.000000] CPU revision is: 00019374 (MIPS 24Kc) Dec 16 01:17:53.204184 [ 0.000000] SoC: Atheros AR9330 rev 1 Dec 16 01:17:53.211647 [ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz Dec 16 01:17:53.215181 [ 0.000000] Determined physical RAM map: Dec 16 01:17:53.219955 [ 0.000000] memory: 02000000 @ 00000000 (usable) Dec 16 01:17:53.224788 [ 0.000000] Initrd not found or empty - disabling initrd Dec 16 01:17:53.227466 [ 0.000000] Zone ranges: Dec 16 01:17:53.231879 [ 0.000000] Normal [mem 0x00000000-0x01ffffff] Dec 16 01:17:53.235805 [ 0.000000] Movable zone start for each node Dec 16 01:17:53.239402 [ 0.000000] Early memory node ranges Dec 16 01:17:53.243819 [ 0.000000] node 0: [mem 0x00000000-0x01ffffff] Dec 16 01:17:53.253962 [ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. Dec 16 01:17:53.261018 [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes Dec 16 01:17:53.268413 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 Dec 16 01:17:53.277891 [ 0.000000] Kernel command line: board=TL-WR703N console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd Dec 16 01:17:53.283574 [ 0.000000] PID hash table entries: 128 (order: 3, 512 bytes) Dec 16 01:17:53.289872 [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Dec 16 01:17:53.296219 [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Dec 16 01:17:53.300308 [ 0.000000] Writing ErrCtl register=00000000 Dec 16 01:17:53.304393 [ 0.000000] Readback ErrCtl register=00000000 Dec 16 01:17:53.317432 [ 0.000000] Memory: 28784k/32768k available (2201k kernel code, 3984k reserved, 592k data, 276k init, 0k highmem) Dec 16 01:17:53.323499 [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Dec 16 01:17:53.325772 [ 0.000000] NR_IRQS:51 Dec 16 01:17:53.407448 [ 0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104) Dec 16 01:17:53.411897 [ 0.080000] pid_max: default: 32768 minimum: 301 Dec 16 01:17:53.416334 [ 0.080000] Mount-cache hash table entries: 512 Dec 16 01:17:53.422608 [ 0.090000] NET: Registered protocol family 16 Dec 16 01:17:53.430122 [ 0.100000] MIPS: machine is TP-LINK TL-WR703N v1 Dec 16 01:17:53.684589 [ 0.350000] bio: create slab <bio-0> at 0 Dec 16 01:17:53.691462 [ 0.360000] Switching to clocksource MIPS Dec 16 01:17:53.698371 [ 0.360000] NET: Registered protocol family 2 Dec 16 01:17:53.704901 [ 0.370000] TCP established hash table entries: 512 (order: 0, 4096 bytes) Dec 16 01:17:53.710997 [ 0.370000] TCP bind hash table entries: 512 (order: -1, 2048 bytes) Dec 16 01:17:53.717047 [ 0.370000] TCP: Hash tables configured (established 512 bind 512) Dec 16 01:17:53.720175 [ 0.380000] TCP: reno registered Dec 16 01:17:53.725469 [ 0.380000] UDP hash table entries: 256 (order: 0, 4096 bytes) Dec 16 01:17:53.731580 [ 0.390000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) Dec 16 01:17:53.735610 [ 0.400000] NET: Registered protocol family 1 Dec 16 01:17:53.759185 [ 0.420000] squashfs: version 4.0 (2009/01/31) Phillip Lougher Dec 16 01:17:53.768774 [ 0.420000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. Dec 16 01:17:53.772668 [ 0.430000] msgmni has been set to 56 Dec 16 01:17:53.776294 [ 0.440000] io scheduler noop registered Dec 16 01:17:53.781122 [ 0.440000] io scheduler deadline registered (default) Dec 16 01:17:53.787194 [ 0.450000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled Dec 16 01:17:53.794222 [ 0.450000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART Dec 16 01:17:53.799853 [ 0.460000] console [ttyATH0] enabled, bootconsole disabled Dec 16 01:17:53.805520 [ 0.460000] console [ttyATH0] enabled, bootconsole disabled Dec 16 01:17:53.812413 [ 0.470000] ath79-spi ath79-spi: master is unqueued, this is deprecated Dec 16 01:17:53.818998 [ 0.480000] m25p80 spi0.0: found w25q32, expected m25p80 Dec 16 01:17:53.823404 [ 0.480000] m25p80 spi0.0: w25q32 (4096 Kbytes) Dec 16 01:17:53.829050 [ 0.490000] 5 tp-link partitions found on MTD device spi0.0 Dec 16 01:17:53.833859 [ 0.490000] Creating 5 MTD partitions on "spi0.0": Dec 16 01:17:53.838634 [ 0.500000] 0x000000000000-0x000000020000 : "u-boot" Dec 16 01:17:53.844311 [ 0.500000] 0x000000020000-0x000000119a18 : "kernel" Dec 16 01:17:53.855789 [ 0.510000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block - forcing read-only Dec 16 01:17:53.862330 [ 0.520000] 0x000000119a18-0x0000003f0000 : "rootfs" Dec 16 01:17:53.873651 [ 0.530000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only Dec 16 01:17:53.880787 [ 0.540000] mtd: device 2 (rootfs) set to be root filesystem Dec 16 01:17:53.887046 [ 0.540000] 1 squashfs-split partitions found on MTD device rootfs Dec 16 01:17:53.892424 [ 0.550000] 0x0000002f0000-0x0000003f0000 : "rootfs_data" Dec 16 01:17:53.897676 [ 0.560000] 0x0000003f0000-0x000000400000 : "art" Dec 16 01:17:53.903254 [ 0.560000] 0x000000020000-0x0000003f0000 : "firmware" Dec 16 01:17:53.922928 [ 0.580000] libphy: ag71xx_mdio: probed Dec 16 01:17:54.480824 [ 1.140000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY] Dec 16 01:17:54.486941 [ 1.150000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII Dec 16 01:17:54.490398 [ 1.150000] TCP: cubic registered Dec 16 01:17:54.494750 [ 1.150000] NET: Registered protocol family 17 Dec 16 01:17:54.498759 [ 1.160000] 8021q: 802.1Q VLAN Support v1.8 Dec 16 01:17:54.513264 [ 1.170000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2. Dec 16 01:17:54.520261 [ 1.180000] Freeing unused kernel memory: 276K (8031b000 - 80360000) Dec 16 01:17:55.805723 procd: Console is alive Dec 16 01:17:55.807580 procd: - watchdog Dec 16 01:17:55.809439 procd: - preinit - Dec 16 01:17:57.253068 Press the [f] key and hit [enter] to enter failsafe mode Dec 16 01:17:57.260031 Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level Dec 16 01:17:59.453587 mount_root: jffs2 is ready Dec 16 01:17:59.503442 [ 6.160000] jffs2: notice: (292) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (1 unchecked, 2 orphan) and 43 of xref (0 dead, 30 orphan) found. Dec 16 01:17:59.540719 procd: - early - Dec 16 01:17:59.542540 procd: - watchdog - Dec 16 01:18:00.283517 procd: - ubus - Dec 16 01:18:00.284942 procd: - init - Dec 16 01:18:00.518039 Please press Enter to activate this console. Dec 16 01:18:00.687922 [ 7.350000] NET: Registered protocol family 10 Dec 16 01:18:00.703478 [ 7.360000] nf_conntrack version 0.5.0 (454 buckets, 1816 max) Dec 16 01:18:00.715577 [ 7.370000] ip6_tables: (C) 2000-2006 Netfilter Core Team Dec 16 01:18:00.743503 [ 7.400000] Loading modules backported from Linux version master-2013-11-05-0-gafa3093 Dec 16 01:18:00.750833 [ 7.410000] Backport generated by backports.git backports-20130802-0-gdb67a3f Dec 16 01:18:00.758530 [ 7.420000] ip_tables: (C) 2000-2006 Netfilter Core Team Dec 16 01:18:00.807247 [ 7.470000] xt_time: kernel timezone is -0000 Dec 16 01:18:00.837310 [ 7.500000] cfg80211: Calling CRDA to update world regulatory domain Dec 16 01:18:00.842544 [ 7.500000] cfg80211: World regulatory domain updated: Dec 16 01:18:00.850758 [ 7.510000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Dec 16 01:18:00.858551 [ 7.510000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Dec 16 01:18:00.866374 [ 7.520000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Dec 16 01:18:00.873744 [ 7.530000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) Dec 16 01:18:00.881550 [ 7.540000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm) Dec 16 01:18:00.889385 [ 7.540000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm) Dec 16 01:18:00.896736 [ 7.550000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm) Dec 16 01:18:00.965119 [ 7.630000] PPP generic driver version 2.4.2 Dec 16 01:18:00.971586 [ 7.630000] NET: Registered protocol family 24 Dec 16 01:18:01.073240 [ 7.730000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2 Dec 16 01:18:01.077877 [ 7.740000] cfg80211: Calling CRDA for country: US Dec 16 01:18:01.083530 [ 7.740000] cfg80211: Regulatory domain changed to country: US Dec 16 01:18:01.087886 [ 7.750000] cfg80211: DFS Master region FCC Dec 16 01:18:01.096132 [ 7.750000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Dec 16 01:18:01.103962 [ 7.760000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm) Dec 16 01:18:01.142643 [ 7.770000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 1700 mBm) Dec 16 01:18:01.142836 [ 7.770000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (300 mBi, 2400 mBm) Dec 16 01:18:01.143024 [ 7.780000] cfg80211: (5490000 KHz - 5600000 KHz @ 80000 KHz), (300 mBi, 2400 mBm) Dec 16 01:18:01.143211 [ 7.790000] cfg80211: (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2400 mBm) Dec 16 01:18:01.143399 [ 7.800000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 3000 mBm) Dec 16 01:18:01.150029 [ 7.810000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Dec 16 01:18:07.359032 [ 14.020000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Dec 16 01:18:08.522902 [ 15.180000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Dec 16 01:18:08.826665 procd: - init complete - Dec 16 01:18:10.584202 [ 17.240000] wlan0: authenticate with xx:xx:xx:xx:xx:xx Dec 16 01:18:10.594845 [ 17.250000] wlan0: send auth to xx:xx:xx:xx:xx:xx (try 1/3) Dec 16 01:18:10.599527 [ 17.260000] wlan0: authenticated Dec 16 01:18:10.607288 [ 17.270000] wlan0: associate with xx:xx:xx:xx:xx:xx (try 1/3) Dec 16 01:18:10.616884 [ 17.270000] wlan0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x431 status=0 aid=2) Dec 16 01:18:10.619946 [ 17.280000] wlan0: associated Dec 16 01:18:10.626073 [ 17.280000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready Dec 16 01:18:14.422266 Dec 16 01:18:14.427866 Dec 16 01:18:14.427902 Dec 16 01:18:14.433398 BusyBox v1.19.4 (2014-03-27 17:39:06 CST) built-in shell (ash) Dec 16 01:18:14.437389 Enter 'help' for a list of built-in commands. Dec 16 01:18:14.438060 Dec 16 01:18:14.440589 _ _ _ Dec 16 01:18:14.444432 | | _| ___ ___ | | | ___ __ Dec 16 01:18:14.448212 | | || || | || | Dec 16 01:18:14.452424 | | | || | || | | __|| | Dec 16 01:18:14.456336 | _ - |_____||__|__|| _ -_ |_____||__| Dec 16 01:18:14.459857 |_| -__| S M A L L |_| -__| S M A R T Dec 16 01:18:14.464688 ---------------------------------------------------- Dec 16 01:18:14.469143 KONKE Technology Co., Ltd. All rights reserved. Dec 16 01:18:14.474000 --------------------------------------------------- Dec 16 01:18:14.479053 * www.konke.com All other products and Dec 16 01:18:14.483685 * QQ:27412237 company names mentioned Dec 16 01:18:14.488387 * 400-871-3766 may be the trademarks of Dec 16 01:18:14.493126 * fae@konke.com their respective owners. Dec 16 01:18:14.497962 --------------------------------------------------- Dec 16 01:18:18.246024 root@koven:/#


Getting shell access

These devices are preconfigured to act as an AP initially. Simply connect to its unencrypted network, and ssh to the device. The default root password seems to be p9z34c, admin or 1234. Once you've gained root shell access, edit /etc/config/network and /etc/config/wireless. You probably want the device to act as a client in your existing wifi network:

root@koven:~# cat /etc/config/network 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 'fd17:d40d:f634::/48' config interface 'lan' option ifname 'eth0' option type 'bridge' option proto 'static' option ipaddr '192.168.10.253' option netmask '255.255.255.0' option ip6assign '60' config interface 'wwan' option proto 'dhcp' root@koven:~# cat /etc/config/wireless config wifi-device radio0 option type mac80211 option channel 11 option hwmode 11ng option path 'platform/ar933x_wmac' option htmode HT20 list ht_capab SHORT-GI-20 list ht_capab SHORT-GI-40 list ht_capab RX-STBC1 list ht_capab DSSS_CCK-40 option disabled 0 option country CN config wifi-iface option device radio0 option network wwan option mode sta option ssid MyNetwork option encryption psk option key secretkey123


The stock firmware includes a couple of binaries (kkeps_*) that phone home to servers in China in order to offer cloud based access to the device through your smartphone. If you're keeping the stock firmware, consider disabling these in the startup scripts:

root@koven:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
#sleep 5
#/sbin/kkeps_on &
#/sbin/kkeps_off &
#/sbin/kkeps_seekwifi &
#/sbin/kkeps_reconect &

exit 0

Flashing

Flashing stock OpenWrt from the shell using sysupgrade works fine. I used openwrt-15.05.1-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin.

BEWARE, there are problems however:

  • The device has no ethernet port, so wireless must be enabled.
  • Stock openwrt firmware images has wireless disabled.

Theoretically sysupgrade -c should solve these problems, but for me 1 out of 3 Chaos Calmer upgrades failed to preserve /etc/config/wireless and all other changed config files, leaving the device unreachable.

You might want to play around with sysupgrade -l, -T or -i to make sure your config files is preserved during upgrade. Perhaps -b and -f is the safest way.

Another option would be to use the OpenWrt firmware image builder, and customize the image to include a wireless configuration that's enabled by default. See the comments in https://plus.google.com/116498915170668533255/posts/U4RhQYRShB6. Flashing this custom image would be safer with regards to misbehaving sysupgrade -c. Use -v with sysupgrade, since that will tell you which files will be preserved.

If the device has its wireless interface disabled, i.e. unreachable, you will have to pry open the case and solder cables to the serial headers on the pcb to fix it.

For more information, see https://plus.google.com/+MarcoTrevisan/posts/JWdsGkTU9ng and https://plus.google.com/108517425068864855690/posts/8unrogtCPFL

Operating the relay and LEDs

Stock firmware:

ON:
echo 1 > /sys/class/leds/tp-link:blue:relay/brigh­tness
OFF
echo 0 > /sys/class/leds/tp-link:blue:relay/brigh­tness

OpenWrt 15.05:

SETUP:
echo 26 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio26/direction
ON:
echo 1 > /sys/devices/virtual/gpio/gpio26/value
OFF:
echo 0 > /sys/devices/virtual/gpio/gpio26/value

For the stock firmware, you can configure the LEDs to act on certain events. Blink blue with network traffic:

uci set system.@led[0].name=wwan-link
uci set system.@led[0].trigger=netdev
uci set system.@led[0].dev=wlan0
uci set system.@led[0].mode='link tx rx'
uci commit system
/etc/init.d/led start

The relay is tied to the red LED, so setting the LED to default ON will make the relay ON after bootup:

uci set system.@led[1].default=1
uci commit system
toh/kankun/kk-sp3.txt · Last modified: 2017/04/03 10:22 by user123