WiFi Unreliable When Booting Into Maintenance Mode

Still not had a failure. Has anything changed in the mean time, which might have been auto-updated?
 
Still not had a failure. Has anything changed in the mean time, which might have been auto-updated?
Famous Last Words! Just tried again and caught a failure. Logs redacted (#) where appropriate for public consumption, as captured by the script in post 35:–

WiFi working in MM:
Code:
++++++++++++++ S00wlan - Sat Apr 30 08:02:04 UTC 2022 ++++++++++++++
Wireless interface: wlan0
Already connected to '############'
No link found on eth0, disabling.
Code:
=== Sat Jan  1 00:00:11 UTC 2000 - modinit - -boot ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - setup boothosts ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - setup hostname ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - complete ===========================
=== Sat Apr 30 08:26:40 UTC 2022 - modinit - ===========================
=== Sat Apr 30 08:26:40 UTC 2022 - diag ===========================
Filesystem                Size      Used Available Use% Mounted on
/dev/root                21.6M     21.6M         0 100% /
tmpfs                    61.0M     40.0K     61.0M   0% /tmp
tmpfs                    61.0M         0     61.0M   0% /media
/dev/mtdblock1            2.0M    608.0K      1.4M  30% /var/lib/humaxtv
/dev/mtdblock2            2.0M    724.0K      1.3M  35% /var/lib/humaxtv_backup
/dev/mtdblock2            2.0M    724.0K      1.3M  35% /etc/opkg
/dev/mtdblock2            2.0M    724.0K      1.3M  35% /sbin/wifi-up
/dev/sda1              1011.4M     50.2M    909.8M   5% /mnt/hd1
/dev/sda2               447.6G    368.9G     55.9G  87% /mnt/hd2
/dev/sda3                 9.8G    747.1M      8.6G   8% /mnt/hd3

eth0      Link encap:Ethernet  HWaddr DC:D3:21:17:85:0F
          inet addr:192.168.1.14  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 70:F1:1C:3A:B4:16
          inet addr:192.0.2.200  Bcast:192.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6251 (6.1 KiB)  TX bytes:2552 (2.4 KiB)


  PID USER       VSZ STAT COMMAND
    1 root      1252 S    init
    2 root         0 SW   [migration/0]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW   [migration/1]
    5 root         0 SWN  [ksoftirqd/1]
    6 root         0 SW<  [events/0]
    7 root         0 SW<  [events/1]
    8 root         0 SW<  [khelper]
    9 root         0 SW<  [kthread]
   10 root         0 SW<  [kblockd/0]
   11 root         0 SW<  [kblockd/1]
   12 root         0 SW<  [khubd]
   13 root         0 SW<  [kseriod]
   14 root         0 SW   [pdflush]
   15 root         0 SW   [pdflush]
   16 root         0 DW<  [kswapd0]
   17 root         0 SW<  [aio/0]
   18 root         0 SW<  [aio/1]
   19 root         0 SW<  [ata/0]
   20 root         0 SW<  [ata/1]
   21 root         0 SW<  [ata_aux]
   22 root         0 SW<  [scsi_eh_0]
   23 root         0 SW<  [scsi_eh_1]
   24 root         0 SW   [mtdblockd]
   25 root         0 SW<  [kpsmoused]
   26 root      1244 S    {rcS} /bin/sh /etc/init.d/rcS
   87 root         0 SWN  [jffs2_gcd_mtd1]
   88 root         0 SWN  [jffs2_gcd_mtd2]
  115 root       972 S    /sbin/bootstrapd maint.html
  118 nobody    3364 S    /usr/bin/shellinaboxd -t -p 88 -s /:root:root:/:/bin/tmenu -s /cli/shell:root:root:/:/bin/tmenu
  166 nobody    3364 S    /usr/bin/shellinaboxd -t -p 88 -s /:root:root:/:/bin/tmenu -s /cli/shell:root:root:/:/bin/tmenu
  168 nobody     932 S    /usr/bin/dnsmasq
  175 root       812 S N  /sbin/utelnetd -l /bin/tmenu -p 23 -d -B
  243 root      1244 S    {snaplogs} /bin/sh /var/lib/humaxtv/mod/xinit.d/snaplogs start
  244 root      1236 S    sleep 180
  261 root      1252 R    {S89maintenance} /bin/sh /etc/init.d/S89maintenance start
  272 root       812 S    /sbin/utelnetd -l /bin/sh -p 24 -d -b
  279 root      331m S    /usr/bin/humaxtv
  415 root         0 SW   [RtmpTimerTask]
  416 root         0 SW   [RtmpMlmeTask]
  417 root         0 SW   [RtmpCmdQTask]
  495 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  499 root         0 SW<  [kjournald]
  504 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  529 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  678 root         0 SW<  [kjournald]
  681 root         0 SW<  [kjournald]
  730 root      1260 S <  {modinit} /bin/sh /sbin/modinit
  747 root      1236 S <  sleep 1
  748 root      1236 S <  sleep 1
  754 root      1244 R <  ps -w

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0

=== Sat Apr 30 08:26:40 UTC 2022 - init ===========================
=== Sat Apr 30 08:26:40 UTC 2022 - reset all ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - rma ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - cleanup ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - ugprade bootmod ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - setup directories ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - create modenv ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - migrate bootmod ===========================
=== Sat Apr 30 08:26:41 UTC 2022 - setup hostname ===========================
=== Sat Apr 30 08:26:42 UTC 2022 - setup hosts ===========================
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
    Interface: [eth0]
    IP: [192.168.1.14]
=== Sat Apr 30 08:26:42 UTC 2022 - complete ===========================
=== Sat Apr 30 08:26:44 UTC 2022 - modinit - setup_hosts ===========================
=== Sat Apr 30 08:26:44 UTC 2022 - setup hosts ===========================
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
    Interface: [wlan0]
    IP: [192.0.2.200]
=== Sat Apr 30 08:26:45 UTC 2022 - complete ===========================
Code:
[/var/lib/humaxtv/mod/xinit.d/ahw]
Micom Timestamp: 1492 - Thu Jan  1 00:24:52 1970
Power cycle detected.
Boot: 4
[/var/lib/humaxtv/mod/xinit.d/dbupdate]
SQLite3: 3.7.5
[/var/lib/humaxtv/mod/xinit.d/install_dustbin]
[/var/lib/humaxtv/mod/xinit.d/install_fan]
[/var/lib/humaxtv/mod/xinit.d/install_ir3]
[/var/lib/humaxtv/mod/xinit.d/install_nugget]
[/var/lib/humaxtv/mod/xinit.d/opkg-beta]
[/var/lib/humaxtv/mod/xinit.d/rsvsync]
[/var/lib/humaxtv/mod/xinit.d/snaplogs]
[/var/lib/humaxtv/mod/xinit.d/webshell]
[/var/lib/humaxtv/mod/xinit.d/wifi]
[/var/lib/humaxtv/mod/xinit.d/xdso]
Opening /var/lib/humaxtv/rsv.db
XDSO: Removed DSO scheduled events.
[/var/lib/humaxtv/mod/xinit.d/xota]
SQLite3: 3.7.5
Opening /var/lib/humaxtv/rsv.db
XOTA: Removing any auto-update scheduled events.
XOTA: Removed 0
Found 0 existing OTA reminders.
Reminder already set.

WiFi not working (adapter MAC registered as connected at router, but no IP address assigned):
Code:
++++++++++++++ S00wlan - Sun May  8 09:53:00 UTC 2022 ++++++++++++++
Wireless interface: wlan0
Already connected to '############'
No link found on eth0, disabling.
Code:
=== Sat Jan  1 00:00:11 UTC 2000 - modinit - -boot ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - setup boothosts ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - setup hostname ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - complete ===========================
=== Sun May  8 10:10:49 UTC 2022 - modinit - ===========================
=== Sun May  8 10:10:49 UTC 2022 - diag ===========================
Filesystem                Size      Used Available Use% Mounted on
/dev/root                21.6M     21.6M         0 100% /
tmpfs                    61.0M     40.0K     61.0M   0% /tmp
tmpfs                    61.0M         0     61.0M   0% /media
/dev/mtdblock1            2.0M    572.0K      1.4M  28% /var/lib/humaxtv
/dev/mtdblock2            2.0M    712.0K      1.3M  35% /var/lib/humaxtv_backup
/dev/mtdblock2            2.0M    712.0K      1.3M  35% /etc/opkg
/dev/mtdblock2            2.0M    712.0K      1.3M  35% /sbin/wifi-up
/dev/sda1              1011.4M     50.2M    909.8M   5% /mnt/hd1
/dev/sda2               447.6G    368.5G     56.3G  87% /mnt/hd2
/dev/sda3                 9.8G    747.1M      8.6G   8% /mnt/hd3

eth0      Link encap:Ethernet  HWaddr DC:D3:21:17:85:0F
          inet addr:192.168.1.14  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 70:F1:1C:3A:B4:16
          inet addr:192.0.2.200  Bcast:192.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1786 (1.7 KiB)  TX bytes:2640 (2.5 KiB)


  PID USER       VSZ STAT COMMAND
    1 root      1252 S    init
    2 root         0 SW   [migration/0]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW   [migration/1]
    5 root         0 SWN  [ksoftirqd/1]
    6 root         0 SW<  [events/0]
    7 root         0 SW<  [events/1]
    8 root         0 SW<  [khelper]
    9 root         0 SW<  [kthread]
   10 root         0 SW<  [kblockd/0]
   11 root         0 SW<  [kblockd/1]
   12 root         0 SW<  [khubd]
   13 root         0 SW<  [kseriod]
   14 root         0 SW   [pdflush]
   15 root         0 SW   [pdflush]
   16 root         0 SW<  [kswapd0]
   17 root         0 SW<  [aio/0]
   18 root         0 SW<  [aio/1]
   19 root         0 SW<  [ata/0]
   20 root         0 SW<  [ata/1]
   21 root         0 SW<  [ata_aux]
   22 root         0 SW<  [scsi_eh_0]
   23 root         0 SW<  [scsi_eh_1]
   24 root         0 SW   [mtdblockd]
   25 root         0 SW<  [kpsmoused]
   26 root      1244 S    {rcS} /bin/sh /etc/init.d/rcS
   87 root         0 SWN  [jffs2_gcd_mtd1]
   88 root         0 SWN  [jffs2_gcd_mtd2]
  115 root       972 S    /sbin/bootstrapd maint.html
  118 nobody    3364 S    /usr/bin/shellinaboxd -t -p 88 -s /:root:root:/:/bin/tmenu -s /cli/shell:root:root:/:/bin/tmenu
  153 nobody    3364 S    /usr/bin/shellinaboxd -t -p 88 -s /:root:root:/:/bin/tmenu -s /cli/shell:root:root:/:/bin/tmenu
  168 nobody     932 S    /usr/bin/dnsmasq
  175 root       812 S N  /sbin/utelnetd -l /bin/tmenu -p 23 -d -B
  243 root      1244 S    {snaplogs} /bin/sh /var/lib/humaxtv/mod/xinit.d/snaplogs start
  244 root      1236 S    sleep 180
  261 root      1252 S    {S89maintenance} /bin/sh /etc/init.d/S89maintenance start
  272 root       812 S    /sbin/utelnetd -l /bin/sh -p 24 -d -b
  279 root      329m S    /usr/bin/humaxtv
  415 root         0 RW   [RtmpTimerTask]
  416 root         0 SW   [RtmpMlmeTask]
  417 root         0 SW   [RtmpCmdQTask]
  493 root         0 SW<  [kjournald]
  502 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  529 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  535 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  662 root         0 SW<  [kjournald]
  673 root         0 SW<  [kjournald]
  678 root      1236 S <  sleep 1
  695 root      1236 S <  sleep 1
  697 root      1236 S    sleep 1
  703 root      1260 S <  {modinit} /bin/sh /sbin/modinit
  716 root      1244 R <  ps -w

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0

=== Sun May  8 10:10:49 UTC 2022 - init ===========================
=== Sun May  8 10:10:49 UTC 2022 - reset all ===========================
=== Sun May  8 10:10:50 UTC 2022 - rma ===========================
=== Sun May  8 10:10:50 UTC 2022 - cleanup ===========================
=== Sun May  8 10:10:50 UTC 2022 - ugprade bootmod ===========================
=== Sun May  8 10:10:50 UTC 2022 - setup directories ===========================
=== Sun May  8 10:10:50 UTC 2022 - create modenv ===========================
=== Sun May  8 10:10:50 UTC 2022 - migrate bootmod ===========================
=== Sun May  8 10:10:50 UTC 2022 - setup hostname ===========================
=== Sun May  8 10:10:50 UTC 2022 - setup hosts ===========================
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
    Interface: [eth0]
    IP: [192.168.1.14]
=== Sun May  8 10:10:51 UTC 2022 - complete ===========================
=== Sun May  8 10:10:53 UTC 2022 - modinit - setup_hosts ===========================
=== Sun May  8 10:10:53 UTC 2022 - setup hosts ===========================
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
    Interface: [wlan0]
    IP: [192.0.2.200]
=== Sun May  8 10:10:53 UTC 2022 - complete ===========================
Code:
[/var/lib/humaxtv/mod/xinit.d/ahw]
Micom Timestamp: 699095 - Fri Jan  9 02:11:35 1970
Power cycle detected.
Boot: 4
[/var/lib/humaxtv/mod/xinit.d/dbupdate]
SQLite3: 3.7.5
[/var/lib/humaxtv/mod/xinit.d/install_dustbin]
[/var/lib/humaxtv/mod/xinit.d/install_fan]
[/var/lib/humaxtv/mod/xinit.d/install_ir3]
[/var/lib/humaxtv/mod/xinit.d/install_nugget]
[/var/lib/humaxtv/mod/xinit.d/opkg-beta]
[/var/lib/humaxtv/mod/xinit.d/rsvsync]
[/var/lib/humaxtv/mod/xinit.d/snaplogs]
[/var/lib/humaxtv/mod/xinit.d/webshell]
[/var/lib/humaxtv/mod/xinit.d/wifi]
[/var/lib/humaxtv/mod/xinit.d/xdso]
Opening /var/lib/humaxtv/rsv.db
XDSO: Removed DSO scheduled events.
[/var/lib/humaxtv/mod/xinit.d/xota]
SQLite3: 3.7.5
Opening /var/lib/humaxtv/rsv.db
XOTA: Removing any auto-update scheduled events.
XOTA: Removed 0
Found 0 existing OTA reminders.
Reminder already set.

There are no significant differences in wlan.log and xinit.log. The major differences in modinit.log are in the process table STAT column, but I don't know what that means.
 
Last edited:
There should be a lot fewer processes running in MM.

The logs appear to show that neither case had a working connection at the end of modinit as eth0 was disabled and wlan0 was using 192.0.2.200.

Otherwise, as in post #75.
 
The logs appear to show that neither case had a working connection at the end of modinit as eth0 was disabled and wlan0 was using 192.0.2.200.
But nonetheless I had communication to 192.168.1.14 via WiFi at the time of the first capture and not at the time of the second, and there is no Ethernet connection.

There should be a lot fewer processes running in MM.
Which implies the logs are not in fact captures of the system booting into MM. Perhaps I have misunderstood the method: boot into MM (fail or not); let it run at least 3 minutes; reboot to normal; copy the files out of /mod/etc/prev within 3 minutes.
 
FWIW, here's modinit.log from the current normal session (retrieved over WiFi to 192.168.1.14 >> Diagnostics):

Code:
=== Sat Jan  1 00:00:05 UTC 2000 - modinit - -boot ===========================
=== Sat Jan  1 00:00:05 UTC 2000 - setup boothosts ===========================
=== Sat Jan  1 00:00:05 UTC 2000 - setup hostname ===========================
=== Sat Jan  1 00:00:05 UTC 2000 - complete ===========================
=== Sun May  8 10:18:14 UTC 2022 - modinit - ===========================
=== Sun May  8 10:18:14 UTC 2022 - diag ===========================
Filesystem                Size      Used Available Use% Mounted on
/dev/root                21.6M     21.6M         0 100% /
tmpfs                    61.0M     44.0K     61.0M   0% /tmp
tmpfs                    61.0M         0     61.0M   0% /media
/dev/mtdblock1            2.0M    584.0K      1.4M  29% /var/lib/humaxtv
/dev/mtdblock2            2.0M    644.0K      1.4M  31% /var/lib/humaxtv_backup
/dev/mtdblock2            2.0M    644.0K      1.4M  31% /etc/opkg
/dev/mtdblock2            2.0M    644.0K      1.4M  31% /sbin/wifi-up
/dev/sda1              1011.4M     50.2M    909.8M   5% /mnt/hd1
/dev/sda2               447.6G    368.5G     56.3G  87% /mnt/hd2
/dev/sda3                 9.8G    747.1M      8.6G   8% /mnt/hd3

eth0      Link encap:Ethernet  HWaddr DC:D3:21:17:85:0F 
          inet addr:192.168.1.14  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 70:F1:1C:3A:B4:16 
          inet addr:192.0.2.200  Bcast:192.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1607 (1.5 KiB)  TX bytes:1760 (1.7 KiB)


  PID USER       VSZ STAT COMMAND
    1 root      1252 S    init
    2 root         0 SW   [migration/0]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW   [migration/1]
    5 root         0 SWN  [ksoftirqd/1]
    6 root         0 SW<  [events/0]
    7 root         0 SW<  [events/1]
    8 root         0 SW<  [khelper]
    9 root         0 SW<  [kthread]
   10 root         0 SW<  [kblockd/0]
   11 root         0 SW<  [kblockd/1]
   12 root         0 SW<  [khubd]
   13 root         0 SW<  [kseriod]
   14 root         0 SW   [pdflush]
   15 root         0 SW   [pdflush]
   16 root         0 SW<  [kswapd0]
   17 root         0 SW<  [aio/0]
   18 root         0 SW<  [aio/1]
   19 root         0 SW<  [ata/0]
   20 root         0 SW<  [ata/1]
   21 root         0 SW<  [ata_aux]
   22 root         0 SW<  [scsi_eh_0]
   23 root         0 SW<  [scsi_eh_1]
   24 root         0 SW   [mtdblockd]
   25 root         0 SW<  [kpsmoused]
   26 root      1244 S    {rcS} /bin/sh /etc/init.d/rcS
   87 root         0 SWN  [jffs2_gcd_mtd1]
   88 root         0 SWN  [jffs2_gcd_mtd2]
  105 root       972 S    /sbin/bootstrapd init.html
  108 nobody    3364 S    /usr/bin/shellinaboxd -t -p 88 -s /:root:root:/:/bin/tmenu -s /cli/shell:root:root:/:/bin/tmenu
  156 nobody    3364 S    /usr/bin/shellinaboxd -t -p 88 -s /:root:root:/:/bin/tmenu -s /cli/shell:root:root:/:/bin/tmenu
  158 nobody     932 S    /usr/bin/dnsmasq
  165 root       812 S N  /sbin/utelnetd -l /bin/tmenu -p 23 -d -B
  233 root      1244 S    {snaplogs} /bin/sh /var/lib/humaxtv/mod/xinit.d/snaplogs start
  234 root      1236 S    sleep 180
  255 root      1260 S    {S90settop} /bin/sh /etc/init.d/S90settop start
  281 root      331m S    /usr/bin/humaxtv
  734 root         0 SW   [RtmpTimerTask]
  735 root         0 DW   [RtmpMlmeTask]
  736 root         0 SW   [RtmpCmdQTask]
  784 root         0 SW<  [kjournald]
  792 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  804 root         0 SW<  [kjournald]
  806 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  813 root         0 SW<  [kjournald]
  858 root      1272 S <  {run-and-gun} /bin/sh /etc/mdev/run-and-gun
  922 root      1236 S <  sleep 1
  947 root      1260 R <  {modinit} /bin/sh /sbin/modinit
  968 root      1244 R <  ps -w

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0

=== Sun May  8 10:18:15 UTC 2022 - init ===========================
=== Sun May  8 10:18:15 UTC 2022 - reset all ===========================
=== Sun May  8 10:18:15 UTC 2022 - rma ===========================
=== Sun May  8 10:18:15 UTC 2022 - cleanup ===========================
=== Sun May  8 10:18:15 UTC 2022 - ugprade bootmod ===========================
=== Sun May  8 10:18:15 UTC 2022 - setup directories ===========================
=== Sun May  8 10:18:16 UTC 2022 - create modenv ===========================
=== Sun May  8 10:18:16 UTC 2022 - migrate bootmod ===========================
=== Sun May  8 10:18:16 UTC 2022 - setup hostname ===========================
=== Sun May  8 10:18:16 UTC 2022 - setup hosts ===========================
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
    Interface: [eth0]
    IP: [192.168.1.14]
=== Sun May  8 10:18:16 UTC 2022 - run init ===========================
Setting up swapspace version 1, size = 268431360 bytes
UUID=88103e3d-29de-4a8c-ba8e-1a90c5fdd6f4
    Sun May  8 10:18:16 UTC 2022 - S00swapper (elapsed: 2s)
Disabling TCP window scaling
net.ipv4.tcp_window_scaling = 0
    Sun May  8 10:18:18 UTC 2022 - S00tcpfix (elapsed: 0s)
    Sun May  8 10:18:18 UTC 2022 - S00wlan (elapsed: 0s)
/etc/init.d/rcS.mod: line 34: /mod/etc/init.d/S00wlan.new: Permission denied
    Sun May  8 10:18:18 UTC 2022 - S00wlan.new (elapsed: 0s)
    Sun May  8 10:18:18 UTC 2022 - S00wlan.old (elapsed: 0s)
Loaded CIFS module into kernel.
    Sun May  8 10:18:18 UTC 2022 - S01cifs (elapsed: 0s)
    Sun May  8 10:18:18 UTC 2022 - S01crond (elapsed: 0s)
Loaded FUSE module into kernel.
    Sun May  8 10:18:19 UTC 2022 - S01fuse (elapsed: 0s)
    Sun May  8 10:18:19 UTC 2022 - S01lighttpd (elapsed: 0s)
    Sun May  8 10:18:20 UTC 2022 - S02anacron (elapsed: 0s)
    Sun May  8 10:18:20 UTC 2022 - S02atd (elapsed: 0s)
Anacron 2.3 started on 2022-05-08
    Sun May  8 10:18:20 UTC 2022 - S02portmap (elapsed: 0s)
Normal exit (0 jobs run)
Backing up scheduled recordings and events...
  Backing up scheduled event 'The Archers'
  Backing up scheduled event 'EPG Refresh 1'
  Backing up scheduled event 'EPG Refresh 2'
  Backing up scheduled event 'BBC Inside Science'
  Backing up scheduled event 'More or Less'
  Backing up scheduled event 'The Curious Cases of Rutherford...'
  Backing up scheduled event 'I'm Sorry I Haven't A Clue'
  Backing up scheduled event 'I'm Sorry I Haven't A Clue'
  Backing up scheduled event '--- Auto Update ---'
Done.
Backing up channel favourites...
  Names:
    Favourite 1
    Favourite 2
    Favourite 3
    Favourite 4
    Favourite 5
Done.
Backing up skiplist...
Done.
Backing up channel list...
Done.
    Sun May  8 10:18:20 UTC 2022 - S03autoschedule (elapsed: 2s)
    Sun May  8 10:18:23 UTC 2022 - S30posttvcrash (elapsed: 0s)
    Sun May  8 10:18:23 UTC 2022 - S31rsvsync (elapsed: 0s)
    Sun May  8 10:18:23 UTC 2022 - S40ir (elapsed: 0s)
Starting recmon...
    Sun May  8 10:18:23 UTC 2022 - S54recmon (elapsed: 0s)
Rotating at 1048576, keeping 2, max age 0

-- Rotate

[qtube.20220202113903.log]
    already rotated.
[recmon.log]
[nugget.log]
[wlan.log]
[auto.log]
[auto.20220414065401.log]
    already rotated.
[activity.log]
[cfupdate.log]
[qtube.20220422082057.log]
    already rotated.
[crash.log]
[qtube.log]
[wlanmonitor.20220223115809.log]
    already rotated.
[rsvsync.log]
[auto.20220413235601.log]
    already rotated.
[empty_dustbin.log]
[wlanmonitor.20220422082057.log]
    already rotated.
[wlanmonitor.log]

-- Purge

[recmon.log] - 0
[nugget.log] - 0
[wlan.log] - 0
[auto.log] - 2
[activity.log] - 0
[cfupdate.log] - 0
[crash.log] - 0
[qtube.log] - 2
[rsvsync.log] - 0
[empty_dustbin.log] - 0
[wlanmonitor.log] - 2
    Sun May  8 10:18:23 UTC 2022 - S59webif (elapsed: 1s)
    Sun May  8 10:18:24 UTC 2022 - S60parseepg (elapsed: 0s)
    Sun May  8 10:18:24 UTC 2022 - S85webshell (elapsed: 0s)
    Sun May  8 10:18:24 UTC 2022 - S89betaftpd (elapsed: 1s)
    Sun May  8 10:18:25 UTC 2022 - S90netshares (elapsed: 0s)
    Sun May  8 10:18:25 UTC 2022 - S90ntpclient (elapsed: 0s)
    Sun May  8 10:18:25 UTC 2022 - S91samba (elapsed: 1s)
    Sun May  8 10:18:27 UTC 2022 - S99auto-unprotect (elapsed: 0s)
=== Sun May  8 10:18:27 UTC 2022 - complete ===========================
=== Sun May  8 10:18:30 UTC 2022 - modinit - setup_hosts ===========================
=== Sun May  8 10:18:30 UTC 2022 - modinit - setup_hosts ===========================
=== Sun May  8 10:18:30 UTC 2022 - setup hosts ===========================
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0
    Interface: [wlan0]
=== Sun May  8 10:18:30 UTC 2022 - setup hosts ===========================
    IP: [192.168.1.14]
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0
    Interface: [wlan0]
=== Sun May  8 10:18:30 UTC 2022 - complete ===========================
    IP: [192.168.1.14]
=== Sun May  8 10:18:31 UTC 2022 - complete ===========================
Updating DLNA database...
Reference time: 1652003600
Scanning disk...
Updating DLNA database...
 
Otherwise, as in post #75.
Okay...
There's some difference in the way iwgetid is working.

The log says "already connected to <redacted>"...
I presume you mean the line in wlan.log. That's a red herring – take a look at the time stamps.

wlan.log:
Code:
++++++++++++++ S00wlan - Sun May  8 09:53:00 UTC 2022 ++++++++++++++
Wireless interface: wlan0
Already connected to '############'
No link found on eth0, disabling.

modinit.log:
Code:
=== Sat Jan  1 00:00:11 UTC 2000 - modinit - -boot ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - setup boothosts ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - setup hostname ===========================
=== Sat Jan  1 00:00:11 UTC 2000 - complete ===========================
=== Sun May  8 10:10:49 UTC 2022 - modinit - ===========================
=== Sun May  8 10:10:49 UTC 2022 - diag ===========================
Filesystem                Size      Used Available Use% Mounted on
/dev/root                21.6M     21.6M         0 100% /
...

wlan.log dates from a previous boot (when the WiFi worked), so has not been over-written in the non-working boot. The same applies for the example where the WiFi was working in MM, so it's a MM thing not a WiFi-not-working thing. Conclusion: wlan.log is of no value to this investigation.

Incidentally: why are bottletop's wlan.logs more verbose than mine? Is that down to me having tried out the revised wifi-up from post 8 and then reverted to the original?

In an effort to gather more data, I increased my WiFi monitoring script from hourly to every minute, but it seems crontab doesn't run in MM – is that true?
 
Last edited:
... Conclusion: wlan.log is of no value to this investigation.

Indeed, in Maintenance Mode /sbin/wifi-up is run from /etc/init.d/S89maintenance so its log will be inside /tmp/maintenance.boot.log

...crontab doesn't run in MM – is that true?

The cron daemon is started in /mod/etc/init.d/S01crond, so not in MM. /sbin/modinit uses the log file above as a flag and skips the startup scripts in /mod/etc/init.d if it's present. The name of the log is undocumented secret knowledge shared between /etc/init.d/S89maintenance and /sbin/modinit, which is something to fix in CF3.15
 
Indeed, in Maintenance Mode /sbin/wifi-up is run from /etc/init.d/S89maintenance so its log will be inside /tmp/maintenance.boot.log
So if I replace /mod/tmp/wlan.log with /tmp/maintenance.boot.log in the LOGS= line in snaplogs , that will help?
 
The name of the log is undocumented secret knowledge shared between /etc/init.d/S89maintenance and /sbin/modinit, which is something to fix in CF3.15
We haven't had a proper release of 3.14 yet, so...
 
We haven't had a proper release of 3.14 yet, so...
I suppose there ought to be a shell variable in /etc/init.d/include.sh that is used in both files, but a separate flag file would be better than using the log file. I imagine that the flag file named by $MAINTFLAG isn't used because it may be deleted before the test in modinit.
 
The name of the log is undocumented secret knowledge shared between /etc/init.d/S89maintenance and /sbin/modinit
Am I missing something here – the name of which log? I've confirmed /tmp/maintenance.boot.log exists in MM (during a "WiFi working" boot), so that one isn't undocumented...

Better, add it to the list.
Why? As I have shown, wlan.log isn't captured during MM, but if that's what you want...
 
This is a memo for my benefit (because I'm having finger trouble manually moving the log files out of PREV before they get auto-deleted... why delete them at all???).

mv /mod/tmp/prev/* /mod/etc/mm-wifi-up

mv /mod/tmp/prev/* /mod/etc/mm-wifi-down
 
The results are in...

Code:
Maintenance boot attempts remaining: 2
Entering maintenance mode at Sat Jan  1 00:00:12 UTC 2000
Muting volume...
Starting humaxtv process...
  ... pid 294 ...
Waiting for hardware initialisation to complete...
  still waiting... 59...
  still waiting... 58...
  still waiting... 57...
  still waiting... 56...
Sat Jan  1 00:00:16 2000 Fan level: -1 -> 0 (ffffffff -> 0)
  still waiting... 55...
DRV_DSC_Init_Begin
route: SIOCADDRT: File exists
SIOCDELRT failed , ret->-1
  still waiting... 54...
  still waiting... 53...
  still waiting... 52...
  still waiting... 51...
[P_MEDIA_CheckValidMediaId] Invalid Media ID.
[DI_MEDIA_MP_GetStreamInfo] Error - Invalid Media Id.
[AP_BrowserManager_Proc:608] [AP_BrowserNetTime_startNetTimeTask:171] [AP_BrowserNetTime_startNetTimeTask:208]   still waiting... 50...
[scanFonts:448] [scanFonts:448] [scanFonts:448]   still waiting... 49...
  still waiting... 48...
  still waiting... 47...

                    IE: WPA Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher :
                        Pairwise Ciphers (1) :
                        Authentication Suites (1) :

                    IE: WPA Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :
Waiting for network initialisation to complete...
Stopping humaxtv process...
Restoring previous volume...
Stopping dnsmasq process...
Unloading BCM kernel module...
Killing run-and-gun
Killing modinit
killall: modinit: no process killed
Running wifi-up
Wireless interface: wlan0
== swifi
ssid=<<<REDACTED>>>
key=<<<REDACTED>>>
manual=1
auth=7
ip=192.168.1.14
mask=255.255.255.0
gw=192.168.1.254
dns=192.168.1.254
Set CountryRegion=31
Set AuthMode=WPA2PSK
Set EncrypType=TKIP
Set SSID=<<<REDACTED>>>
Set WPAPSK=<<<REDACTED>>>
Set SSID=<<<REDACTED>>>
== iwpriv show
wlan0     show:    Infra
wlan0     show:    WPA2PSK
wlan0     show:    TKIP
wlan0     show:
wlan0     show:    PMK = <<<REDACTED>>>
wlan0     show:    <<<REDACTED>>>
Manual config:
+ eth_check
+ local eth=eth0
+ ifconfig eth0
+ grep -q RUNNING
+ echo No link found on eth0, disabling.
No link found on eth0, disabling.
+ ifconfig eth0 down
+ ip route flush dev eth0
+ /sbin/modinit setup_hosts
+ swifi ip
+ swifi mask
+ ifconfig wlan0 192.168.1.14 netmask 255.255.255.0 up
+ swifi gw
+ route add -net default gw 192.168.1.254
+ swifi dns
+ echo nameserver 192.168.1.254
+ isConnected wlan0
+ iwgetid --raw --ap wlan0
+ [ -n 44:94:FC:E8:34:9A ]
+ type swifi
+ grep -qF function
+ save_settings
+ local conf
+ [ -w /mod/etc ]
+ swifi
+ conf=ssid=<<<REDACTED>>>
key=247eb3ace6
manual=1
auth=7
ip=192.168.1.14
mask=255.255.255.0
gw=192.168.1.254
dns=192.168.1.254
+ echo ssid=<<<REDACTED>>>
key=247eb3ace6
manual=1
auth=7
ip=192.168.1.14
mask=255.255.255.0
gw=192.168.1.254
dns=192.168.1.254
+ grep -cF =Failed:
+ [ 0 = 0 ]
+ echo # these settings are used if no settings are configured
+ echo ssid=<<<REDACTED>>>
key=247eb3ace6
manual=1
auth=7
ip=192.168.1.14
mask=255.255.255.0
gw=192.168.1.254
dns=192.168.1.254
Done.
Displaying IP address: [192.0.2.200/200]

Code:
Maintenance boot attempts remaining: 2
Entering maintenance mode at Sat Jan  1 00:00:12 UTC 2000
Muting volume...
Starting humaxtv process...
  ... pid 294 ...
Waiting for hardware initialisation to complete...
  still waiting... 59...
  still waiting... 58...
  still waiting... 57...
Sat Jan  1 00:00:16 2000 Fan level: -1 -> 0 (ffffffff -> 0)
  still waiting... 56...
DRV_DSC_Init_Begin
route: SIOCADDRT: File exists
SIOCDELRT failed , ret->-1
  still waiting... 55...
  still waiting... 54...
  still waiting... 53...
  still waiting... 52...
  still waiting... 51...
[P_MEDIA_CheckValidMediaId] Invalid Media ID.
[DI_MEDIA_MP_GetStreamInfo] Error - Invalid Media Id.
[AP_BrowserManager_Proc:608] [AP_BrowserNetTime_startNetTimeTask:171] [AP_BrowserNetTime_startNetTimeTask:208] [scanFonts:448] [scanFonts:448] [scanFonts:448]   still waiting... 50...
  still waiting... 49...
  still waiting... 48...
  still waiting... 47...

                    IE: WPA Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :
########################################
Domain      :.humaxtvportal.com
CertPath    :htvdev_portal_ccert_2k_20101106.p12
###### New Cert is Added
########################################
########################################
Domain      :none
CertPath    :humax_tvportal_rootcert_2k_20101106_pub.pem
###### New Cert is Added
Waiting for network initialisation to complete...
Stopping humaxtv process...
Restoring previous volume...
Stopping dnsmasq process...
Unloading BCM kernel module...
Killing run-and-gun
Killing modinit
killall: modinit: no process killed
Running wifi-up
Wireless interface: wlan0
Already connected to '<<<REDACTED>>>'
No link found on eth0, disabling.
Done.
Displaying IP address: [192.0.2.200/200]

The record in the working instance shows much more activity establishing the WiFi link than in the not working instance. Where the non-working instance says "Already connected to (correct SSID)" must be either a red herring duplicated from a previous boot, or is obtaining the SSID direct from the dongle.

Could it be that the dongle is not being reinitialised? Maybe (guesswork) the non-working instance is when the USB power hasn't been dropped long enough for the dongle to register a power loss and reset itself. The system then queries it and it says "hey, we're fine here, already connected"...

Hmm. Maybe the other way around. I just booted into MM by dropping the power for a good number of seconds and the result was a non-working WiFi. The result is a slightly different log:

Code:
Maintenance boot attempts remaining: 2
Entering maintenance mode at Sat Jan  1 00:00:12 UTC 2000
Muting volume...
Starting humaxtv process...
  ... pid 294 ...
Waiting for hardware initialisation to complete...
  still waiting... 59...
  still waiting... 58...
  still waiting... 57...
  still waiting... 56...
Sat Jan  1 00:00:16 2000 Fan level: -1 -> 0 (ffffffff -> 0)
DRV_DSC_Init_Begin
route: SIOCADDRT: File exists
  still waiting... 55...
SIOCDELRT failed , ret->-1
  still waiting... 54...
  still waiting... 53...
  still waiting... 52...
  still waiting... 51...
[P_MEDIA_CheckValidMediaId] Invalid Media ID.
[DI_MEDIA_MP_GetStreamInfo] Error - Invalid Media Id.
[AP_BrowserManager_Proc:608] [AP_BrowserNetTime_startNetTimeTask:171] [AP_BrowserNetTime_startNetTimeTask:208] [scanFonts:448] [scanFonts:448] [scanFonts:448]   still waiting... 50...
  still waiting... 49...
  still waiting... 48...
########################################
Domain      :.humaxtvportal.com
CertPath    :htvdev_portal_ccert_2k_20101106.p12
###### New Cert is Added
########################################
########################################
Domain      :none
CertPath    :humax_tvportal_rootcert_2k_20101106_pub.pem
###### New Cert is Added
  still waiting... 47...
########################################
########################################
Domain      :.bbc.co.uk
CertPath    :hdrfoxt2_20201202.p12
###### New Cert is Added

                    IE: WPA Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher :
                        Pairwise Ciphers (2) :
                        Authentication Suites (1) :

                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher :
                        Pairwise Ciphers (1) :
                        Authentication Suites (1) :
  still waiting... 46...
########################################
########################################
Domain      :.bbc.co.uk
CertPath    :rootcert_1k.pem
###### New Cert is Added
########################################
[syncBoxInfo:1235]   still waiting... 45...
Waiting for network initialisation to complete...
Stopping humaxtv process...
Restoring previous volume...
Stopping dnsmasq process...
Unloading BCM kernel module...
rmmod: can't unload 'bcmdriver': Resource temporarily unavailable
Killing run-and-gun
Killing modinit
killall: modinit: no process killed
Running wifi-up
Wireless interface: wlan0
Already connected to '<<<REDACTED>>>'
No link found on eth0, disabling.
Done.
Displaying IP address: [192.0.2.200/200]

The can't unload 'bcmdriver' is a difference here.

Just to refocus:
  • WiFi link rarely (if ever) fails to establish for a normal Diagnostics reboot operation;

  • WiFi link rarely (if ever) fails to establish for a normal power cycle reboot;

  • WiFi link sometimes does and sometimes doesn't establish when booting into MM.
What's different about a MM boot compared with a normal boot? I presume humaxtv is in charge of setting up the WiFi during a normal boot, but has to be handled by the CF for a MM boot, so CF is not doing it the same as humaxtv would.

After being power cycled, how does it still know it's "already connected..."? Is it only me having this problem, ie my specific dongle?
 
Last edited:
Am I missing something here – the name of which log? I've confirmed /tmp/maintenance.boot.log exists in MM (during a "WiFi working" boot), so that one isn't undocumented...
It's not documented or enforced that the name of the file has to be the same in two otherwise unrelated places.

Why? As I have shown, wlan.log isn't captured during MM, but if that's what you want...

The same list should work for MM and not MM, with any missing log being ignored.

The results are in...

As before, the system thinks it has connected to the WiFi with 192.0.2.200.

These lines come from /etc/init.d/S89maintenance as it kills the settop program, launched to discover devices, as part of MM start-up:
Code:
Stopping humaxtv process...
Restoring previous volume...
Stopping dnsmasq process...
Unloading BCM kernel module...
Killing run-and-gun
Killing modinit
killall: modinit: no process killed
Running wifi-up
These lines apply:
Code:
      echo "Stopping humaxtv process..."
      kill $pid
...
      echo "Stopping dnsmasq process..."
      killall dnsmasq

      echo "Unloading BCM kernel module..."
      rmmod bcmdriver

      echo "Killing run-and-gun"
      killall run-and-gun

      echo "Killing modinit"
      killall modinit

      if iwgetid >/dev/null; then
              # Wireless dongle detected. Connection should already be up
              # but try and force it again.
              echo "Running wifi-up"
              if ! ifconfig eth0 | grep -q RUNNING; then
                      feedback "... WiFi ..." WiFi
              fi
              /sbin/wifi-up
      else
              echo "No wireless dongle detected."
      fi
In passing I notice that a lot of the startup routines in /etc/init.d and /mod/etc/init.d don't test whether the system is starting up or shutting down. This is reasonable if the system will never shut down partially and then restart, which was a good assumption but might be wrong as we have the fast restart now.

Here's a possible scenario.

Let's assume that the settop program can force the WiFi on with its built-in IP address (192.0.2.200 -- there are others, as we previously found), and that it may do so if its attempt to set up the connection properly has failed after some period. In MM this could happen during the fake startup if the parameters in setup.db are wrong: here the wifi-up script doesn't run until after the settop program has been killed, which only happens once /etc/init.d/S89maintenance has found a network connection, whereas in the normal boot wifi-up gets run asynchronously and apparently (usually) completes before the settop program's last resort settings have been applied. As there is valid connection to a WiFi AP, wifi-up sees everything apparently OK, then saves the active settings and exits.

If this is the problem, one solution could be to reorganise the MM startup logic so that wifi-up gets run asynchronously, perhaps spawning the WiFi block just before the NETWAIT block. Simpler, we could leave the logic as-is and detect the bad IP address to force a reconnect. It should be enough for wifi-up to check that there is no valid gateway in the routing table:
Code:
 # define a function to confirm active connection
 isConnected() { # ifname
-	[ -n "$(iwgetid --raw --ap "$1")" ]
+	[ -n "$(iwgetid --raw --ap "$1")" ] &&
+	[ -n "$(/sbin/route -n | /bin/sed -rn -e '/^0\.0\.0\.0/ {s/^[0.]+ +//;s/ .*//;p;q}')" ]
 }
Thus, from the routing table, which looks s/t like this,
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.1.254  0.0.0.0         UG    0      0        0 wlan0
we find the line starting with 0.0.0.0 and strip first that and subsequent spaces, then the next space and the rest of the line, leaving the gateway address. Or if a line like the last isn't found, the result is an empty string, which fails the [ -n test.

As well as this, it would be good to add /mod/etc/wlan.conf to the list of preserved log files, even if it isn't one.
 
Last edited:
If this is the problem, one solution could be to reorganise the MM startup logic so that wifi-up gets run asynchronously, perhaps spawning the WiFi block just before the NETWAIT block. Simpler, we could leave the logic as-is and detect the bad IP address to force a reconnect. It should be enough for wifi-up to check that there is no valid gateway in the routing table:
Code:
# define a function to confirm active connection
isConnected() { # ifname
- [ -n "$(iwgetid --raw --ap "$1")" ]
+ [ -n "$(iwgetid --raw --ap "$1")" ] &&
+ [ -n "$(/sbin/route -n | /bin/sed -rn -e '/^0\.0\.0\.0/ {s/^[0.]+ +//;s/ .*//
;p;q}')" ]
}
Thus, from the routing table, which looks s/t like this,
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
we find the line starting with 0.0.0.0 and strip first that and subsequent spaces, then the next space and the rest of the line, leaving the gateway address. Or if a line like the last isn't found, the result is an empty string, which fails the [ -n test.

As well as this, it would be good to add /mod/etc/wlan.conf to the list of preserved log files, even if it isn't one.
OK, I'll give it a go. The relevant section of my /mod/boot/2/wifi-up now looks like this (I hope I've straightened out the line wraps in yours properly):
Code:
# define a function to confirm active connection
isConnected() { # ifname
    [ -n "$(iwgetid --raw --ap "$1")" ] &&
    [ -n "$(/sbin/route -n | /bin/sed -rn -e '/^0\.0\.0\.0/ {s/^[0.]+ +//;s/ .*//;p;q}')" ]
}

Update: well, it's connected on three boots to MM so far, so it looks hopeful (it's hard to prove it will always work!). Will the logs reveal whether the previous fail point has been trapped?
 
Last edited:
As before, the system thinks it has connected to the WiFi with 192.0.2.200.
Apparently even if it was working: from the "working" log in post 54:
Displaying IP address: [192.0.2.200/200]

I've run a fourth MM and inspected the maintenance.boot.log, and it looks more like the previous working log than the previous non-working log. What should I look for to show the previous problem being resolved?
 
I'm looking for a way to make archiving the logs automatic. I can make a boot executable, eg /mod/etc/init.d/s99logcap, but I'm not sure what to put in it:
Code:
#!/bin/sh

mkdir /mod/tmp/<new-folder>
mv /mod/tmp/prev/* /mod/tmp/<new-folder>
...but I don't know how to programmatically create a unique name for <new-folder>. I guess something based on a timestamp, provided the script only runs at a normal boot after the system clock has been set.
 
...
I've run a fourth MM and inspected the maintenance.boot.log, and it looks more like the previous working log than the previous non-working log. What should I look for to show the previous problem being resolved?
Check modinit.log too. Telnet to the MM machine after boot and ifconfig wlan0; route -n; cat /mod/etc/wlan.conf.
 
Back
Top