NX1/NX500 mod: "hot-patching" scripts
Jul 1, 2016
Hi again,
I was wondering if there was any easy way to edit/replace scripts while the camera is on from a remote connection. I mean, I could probably do some editing in a telnet session, but I'm definitely not a 'vi' fan (even less on a Windows telnet console). I'd rather stay in the comfort of a GUI editor on my computer, then 'push' the files on my camera. Any "built-in" way to do that?
Well, I managed to setup a way to do it but I'm asking anyway, in case I missed something obvious already in the mod, and mostly because it has to be done on every nx-patch release, which is not convenient (side note: I started a local git repository to ease merging my mods with future "unzipped nx-patch", but that might be a bit overkill, and that's out of scope for this topic...)
But if there wasn't any built-in way, then to whoever might be interested (other than otto, vasile, etc. who surely know their way around), here's what I did. I set up an FTP server that starts/stop along with telnet. This is easily done once nx-patch.zip is unzipped on the sd-card but before putting the card into the camera:
1. in the original on-wake script, I added the two last lines below after the first one (which was already in the script).
chmod +x *.sh on-wake-run popup_* telnetd keyscan mod_gui focus_* nx-patch shutter_to_rec
ln -s telnetd ftpd
ln -s telnetd tcpsvd
2. Then in telnet.sh, after
/opt/usr/nx-on-wake/telnetd &
I added
/opt/usr/nx-on-wake/tcpsvd -E 0.0.0.0 21 /opt/usr/nx-on-wake/ftpd -w / &
The last '/' is to allow access to the whole file system from ftp. It can be restricted to any folder.
3. Finally, everywhere a script would kill telnetd (i.e. any line with both 'killall' and 'telnetd'), I also added tcpsvd next to telnetd, that is in:
off_telnet.sh, on-wake, on-wake-run, telnet.sh, uninstall-tmp.sh
any occurence of "killall ... telnetd ..." becomes "killall ... telnetd tcpsvd ...".
Then, put the card in the camera, turn it on, enable wi-fi, and enable telnet from the mod menu. You can access all your camera through "ftp://your.camera.ip.address". I personally do it from Windows file explorer (to open/edit/save my files directly!) but there are other options. Make sure your camera doesn't go to sleep, or you'll lose wi-fi and your connection. Note that transfer are sloooooow. This works to transfer small files, but not for copying images/video from the sdcard (unless you are very patient...).
ANSWER:
This question has not been answered yet.