question

Johannes Caprano avatar image
Johannes Caprano asked

Access Cerbo GX SD Card from SignalK

First of all thanks to the entire team at Victron for your work on the integration of SignalK! I have a question on using SignalK as part of VenusOS Large on a Cerbo GX: I would like to save log data from SignalK to SD card. However, Venus OS mounts the SD without write permissions for other users meaning that the user which runs the signalk-server process canā€™t write to it. Any ideas on how to give SignalK plugins write access without messing up VenusOS?
Thanks and best regards,
Johannes

Venus OSSignalKsd card
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
bathnm avatar image
bathnm answered Ā·

Insert an additional SD-Card into teh Cerbo GX. This is mounted R/W (unless it has errors in which case it is R/O) as it is also used by the VRM logger log file. It is only the root partition that is mounted as R/O.

The SD-Card will be mounted as

/dev/mmcblk0p1 on /run/media/mmcblk0p1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Johannes Caprano avatar image
Johannes Caprano answered Ā·

Hi @Bathnm, thank you so much for your fast reply! The mount information you supplied is consistent with what I have on my system (except for my card being exFAT but I have tried FAT32 too)

/dev/mmcblk0p1 on /run/media/mmcblk0p1 type exfat (rw,relatime,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro)

However, as fmask and dmask indicate, rwx permission is only allowed for root leading to the following output of ls -l for the cards mount path and changing these permissions is not possible (as it's prohibited by the mask)

drwxr-xr-x    5 root     root         32768 Aug 16 10:48 mmcblk0p1

Following the output of ps on my system, I find that signalk-server is run by user signalk and not by root

1384 signalk   247m R    node /usr/lib/node_modules/signalk-server/bin/signal

I suspect that it's because of this that my SignalK Plugins can't write to /run/media/mmcblk0p1 even if I supply that precise path, what do you think?

Best regards,

Johannes

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bathnm avatar image
bathnm answered Ā·

@sy.shenandoah yes looks like permissions, create a folder under /run/media/mmcblk0p1, then give that folder permissions and ownership by the user signals and point the plugin to that directory.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Johannes Caprano avatar image
Johannes Caprano answered Ā·

Hi, just a quick update on how I solved this: as @Bathnm correctly pointed out, I needed to change permissions on the folder I wanted to write to on the SD. However, this only works with ext3/4 formatted SD cards since FAT does not include permissions and therefore won't let you change rights or ownership. So what I ended up doing was format the SD card to ext4 in the Cerbo

fdisk /dev/mmcblk0
d
n
w
mkfs.ext4 /dev/mmcblk0p1

and then add write permission for other

chmod o+w /run/media/mmcblk0p1/foldername

I guess to use non ext-formatted SD cards you'd still have to change the mount settings of Venus OS.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

andy156 avatar image andy156 commented Ā·

Great, this took me ages and I was getting nowhere until I found your post. I've enabled node red access with this. Thanks so much.

0 Likes 0 Ā·

Related Resources

Additional resources still need to be added for this topic

Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)