This repository provides a sample project that will help you to easily take some pictures from the ReCamera.
For that the project you are looking for is sscma-node.
To build it you will want to follow the next guidelines in order to properly setup the different dependencies and download the ReCamera-OS and the prebuilt SDK (see chapter 1 and 2 of this guide)
A script that will help you build and deploy your project to your ReCamera.
You will need to edit the begining of the file to setup your environement folders:
HOME_DIR="/home/xxx" # replace xxx with your user name on your Ubuntu 20.04
PROJECT_FOLDER="sscma-example-sg200x"
RECAMERA_OS_FOLDER="reCamera"
RECAMERA_OS_SDK_FOLDER="reCameraOS_SDK"
# Configuration
CAMERA_USER="recamera"
CAMERA_IP="192.168.42.1"
PASSWORD="XXXX" # Consider safer ways to handle passwords-
on my Ubuntu 20.04 LTS (wsl), i have this repo files downloaded inside /home/[USERNAME]/sscma-example-sg200x
-
I have my ReCamera OS downloaded into /home/[USERNAME]/reCamera
-
I have mu ReCamera OS SDK downloaded into /home/[USERNAME]/reCameraOS_SDK So adjust the variables above to fit your environement.
-
Of course replace the "XXXX" to fit your ssh camera password.
Execute the script on your vsCode terminal:
/home/xxx/deploy_sscma_node.shThe script will then build your project, make a static includes of all the dependancies and libs, then create a .deb package, then will try to deploy it using sshpass (you may need to install it in your ubuntu system for it to work.)
- Once deployed, connect to your camera using another terminal inside VsCode:
ssh recamera@192.168.42.1- once logged in, copy the helper scripts (using winscp or scp command) start_custom_node.sh and stop_all.sh to your home folder.
make them executable if needed:
sudo chmod +x start_custom_node.sh
sudo chmod +x stop_all.sh- Run the stop_all.sh to stop NodeRed service (it will cause you trouble if it's still runnin, plus it will free you a lot of memory for your application!!!!)
sudo stop_all.sh- Start you application (it will also close existing instances and stop NodeRed)
sudo start_custom_node.shIf everything is fine you should have your sscma-node application running.
- To deploy a new version of your application, on you vscode ubuntu system, call again the deploy_sscma_node.sh script and it will deploy the new version to your camera.
.
├── cmake # Build scripts
├── components # Functional components
├── docs # Documentation
├── images # Images
├── scripts # Scripts
├── solutions # Applications
├── test # Tests
└── tools # ToolsThis project depends on ReCamera-OS, which provides the necessary toolchain, SDK, and runtime environment. Ensure you have cloned and set up ReCamera-OS from the following repository:
🔗 ReCamera-OS GitHub Repository
git clone https://github.com/Seeed-Studio/reCamera-OS.git
cd reCamera-OS
# Follow the setup instructions in the repositoryIf you do not wish to build ReCamera-OS manually, you can download a prebuilt SDK package:
-
Visit ReCamera-OS Releases.
-
Download the latest reCamera_OS_SDK_x.x.x.tar.gz package.
-
Extract the package and set the SDK path:
export SG200X_SDK_PATH=<PATH_TO_RECAMERA-OS-SDK>/sg2002_recamera_emmc/
Follow these steps to set up the environment, compile the project, and generate the necessary application package.
git clone https://github.com/Seeed-Studio/sscma-example-sg200x
cd sscma-example-sg200x
git submodule update --initSet up the required paths before building the application:
export SG200X_SDK_PATH=<PATH_TO_RECAMERA-OS>/output/sg2002_recamera_emmc/
export PATH=<PATH_TO_RECAMERA-OS>/host-tools/gcc/riscv64-linux-musl-x86_64/bin:$PATHNavigate to the project directory and compile:
cd solutions/helloworld
cmake -B build -DCMAKE_BUILD_TYPE=Release .
cmake --build buildIf the build process completes successfully, the executable binary should be available in the build directory.
To prepare the application for distribution, package it using cpack:
cd build && cpackThis will generate a .deb package, which can be installed on the device.
Use scp or other file transfer methods to copy the package to the ReCamera device:
scp build/helloworld-1.0.0-1.deb recamera@192.168.42.1:/tmp/Replace recamera@192.168.42.1 with the actual username and IP address of your device.
Log into the device via SSH and install the package using opkg:
ssh recamera@192.168.42.1
sudo opkg install /tmp/helloworld-1.0.0-1.debNote: sudo password is the same as the WEB UI password. default is recamera.
Once installed, you can run the application:
helloworld
Hello, ReCamera!For more information, go to the specific solution's README.