Skip to content

Configuring camera using runonce.sh script

bort9 edited this page Mar 17, 2026 · 1 revision

Full upgrade from SSH. No Portal Configuration needed. Settings applied automatically.

This information assumes you have read and comprehend the Updating Firmware wiki page.

Here is an example workflow for updating cameras that are already running Thingino firmware. This process is completed entirely from an SSH connection to the camera. It performs a Full Update. The Full Update removes any configuration and settings that were previously set in your camera. This workflow strives to simplify the process of reconfiguring the camera's settings after a Full Update. The camera can be added to WiFi and reconfigured without using the Web UI. This example is for cameras that do not have internet access, but the same steps can be used whether the cameras have internet access or not.


Initial one-time setup

  • A Fat32 SD Card in the camera with a maximum size of 32 GB
  • A runonce.sh shell script on the SD Card

runonce.sh

The runonce.sh file is the secret ingredient of this workflow. This file adds the camera to WiFi and configures the camera settings.

Here is an example of a runonce.sh

wlan configure MyWiFiSSID MyWiFiPassword
echo '{"stream0":{"fps": 15, "gop": 15},"stream1":{"fps": 5, "gop": 5}}' > /tmp/myprudynt.json
echo '{"motors":{"pos_0": "830,160"}}' > /tmp/mymotors.json
echo '{"webui":{"paranoid": true}}' > /tmp/mythingino.json
jct /etc/prudynt.json import /tmp/myprudynt.json
jct /etc/motors.json import /tmp/mymotors.json
jct /etc/thingino.json import /tmp/mythingino.json
tzselect -n Chicago
reboot

What exactly is this doing? The configuration files on the camera are stored as .json files, typically in the /etc directory. Thingino's built in jct import command is being utilized to update the .json configuration files.

  • The wlan configure line sets the WiFi SSID and password. Replace MyWiFiSSID and MyWiFiPassword with your specific WiFi values. Match the case exactly for both SSID and Password.
  • The lines staring with echo are building temporary .json files in the camera's /tmp directory. These temporary .json files contain the desired settings for the camera.
  • The temporary .json files are then imported and merged into the camera's respective configuration files with the jct import command.
  • The time zone on the camera is set.
  • The camera is rebooted. This is optional, but may ensure the time zone is applied properly.

To investigate camera settings that can be configured, use the jct print command. For example, to print the prudynt.json file use the following command

jct /etc/prudynt.json print

Check out the full jct capabilities in the jct repo. The export function could be useful for listing out the settings that have been customized. This would be a great starting point for values to include in the ruonce.sh.


Upgrade Steps

  • Build updated firmware or download the latest file from thingino.com. Verify it is the correct file for the target camera hardware.

  • Copy the firmware to the camera through an ssh session. Use scp -O option (upper case oh). scp -O <source> <destination> for example:

      scp -O c:\CameraFirmware\firmware_filename.bin root@camera_ip:/tmp/
    
  • SSH to the camera

      ssh root@CameraIPAddress
    
  • Remove the runonce.done file from the SD Card if it exists. This file prevents the runonce.sh from executing on boot. The mount point of the SD Card may vary. If your SD Card is mounted at mmcblk0p1 the file can be removed with:

      rm /mnt/mmcblk0p1/runonce.done
    
  • Upgrade the camera from ssh with the firmware file. Use offline mode for sysupgrade (the -x option) if the camera does not have internet.

      sysupgrade -x /tmp/<firmware_filename>
    
    • The camera will update the firmware and then reboot. runonce.sh will be executed on boot to automatically join the camera to Wi-Fi, and it will also configure the included camera settings. A runonce.done file will be created on the SD Card to prevent runonce.sh from executing on subsequent boots.
  • SSH to the camera to set the root password. you will be prompted to set the root password after logging in for the first time (default password is root).

  • Complete!

In summary:

  • Obtain the appropriate firmware file and copy it to the camera
  • Ensure that the appropriate runonce.sh exists on the SD Card, and that runonce.done does not exist on the SD Card
  • Run sysupgrade -x <filename>
  • Set the root password
  1. Wiki Home
  2. About the Project
    1. Contributions
    2. Features
    3. Project Philosophy
    4. Releases
  3. Getting Started
    1. FAQ
    2. Hardware Identification
    3. Ingenic USB Cloner
      1. OTG Booting
    4. PPSTRONG
    5. Installation: General
    6. Installation: No Tools Methods
    7. Resources and Links
    8. Support Community
    9. Troubleshooting
    10. UART Connection
    11. Updating Firmware
    12. Unbricking
    13. Web UI
  4. Supported Cameras
    1. Cameras
    2. 360 AP1PA3
    3. AliExpress LTIA‐37FJZ (Vanhua Z55 module)
    4. AOQEE C1
    5. Aosu C5L
    6. Cinnado
      1. Cinnado D1 2K
      2. Cinnado D1 3K
    7. Dekco DC5L
    8. Eufy
      1. Eufy E210 Outdoor Cam
      2. Eufy E220
    9. Galayou/Wansview
      1. Galayou G2
      2. Galayou G7
      3. Wansview W6
      4. Wansview W7/Galayou Y4
    10. Hualai (Wyze/Atom/Neos/Personal)
      1. Dafang Upgrading for Wyze v2
      2. NEOS conversion
      3. Personalcam
      4. Wyze Cam Pan V1
      5. Wyze Doorbell (V1)
        1. Chime Reverse Engineering
      6. Wyze v2/Neos SmartCam/ATOM Cam 1
      7. Wyze v3
      8. Wyze Accessories
    11. iFlytek XFP301‐M
    12. Jienuo JN-107-AR-E-WIFI
    13. Jooan A6M
    14. LaView L2
    15. LongPlus X07
    16. LSC 3215672
    17. Sannce I21AG
    18. Sonoff Cam‐S2 and B1P
    19. TP-Link Tapo C100/C110/C111
    20. Wuuk Y0510
    21. Xiaomi
      1. Xiaomi Mijia1080p (SXJ02ZM)
      2. Xiaomi MJSXJ03HL
      3. Xiaomi Outdoor Camera AW200 (MJSXJ05HL)
  5. Configuration
    1. Administration
    2. Automation
      1. Configuring camera using runonce.sh script
    3. Cron jobs
    4. General
    5. LED Indicators
    6. Lighting
    7. Media Streaming Endpoints
    8. Network Storage
    9. Networking
      1. Wireless Networking
      2. USB Direct w CDC
      3. USB Ethernet Networking
      4. Remote Access
      5. VPN
        1. Tailscale
        2. Wireguard
        3. Zerotier
      6. Wi-Fi
        1. Self Hosted AP
        2. Tips and Tricks
      7. WWAN (Cellular)
    10. Night Mode
    11. ONVIF
    12. OSD (On-screen Display)
    13. Plugins
      1. Motion Guard
      2. Yandex Disk
    14. SSH Access Keys
    15. Wi-Fi Access
    16. Provisioning
    17. Streamer Bitrate Control
  6. Integration
    1. Home Assistant
    2. Frigate
    3. Ingenic A1/$15 NVR
    4. Mobile Apps
    5. MQTT Integration
    6. Virtual Webcam on Linux
    7. Mainsail (Klipper)
  7. Development
    1. Booting
      1. Boot: MMC SD
      2. Boot: NFS
    2. CH341A Programmer
    3. RTSP Players
    4. Flash Chips
    5. go2rtc
    6. Porting Guide
    7. Ingenic Platform Capability Matrix
    8. Ingenic Image Processor
    9. ISP Reserved Memory (RMEM)
    10. Debugging
    11. Software
      1. Building From Sources
      2. Buildroot
      3. Toolchain
      4. Choice of JSON library
    12. SSL and TLS Web UI in thingino
    13. Tech Info
      1. Hardware
      2. PWM Info
      3. Supported Hardware
      4. T23 GPIOs
      5. T31 GPIOs
    14. U-Boot Cheatsheet
    15. Zeratul/Atlas/Tassadar
    16. Resources

Clone this wiki locally