Persistent Flashing Issues with OpenWrt 23.05.0 on SamKnows SK-WB8+: Failsafe Mode and TFTP Transfer Problems

Embarking on a tech adventure, I've dedicated the past week to flashing OpenWrt 23.05.0 onto my SamKnows SK-WB8+ device. My journey was inspired by a detailed forum post on OpenWrt, and equipped with the right tools (DSD TECH SH-U09C USB to TTL Serial Adapter with FTDI FT232RL Chip and an Elegoo 120pcs Multicolored Dupont Wire kit), I felt prepared for the task.

The prep work involved diving into several resources:

EDIT: Since the links to the OpenWRT and TFTP section are offline on the Wiki, I have included a link to them in my ProtonDrive here as I had already saved the PDFs when I was preparing to do this project:

Issue Encountered

Initially, things were looking up with a smooth serial connection and easy access through PuTTY, allowing me to navigate the router's interface without the common hiccups. Failsafe mode was accessible, and I could follow through with the needed steps, including option selection.

However, I've encountered a significant blockade with the TFTP transfer – it's just not happening. More troubling, I've now lost the ability to even enter Failsafe mode, a regression in my troubleshooting journey. This setback is compounded by the fact that despite my efforts to share detailed logs and terminal outputs, my pleas for assistance seem to be overlooked, or brushed aside.

Logs and Further Details

I have meticulously captured all relevant logs and terminal outputs, ready to share for a deeper analysis, and have shared. My attempts at reaching out for guidance were often met with generic advice to "go learn TFTP," disregarding the detailed documentation of my process and the unique problems at hand.

Request for Assistance

I'm starting my own post here with genuine hope of a collaborative problem-solving approach. Seeing as I was sent on wild goose chases into changes that have now set me back further than I was, I want to course correct. The challenge of learning from failure is one I embrace, but I find myself in need of direction to understand where my process is faltering. I have engaged our employee learning resources with Hack The Box, DataCamp and Udemy Business all to learn more in prep for this but until I figure out where I went wrong, I can't go any further.

Your expertise, insights, or even a fresh perspective on my captured logs could shine a light on the path forward. I am fully committed to the work required; I just need that initial spark to guide me.

Here is the last PuTTy log that should my ability to get into the failsafe mode and then all of a sudden, poof, its gone. Please don't come back at me and say, "get good" or something like that. If there is work involved, give me the work, set me on the right path and I will learn.

Thank you for considering my request. Any assistance, advice, or guidance you can offer would be deeply appreciated.

TFTP from server 192.168.2.10; our IP address is 192.168.2.2
 
Filename 'firm.bin'.
 
 
 TIMEOUT_COUNT=10,Load address: 0x80100000
 
Loading: *Got ARP REPLY, set server/gtwy eth addr (e8:6a:64:f6:57:e8)
 
Got it

this suggests that the router did find your computer/ tftp server (in the sense of resolving 192.168.2.10 to your computer's MAC address ( e8:6a:64:xx:xx:xx), that's good so far.

T T 

At this point the tftp request of your router to the tftp-server on your computer is timing out, as the tftpd on your computer doesn't answer. This suggests a host side firewall issue on your computer - or you didn't start the tftpd in the first place.

Abort
 
Done!
 
## Booting image at bc050000 ...
 
   Image Name:   MIPS LEDE Linux-4.4.79

All this is just a consequence of your tftpd no responding, the router gets impatient and falls back to booting the already installed OEM firmware from flash.

Investigate why the router can't fetch firm.bin from your tftpd, check (disable) the firewall, ramp up your tftpd's logging, try to GET the file manually with a tftp client (on your own computer, better from a second one attached to it). Check what's happening on the wire, e.g. using wireshark.

Thanks! I appreciate you chiming in so quickly but I do need to say that that is but the start of my log entries and all those concerns were since resolved. Specifically, I performed both sudo ufw allow 69/udp and sudo ufw disable in an attempt to try allowing it through. In order to make sure it wasn't an operating system issue, I even went off my Linux Mint 21.2 XCFE and went to my Windows 11 Enterprise and proceeded to both open port 69 on all Networks (public, private and domain) and also disabling the firewall in Windows Security. With Windows 11 Enterprise, I have the same level of control I would have in my Linux environment and the issue still persisted. I was able to Dism /online /Enable-Feature /FeatureName:TFTP /All and netsh advfirewall firewall add rule name="TFTP" dir=in action=allow protocol=udp localport=69 remoteip=localsubnet interfacetype=lan profile=private,public and more, to no effect. Like I said, I read the guides and followed them verbatim until such a point when they became very poorly worded and I had to make guesses on what it meant while working with my OpenAI API running GPT-4 Turbo to try and reason some of it through.

Using the two environments meant that I could also try out two different TFTP programs. In Linux Mint 21.2. XFCE I used tftpd-hpa and every single time I went to perform the transfer, I would use sudo systemctl status tftpd-hpa to check the status of the server, followed by if config andip a, as well as a check on sudo ufw status numbered in order to make sure it was working. On Windows 11 Enterprise, I used tftpd64's GUI and was able to at least see that it was communicating but I was not very familiar with how it operates.

My logging was increased to verbose wherever possible and I even did monitoring of syslog where I could. I have those logs if you want.

I even took the time to check if I could receive a .txt file and then if I could get the firm.bin file locally as well and I could. If you read my later logs all the way down in that other post, I do just as you asked and the issue is that I don't know what I don't know, you know? You're asking me to investigate something where I am able to pull the data but I don't know what to look for because in all honesty, it should be working. Here is that log:

user@user-TC-M720q:~$ tftp 10.10.10.3
tftp> get firmware.bin
Received 5780700 bytes in 0.2 seconds
tftp> get firmware.bin
Received 5780700 bytes in 0.3 seconds
tftp> z^Z
[2]+  Stopped                 tftp 10.10.10.3
user@user-TC-M720q:~$ ip addr show
sudo ip addr add 10.10.10.3/24 dev eno1
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e8:6a:64:f6:57:e8 brd ff:ff:ff:ff:ff:ff
    altname enp0s31f6
    inet 10.10.10.3/24 scope global eno1
       valid_lft forever preferred_lft forever
8: wlx002e2dc03533: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:2e:2d:c0:35:33 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.77/24 brd 10.0.0.255 scope global dynamic noprefixroute wlx002e2dc03533
       valid_lft 119808sec preferred_lft 119808sec
    inet6 2607:fea8:fec0:7498::c8e9/128 scope global dynamic noprefixroute 
       valid_lft 853sec preferred_lft 253sec
    inet6 2607:fea8:fec0:7498:a02:7c05:5622:893/64 scope global temporary dynamic 
       valid_lft 301sec preferred_lft 301sec
    inet6 2607:fea8:fec0:7498:7357:2659:707a:7518/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 301sec preferred_lft 301sec
    inet6 fe80::b03:f7e6:2545:aff7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
user@user-TC-M720q:~$ sudo systemctl start tftpd-hpa
user@user-TC-M720q:~$ sudo systemctl status tftpd-hpa
● tftpd-hpa.service - LSB: HPA's tftp server
     Loaded: loaded (/etc/init.d/tftpd-hpa; generated)
     Active: active (running) since Tue 2024-02-06 13:08:07 EST; 11min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 243266 ExecStart=/etc/init.d/tftpd-hpa start (code=exited, status=0/SUCCESS)
      Tasks: 25 (limit: 18867)
     Memory: 6.6M
        CPU: 536ms
     CGroup: /system.slice/tftpd-hpa.service
             β”œβ”€243274 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243770 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243775 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243777 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243782 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243786 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243790 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243793 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243797 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243805 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243809 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243813 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243816 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243819 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243830 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243833 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243837 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243841 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243846 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243850 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243853 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243857 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243864 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             β”œβ”€243868 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/
             └─243872 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /srv/tftp/

Feb 06 13:08:07 user-TC-M720q systemd[1]: Starting LSB: HPA's tftp server...
Feb 06 13:08:07 user-TC-M720q tftpd-hpa[243266]:  * Starting HPA's tftpd in.tftpd
Feb 06 13:08:07 user-TC-M720q tftpd-hpa[243266]:    ...done.
Feb 06 13:08:07 user-TC-M720q systemd[1]: Started LSB: HPA's tftp server.
user@user-TC-M720q:~$ sudo cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp/"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
user@user-TC-M720q:~$ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 9] 69/udp                     ALLOW IN    Anywhere                  
[18] 69/udp (v6)                ALLOW IN    Anywhere (v6)             

user@user-TC-M720q:~$ ls -l /srv/tftp
total 5604
-rw-rw-rw- 1 root tftp 5735964 Feb  6 09:08 firmware.bin
user@user-TC-M720q:~$ ls -l /srv/tftp/firmware.bin
-rw-rw-rw- 1 root tftp 5735964 Feb  6 09:08 /srv/tftp/firmware.bin

Nevertheless, the pastebin log is the key piece now as, the last person who told me to "figure out TFTP" led to me trying a bunch of different options and now I cannot even get to the point I was at before, even if I tried. I know that the pastebin log is long but its the clearest thing I have that says what was working at one point:

===================================================================
 
            MT7621   stage1 code done 
 
            CPU=500000000 HZ BUS=125000000 HZ
 
===================================================================
 
 
 
U-Boot 1.1.3 (Jan 15 2016 - 09:47:18)
 
 
Board: Ralink APSoC DRAM:  128 MB
 
relocate_code Pointer at: 87fb8000
 
 
Config XHCI 40M PLL 
 
flash manufacture id: ef, device id 40 18
 
find flash: W25Q128BV
 
============================================ 
 
Ralink UBoot Version: 4.3.0.0
 
-------------------------------------------- 
 
ASIC MT7621A DualCore (MAC to MT7530 Mode)
 
DRAM_CONF_FROM: Auto-Detection 
 
DRAM_TYPE: DDR2 
 
DRAM bus: 16 bit
 
Xtal Mode=3 OCP Ratio=1/4
 
Flash component: SPI Flash
 
Date:Jan 15 2016  Time:09:47:18
 
============================================ 
 
icache: sets:256, ways:4, linesz:32 ,total:32768
 
dcache: sets:256, ways:4, linesz:32 ,total:32768 
 
 
 ##### The CPU freq = 880 MHZ #### 
 
 estimate memory size =128 Mbytes
 
#Reset_MT7530
 
 
Please choose the operation: 
 
   1: Load system code to SDRAM via TFTP. 
 
   2: Load system code then write to Flash via TFTP. 
 
   3: Boot system code via Flash (default).
 
   4: Entr boot command line interface.
 
   7: Load Boot Loader code then write to Flash via Serial. 
 
   9: Load Boot Loader code then write to Flash via TFTP. 
 
 
 
You choosed 2
 
 
 0 
 
 
   
 
2: System Load Linux Kernel then write to Flash via TFTP. 
 
 Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)
 
 Please Input new ones /or Ctrl-C to discard
 
    Input device IP (10.98.11.62) ==:10.98.11.62           192.168.2.1 2
 
    Input server IP (10.10.10.3) ==:10.10.10.3          192.168.2.10
 
    Input Linux Kernel filename () ==:firm.bin
 
 
 netboot_common, argc= 3 
 
 
 NetTxPacket = 0x87FE4B80 
 
 
 KSEG1ADDR(NetTxPacket) = 0xA7FE4B80 
 
 
 NetLoop,call eth_halt ! 
 
 
 NetLoop,call eth_init ! 
 
Trying Eth0 (10/100-M)
 
 
 Waitting for RX_DMA_BUSY status Start... done
 
 
 
 ETH_STATE_ACTIVE!! 
 
TFTP from server 192.168.2.10; our IP address is 192.168.2.2
 
Filename 'firm.bin'.
 
 
 TIMEOUT_COUNT=10,Load address: 0x80100000
 
Loading: *Got ARP REPLY, set server/gtwy eth addr (e8:6a:64:f6:57:e8)
 
Got it
 
T T 
 
Abort
 
Done!

And here:

1. Press the [f] key and hit [enter] to enter failsafe mode

2. Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

3. - failsafe -

4. Generating key, this may take a while...

5. Public key portion is:

6. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9K9lSSeod9vH6MBwPvF6/pRjD8UdiZ/4zLqOGrB/EE8IkDRlEWrSGvtyH5a6fOBLy0cVic+vQ/ycygNhT8NnMXNhV+rgZM3noHnpvT+WIHZQglip6U2th2VXHxeQ9Au641rbr3TZDKIZ3DXhg22vwVg/2ntShyOW7CjzfZw6wNw== root@(none)

7. Fingerprint: md5 65:12:ac:2b:a4:3c:b2:2e:fa:aa:af:0e:d5:00:bb:38

* BusyBox v1.25.1 () built-in shell (ash)

* ash: can't access tty; job control turned off

8. _

9. ___ __ _ _ __ ___ | | ___ __ _____ _____

10. / __|/ _` | '_ ` _ \| |/ / '_ \ / _ \ \ /\ / / __|

11. \__ \ (_| | | | | | | <| | | | (_) \ V V /\__ \

12. |___/\__,_|_| |_| |_|_|\_\_| |_|\___/ \_/\_/ |___/

13. P E R F O R M A N C E M O N I T O R I N G

* OS: LEDE Reboot, r3436+83-2da512e

14. SW: WB8 Build

15. -------------------------------------------------

16. ================= FAILSAFE MODE active ================

17. special commands:

18. * firstboot reset settings to factory defaults

19. * mount_root mount root-partition with config files

* after mount_root:

20. * passwd change root's password

21. * /etc/config directory with config files

* for more help see:

22. http://wiki.openwrt.org/doc/howto/generic.failsafe

23. =======================================================

* root@(none):/# mount_root

24. [ 93.280518] mount_root: loading kmods from internal overlay

25. [ 93.318963] kmodloader: loading kernel modules from //etc/modules-boot.d/*

26. [ 93.333361] kmodloader: done loading kernel modules from //etc/modules-boot.d/*

27. [ 93.714259] jffs2: notice: (423) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

28. [ 93.745547] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab

29. [ 93.762383] block: extroot: not configured

30. [ 93.857293] jffs2: notice: (420) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

31. [ 94.157775] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab

32. [ 94.175023] block: extroot: not configured

33. [ 94.229704] mount_root: switching to jffs2 overlay

34. root@(none):/# ping openwere[Je[Je[Jwrt.org

35. ping: bad address 'openwrt.org'

36. root@(none):/#

lroot@(none):/# ipe[Je[Jifconfig

85. eth0 Link encap:Ethernet HWaddr 24:0B:88:08:2E:1D

86. inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0

87. inet6 addr: fe80::260b:88ff:fe08:2e1d/64 Scope:Link

88. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

89. RX packets:0 errors:0 dropped:0 overruns:0 frame:0

90. TX packets:9 errors:0 dropped:0 overruns:0 carrier:0

91. collisions:0 txqueuelen:1000

92. RX bytes:0 (0.0 B) TX bytes:1727 (1.6 KiB)

93. Interrupt:10

* root@(none):/# ip a

94. 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1

95. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

96. 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000

97. link/ether 24:0b:88:08:2e:1d brd ff:ff:ff:ff:ff:ff

98. inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0

99. valid_lft forever preferred_lft forever

100. inet6 fe80::260b:88ff:fe08:2e1d/64 scope link

101. valid_lft forever preferred_lft forever

102. root@(none):/#

103. root@(none):/# ip ae[J

104. root@(none):/# ifconfige[J

105. root@(none):/# vim /etc/config/networke[Jim /etc/config/networke[Je[20D /etc/config/networke[Je[20D /etc/config/networke[Je[20Dc /etc/config/networke[20Da /etc/config/networke[20Dt /etc/config/networke[20D /etc/config/network

* config interface 'loopback'

106. option ifname 'lo'

107. option proto 'static'

108. option ipaddr '127.0.0.1'

109. option netmask '255.0.0.0'

* config interface 'lan'

110. option ifname 'eth0'

111. option proto 'static'

112. option ipaddr '192.168.2.2'

113. option netmask '255.255.255.0'

* config interface 'wan'

114. option ifname 'eth0'

115. option proto 'dhcp'

* config interface 'wan6'

116. option ifname 'eth0'

117. option proto 'dhcpv6'

* config interface 'wlan2g'

118. option proto 'dhcp'

119. option metric '1'

* config interface 'wlan2g_6'

120. option proto 'dhcpv6'

* config interface 'wlan5g'

121. option proto 'dhcp'

122. option metric '2'

* config interface 'wlan5g_6'

123. option proto 'dhcpv6'

* config switch

124. option name 'switch0'

125. option reset '1'

126. option enable_vlan '0'

* config switch_vlan

127. option device 'switch0'

128. option vlan '0'

129. option ports '0 1 2 3 4 6'

* root@(none):/# scp/wget/etce[Je[Je[Je[Je[Je[Je[Je[Je[Je[Je[Je[Jpasswd

130. Changing password for root

131. New password:

132. Bad password: too weak

133. Retype password:

134. passwd: password for root changed by root

135. root@(none):/#

Then something happened here:

1. ===================================================================

* MT7621 stage1 code done

* CPU=500000000 HZ BUS=125000000 HZ

* ===================================================================

* U-Boot 1.1.3 (Jan 15 2016 - 09:47:18)

* Board: Ralink APSoC DRAM: 128 MB

* relocate_code Pointer at: 87fb8000

* Config XHCI 40M PLL

* flash manufacture id: ef, device id 40 18

* find flash: W25Q128BV

* ============================================

* Ralink UBoot Version: 4.3.0.0

* --------------------------------------------

* ASIC MT7621A DualCore (MAC to MT7530 Mode)

* DRAM_CONF_FROM: Auto-Detection

* DRAM_TYPE: DDR2

* DRAM bus: 16 bit

* Xtal Mode=3 OCP Ratio=1/4

* Flash component: SPI Flash

* Date:Jan 15 2016 Time:09:47:18

* ============================================

* icache: sets:256, ways:4, linesz:32 ,total:32768

* dcache: sets:256, ways:4, linesz:32 ,total:32768

* ##### The CPU freq = 880 MHZ ####

* estimate memory size =128 Mbytes

* #Reset_MT7530

* Please choose the operation:

* 1: Load system code to SDRAM via TFTP.

* 2: Load system code then write to Flash via TFTP.

* 3: Boot system code via Flash (default).

* 4: Entr boot command line interface.

* 7: Load Boot Loader code then write to Flash via Serial.

* 9: Load Boot Loader code then write to Flash via TFTP.

*  4  3  2  1  0

* bootcount: 3

* 3: System Boot system code via Flash.

* Erasing SPI Flash...

* .

* Writing to SPI Flash...

* .

* done

* ## Booting image at bce30000 ...

* Image Name: MIPS LEDE Linux-4.4.79

* Image Type: MIPS Linux Kernel Image (lzma compressed)

* Data Size: 1076829 Bytes = 1 MB

* Load Address: 80001000

* Entry Point: 80001000

* Verifying Checksum ... OK

* Uncompressing Kernel Image ... OK

* No initrd

* ## Transferring control to Linux (at address 80001000) ...

* ## Giving linux memsize in MB, 128

* Starting kernel ...

* Linux version 4.4.79 (builder@) (gcc version 5.4.0 (LEDE GCC 5.4.0 r0+3509-2fce1de31f) ) #0 SMP Tue Aug 29 13:35:55 2023

2. SoC Type: MediaTek MT7621 ver:1 eco:3

3. bootconsole [early0] enabled

4. CPU0 revision is: 0001992f (MIPS 1004Kc)

5. MIPS: machine is SamKnows Whitebox 8

6. Determined physical RAM map:

7. memory: 08000000 @ 00000000 (usable)

8. Initrd not found or empty - disabling initrd

9. Zone ranges:

10. Normal [mem 0x0000000000000000-0x0000000007ffffff]

11. HighMem empty

12. Movable zone start for each node

13. Early memory node ranges

14. node 0: [mem 0x0000000000000000-0x0000000007ffffff]

15. Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]

16. VPE topology {2,2} total 4

17. Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.

18. Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes

19. MIPS secondary cache 256kB, 8-way, linesize 32 bytes.

20. PERCPU: Embedded 10 pages/cpu @8110c000 s8608 r8192 d24160 u40960

21. Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512

22. Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2

23. PID hash table entries: 512 (order: -1, 2048 bytes)

24. Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

25. Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)

26. Writing ErrCtl register=00030220

27. Readback ErrCtl register=00030220

28. Memory: 126072K/131072K available (2734K kernel code, 194K rwdata, 240K rodata, 212K init, 240K bss, 5000K reserved, 0K cma-reserved, 0K highmem)

29. SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1

30. Hierarchical RCU implementation.

31. NR_IRQS:256

32. clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns

33. clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns

34. sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns

35. Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)

36. pid_max: default: 32768 minimum: 301

37. Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)

38. Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

39. Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.

40. Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes

41. MIPS secondary cache 256kB, 8-way, linesize 32 bytes.

42. CPU1 revision is: 0001992f (MIPS 1004Kc)

43. Synchronize counters for CPU 1: done.

44. Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.

45. Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes

46. MIPS secondary cache 256kB, 8-way, linesize 32 bytes.

47. CPU2 revision is: 0001992f (MIPS 1004Kc)

48. Synchronize counters for CPU 2: done.

49. Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.

50. Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes

51. MIPS secondary cache 256kB, 8-way, linesize 32 bytes.

52. CPU3 revision is: 0001992f (MIPS 1004Kc)

53. Synchronize counters for CPU 3: done.

54. Brought up 4 CPUs

55. clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

56. futex hash table entries: 1024 (order: 3, 32768 bytes)

57. pinctrl core: initialized pinctrl subsystem

58. NET: Registered protocol family 16

59. Can't analyze schedule() prologue at 8000bd44

60. pull PCIe RST: RALINK_RSTCTRL = 0

61. release PCIe RST: RALINK_RSTCTRL = 7000000

62. ***** Xtal 40MHz *****

63. release PCIe RST: RALINK_RSTCTRL = 7000000

64. Port 0 N_FTS = 1b102800

65. Port 1 N_FTS = 1b102800

66. Port 2 N_FTS = 1b102800

67. PCIE2 no card, disable it(RST&CLK)

68. -> 21007f2

69. PCIE0 enabled

70. PCIE1 enabled

71. PCI host bridge /pcie@1e140000 ranges:

72. MEM 0x0000000060000000..0x000000006fffffff

73. IO 0x000000001e160000..0x000000001e16ffff

74. PCI coherence region base: 0x60000000, mask/settings: 0xf0000002

75. mt7621_gpio 1e000600.gpio: registering 32 gpios

76. mt7621_gpio 1e000600.gpio: registering 32 gpios

77. mt7621_gpio 1e000600.gpio: registering 32 gpios

78. PCI host bridge to bus 0000:00

79. pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]

80. pci_bus 0000:00: root bus resource [io 0xffffffff]

81. pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]

82. pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]

83. pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring

84. pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring

85. pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]

86. pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]

87. pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]

88. pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]

89. pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]

90. pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]

91. pci 0000:00:01.0: BAR 8: assigned [mem 0x60200000-0x602fffff]

92. pci 0000:00:01.0: BAR 9: assigned [mem 0x60300000-0x603fffff pref]

93. pci 0000:00:00.0: BAR 1: assigned [mem 0x60400000-0x6040ffff]

94. pci 0000:00:01.0: BAR 1: assigned [mem 0x60410000-0x6041ffff]

95. pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]

96. pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]

97. pci 0000:00:00.0: PCI bridge to [bus 01]

98. pci 0000:00:00.0: bridge window [mem 0x60000000-0x600fffff]

99. pci 0000:00:00.0: bridge window [mem 0x60100000-0x601fffff pref]

100. pci 0000:02:00.0: BAR 0: assigned [mem 0x60200000-0x602fffff 64bit]

101. pci 0000:02:00.0: BAR 6: assigned [mem 0x60300000-0x6030ffff pref]

102. pci 0000:00:01.0: PCI bridge to [bus 02]

103. pci 0000:00:01.0: bridge window [mem 0x60200000-0x602fffff]

104. pci 0000:00:01.0: bridge window [mem 0x60300000-0x603fffff pref]

105. BAR0 at slot 0 = 0

106. bus=0x0, slot = 0x0

107. BAR0 at slot 1 = 0

108. bus=0x0, slot = 0x1

109. bus=0x1, slot = 0x0, irq=0xff

110. bus=0x2, slot = 0x1, irq=0xff

111. clocksource: Switched to clocksource GIC

112. NET: Registered protocol family 2

113. TCP established hash table entries: 1024 (order: 0, 4096 bytes)

114. TCP bind hash table entries: 1024 (order: 1, 8192 bytes)

115. TCP: Hash tables configured (established 1024 bind 1024)

116. UDP hash table entries: 256 (order: 1, 8192 bytes)

117. UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)

118. NET: Registered protocol family 1

119. 4 CPUs re-calibrate udelay(lpj = 2924544)

120. squashfs: version 4.0 (2009/01/31) Phillip Lougher

121. io scheduler noop registered

122. io scheduler deadline registered (default)

123. Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled

124. console [ttyS0] disabled

125. 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 33, base_baud = 3125000) is a 16550A

126. console [ttyS0] enabled

127. console [ttyS0] enabled

128. bootconsole [early0] disabled

129. bootconsole [early0] disabled

130. MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error

131. spi-mt7621 1e000b00.spi: sys_freq: 50000000

132. m25p80 spi32766.0: using chunked io (size=32)

133. m25p80 spi32766.0: w25q128 (16384 Kbytes)

134. 5 ofpart partitions found on MTD device spi32766.0

135. Creating 5 MTD partitions on "spi32766.0":

136. 0x000000000000-0x000000030000 : "u-boot"

137. 0x000000030000-0x000000040000 : "u-boot-env"

138. 0x000000040000-0x000000050000 : "factory"

139. 0x000000050000-0x000000e30000 : "mainimage"

140. 0x000000e30000-0x000001000000 : "firmware"

141. 2 uimage-fw partitions found on MTD device firmware

142. 0x000000e30000-0x000000f36e9d : "kernel"

143. 0x000000f36e9d-0x000001000000 : "rootfs"

144. mtd: device 6 (rootfs) set to be root filesystem

145. 1 squashfs-split partitions found on MTD device rootfs

146. 0x000000ff0000-0x000001000000 : "rootfs_data"

147. netif_napi_add() called with weight 128 on device eth%d

148. libphy: mdio: probed

149. mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver

150. mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 10

151. mt7621_wdt 1e000100.wdt: Initialized

152. NET: Registered protocol family 10

153. NET: Registered protocol family 17

154. hctosys: unable to open rtc device (rtc0)

155. VFS: Mounted root (squashfs filesystem) readonly on device 31:6.

156. Freeing unused kernel memory: 212K (8031b000 - 80350000)

157. random: nonblocking pool is initialized

158. init: Console is alive

159. init: - watchdog -

160. kmodloader: loading kernel modules from /etc/modules-boot.d/*

161. kmodloader: done loading kernel modules from /etc/modules-boot.d/*

162. init: - preinit -

163. Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

164. mtk_soc_eth 1e100000.ethernet eth0: port 4 link up

165. mtk_soc_eth 1e100000.ethernet eth0: port 0 link up

166. mount_root: jffs2 not ready yet, using temporary tmpfs overlay

167. urandom-seed: Seed file not found (/etc/urandom.seed)

168. procd: - early -

169. procd: - watchdog -

170. procd: - watchdog -

171. procd: - ubus -

172. procd: - init -

173. kmodloader: loading kernel modules from /etc/modules.d/*

174. kmodloader: done loading kernel modules from /etc/modules.d/*

175. reboot: Restarting system

After that, I cannot press 2 to get to that option anymore and it does not boot to the default SamKnows OpenWRT, let alone into failsafe mode.

Line 1256 to line 1813 in my paste bin, something happened after that last reboot and it just stops at: 1. [ 15.003716] kmodloader: done loading kernel modules from /etc/modules.d/* now and that is all.

Like I said, I am not someone who doesn't want to put in the effort or the work but when following the advice of someone led me to be further back than when I started, I really would like someone to help me figure out where I went wrong so that I could learn from it. I also want to emphasize that if this were a common issue, I would have been able to figure it out from the number of helpful posts here but this isn't common, and I in fact was able to speed past the common issues out the gate because I had prepared so. This is unique to my knowledge set and/or something outside my periphery but isn't something I can see because I don't know what to look for.

Sorry if that sounds disrespectful. I am rarely this distraught and can often find my way out of things, so when I turn to someone for help, I want them to know that I am committed to learning from my errors so that I can help others someday.

At this point, I've already considered booking a Linux live specialist to help me one on one. I can't put more time into this project and I can't advance but I want to try.

While I don't own that particular device (nor any similar one), I have used tftpd-hpa numerous times on other routers myself.

While your log doesn't quite suggest it, what could still be an issue is that your computer might lose its network configuration at just the wrong time (rebooting the router implies that the other end of the network link goes down, for many operating systems that causes a link-down and deconfiguration, it might take too long to come up again for the router). You can avoid this by putting a simple unmanaged switch between router and your computer (that way, thanks to the switch, the link remains up all the time, avoiding any smart behaviour by the OS).

1 Like

You are the FIRST person to step outside the standard troubleshooting headspace and actually look at the fine details and provide something that makes logical sense. In fact this lines up with a PowerShell log that I didn’t originally provide but might be relevant:

PS C:\Program Files\Tftpd64> ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data: Reply from 192.168.2.10: Destination host unreachable. 
Request timed out. 
Request timed out. 

Ping statistics for 192.168.2.2: 
Packets: Sent = 3, Received = 1, Lost = 2 (66% loss)

PS C:\Program Files\Tftpd64> 
ping 192.168.2.2 Pinging 192.168.2.2 with 32 bytes of data: 
Request timed out. 
Request timed out. 

Ping statistics for 192.168.2.2: Packets: Sent = 2, Received = 0, Lost = 2 (100% loss)

For the life of me I couldn’t understand why it would get one packet and not another moments later. My WireShark outputs on Linux provided similar odd behaviour but I could not understand what it was.

I do have a small unmanaged switch and a larger unmanaged switch. My PC connects directly to its own dedicated 1Gbps Ethernet outlet, as do all my Ethernet outlets. My network setup is a bit unique; I have 8Gbps XSGPON Fiber running to a Nokia Optical Terminal via its 10Gbps port to the NetGear XS505M-Unmanaged Switch, which runs its 5Gbps port to my XB8 Gateway, which handles WiFi and then the remaining ports connect out to the various Ethernet outlets carrying dedicated 1Gbps. You are the first person who said something that makes sense since my PC connection already comes in on an unmanaged switch to a smaller unmanaged switch.

I’ve attached some pictures. Given that I don’t need to be connected to the internet to accomplish this task (correct?), could I use my smaller switch and just connect my PC to the router via the smaller switch, LAN to LAN?

Thank you for this information. That you took the time to consider the bigger picture is something I appreciate and you were able to reason something that makes sense given my setup. Here’s hoping I can keep you looped in and in turn I will get some fresh logs.

While your suggestions don’t help the immediate issue of not being able to boot the router into any sort of useable mode after something I did, I thank you. Here’s hoping someone will see what went wrong in those logs that made it so I can’t do anything.

The bootloader doesn't necessarily react to pings (at all or intermittently).

You don't need internet access just 3 devices isolated from everything else, the to-be-recovered router, the unmanaged switch (size doesn't matter, unmanaged is -for this- better than managed), your computer with the tftpd, all connected to the switch by patch cables.

I will def try that as soon as I can get it to work again. Like I said, something I did made it so I can no longer press 2 or enter failsafe mode and the router will no longer boot to anything.

Check that rx of the router/ tx of your usb2serial adapter are firmly connected, these cables like to get loose.

Wow, that is 100% what it was too after days and days of being firmly in there.

Ok, I am going to step away from this for a day but then attempt your steps you outlined to me. I will admit the whole TFTP thing is a bit foreign and new to me but I am happy to learn and I'll do it with tftpd-hpa in my Linux environment where I am much more comfy. If you have any tips on like basic setup you've used before, let me know. :slight_smile:

The (push-button) tftp recovery is quite simple as a concept:

  • tftp is just a data transmission protocol, just like ftp or http/ https, the major difference to the later is just that's it's a lot simpler (smaller, easy to implement, no security, just fetch (GET) and a handful additional commands). this makes it easier and better to insert into very resource constrained environments like the bootloader
  • when you interrupt the bootloader and ask it to fetch the firmware image, the router does:
    • enable the network stack on the router
    • configures itself for 192.168.2.2/24
    • tries to "GET /firm.bin" from your tftp-server hosted at the fixed IP address (of your computer) on 192.168.2.10
      so effectively tftp://192.168.2.10/firm.bin
    • if it successfully received the file -in time- and if the file passes a quick sanity check, it's written to flash and (re-)booted into, if it times out (T T T ...) (tftp://192.168.2.10/firm.bin not received) or doesn't pass the checks, the upgrade procedure gets aborted and it boots normally from flash.

If this is implemented reasonably well, it's spot-on reliable. In the cases of push-button tftp recovery (as in not your device), the only real uncertainty is getting the time window right (pressing the reset button exactly in the right moment - and for the correct amount of time). An unmanaged switch is not strictly required, but it makes this process a lot more reliable (much easier to hit the right time window).