Cross-Compilation Development Environment for Host Computer and Camera
Percipio network cameras support custom embedded applications running directly on the camera. This allows users to fully utilize on-camera compute resources for image pre-processing and application logic. For camera models that support embedded applications, contact Percipio technical support. .. Percipio network cameras allow users to fully utilize their internal computational resources for image pre-processing or application logic processing.
Note
USB depth cameras do not support users running embedded applications inside the camera.
Compile Sample Programs
Download Camport SOC SDK from https://GitHub.com/percipioxyz/camport3_soc.git
Execute
./build.shin the SDK root directory. After execution is completed, you will find the generated executable fileRawFetchFramein the./build/bindirectory.Copy the executable file to the camera’s user application folder using
scporsftp. See Install Programs and Library Files.
Compile User Programs
Refer to the SDK’s
./Sample/RawFetchFramefile, develop the application after creating a user program directory in theSampledirectory.Modify
./Sample/CMakeLists.txt, add the user program directory path in ALL_SAMPLES.Execute
./build.sh, after execution is completed, an executable file will be generated in the./build/bindirectory.Copy the executable file to the camera’s user application folder using
scporsftp. See Install Programs and Library Files.
Compile Programs using Opencv
Refer to the SDK’s
./Sample/RawFetchFramefile, develop the application after creating a program directory using OpenCV in the Sample directory.Modify
./Sample/CMakeLists.txt, add the program directory path that uses OpenCV in ALL_SAMPLES.Execute
./build.sh opencv, after execution is completed, an executable file will be generated in the./build/bindirectory.Copy the executable file to the camera’s user application folder using
scporsftp. At the same time, copy the required OpenCV library to the camera. The OpenCV library is in./ThirdPartyLib/Opencv-3.4/lib. See Install Programs and Library Files.
Install Programs and Library Files
Using
scporsftpcommand, copy the files that need to be installed to the camera’s/mnt/ramdirectory:scp ur_FILES percipio@XXX.XXX.XXX.XXX:/mnt/ram
Use
puttyor other terminals to remotely log in to the camera:ssh percipio@XXX.XXX.XXX.XXX
Extract the compressed file inside the camera, and copy the executable file and shared libraries to the corresponding directory under
/usr/local:cd /mnt/ram cp ur_ELFS_FILENNAME /usr/local/bin cp ur_lib*.so /usr/local/lib/ cp ur*config /usr/local/etc
Execute the
synccommand to permanently save the modifications to the flash.
Note
The copying process is divided into two steps. First, it is necessary to copy to the
/mnt/ramdirectory to prevent errors due to insufficient file system space during the decompression process if the application is a compressed package.
When there are only a few files, you may copy them directly without compression. For larger file sets, package and compress them before copying to the camera for extraction. The camera supports
tar,tar.gz,tar.bz2, and unencryptedzipfiles. These can be extracted withtar -xvf,tar -xzvf,tar -xjvf, andunzip.
The maximum storage capacity for the user’s secondary development directory
/usr/localis 25MB.After decompressing the file, be sure to copy it to the user directory, otherwise the content in
/mnt/ramwill be lost after rebooting.The library file
libtycam.soused in development is already included in the camera file system, so users do not need to copy it again to/usr/local/lib.Users need to use the command
chmod a+x ELFS_FILENNAMEto grant execution permissions to applications or scripts.XXX.XXX.XXX.XXX is the IP address of the target camera.
Set Program to Start up on Boot
Log in to the camera
ssh percipio@XXX.XXX.XXX.XXX
Modify the startup script
vi /usr/local/etc/start_app.sh 1 #!/bin/bash 2 # Created By: Leon Zhou 3 # Created Time: 2019-04-26 20:29:12 4 # Modified Time: 2019-04-26 20:33:22 5 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ 6 export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin 7 8 #Add your app start command below
Add the startup command for your app on line 8, for example:
1 #!/bin/bash 2 # Created By: Leon Zhou 3 # Created Time: 2019-04-26 20:29:12 4 # Modified Time: 2019-04-26 20:33:22 5 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ 6 export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin 7 8 #Add your app start command below 9 /usr/loca/bin/your_app
Execute the
synccommand in the console to write to the storage system and reboot the device.
Warning
If a reboot of
gevcamis required during the debugging process, you need to runkillall percipio_gev_disd.Do not add statements like
rebootin the startup script!
Configure Network
IP Settings
By default, the system uses DHCP mode to obtain an IP address dynamically.
Static IP settings
Log in to the camera to execute the instructions below, or modify the configuration file below in the application or script to configure the IP. It is not advised to use ifconfig or other methods to directly modify the IP to avoid chaotic camera IP management. After modifying the configuration file using this method, it will be permanently stored in the camera and take effect after rebooting.
echo "your_ip" > /etc/device_ip echo "your_gw" > /etc/device_gw echo "your_netmask" > /etc/device_netmask
Dynamic IP settings
echo "" > /etc/device_ip echo "" > /etc/device_gw echo "" > /etc/device_netmask
Warning
Please be cautious when modifying the IP address, subnet mask, and gateway; setting incorrect values may result in being unable to connect to the camera.
Be sure to execute the
synccommand in the console to write the changes to the storage system and reboot the device.
NTP Server Configuration
Tip
Before configuring the NTP server, you need to set the camera’s time synchronization mode to NTP time synchronization. For more information, refer to Time Synchronization Settings.
The camera supports NTP time synchronization. The default NTP servers used are: ‘cn.ntp.org.cn’, ‘0.ubuntu.pool.ntp.org’, ‘1.ubuntu.pool.ntp.org’.
If the user has set up an NTP server, they can execute the following command to add the IP or domain name of the NTP server in
/etc/ntp_server:echo your_ntp_server > /etc/ntp_server