Cross-compilation development environment for host computer and camera
Percipio network cameras support to run the customized embedded applications within the camera, and allow users to fully utilize their internal computational resources for image pre-processing or application logic processing. For specific camera models that support embedded applications, please consult 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 within the camera.
Compiling sample programs
Download Camport SOC SDK, link: https://github.com/percipioxyz/camport3_soc.git
Execute
./build.sh
in the SDK root directory. After execution is complete, you will find the generated executable file RawFetchFrame in the./build/bin
directory.Copy the executable file to the camera’s user application folder using
scp
orsftp
. Please refer to Installation of programs and library files.
Compiling user programs
Refer to the SDK’s
./Sample/RawFetchFrame
, develop the application after creating a user program directory in the Sample directory.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/bin
directory.Copy the executable file to the user application folder of the camera using
scp
orsftp
, please refer to Installation of programs and library files.
Compiling programs using Opencv
Refer to the SDK’s
./Sample/RawFetchFrame
, 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/bin
directory.Copy the executable file to the user application folder of the camera using
scp
orsftp
. At the same time, copy the required OpenCV library to the camera. The OpenCV library is located in the./ThirdPartyLib/Opencv-3.4/lib
directory. Please refer to Installation of programs and library files.
Installing programs and library files
Using
scp
orsftp
command, copy the files that need to be installed to the camera’s/mnt/ram
directory:scp ur_FILES percipio@XXX.XXX.XXX.XXX:/mnt/ram
Use
putty
or 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
sync
command 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/ram
directory to prevent errors due to insufficient file system space during the decompression process if the application is a compressed package.When there are few files, you can choose not to use compressed files. However, when there are many files, it is recommended to pack them and then copy them to the camera for decompression. Currently, the camera supports several types of compressed files:
tar
,tar.gz
,tar.bz2
, and unencryptedzip
files. They can be decompressed using the following commands:tar -xvf
,tar -xzvf
,tar -xjvf
andunzip
.The maximum storage capacity for the user’s secondary development directory
/usr/local
is 25MB.After decompressing the file, be sure to copy it to the user directory, otherwise the content in
/mnt/ram
will be lost after rebooting.The library file
libtycam.so
used 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_FILENNAME
to grant execution permissions to applications or scripts.XXX.XXX.XXX.XXX is the IP address of the target camera.
Setting program to start up on boot
Login 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
sync
command in the console to write to the storage system and reboot the device.
Warning
If a reboot of
gevcam
is required during the debugging process, you need to runkillall percipio_gev_disd
.Do not add statements like
reboot
in the startup script!
Network Configuration
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 recommended to use ifconfig or other methods to directly modify the IP to avoid confusion in 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
sync
command 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 method to NTP time synchronization. For more details, please refer to Time synchronization settings.
The camera supports NTP time synchronization and 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