Skip to content
Nicolas Roche edited this page Nov 1, 2024 · 29 revisions

Updating Thingino Firmware

When it comes to installing a newer version of the firmware, there are several ways to do it. Some methods are easier than others, and some are more appropriate for different situations.

Update vs. Upgrade

First, it’s important to understand the two approaches to updating the camera firmware:

  1. Partial Update (update): This method updates only the kernel, userland applications, and the overlay partition, leaving the bootloader and its environment settings intact.

  2. Full Update (upgrade): This method includes the bootloader and environment, leaving the camera in a pristine state, similar to after a hard factory reset.

From the Development Environment

During development, you may need to update or upgrade your firmware frequently. To make this process easier, two commands have been added to the Thingino makefile: make update_ota and make upgrade_ota. Both commands require the IP address of the camera as the value of the IP= argument. Note that the camera should be online to use this method.

The usual routine to build and install the new firmware would be as follows:

make update_ota IP=192.168.1.10

or

make upgrade_ota IP=192.168.1.10

From the Camera Itself

When the camera is installed at its final location, the firmware can be upgraded to a newer version directly from within the camera’s Linux system. Log in via ssh and use the sysupgrade script to install a newer version of the firmware.

sysupgrade

To use the sysupgrade command, you can run it with one of the following options:

sysupgrade <filename> | [-f | -p] | <URL>

Options

  • -f: Perform a full upgrade. This option upgrades the entire system, including the bootloader. It is the most thorough update method but will reset the U-Boot environment, which includes settings like your Wi-Fi SSID, password, and root password.

  • -p: Perform a partial upgrade. This is the recommended option for most users as it upgrades the system while preserving the U-Boot environment. Your Wi-Fi SSID, password, and root password will remain intact.

  • <filename>: Perform a full or partial upgrade using a local file. This option is useful if you have already downloaded the firmware binary and want to upgrade without fetching it from a remote source.

  • <URL>: Perform a full or partial upgrade using a URL. This option allows you to specify a direct URL to the firmware binary for the upgrade.

  • -h: Display help information for the sysupgrade command.

Recommendations

  • Partial Upgrade (-p): This option is recommended for most users as it preserves critical settings such as the U-Boot environment. Use this option to upgrade your system while keeping your Wi-Fi credentials and root password unchanged.

  • Full Upgrade (-f): Use this option only when you need to perform a complete system overhaul, including the bootloader. Be aware that this will reset your U-Boot environment, so you may need to reconfigure your Wi-Fi and other settings afterward.

Important

After a full upgrade is complete, the system may take up to 60 seconds to complete provisioning and be ready for use. Be patient.

How It Works

The sysupgrade script automatically downloads the latest precompiled build for your specific device from the Thingino GitHub repository. Whether you choose a full or partial upgrade, the script ensures that you are running the latest available firmware for your device.

Example Commands

  1. Partial Upgrade (recommended):

    sysupgrade -p

    This command will fetch the latest partial upgrade from the GitHub repository and apply it, preserving your U-Boot environment.

  2. Full Upgrade:

    sysupgrade -f

    This command will perform a complete system upgrade, including the bootloader. Use this only when necessary, as it will reset your U-Boot environment.

  3. Upgrade from a Local File:

    sysupgrade /path/to/firmware.bin

    Replace /path/to/firmware.bin with the actual path to your firmware file. This command will perform the upgrade using the specified file.

  4. Upgrade from a URL:

    sysupgrade https://example.com/firmware.bin

    Replace https://example.com/firmware.bin with the actual URL of the firmware binary. This command will download the firmware from the URL and perform the upgrade.

  • Updating your Thingino device is straightforward with the sysupgrade command. Most users will find the -p option sufficient for keeping their device up to date while preserving their settings. Reserve the -f option for situations where a complete system update, including the bootloader, is required.

Switching between camera models

If you happen to flash the wrong version of thingino, you can switch to another image from within the system. Change IMAGE_ID in /etc/-os-release to the one you want to install and run sysupgrade -p.

Troubleshooting

Cameras like Xiaomi MJSXJ03HL with low-end SoC, large sensor resolution, and large flash memory (16MB) can have issues trying to install an update:

   \\   _______ _     _ _____ __   _  ______ _____ __   _  _____
   )\\     |    |_____|   |   | \  | |  ____   |   | \  | |     |
  (  /     |    |     | __|__ |  \_| |_____| __|__ |  \_| |_____|
  / /
        xiaomi_mjsxj03hl_t31n_jxq03p
        master+8b67c2e, 2024-10-02 00:02:24 -0400

root@ing-xiaomi-mjsxj03hl-8a0a ~# sysupgrade -p
Partial upgrade from GitHub
Upgrading from GitHub
Not enough free space to download firmware: 16449536 > 13631488

To upgrade such a camera from Linux, you first need to change the memory mapping to give the system more space:

fw_setenv osmem 52M@0x0
fw_setenv rmem 12M@0x3400000
reboot

Then do the upgrade and reset the memory mapping back:

fw_setenv osmem 32M@0x0
fw_setenv rmem 32M@0x2000000
reboot

Alternative: Upgrade from a focal file on sd card: 1. mount sd card to /mnt/mmc... 2. copy/download firmware to /mnt/mmc.../file 3. sysupgrade /mnt/mmc.../file

  1. Wiki Home
  2. About the Project
    1. Contributions
    2. Features
    3. Project Philosophy
    4. Releases
  3. Getting Started
    1. FAQ
    2. Glossary
    3. Hardware Identification
    4. Image Builder
    5. USB Boot Mode
    6. Ingenic USB Cloner
      1. OTG Booting
    7. PPSTRONG
    8. Installation: General
    9. Installation: No Tools Methods
    10. Resources and Links
    11. Support Community
    12. Troubleshooting
    13. UART Connection
    14. Updating Firmware
    15. Unbricking
    16. 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. Personal Cam Pan and Cam 2
      4. Wyze Cam Pan V1
      5. Wyze Doorbell (V1)
        1. Chime Reverse Engineering
        2. Flashing VDB1 over UART (YMODEM)
        3. MQTT Control and Monitoring
      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. DHCP: Timezone
      2. Wireless Networking
      3. USB Direct w CDC (NCM)
      4. USB Ethernet Networking
      5. Remote Access
      6. VPN
        1. Tailscale
        2. Wireguard
        3. Zerotier
      7. Wi-Fi
        1. Self Hosted AP
        2. Tips and Tricks
      8. 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
    18. Video Rotation
  6. Integration
    1. Home Assistant
    2. Frigate
    3. Ingenic A1/$15 NVR
    4. LightNVR
    5. Mobile Apps
    6. MQTT Integration
    7. Telegram Bot Integration
    8. Virtual Webcam on Linux
    9. 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