config/hostname.conf file (found under
/system/sdcard/when the camera is running) file defines the camera’s name:
That file overrides the contents of the usual
etc/hostname.conf file, somewhat to my surprise, which remains the default
bin/hostname utility returns the hostname:
[root@Cam4 ~]# which hostname /bin/hostname [root@Cam4 ~]# hostname Cam4
You can automagically get the hostname in the on-screen display by modifying the
OSD formatting variable in
OSD="$(/bin/hostname) %Y-%m-%d %H:%M:%S"
Which works because the main OSD script sources the config file to set the variable:
It’s also helpful (at least for my purposes) to add the hostname to the image filenames. A one-line tweak in the
scripts/detectionOn.sh script does the trick:
Which produces names along these lines:
-rwxr-xr-x 1 ed root 246K Apr 23 2019 Cam4_2019-04-23_17.51.02.jpg*
Having source code makes simple changes like this … simple!