Last week I unboxed an old (may be more than 1 year) RAK7258 but never unboxed it before so it was a brand new GW (never used)
I configured the onboard LoRa Server and started to receive data. All was perfect until after one week gateway was down and refused to start back. Lucky I am, I ordered few weeks ago some console cable and checked the boot log.
Surprised to see an issue with mmcblk0p1 reading (or writing don’t remember and sorry did not recorded the logs) and then I saw there was a 16GB SD card on the GW (strange the other one GW on the same order does not have this SD)
Anyway, I removed the card then the GW booted and worked (no data was lost I still have devices declared into LoRa server)
Then I tested the card on my computer, all was fine, except something strange on boot region (not sure why and how because it should not boot on this)
charles@mac-office:Volumes$ sudo fsck_exfat /dev/disk4
fsck_exfat: Opened /dev/rdisk4 read-only
** Checking volume.
** Checking main boot region.
Main boot region is invalid. Trying alternate boot region.
** Checking alternate boot region.
Alternate boot region is invalid.
** The volume could not be verified completely.
charles@mac-office:Volumes$ sudo /usr/local/Cellar/e2fsprogs/1.45.6/sbin/badblocks -v /dev/disk4
Vérification des blocs 0 à 15558143
Vérification des blocs défectueux (test en mode lecture seule) : o
y
complété
Passe complétée, 0 blocs défectueux repérés. (0/0/0 erreurs)
So reading card all night did not fire any errors, but when plugged back into the GW still no boot due to errors, so I decided to format back the SD card (FAT32) and then put back in the GW and magic all is fine again.
So my question is : what’s is the goal of this card ? To be honest I’m not confortable to send this configured GW to customer and I don’t want that issue to occurs again so what’s the pro and con of using a SD card on this GW? Should we format this card to another one such as ext4?
I saw also that it’s used on startup scripts for lora_pkt_fwd
and loraserver
start() {
config_load lorasrv
config_get enable lorasrv enable 0
config_get loglvl lorasrv loglvl 1
[ "${enable}" = "0" ] && return
local db_file="/etc/lorasrv/mote_db"
mkdir -p /var/etc/
rm -f /var/etc/.mote_db
if [ -d "/mnt/mmcblk0p1" ];then
mkdir -p /mnt/mmcblk0p1/lorasrv
[ -f "/mnt/mmcblk0p1/lorasrv/mote_db" ] || cp -f /etc/lorasrv/mote_db /mnt/mmcblk0p1/lorasrv/mote_db
db_file="/mnt/mmcblk0p1/lorasrv/mote_db"
fi
#init_config
/usr/sbin/lorasrv -D $db_file -d $loglvl -P /var/run/lorasrv.pid
}
Here the contents after boot, for now syslog folder is empty but before I format the card it was containing old *.tgz
syslog files.
root@RAK7258:/etc/init.d# ls -al /mnt/mmcblk0p1/*
/mnt/mmcblk0p1/lorasrv:
drwxr-xr-x 2 root root 8192 Dec 2 10:32 .
drwxr-xr-x 5 root root 8192 Dec 2 10:59 ..
-rwxr-xr-x 1 root root 4096 Dec 2 10:57 mote_db
-rwxr-xr-x 1 root root 4096 Dec 2 10:57 mote_db.0
/mnt/mmcblk0p1/packet_forwarder:
drwxr-xr-x 2 root root 8192 Dec 1 13:20 .
drwxr-xr-x 5 root root 8192 Dec 2 10:59 ..
/mnt/mmcblk0p1/syslog:
drwxr-xr-x 2 root root 8192 Dec 1 13:20 .
drwxr-xr-x 5 root root 8192 Dec 2 10:59 ..
root@RAK7258:/etc/init.d#
So any explanation would really be very useful to take the good decision. Does this card is only used to backup data or does it is used for something else? And the $1 000 000 question, why on errors on this card, this prevent GW from booting?
Thank you for your help