Armadilloフォーラム

USB書込み不具合

ito1997

2021年4月26日 12時15分

お世話になります。

G2でrc.localにて、USBでArmadilloに書込み処理を行っていますが、失敗します。
成功時、失敗時のdiffは以下となりますが、対応策をご教示ください。
※G2には、MicroSDを付けていて、MicroSDをmount後、実行モジュールを
 MicroSD内に書き込んでします。
※rc.localと成功時と失敗時のファイルを添付します。
※書込み失敗時は、モジュールは起動しません。

❯ diff -u success.txt error.txt
--- success.txt 2021-04-26 11:37:49.036306800 +0900
+++ error.txt   2021-04-26 11:37:43.265611700 +0900
@@ -174,9 +174,9 @@
 Initializing XFRM netlink socket
 mmcblk0: mmc0:aaaa SL08G 7.40 GiB
 NET: Registered protocol family 10
+usb-storage 1-1:1.0: USB Mass Storage device detected
  mmcblk0: p1
 ip6_tables: (C) 2000-2006 Netfilter Core Team
-usb-storage 1-1:1.0: USB Mass Storage device detected
 sit: IPv6 over IPv4 tunneling driver
 scsi0 : usb-storage 1-1:1.0
 NET: Registered protocol family 17
@@ -200,41 +200,44 @@
 regulator-dummy: incomplete constraints, leaving on
 input: gpio-keys as /devices/platform/gpio-keys/input/input0
 input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input1
-rtc-s35390a 3-0030: setting system clock to 2000-01-22 07:40:00 UTC (948526800)
+rtc-s35390a 3-0030: setting system clock to 2000-01-22 07:36:16 UTC (948526576)
 ALSA device list:
   No soundcards found.
 RAMDISK: ext2 filesystem found at block 0
-RAMDISK: Loading 32768KiB [1 disk] into ram disk... |
+RAMDISK: Loading 32768KiB [1 disk] into ram disk... -
 scsi 0:0:0:0: Direct-Access     V2.321   RamBo            1100 PQ: 0 ANSI: 0 CCS
--
-sd 0:0:0:0: [sda] 7700480 512-byte logical blocks: (3.94 GB/3.67 GiB)
 |
-usb 2-1: new full-speed USB device number 3 using ci_hdrc
+sd 0:0:0:0: [sda] 7700480 512-byte logical blocks: (3.94 GB/3.67 GiB)
+/
 sd 0:0:0:0: [sda] Write Protect is off
-sd 0:0:0:0: [sda] No Caching mode page found
-sd 0:0:0:0: [sda] Assuming drive cache: write through
 -
 sd 0:0:0:0: [sda] No Caching mode page found
-/
+usb 2-1: new full-speed USB device number 3 using ci_hdrc
+\
 sd 0:0:0:0: [sda] Assuming drive cache: write through
 \
+sd 0:0:0:0: [sda] No Caching mode page found
+-
+sd 0:0:0:0: [sda] Assuming drive cache: write through
+|
  sda: sda1
 \
 sd 0:0:0:0: [sda] No Caching mode page found
--
+\
 sd 0:0:0:0: [sda] Assuming drive cache: write through
 sd 0:0:0:0: [sda] Attached SCSI removable disk
--
+\
 cdc_acm 2-1:1.0: This device cannot do calls on its own. It is not a modem.
-|
+/
 cdc_acm 2-1:1.0: ttyACM0: USB ACM device
 /
 usb 2-1: USB disconnect, device number 3
-|
+/
 usb 2-1: new full-speed USB device number 4 using ci_hdrc
-\
+|
 usb 2-1: not running at top speed; connect to a high speed hub
-done.VFS: Mounted root (ext2 filesystem) on device 1:0.
+done.
+VFS: Mounted root (ext2 filesystem) on device 1:0.
 devtmpfs: mounted
 Freeing unused kernel memory: 240K (c06b5000 - c06f1000)
 Mounting proc:                                                  done
@@ -249,11 +252,10 @@
 Cleaning up system:                                             done
 Running local start scripts.
 Starting the hotplug events dispatcher udevd:                   done
-Synthesizing the initial hotplug events:usb 2-1: unable to read config index 0 descriptor/all
-usb 2-1: can't read configurations, error -110
-usb 2-1: new full-speed USB device number 5 using ci_hdrc
+Synthesizing the initial hotplug events:usb 2-1: can't set config #1, error -110
                                                                 done
-usb 2-1: new full-speed USB device number 6 using ci_hdrc
+usb 2-1: USB disconnect, device number 4
+usb 2-1: new full-speed USB device number 5 using ci_hdrc
 usb 2-1: not running at top speed; connect to a high speed hub
 cdc_acm 2-1:1.0: This device cannot do calls on its own. It is not a modem.
 cdc_acm 2-1:1.0: ttyACM0: USB ACM device
@@ -284,10 +286,10 @@
 Starting vinmonitor:                                            done
 Starting Gateway application:
 Starting Console:                                               done
-Sync time from RTC: Sat Jan 22 07:40:24 UTC 2000
-Sat Jan 22 07:40:25 2000  -0.015364 seconds
-Sat Jan 22 07:40:27 2000  -0.967175 seconds
-Sat Jan 22 07:40:27 UTC 2000
+Sync time from RTC: Sat Jan 22 07:36:40 UTC 2000
+Sat Jan 22 07:36:42 2000  -0.924756 seconds
+Sat Jan 22 07:36:44 2000  -0.998804 seconds
+Sat Jan 22 07:36:44 UTC 2000
                                                                 done
 microSD File system checking: e2fsck: Bad magic number in super-block while trying to open /dev/mmcblk0p1
 (null):
ファイル ファイルの説明
error.zip
コメント

at_koseki

2021年4月26日 18時37分

古関です。

> microSD File system checking: e2fsck: Bad magic number in super-block while trying to open /dev/mmcblk0p1 (null):
> The superblock could not be read or does not describe a correct ext2 filesystem.
> If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else),
> then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193

正常系でも異常系でも
e2fsckでワーニングが出ていますが内容は確認したでしょうか?
ファイルシステムが破損していたりはしないでしょうか。

> G2でrc.localにて、USBでArmadilloに書込み処理を行っていますが、失敗します。
失敗するとはrc.local内のどこの処理で失敗するのでしょうか?
cpコマンドは成功したけど、実際に確認するとファイルがコピーされていないでしょうか。

if [ -s /root/mnt/gw_cfg.txt ]; then
        echo -n 'Copying Gateway Configuration: '
        cp /root/mnt/gw_cfg.txt /root/gateway/gw_cfg.txt
        chmod 644 /root/gateway/gw_cfg.txt
        check_status
fi

例えば上記だと、check_statusは直前の一行の処理の結果しか判別しないように見え、
cpが失敗し、chmodが成功した場合OKになります。
古い/root/gateway/gw_cfg.txtが残っていた場合chmodは成功しますがチェック方法は問題ないでしょうか。

よろしくお願いいたします。