Developers Guide
Tips and tricks for developing on/with the qtec cameras.
Remote Development using SSH
It is possible to use VS code (or a similar IDE) to develop using an external computer while accessing the camera file system directly by using remote SSH remote-ssh.
The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container with a running SSH server and take full advantage of VS Code's feature set. Once connected to a server, you can interact with files and folders anywhere on the remote filesystem.
No source code needs to be on your local machine to gain these benefits since the extension runs commands and other extensions directly on the remote machine.
It might be necessary to create a symlink in the camera first in order to get the vscode server to work.
ln -s /lib /lib64
If you still encounter issues try removing the vscode-server and then re-installing:
rm -rf /home/root/.vscode-server/
Filesystem synchronization
rsync
Another trick to streamline development is using rsync
rsync to
synchronize 2 filesystems (for example a local machine and a qtec camera).
Example usage:
- dry-run:
rsync -anv <src> root@<cam_ip>:<dst>
- copy and show progress:
rsync -aP <src> root@<cam_ip>:<dst>
entr
A utility for running arbitrary commands when files change. Uses kqueue(2) or inotify(7) to avoid polling. entr was written to facilitate rapid feedback on the command line.
entr
entr can be used in combination with rsync
in order to for example
trigger a file synchronization every time a file changes in a directory.
Example usage:
find <src_dir> -name \* | entr -s "echo =========;rsync -aP <src> root@<cam_ip>:<dst>"
Install entr
with: apt-get install entr