KKM KGateway KG01

Linux (none) 4.14.151 #0 Tue Nov 5 14:12:18 2019 mips GNU/Linux

root password hash

root:$1$HM2Qn8zr$GK2/Vto8EKby6vtNZ3U/C.:18084:0:99999:7:::

dmesg

[    0.000000] Linux version 4.14.151 (ytw@ubuntu) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7897-9d401013fc)) #0 Tue Nov 5 14:12:18 2019
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is KG
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat 8047a550, node_mem_map 81000040
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x478 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=0000000d
[    0.000000] Readback ErrCtl register=0000000d
[    0.000000] Memory: 124812K/131072K available (3549K kernel code, 182K rwdata, 856K rodata, 204K init, 210K bss, 6260K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] intc: using register map from devicetree
[    0.000000] CPU Clock: 580MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015507] Console: colour dummy device 80x25
[    0.024173] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087594] pid_max: default: 32768 minimum: 301
[    0.096946] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109906] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.129742] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.149120] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.161221] pinctrl core: initialized pinctrl subsystem
[    0.171985] NET: Registered protocol family 16
[    0.184001] rt2880-pinmux pinctrl: invalid group "gpio" for function "gpio"
[    0.303933] mt7620-pci 10140000.pcie: Port 0 N_FTS = 1b105000
[    0.464942] mt7620-pci 10140000.pcie: PCIE0 no card, disable it(RST&CLK)
[    0.478086] mt7620-pci: probe of 10140000.pcie failed with error -1
[    0.511475] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.522699] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.533830] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.549712] clocksource: Switched to clocksource MIPS
[    0.566319] NET: Registered protocol family 2
[    0.575732] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.589434] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.601951] TCP: Hash tables configured (established 1024 bind 1024)
[    0.614651] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.626108] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.638709] NET: Registered protocol family 1
[    0.647236] PCI: CLS 0 bytes, default 32
[    0.661054] Crashlog allocated RAM at address 0x3f00000
[    0.672845] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.691368] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.702801] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.731799] io scheduler noop registered
[    0.739412] io scheduler deadline registered (default)
[    0.750650] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.764404] console [ttyS0] disabled
[    0.771433] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.789260] console [ttyS0] enabled
[    0.802994] bootconsole [early0] disabled
[    0.819495] 10000d00.uart1: ttyS1 at MMIO 0x10000d00 (irq = 29, base_baud = 2500000) is a 16550A
[    0.837619] 10000e00.uart2: ttyS2 at MMIO 0x10000e00 (irq = 30, base_baud = 2500000) is a 16550A
[    0.856499] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.881675] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.891074] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.903660] Creating 4 MTD partitions on "spi0.0":
[    0.913157] 0x000000000000-0x000000030000 : "u-boot"
[    0.923941] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.935373] 0x000000040000-0x000000050000 : "factory"
[    0.946303] 0x000000050000-0x000001000000 : "firmware"
[    0.992840] 2 uimage-fw partitions found on MTD device firmware
[    1.004601] 0x000000050000-0x0000001c8e76 : "kernel"
[    1.015359] 0x0000001c8e76-0x000001000000 : "rootfs"
[    1.026047] mtd: device 5 (rootfs) set to be root filesystem
[    1.038739] 1 squashfs-split partitions found on MTD device rootfs
[    1.051046] 0x0000008e0000-0x000001000000 : "rootfs_data"
[    1.063688] libphy: Fixed MDIO Bus: probed
[    1.082847] rt3050-esw 10110000.esw: link changed 0x00
[    1.094697] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.112941] NET: Registered protocol family 10
[    1.125837] Segment Routing with IPv6
[    1.133277] NET: Registered protocol family 17
[    1.142141] 8021q: 802.1Q VLAN Support v1.8
[    1.158508] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    1.173644] Freeing unused kernel memory: 204K
[    1.182468] This architecture does not have kernel memory protection.
[    2.079450] init: Console is alive
[    2.086515] init: - watchdog -
[    2.509721] random: fast init done
[    3.810573] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.028253] usbcore: registered new interface driver usbfs
[    4.039269] usbcore: registered new interface driver hub
[    4.049913] usbcore: registered new device driver usb
[    4.093830] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.115962] SCSI subsystem initialized
[    4.128879] ehci-platform: EHCI generic platform driver
[    4.149608] phy phy-10120000.usbphy.0: remote usb device wakeup disabled
[    4.162900] phy phy-10120000.usbphy.0: UTMI 16bit 30MHz
[    4.173267] ehci-platform 101c0000.ehci: EHCI Host Controller
[    4.184685] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    4.200485] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    4.239757] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    4.253222] hub 1-0:1.0: USB hub found
[    4.261083] hub 1-0:1.0: 1 port detected
[    4.272417] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    4.286437] ohci-platform: OHCI generic platform driver
[    4.297142] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[    4.310657] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    4.326457] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    4.404709] hub 2-0:1.0: USB hub found
[    4.412632] hub 2-0:1.0: 1 port detected
[    4.433410] MTK MSDC device init.
[    4.499942] mtk-sd: MediaTek MT6575 MSDC Driver
[    4.514844] usbcore: registered new interface driver usb-storage
[    4.530238] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.555108] init: - preinit -
[    4.629759] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    4.996767] hub 1-1:1.0: USB hub found
[    5.093466] hub 1-1:1.0: 4 ports detected
[    5.326965] random: procd: uninitialized urandom read (4 bytes read)
[    5.546240] usb 1-1.3: new full-speed USB device number 3 using ehci-platform
[    6.052869] rt3050-esw 10110000.esw: link changed 0x00
[    9.315290] random: dropbearkey: uninitialized urandom read (32 bytes read)
[    9.330781] random: dropbearkey: uninitialized urandom read (32 bytes read)
[   10.986143] random: dropbearkey: uninitialized urandom read (32 bytes read)
[   11.097867] random: dropbear: uninitialized urandom read (32 bytes read)
[   11.326596] rt3050-esw 10110000.esw: link changed 0x01
[   30.627815] mount_root: loading kmods from internal overlay
[   30.680736] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[   30.696209] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[   31.706485] jffs2: notice: (524) jffs2_build_xattr_subsystem: complete building xattr subsystem, 11 of xdatum (2 unchecked, 9 orphan) and 51 of xref (7 dead, 20 orphan) found.
[   31.738182] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   31.756797] block: extroot: not configured
[   31.837780] jffs2: notice: (522) jffs2_build_xattr_subsystem: complete building xattr subsystem, 11 of xdatum (2 unchecked, 9 orphan) and 51 of xref (7 dead, 20 orphan) found.
[   32.447363] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   32.466122] block: extroot: not configured
[   32.475626] mount_root: switching to jffs2 overlay
[   32.525329] overlayfs: upper fs does not support tmpfile.
[  114.059772] random: crng init done

Main application source code

Lua and decompiled python.

Download

down_data_mgr.py

Handles decoding and dispatch of mqtt/json messages from the remote router/server.

http_client_mgr.py

Periodically POSTs data to an HTTP[S]* endpoint and handles a response. This is complicated by a queuing system to preserve data if the HTTP server is down.

location_mgr.py

GPS (serial) driver for optional attached cellular baseband.

main.py

Entrypoint. Spawns 5