A Programmer's Guide to SJCAM SJ4000 WiFi

Nutchanon Wetchasit

Version 0.7.0 (alpha release, 25 December 2016)

Project homepage: http://sj4000programming.sourceforge.net/

This guide is free document: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This guide is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

A copy of the license is included in the section Appendix F, GNU General Public License version 3 . The corresponding source code of this guide and additional bonus materials are available from project homepage.

Additionally, permission to redistribute and/or modify this guide is also provided under the terms of the GNU Free Documentation License as published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of this license could be obtained from http://www.gnu.org/licenses/fdl.html


Dedication

This documentation effort is dedicated to fellow free software developers around the world who spend countless hours reverse-engineering proprietary software and hardware products, free customers from vendor lock-in, and give us our much-deserved freedom of choice in computing world.

Table of Contents

Introduction
1. About The Camera
2. Standard Connectors
USB
MassStorage (USB Mass Storage) Mode
PCCamera (USB Video Class) Mode
HDMI
3. Wireless Connection
4. Accessing Stored Files
Browsing Files
Downloading File
Deleting File and Directory
Uploading File
5. Obtaining Live Video Feed
6. Recording Videos
Starting Video Recording
Stopping Video Recording
7. Camera Modes
Switching Camera Mode
Checking Camera Mode
8. Shooting Photos
Previewing Before Shooting
Shooting a Photo
Starting Timelapse Photo Shoot
Stopping Timelapse Photo Shoot
9. Accessing Camera Configuration
Obtaining Camera Settings
Setting Video Recording Resolution
Setting Loop Recording Mode
Setting Wide Dynamic Range Mode
Setting Motion-Triggered Mode
Setting Audio Recording Mode
Setting Timestamp Overlay Mode
Setting Timelapse Video Capture Rate
Setting Photo Shooting Resolution
Setting White Balance Mode
Setting Exposure Value
Setting Timelapse Photo Shooting Interval
Setting Power Line Frequency
Setting Automatic Power Off Time
Setting WiFi SSID
Setting WiFi Password
Setting Date and Time
Setting Date
Setting Time
Setting Interface Language
Resetting Camera Configuration
Formatting MicroSD Card
10. Reading Camera Information
Checking Recording and Timelapse Shooting Status
Checking Power Status
Obtaining Firmware Information
Listing Supported Commands
11. Streaming Camera Status
General Camera Event Status
Elapsed Video Recording Time Status
Remaining Photos Status
A. Camera Command Format
B. Camera Commands Listing
Camera Commands Index
Mysterious Command 3027
C. Camera Setup Screen
D. Connecting Camera to Existing Network
Using ARP Proxy
Using NAT
Using 1:1 NAT with ARP Proxy
Connecting Through Android Device
E. Miscellaneous Trivia
Power On Trivia
Video Recording Trivia
Photo Shooting Trivia
Media Playback Trivia
Playback Interface
Playback Controls
Storage Trivia
Configuration Trivia
F. GNU General Public License version 3
Glossary
Index

List of Figures

3.1. Camera's wireless network
D.1. Example network configuration using static route and ARP proxy
D.2. Example network configuration using NAT
D.3. Example network configuration using 1:1 NAT with ARP proxy
D.4. Layer-3 view of 1:1 NAT with ARP proxy example (PC perspective)
D.5. Layer-3 view of 1:1 NAT with ARP proxy example (camera perspective)
D.6. Example network configuration using Android device's USB Tethering

List of Tables

1.1. Camera firmware version information
1.2. SJCAM ZONE Android application version information
1.3. SJCAMZONE.apk checksum information
3.1. Camera's IP configuration
3.2. List of HTTP headers returned from the camera
4.1. List of file deletion status values
4.2. List of file uploading status values
6.1. List of video recording start command status values
6.2. List of video recording stop command status values
7.1. List of camera mode numbers
7.2. List of returned camera mode numbers
8.1. List of photo shooting command status values
8.2. List of timelapse photo shooting start command status values
8.3. List of timelapse photo shooting stop command status values
9.1. List of returned camera setting items
9.2. List of video recording resolution setting values
9.3. List of loop recording mode numbers
9.4. List of wide dynamic range mode numbers
9.5. List of motion trigger mode numbers
9.6. List of audio mode numbers
9.7. List of timestamp mode numbers
9.8. List of timelapse video capture rate numbers
9.9. List of photo resolution numbers
9.10. List of white balance mode numbers
9.11. List of exposure numbers
9.12. List of photo shooting interval numbers
9.13. List of power line frequency numbers
9.14. List of automatic power off mode numbers
9.15. List of language numbers
9.16. List of MicroSD format command status values
10.1. List of camera's continuous shooting status values
10.2. List of power status values
11.1. List of camera event numbers
B.1. List of camera command numbers
E.1. List of metadata found in recorded video files
E.2. List of EXIF metadata found in shot photos

Introduction

SJCAM SJ4000 WiFi is a Chinese-made action camera with decent specification; and one of the advertised features is WiFi-based control- as its model name suggests. However, to use this feature, users are instructed to install a proprietary control software on their mobile device, and SJCAM does not provide technical specification for it; effectively barring free software users from using this feature of their purchased product.

However, through bits and pieces obtained from reverse engineering, together with months of experiment, I was able to write a technical documentation of this feature. The effort results in this guide, which provides information necessary for third party developers to write software (desktop, server, or mobile) which access and control SJCAM SJ4000 WiFi wirelessly, without relying on proprietary software; and complete enough to cover all functionalities available in the official SJCAM ZONE Android application.

This also consequentially allows the camera to be used in radically different ways: wireless webcam, wireless CCTV, studio photography camera, wildlife observation site camera, and much more. Possibilities and combinations are only limited by your imagination.

You should read this guide if:

  • You are a developer looking for a way to write application software or software library for controlling the SJCAM SJ4000 WiFi camera.

  • You own SJCAM SJ4000 WiFi camera yourself and want to use its WiFi capability, but can't use, or don't want to use SJCAM ZONE application; for example, when you want to use it with a laptop or desktop computer. In contrary to its name, you need not be a software developer to read this guide.

  • You are considering buying SJCAM SJ4000 WiFi camera, and would like to know trivia and catches in camera's functionality that were not documented in sale brochure or official manual.

  • You are a curious reader who interested to read one of the case studies of how WiFi capabilities in digital camera are implemented.

Anyway, due to incompleteness nature of reverse-engineered information, this guide is provided with the hope that it is useful, but without any warranty. This means you use it at your own risk; the author could not be held responsible for broken cameras or any damages whatsoever caused by your uses of these information.

The author is not in any way affiliated with SJCAM, other than being SJCAM SJ4000 WiFi camera user; so don't assume that I know better. Also, as the guide is not professionally edited, if you noticed errors, found mistake in my English writing, got suggestion on improvements, or discover more information to share, feel free to open a new discussion at project's issue tracker[1], or drop me a line via email; and I will check what can I do about it.



[1] Issue tracker of this guide is located at https://sourceforge.net/p/sj4000programming/tickets/

Chapter 1. About The Camera

SJCAM SJ4000 WiFi[2] is a middle-end action camera sold by SJCAM Limited (Hong Kong)[3], and is manufactured by China-based Shenzhen Hongfeng Century Technology Co., Ltd.[4]

This camera features:

  • 170-degree wide-angle lens.

  • 1.5-inch 4:3 LCD screen, with narrow vertical viewing angle but near-180 degree horizontal viewing angle.

  • 4x digital zoom.

  • Single microphone.

  • MicroSD card-based storage (also known to work with MicroSDHC card).

  • Proprietary 3.7V 900 mAh (3.33 Wh) Li-ion battery, replaceable, automatically recharged when the camera is connected to USB.

  • Four control buttons:

    • Shutter button (also used as affirmative OK).
    • Power button (also used for changing camera mode).
    • Up button (also used for zooming in and toggling WiFi access).
    • Down button (also used for zooming out).
  • 1920x1080 (full HD, aspect 16:9) 30 FPS video recording:

    • QuickTime MOV container format.
    • H.264 video.
    • Mono PCM 32000 Hz 16-bit audio (can be turned off).
    • In-video date/time stamping (can be turned off).
  • 4032x3024 (12 megapixels, aspect 4:3) photo shooting.

    • JPEG format.
    • In-photo date/time stamping (can be turned off).
  • Timelapse video and photo shooting mode.

  • Micro HDMI output for live video feed and media playback (1920x1080 60 Hz interlaced).

  • Micro USB port for connecting with PC, selectable mode on connecting:

    • USB mass storage device (direct read-write access to SD card).
    • Standard USB video capture device (1280x720 YUV 4:2:0, 30 FPS MJPEG live feed, no audio).
  • WiFi access with live feed, remote shooting, recording, and configuration.

However, in order to use the WiFi function, users are instructed to install a proprietary SJCAM ZONE application (Android/iOS) on their mobile device.

SJCAM does not provide public technical documentation of the feature; this causes problem to users who wish to use free software as they cannot simply write their own software to control and make use of this function without any access to the relevant specification.

Though, partially thanks to folks at SJCAM (or their contractors), they didn't go out of their way to make their customers' life difficult: they use a simplistic interface for accessing files, live feed, configuration, and a standard passphrase-based WPA2-PSK for securing wireless access; no home-grown encryption protocol or digital signature checking. I definitely consider this a plus when I'm going to shop for similar gadgets in the future.

Most of information described in this guide are reverse engineered: some from simple prod-and-poke, and some from communication data snooping between SJCAM ZONE application and the camera. The process does not involve bytecode decompilation/disassembling of SJCAM ZONE application or the camera firmware itself. The rest of information, including trivia, are from simple (but tedious) experiments.

Version of software used in experiments are listed below.

Table 1.1. Camera firmware version information

Camera firmware version G20140116V01
Camera firmware date 16-Jan-2015

Table 1.2. SJCAM ZONE Android application version information

APK version number 0.9.7.19
APK version code 9729
Displayed version number (from its App Settings screen) 2.9.8 (422)

SJCAM ZONE Android application used in my test is the APK binary downloaded from SJCAM's main web site, not the one from Google Play. Since its displayed version number does not seem to uniquely identify different versions, these are checksum information of the APK binary I used in my test, just in case:

Table 1.3. SJCAMZONE.apk checksum information

Checksum type Checksum value
MD5 312b39266a0f098b421daad79f6fffaa
SHA-1 c55336d43aaf5c3ef370ad42d30ca7f0c09bf30e
SHA-256 9ba28c501f1a4fa1512a1626317289284401177215f068b3e51a915d98f607aa
SHA-512 8c69fddf4dcc2b7c7c245f0b39a61ad861ee1559a6519825539f188970eef910​661cb3be8c4fb58bcf76df65d06dc3208d720fc37698bcf6c9fea1b3dae42b14

The guide describes this particular version of camera firmware and SJCAM ZONE. But even your camera uses different or more recent firmware version, most parts of the guide should still apply; although some trivia or warnings listed here might not be applicable to your version.

Again, as this is an alpha release of the guide, it might not cover all uncommon error conditions; so you need to be aware that there might be some unknown error codes or undefined situations for you to deal with when you're writing control software. Handle them wisely.

From now on, I will use SJ4000WIFI (or simply the camera) to refer to the SJCAM SJ4000 WiFi camera, and SJCAM ZONE to refer to the SJCAM ZONE Android application for brevity's sake. And lastly, I must note that even this guide is mainly aimed for developers, basic information in the next four chapters are also useful for end users, as no special software is needed to make use of them.

Extra trivia about SJCAM ZONE Android application:

  • SJCAM ZONE supports only ARM-based Android devices. It won't work on x86-based devices (e.g. ASUS Fonepad) or MIPS-based devices, as it included only ARM build of native libraries it uses. If you try to run it on those systems, it will show an error (with a big VLC Media Player logo at the top) briefly, with message similar to the following:

    Sorry, your device is currently not supported by this version of SJCAM for Android™.
    The error message is (please mention this when debugging):
    ARM build on x86 device

    Then it will be terminated with system's message Unfortunately, SJCAM ZONE has stopped..



[2] SJCAM's official product page: http://sjcamhd.com/sjcam-sj4000-wifi/

[3] SJCAM Limited web site: http://sjcamhd.com/

[4] Shenzhen Hongfeng Century Technology web site: http://www.cnhfzj.com/

Chapter 2. Standard Connectors

The camera provides two standard wired way for connecting with other devices: USB and HDMI. As this guide is not focused about these standard connectors, I will cover only just basic information.

USB

The camera provides one Micro USB-B connector. This is used both for data and battery charging. When plugged to the PC, camera screen will show a pop up asking which type of USB device you want it to be:

MassStorage
PCCamera

The MassStorage mode is selected by default. And unlike other digital cameras, it does not provide PTP mode for acquiring picture or video files; but I think you'll find the familiar Mass Storage mode as a more robust alternative.

Extra trivia about USB connector:

  • If you plug the camera to a PC while the camera is off; the camera will turn on, and the usual dialog for selecting USB device type will follow.

  • When USB device type selection dialog popped up, there's no way to cancel it; you must select one (then other camera functions will deactivate). If you unplug the USB cable at this point, the camera will just turn off.

  • If you plug the camera to a USB charger, it will not affect current camera operation. But when you unplug it from USB charger, the camera will turn off.

  • If you plug the camera to a USB charger while the camera is off, a battery charging screen will show up together with red light; this screen will not disappear by itself (even after the battery became full). If you would like to continue charging without leaving the screen on, to prevent LCD burn-in: leave the USB charger connected (don't unplug it), turn on the camera, then turn it off; the screen will now be off, leaving only red light as a charge indicator.

  • The camera can operate on external power alone (battery can be removed; including while the camera is powered on). The charging screen will show 100% charge, but camera's red light will be always lit, and date/time will reset if you unplug the power.

  • Camera's USB charger is rated at 5 V 1 A.

MassStorage (USB Mass Storage) Mode

This mode will turn the camera into a USB Mass Storage device (a.k.a. flash drive), giving your PC a direct read-write access to the MicroSD card currently inserted in the camera, it works as if you pop the MicroSD card out, put it in a card reader, and plug it to the PC.

You can add, delete, rename, move files and folder, or even format the card, like you can do with a regular flash drive.

The camera will cease working all other functions while operating in this mode, show blue LED indicator and show white MassStorage message in the middle of blue screen. When you unplug the USB cable (or hold down power button), the camera will turn off.

Note: In this mode, the camera shows itself as USB 2.0 device with Vendor ID 0x0603 (Novatek Microelectronics Corp.), Product ID 0x8611, Manufacturer name NOVATEK, and Product name J1455.

Extra trivia on USB Mass Storage mode:

  • MicroSD card access via the camera has linear data read rate at block level topped around 8.0 MiB/s. Reading the MicroSD card directly on a dedicated card reader will allow a higher read speed. (In my experiment, the same MicroSDHC card reads at 64.5 MiB/s when attached via USB 3.0 card reader)

PCCamera (USB Video Class) Mode

This mode will turn the camera into a USB Video Class device (a.k.a. web cam), giving your PC a live video feed from the camera, without the audio. The video feed will run at 1280x720 resolution (16:9 aspect ratio) with 30 FPS, using YUV 4:2:0 pixel format, Motion JPEG encoding.

This mode is the way to go when you want to use the camera as a web cam for video call, or as a CCTV camera. (In case of video call, you still need to use a separate microphone; and beware that video latency is quite high: around 0.6 sec)

The camera will cease working all other functions while operating in this mode, show blue LED indicator and show white PCCamera message in the middle of blue screen. When you unplug the USB cable (or hold down power button), the camera will turn off.

Note: In this mode, the camera shows itself as USB 2.0 device with Vendor ID 0x0603 (Novatek Microelectronics Corp.), Product ID 0x8612, Manufacturer name NOVATEK, and Product name J1455.

HDMI

The camera provides one Micro HDMI connector. This is used for connecting the camera directly to a TV or a PC monitor and view a live video feed or watch stored media files as if was camera's own screen (OSD is also displayed).

When HDMI cable is connected, the camera will automatically turn off its own screen, and send HDMI video signal to your display device, using 1920x1080 resolution interlaced at 60 Hz (30 FPS), with low latency (<= 0.2 sec). While camera is in this mode, video recording will be disabled; albeit showing the same OSD. (Though if you must, you still can start video recording via WiFi access in some configurations; see notes in “Starting Video Recording” section) Other functions like camera mode change, photo shooting, media playing, Setup screen, and WiFi access are still operating normally. If this mode is activated while a video recording in progress, the video recording will be stopped.

This HDMI connection also carries audio, so you should hear button beeps, shutter sounds, camera startup/shutdown chimes, and sound from media playback on your display device too (built-in speaker on the camera will be muted). But the audio from live video feed will not be audible, probably for preventing loud screech from acoustic feedback.

As this mode is always automatically activated on connecting HDMI cable, you could turn it off by going to camera's Setup > TV out and select Off while the HDMI cable is connected; and it will be re-activated if you change this setting to On. If HDMI is already disconnected, the option will already be Off. If you have trouble getting the camera to detect your display, you can turn this setting to On manually, which forces the camera to activate this mode.

When you unplug the HDMI cable or set camera's Setup > TV out to Off, the camera screen will turn back on, and you will be able to record video again.

Note

It is not advisable to leave HDMI together with USB charger plugged in while you are turning the camera on. If you did so, you would get a persistent No card inserted message with garbled background (instead of live video feed) on your display device. To fix this, you would need to turn off the camera by holding power button, unplug HDMI or USB, and turn the camera on again. (Merely unplugging HDMI is not enough)

If you must use USB charging at the same time as viewing HDMI output; you can turn the camera on without HDMI first. Once it is ready, plug in the HDMI cable.

Extra trivia on HDMI connection:

  • Plugging-in or unplugging HDMI cable while WiFi access is enabled will restart camera's RTSP service.

Chapter 3. Wireless Connection

When WiFi access function on the camera is enabled (by pressing Up button), the camera will act as a WPA2 PSK-encrypted WiFi access point, which you can use regular laptop or mobile phone to connect by selecting the access point and enter the configured passphrase (12345678 by default). For client's IP configuration, using automatic settings (DHCP) is recommended and convenient. However, manual IP configuration works too; see network configuration below:

Figure 3.1. Camera's wireless network

Camera's wireless network

Camera's wireless network has following IP configuration:

Table 3.1. Camera's IP configuration

Configuration item Configuration value
Camera's IP address 192.168.1.254
Subnet mask 255.255.255.0
DNS server (None)
Default gateway (None)

If your devices connected to the network with DHCP enabled, their IP address will be numbered 192.168.1.12 or above. Also, it is worth noting that camera's IP address is hard-coded and cannot be changed.

The camera runs following network services:

  • DHCP (UDP port 67)

    This service is used for giving automatic IP address configuration for connected device.

  • HTTP (TCP port 80)

    This service is used for accessing files inside camera's MicroSD card as well as for applying camera action/configuration commands.

  • RTSP (TCP port 554)

    This service is running only in video recording mode, used for streaming live video feed.

  • SJ4000WIFI Status Service (TCP port 3333)

    This service is used for streaming camera's status and events, like amount of time elapsed in current recording, or how much space is left for shooting photos.

  • HTTP (TCP port 8192)

    This service is running only in photo shooting mode, used for previewing photo shoot.

  • ICMP Echo

    This service is not used for anything but diagnostic purpose.

See next chapters for information on each service and their roles in supporting SJCAM ZONE application.

Extra trivia about association with camera's wireless access point:

  • Once WiFi access is enabled, camera will cease working other function, change to video recording mode, reset digital zoom to 1x, and display a black window showing current configured SSID and WPA2-PSK passphrase. Camera's yellow light will be blinking.

  • Once the first device associated to camera's access point (without doing anything else), camera's yellow light will now lit continuously, and camera screen will be back to video recording mode display, and camera's Mode button will be locked (but still can be used for powering off), Up and Down button will cease from doing zooming function (and Up button is now used for turning off WiFi access), OK button still can be used for starting/stopping recording or shooting photo (if camera is switched to photo shooting mode by a connected device); until WiFi access is turned off by pressing Up button.

  • Access point could handle more than one device simultaneously connected to it.

  • When one device disassociates from camera's access point, camera's yellow light will be back to blinking, no matter that there're more devices still associating to it or not. The SSID and password display will not come back, unless you turn off WiFi access and turn it on again.

  • If another device came up and associate to camera's access point, the yellow light will be lit continuously again.

  • When WiFi access is turned off by pressing Up button, the camera will switch to video recording mode again; no matter which mode connected devices have currently changed camera into. Also, if there is any video recording in progress, the recording will be stopped too.

Extra trivia about technical implementation of camera's wireless access point:

  • Access point is operated in Master mode (like an ordinary WiFi access point, as opposed to Ad-Hoc mode).

  • Access point is based on 802.11 b/g standard; 54 mbps max transfer rate.

  • Access point's channel setting is not fixed; it can use different channel each time the WiFi access is enabled. I haven't dug deeper on how the camera choose radio channel for its access point yet, but I have personally seen it on channel 1 (2.412 GHz), channel 2 (2.417 GHz), channel 3 (2.422 GHz), channel 6 (2.437 GHz), channel 7 (2.442 GHz), and channel 11 (2.462 GHz) at least.

  • Access point's WPA2 implementation uses only CCMP cipher.

Extra trivia about configuring camera's wireless access point:

  • You cannot configure access point's SSID name to empty value. If you did so, the SSID will be set to 0 instead.

  • You cannot configure access point's WPA2-PSK passphrase to anything that's shorter than 8 characters. If you did so, the old passphrase will be restored instead.

Extra trivia about camera's HTTP service (on TCP port 80):

  • Camera's HTTP server reported in its response that it utilizes HTTP version 1.1 and uses these HTTP headers in following order:

    Table 3.2. List of HTTP headers returned from the camera

    HTTP header name HTTP header value
    Server eCos/1.0
    Cache-Control no-store, no-cache, must-revalidate
    Pragma no-cache
    Accept-Ranges bytes
    Content-Length (Varies)
    Content-Type (Varies)
    Connection close

    As the server identifies itself in HTTP response as eCos/1.0 , I'm not sure if this is related to eCos operating system or not; if it is, SJCAM should have included appropriate legal notice and source offer in the package as eCos is licensed under GNU GPL with linking exception. I found no such notice in camera's software, manual, or package.

  • Camera's HTTP server doesn't seem to handle HTTP HEAD request properly. If you try to send it a HEAD request, it will simply close the connection instead of returning 501 Not Implemented or 405 Method Not Allowed response. As a consequence, wget --spider command won't work with it.

Chapter 4. Accessing Stored Files

Camera's HTTP service (on TCP port 80) is used for accessing all files stored on camera's MicroSD card. The interfaces is similar to ordinary HTTP server's directory listing page which you could browse directories and download files, but it also allow file uploading and file deletion. (Directory deletion requires user to enter the command URL manually. Limited directory creation is allowed as a side effect of file uploading. And operations like file renaming, file moving, directory renaming, and directory moving are not supported)

Browsing Files

Once your device is connected to camera's WiFi access point, you can access files stored in camera's MicroSD card by opening your web browser to the following URL:

http://192.168.1.254/

Or, if you're going to view a specific directory:

http://192.168.1.254/PATH/TO/DIRECTORY

Substitute PATH/TO/DIRECTORY with the desired directory path (slash-delimited). Trailing slash is OK but not needed (and not used by default). When directory URL is accessed without trailing slash, the camera will not produce any redirect and just show the directory listing.

If the directory exists, camera will return HTTP 200 response using text/html content type and appropriate content length, with HTML content consisting of directory listing, formatted for in-browser view. Note that the camera didn't return document encoding information in HTTP header and HTML code, so it is likely to be displayed using your browser's default character encoding.

In case you wish to parse the directory listing content yourself (like SJCAM ZONE did), it came in following format:

<html>
<body>
<div id=folderlabel>folder</div>
<div id=folder>/PATH/TO/CURRENT/DIRECTORY</div>
<div id=body>
<table cellpadding=5>
<th>Filename
<th>Filesize
<th>Filetime
<tr><td><a href="/PATH/TO/FILENAME1"><b>FILENAME1</b></a><td align=right> FILESIZE1<td align=right>FILETIME1
<td align=right><a href="/PATH/TO/FILENAME1?del=1">Remove</a>
<tr><td><a href="/PATH/TO/FILENAME2"><b>FILENAME2</b></a><td align=right> FILESIZE2<td align=right>FILETIME2
<td align=right><a href="/PATH/TO/FILENAME2?del=1">Remove</a>
<tr><td><a href="/PATH/TO/DIRNAME1"><b>DIRNAME1</b></a><td align=center><i>folder</i><td align=right>DIRTIME1
<tr><td><a href="/PATH/TO/FILENAME3"><b>FILENAME3</b></a><td align=right> FILESIZE3<td align=right>FILETIME3
<td align=right><a href="/PATH/TO/FILENAME3?del=1">Remove</a>
.
.
.
<tr><td colspan="4"><hr size=1 noshade align=top></td></tr></table>
<form name=frm action="/PATH/TO/CURRENT/DIRECTORY" method=post enctype="multipart/form-data"><input name=fileupload1 size=70 type=file><br/><input name=upbtn type=submit value="Upload files"></form></div>
</body>
</html>

Each line is terminated by a single LF (ASCII 10) character, including the last line. Its visible table structure is as follows:

Filename Filesize Filetime  
FILENAME1 FILESIZE1 FILETIME1 Remove
FILENAME2 FILESIZE2 FILETIME2 Remove
DIRNAME1 folder DIRTIME1  
FILENAME3 FILESIZE3 FILETIME3 Remove

Notes on HTML display format:

  • /PATH/TO/CURRENT/DIRECTORY will be a path to current directory without trailing slash (no matter that URL of the directory listing has a trailing slash or not). If current directory is root directory, it will be empty.

  • FILENAMEn will be a filename (including its extension), wrapped inside HTML <b> tag within <a> tag that links to the file. The link is specified as a path relative to root directory.

  • DIRNAMEn will be a directory name (without trailing slash), wrapped inside HTML <b> tag within <a> tag that links to the directory. The link is specified as a path relative to root directory, and without trailing slash.

  • There is one space in front of FILESIZEn in HTML code.

  • File sizes are displayed in binary prefix (byte, KiB, MiB, but not GiB), rounded to 2-digit decimal point. The size unit displayed will be B, KB, MB (no i), the unit will change as soon as file size reached the prefix; rounding does not affect the prefix used. There will be one space between file size and unit, file size displayed with byte unit will not show any decimal point, but file size displayed with other prefix unit will always have 2-digit decimal point.

    For example, a file sized 1500000000 byte will show as 1430.51 MB, a file sized 1600000 byte will show as 1.53 MB, a file sized 1048575 byte will show as 1024.00 KB, a file sized 1048576 byte will show as 1.00 MB, and a file sized 1023 byte will show as 1023 B .

  • FILETIMEn and DIRTIMEn will be a modification date of the file and directory in local timezone, with YYYY/MM/DD HH:mm:ss format; no matter which date format you chose in camera settings.

    • YYYY will be four-digit CE year (e.g. 2016).
    • MM will be two-digit month number (e.g. 09 for September).
    • DD will be two-digit date (e.g. 20 for 20th day of the month).
    • HH will be two-digit hour number in 24-hour clock (e.g. 17 for 5 p.m.).
    • mm will be two-digit minute number.
    • ss will be two-digit second number.
  • File and directory name display are not properly escaped in HTML code, causing anomaly when encountered with unusual filename, e.g. a file named character&nbsp;ace.txt would be displayed as character ace.txt . But even so, file/directory access and deletion link URL are encoded properly; so you should have no problem accessing them.

  • There's no link to parent directory, users must change the URL themselves.

Notes on directory listing behavior:

  • Sorting order in directory listing is fixed to none; they are displayed according to the order in underlying filesystem, subdirectories are not separately grouped.

  • If you're browsing root directory, you might notice there is one mysterious zero-byte file that is not really exist. If you try to download it, it will appear the same as a regular empty file. This is because that the camera also list a directory entry that is actually a volume label (if you accessed the MicroSD card from PC, you'll see that the filename matches with the drive name); this is a really odd behavior. If you delete this file, drive's volume label will be erased. (This does not erase volume label specified in the boot sector though, but most system won't use that anyway)

  • Files and directories with characters other than ISO-8859-1 encoding, or with plus sign (+) in its name will simply be omitted from directory listing, and cannot be accessed even by manually entering the URL. The filename character set oddities is due to the fact that the camera supports only ISO-8859-1 encoding when reading VFAT long filenames; exception to this are filenames that fits DOS's 8.3 pattern and stored without long filename- they will be displayed without any conversion.

  • Dotfiles (files and directories with . as first character in its name) are omitted from directory listing, but can be accessed if you entered their URL manually.

  • The camera ignores FAT's Hidden attribute. Files and directories with hidden attribute will be displayed in directory listing and can be accessed normally.

  • Root directory always exists, even there's no MicroSD card inserted in the camera. (It will show as empty directory though)

Following is an example HTML code of directory listing (returned from accessing http://192.168.1.254/DCIM/MOVIE):

<html>
<body>
<div id=folderlabel>folder</div>
<div id=folder>/DCIM/MOVIE</div>
<div id=body>
<table cellpadding=5>
<th>Filename
<th>Filesize
<th>Filetime
<tr><td><a href="/DCIM/MOVIE/2016_1001_233301_005.MOV"><b>2016_1001_233301_005.MOV</b></a><td align=right> 5.88 MB<td align=right>2016/10/01 23:33:04
<td align=right><a href="/DCIM/MOVIE/2016_1001_233301_005.MOV?del=1">Remove</a>
<tr><td><a href="/DCIM/MOVIE/2016_1001_234112_006.MOV"><b>2016_1001_234112_006.MOV</b></a><td align=right> 313.51 MB<td align=right>2016/10/01 23:43:56
<td align=right><a href="/DCIM/MOVIE/2016_1001_234112_006.MOV?del=1">Remove</a>
<tr><td><a href="/DCIM/MOVIE/2016_1001_232659_003.MOV"><b>2016_1001_232659_003.MOV</b></a><td align=right> 344.05 MB<td align=right>2016/10/01 23:30:00
<td align=right><a href="/DCIM/MOVIE/2016_1001_232659_003.MOV?del=1">Remove</a>
<tr><td><a href="/DCIM/MOVIE/2016_1001_233000_004.MOV"><b>2016_1001_233000_004.MOV</b></a><td align=right> 343.95 MB<td align=right>2016/10/01 23:33:00
<td align=right><a href="/DCIM/MOVIE/2016_1001_233000_004.MOV?del=1">Remove</a>
<tr><td><a href="/DCIM/MOVIE/1.6M"><b>1.6M</b></a><td align=right> 1.53 MB<td align=right>2016/09/16 18:59:04
<td align=right><a href="/DCIM/MOVIE/1.6M?del=1">Remove</a>
<tr><td><a href="/DCIM/MOVIE/MYVID"><b>MYVID</b></a><td align=center><i>folder</i><td align=right>2016/10/01 23:54:12
<tr><td><a href="/DCIM/MOVIE/1M.DAT"><b>1M.DAT</b></a><td align=right> 1024.00 KB<td align=right>2016/09/16 19:07:16
<td align=right><a href="/DCIM/MOVIE/1M.DAT?del=1">Remove</a>
<tr><td><a href="/DCIM/MOVIE/FULL1M.BIN"><b>FULL1M.BIN</b></a><td align=right> 1.00 MB<td align=right>2016/09/16 19:11:28
<td align=right><a href="/DCIM/MOVIE/FULL1M.BIN?del=1">Remove</a>
<tr><td colspan="4"><hr size=1 noshade align=top></td></tr></table>
<form name=frm action="/DCIM/MOVIE" method=post enctype="multipart/form-data"><input name=fileupload1 size=70 type=file><br/><input name=upbtn type=submit value="Upload files"></form></div>
</body>
</html>

If the directory is not exist, camera will return HTTP 200 response (weird!) using text/html content type and appropriate content length, with following HTML content:

<html>
<head><title>Page Not found</title></head>
<body><h2>The requested URL was not found on this server.</h2></body>
</html>

Each line is terminated by a single LF (ASCII 10) character, including the last line.

If the specified path does exist, but is a file (not directory); it will start file downloading instead.

Extra trivia about SJCAM ZONE's media files listing:

  • SJCAM ZONE also use this way to retrieve media files listing.

  • In SJCAM ZONE, only list of files in /DCIM/MOVIE and /DCIM/PHOTO are retrieved and displayed; files from /DCIM/MOVIE are grouped first, followed by files from /DCIM/PHOTO. Within each group, files are displayed in original filesystem order. All files are displayed and downloadable (regardless of extension).

  • SJCAM ZONE does not handle directory placed within /DCIM/MOVIE and /DCIM/PHOTO correctly; directory's entry in the list will show incorrect size and time (jumble of HTML code will be displayed instead). And the file listed next to the directory (in the same group) will not be displayed. If you clicked on the directory, its directory listing's HTML page will be downloaded to your device (rather than files inside it), with directory name as a file name, no file extension.

Downloading File

File from camera's MicroSD card can be downloaded in the same manner as normal file from web server. If you are already browsing from the directory listing, simply clicking the file name link in the directory listing should do the trick. Alternatively, you could start the download manually by going to a URL:

http://192.168.1.254/PATH/TO/FILE

Substitute PATH/TO and FILE with directory path and file name you are going to download, e.g. if I need to download file named 2016_0101_160315_001.JPG which is located inside subdirectory PHOTO, inside the directory DCIM, I would need to enter the URL: http://192.168.1.254/DCIM/PHOTO/2016_0101_160315_001.JPG . Path with trailing slash also works; which is an odd behavior, and it does not even generate a redirect.

If the file is not exist, the camera will return a response identical to the one returned from a request for nonexistent directory. However, if the specified path does exist, but is a directory (not file); it will return directory listing instead.

Extra trivia on file downloading:

  • Camera's HTTP server has download continuation support, if your WiFi connection dropped (or battery was dead), you can resume your download when you're on again.

  • HTTP download from the camera has effective transfer rate topped around 1.4 MiB/s in single connection; not fast enough for directly viewing its recorded 1920x1080 30 FPS or 1280x720 60 FPS video (you'll experience constant hiccups). For 1280x720 30 FPS video and lower, it should play okay.

  • Camera's HTTP server could handle maximum 4 simultaneous connections in total (no matter which files they request), with combined transfer rate topped at around 1.8 MiB/s. If you try to make a fifth request, the camera will reply with the same response as nonexistent file request even the file pointed by your request URI is exist.

Deleting File and Directory

You can delete specific file or directory from camera's MicroSD card by accessing URL of the file or directory with query string ?del=1 appended:

http://192.168.1.254/PATH/TO/FILE?del=1

Substitute PATH/TO and FILE with directory path and file name (or directory name) you are going to delete. In case you're deleting a directory, a path with trailing slash also works, and deleting nonempty directory is also allowed.

For example, if I need to delete a file named 2016_0101_191600_003.MOV which is located inside subdirectory MOVIE, inside the directory DCIM, I would need to enter the URL: http://192.168.1.254/DCIM/MOVIE/2016_0101_191600_003.MOV?del=1. If I need to delete a directory named EXTRAS which is located inside the directory DCIM, I would need to enter the URL: http://192.168.1.254/DCIM/EXTRAS?del=1 or http://192.168.1.254/DCIM/EXTRAS/?del=1

If you have already browsing from the directory listing, simply clicking a link named Remove shown on the right side of desired filename will do the deletion. (But this link is not provided for directory, you need to enter the URL yourself in that case) Also keep in mind that this will delete the file or directory without any confirmation.

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>4003</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following file deletion command status values:

Table 4.1. List of file deletion status values

Command status value Command status meaning
0 Specified file or directory is deleted successfully.
-1 Failed deleting specified file or directory.

Cause of deletion failure can be:

  • There's no MicroSD card in the camera.

  • File/directory specified in the URL is not exist.

  • File/directory specified in the URL is located within nonexistent directory.

  • File specified in the URL is currently in use (e.g. other connection is downloading it). In this case, camera will refuse to delete the file.

Uploading File

The easiest way to upload file to the directory on camera's MicroSD card, is browsing through camera's directory listing, scroll to the bottom of directory listing page where you'll find a Browse button, click and select file on your machine to upload, then click Upload files to start uploading.

If you wish to do this manually, send HTTP POST request to the following URL:

http://192.168.1.254/PATH/TO/DIRECTORY

Substitute PATH/TO/DIRECTORY with the actual directory path you wish to upload your file to (trailing slash is also allowed). In request header, use multipart/form-data content type[5], and send following content parts in request body:

Content-Disposition value Content-Type value Part's content
form-data; name="fileupload1"; filename="TARGETFILENAME" (Varies) (Content of uploaded file)
form-data; name="upbtn" text/plain Upload files

Substitute TARGETFILENAME with the filename you wish to upload the file as (original file name works too). For uploaded file's content type field, it varies, depends how your browser see the type of file you're uploading (e.g. text/plain when uploading file with .txt extension or audio/mpeg when uploading file with .mp3 extension); it does not have effect on file downloading, you can just use application/octet-stream too if you want.

You can also use the command-line cURL program for uploading, as follows:

curl -F "fileupload1=@LOCALFILE" -F "upbtn=Upload files" http://192.168.1.254/PATH/TO/DIRECTORY

Substitute LOCALFILE with path to file you wish to upload (on local machine), and PATH/TO/DIRECTORY with path to directory (on the camera) you wish to upload the file to.

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<cmd>3031</cmd>
<Status>UPLOADSTATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). UPLOADSTATUS part of the response will be one of the following file uploading status values:

Table 4.2. List of file uploading status values

File uploading status value File uploading status meaning
0 File uploading completed successfully.
-1 File uploading failed: a file or directory with the same name is already exists.
-3 File uploading failed: there's no MicroSD card in the camera, or not enough space left on the MicroSD card.
-4 File uploading failed: no file was specified in the upload form.

Important notes:

  • File uploading status -4 can be caused by omitting fileupload1 field in the request, giving fileupload1 field with empty filename (e.g. clicking Upload files without selecting any file), or giving fileupload1 field without filename parameter (e.g. submitting it as non-file field).

  • If there is not enough space for the new file, the camera will return the response in the middle of upload (with uploading status -3), then reset the connection. The file will not be saved in this case.

Uploading file to non-existing directory will cause the target directory tree (not just the last level of directory) to be created automatically, and the camera will return a response identical to successful upload.

If you uploaded a file that its name is within 8 characters and extension that is within 3 characters or without extension at all (name that fits DOS 8.3 filename); the uploaded file name will be converted to all uppercase, and VFAT long file name creation will be omitted. This also applies to directory names created in the process.

If the filename does not fit DOS 8.3 pattern and contains non-ASCII characters, VFAT long file name will be created with an assumption that uploaded filename is encoded in ISO-8859-1 character set. This also applies to directory names created in the process.

Caution

If you attempt to upload file into any path nested under existing file as if it was a directory, the camera will not stop you: It apparently created a directory with the same name as your existing file, and put your uploaded file inside it. Consequences are:

  • You'll never see the newly-created directory in camera's directory listing; only the existing file (which you tried to upload into) is seen. Entering the directory URL manually, with or without trailing slash, won't work, as it will just download the original existing file.

  • You'll have to enter the URL to file manually to be able to download the file you uploaded this way.

  • If you popped the MicroSD card out, insert it to your computer, and try to browse the affected directory, you would find only the original existing file; the file you uploaded will be nowhere in sight.

  • It is yet not known how the camera store directory entries for files uploaded this way. If you checked the MicroSD card with a filesystem diagnostic tool, you would not see duplicate name in the directory; but the affected files would be found as lost clusters (orphaned inode, in case you prefer Unix term).



[5] See RFC 7578 for details on structure of multipart/form-data request body: https://tools.ietf.org/html/rfc7578

Chapter 5. Obtaining Live Video Feed

Camera's RTSP service (on TCP port 554) is used for streaming live video captured from camera. This service is available when the camera is in video recording mode (which is the default mode when WiFi access is enabled) and timelapse video recording mode. You can use any RTSP-capable media player program (e.g. VLC Media Player, MPlayer) to stream video from it.

To obtain a live video feed, start your media player, and enter the following URL:

rtsp://192.168.1.254/sjcam.mov

You'll see a live video preview of what that would be recorded when you press the record button, so you'd notice (if it's not disabled in camera's configuration) that there's a timestamp displayed at bottom-left corner of the video. The stream is running on RTP transport; video part is encoded in H.264 with YUV 4:2:0 pixel format, 30 FPS frame rate. This stream does not include audio or any bit rate information.

  • If the configured video recording resolution has 16:9 aspect ratio, the stream video will have 640x360 resolution, with bit rate estimated around 1640 kbps to 1650 kbps give or take.

  • If the configured video recording resolution has 4:3 aspect ratio, the stream video will have 320x240 resolution, with bit rate estimated around 1615 kbps to 1640 kbps give or take.

Camera's RTSP service allows only one stream at a time, if there's second request made to the service while the first stream is running, the first stream will be terminated (even when the second request just accessed nonexistent stream URL and was given a Stream Not Found error).

If any of connected devices switched the camera to photo shooting mode, the video feed (and camera's entire RTSP service) will terminate. If you wish to stream a preview from photo shooting mode's viewfinder, there is a separate service for it, described in Chapter 8, Shooting Photos.

Caveat

There is a problem in camera's RTSP service that when you changed video recording resolution via WiFi access which changed video's aspect ratio (4:3 from/to 16:9), the streaming service will not properly acknowledge this change (and didn't terminate the running stream). If the previous ratio was 16:9, you'll see that the streamed video will still be in 640x360 (16:9), retain the normal timestamp overlay font and text size, left side of the video will show the current 4:3 video feed, and smaller right side will be stuck in a loop of ~0.5 sec video captured before resolution change. If the previous ratio was 4:3, the streamed video is still be in 320x240 (4:3), retain square-looking overlay timestamp text, and will show only left side of the actual video to be recorded.

This could be fixed by forcing the camera to restart its RTSP service, either by switching WiFi access off and on again (merely re-connecting to RTSP service or disassociating from access point are not enough); or alternatively, use WiFi access to switch the camera to photo shooting mode (stopping RTSP service in the process) then switch back to video recording mode again.

Video's aspect ratio changed by camera's own Setup screen will not result in this problem, as the Setup screen can only be accessed while the WiFi access is turned off; when WiFi access is turned on again, RTSP service would be already in a correct aspect ratio from the start.

Important notes:

  • Starting/stopping video recording (including timelapse video recording), or plugging/unplugging HDMI cable will restart camera's RTSP service; terminating video stream. You'll need to reconnect in order to continue viewing the live video feed.

  • It is not recommended to use RTSP service while timelapse video recording takes place; or moments afterward (unless you applied workaround described below).

    This is because starting timelapse video recording will change live video feed into 1920x1080 resolution with advertised frame rate of 30 FPS, but the camera will emit each frame at the same rate as the running timelapse capture (e.g. 1 frame/sec). Media players don't seem to handle this very well: some stuck in an endless attempt to buffer, some displayed frame as soon as it arrives but terminated stream prematurely when it realized something was wrong.

    When the timelapse video recording stops, despite the RTSP service being restarted, it would continue providing feed in 1920x1080 resolution at 30 FPS- though now the frames will be captured in real time. At a glance, this would appear as good thing (HD video); but due to bitrate limitation, the video will be blocky, have a large delay, and become garbled on intensive movement, which makes it less suitable as a preview.

    The live video feed could be restored into a usable state again by switching the camera to photo shooting mode or timelapse photo shooting mode, then switch to normal video recording mode. (Actually, switching to normal video recording mode, followed by recording video works too) See “Switching Camera Mode” section and “Starting Video Recording” section for details on how to do each step.

Extra trivia on live video feed function:

  • When the configured video recording resolution has 4:3 aspect ratio, camera will use square-looking font in timestamp overlay; this applies to the file recorded too.

  • If timestamp is not disabled in the configuration, when viewing live video feed without any recording in progress, the timestamp will be located at the bottom-left corner of the feed. But if you view the feed while a video is recording, the timestamp will be at the bottom-right corner instead. (The recorded video will always have timestamp at the bottom-left corner) This is an odd behavior.

  • SJCAM ZONE identified itself on RTSP as LibVLC/2.2.0-pre1 (LIVE555 Streaming Media v2014.05.27) . Since VideoLAN's LibVLC is licensed under GNU LGPLv2.1+, SJCAM should have included appropriate legal notices and source offer in SJCAM ZONE's About screen. But from what I have observed- I found none.

  • Camera's RTSP server identified itself as LIVE555 Streaming Media v2013.07.03 . Since LIVE555 media server is also licensed under GNU LGPLv2.1+, SJCAM should have included appropriate legal notices/source offer in camera manual and provide re-linkable object files download location (or physical media). But from what I have observed- I found none.

Chapter 6. Recording Videos

Camera's HTTP service (on TCP port 80) is also used for video recording commands. In order to record a video, camera must be in either video recording mode or timelapse video recording mode. (The camera will be in video recording mode by default; but if you previously changed to photo shooting or timelapse photo shooting mode, you must change it back first).

Important notes:

  • In timelapse video recording mode, the camera will always record video in 1920x1080 resolution with 30 FPS playback frame rate, no matter which video recording resolution/frame rate mode you set from camera's Setup screen or WiFi access. See notes in “Setting Video Recording Resolution” section for caveats related to this problem.

Extra trivia on video recording:

  • Timelapse video recording will not record audio, and resulting video file will not have any audio track.

Starting Video Recording

In video or timelapse video recording mode, to start video recording, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2001&par=1

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2001</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following video recording start command status values:

Table 6.1. List of video recording start command status values

Command status value Command status meaning
0 Video recording is now started, or is already started.
-11 Recording start failed: there's not enough space on MicroSD card to start video recording.
-13 Recording start failed: the camera is not in video recording mode.
-22 Recording start failed: there's no MicroSD card in the camera.

Important notes:

  • Starting video recording or timelapse video recording will restart camera's RTSP service. If you are streaming camera's live video feed, you will need to reconnect.

  • An attempt to start non-timelapse video recording via WiFi access while external HDMI display is enabled, would work only when the configured video recording resolution is not 1920x1080 30 FPS.

    If you attempt to record in 1920x1080 30 FPS while HDMI display is enabled anyway, HTTP and XML response will still be the same and video recording start status message will be emitted, but the recording would not actually start, and datetime display on camera OSD would freeze (and refresh only at the time that camera changes mode). If you attempted to start the recording again, the command would return status -13.

    Moreover, if you tried to change the camera to photo shooting or timelapse photo shooting mode afterward, camera firmware will crash (can only hold down power button to turn off). Changing to timelapse video recording mode is okay, but starting recording would still return status -13. If you try to turn the camera off (either by holding down power button, or via WiFi access), the shutdown chime will not be heard, and camera would crash just before it can completely powered down (screen is off, but yellow and blue light would still be on; hold down power button again to turn it off).

  • Video recording will automatically stop when all space on MicroSD card is used up (and corresponding status message will be emitted).

Stopping Video Recording

In video or timelapse video recording mode, to stop video recording, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2001&par=0

Once the recording is completely stopped, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2001</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following video recording stop command status values:

Table 6.2. List of video recording stop command status values

Command status value Command status meaning
0 Video recording is now stopped, or is already stopped.
-13 The camera is not in video recording mode.
-22 There's no MicroSD card in the camera.

Important notes:

  • Stopping video recording or timelapse video recording will restart camera's RTSP service. If you are streaming camera's live video feed, you will need to reconnect.

Chapter 7. Camera Modes

The camera has four operating mode: video recording mode, timelapse video recording mode, photo shooting mode, and timelapse photo shooting mode. In both video modes, you can't shoot any photo. In both photo modes, you can't record any video. When WiFi access is enabled, the camera will automatically switch to video recording mode (or timelapse video recording mode, if it was enabled in camera's Setup screen). So, in order to shoot some photos, you must switch to photo shooting mode first.

Camera's mode could be set and queried from its HTTP service (on TCP port 80).

Switching Camera Mode

In order to do switch the camera to different mode, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3001&par=MODENUMBER

Substitute MODENUMBER with one of the following camera mode numbers:

Table 7.1. List of camera mode numbers

Camera mode number Camera mode
0 Photo shooting mode
1 Video recording mode
3 Timelapse video recording mode
4 Timelapse photo shooting mode

After switched to the target mode, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3001</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Notes:

  • If you access this URL when the camera is already in the target mode, it will have no effect (except some certain status message being emitted).

  • If there's a video recording, timelapse video recording, or timelapse photo shooting in progress when you're trying to change to different mode, the result varies:

    • If you're recording video or timelapse video and attempt to change to any photo modes, the recording will stop, without video recording stop event status message emitted.

    • If you're shooting timelapse photos and attempt to change to any video modes, as HTTP and XML response is returned, you'll briefly see the changed mode on camera screen. But when timelapse photo timer fires again, camera's firmware will crash; the screen will freeze. entire WiFi access point will stop and all buttons will stop working (including power button). You will have to pull the battery out to turn it off.

    • If you're recording video and attempt to change to timelapse video recording mode, the recording will continue in non-timelapse mode (in spite of icon displayed on camera screen).

    • If you're recording timelapse video and attempt to change to normal video recording mode, the recording will continue in timelapse mode (in spite of icon displayed on camera screen), but video recording time event message will be emitted every second passed in recorded video's duration instead of every second of wall-clock time.

    So, when you're writing application that changes camera mode, as a rule of thumb: avoid changing camera mode while there's video recording or timelapse photo shooting in progress. Instead, warn user first, then stop the recording/shooting before proceeding to change the camera mode.

  • In all cases, HTTP and XML response will be the same.

  • If you are going to change camera setting item that is not settable in the previous camera mode, you would need wait a short time (around half of second) after mode change response before trying to change the setting; or else the camera would ignore your new setting.

Checking Camera Mode

To check for current mode the camera is operating in, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3016

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3016</Cmd>
<Status>MODENUMBER</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). and MODENUMBER part will be one of these camera mode numbers:

Table 7.2. List of returned camera mode numbers

Camera mode number Camera mode
0 Photo shooting mode
1 Video recording mode
3 Timelapse video recording mode
4 Timelapse photo shooting mode

Chapter 8. Shooting Photos

Camera's HTTP service (on TCP port 80) is also used for photo shooting commands. In order to view the viewfinder or shoot a photo, camera must be in photo shooting mode first. (Read “Switching Camera Mode” section to see how. Also, please note that when WiFi access is enabled, the camera will be in video recording mode by default) In case of timelapse photo shooting, the camera would have to be in timelapse photo shooting mode instead.

Previewing Before Shooting

Camera's HTTP service on TCP port 8192 is used for streaming previews (viewfinder view) before shooting photo. This service is available only when the camera is in photo shooting or timelapse photo shooting mode.

To display preview, open your web browser to the following URL:

http://192.168.1.254:8192/

The camera will return HTTP 200 response with MIME multipart content[6] using a nonstandard multipart/x-mixed-replace content type. Each part in the response will use image/jpeg content type and appropriate content length, with JPEG content that is a single frame view of the viewfinder. Resolution of each preview frame depends on current photo shooting resolution setting:

  • If the configured photo shooting resolution has 4:3 aspect ratio, each preview frame will have 640x480 resolution.

  • If the configured photo shooting resolution has 16:9 aspect ratio, each preview frame will have 640x360 resolution.

The multipart stream will continue endlessly; subsequent part will quickly replace the image of earlier part, resulting in a view that is not very different from video (though less smooth). And note that you wouldn't see any timestamp at bottom-right corner of the preview no matter you enable it or not; but if enabled, it will show on the result photo.

If a photo is shot while you are streaming preview, you will see that the preview would stop moving for few seconds while the shot is being captured and saved, before it continues to move again. Note that what you see during preview freezes is, unfortunately, not necessarily what you get in your result photo; the actual shot takes place a bit (~0.7 sec) after the preview starts freezing.

Only single connection to this service is allowed at a time; it you opened the URL from other browser window, it will stuck waiting for camera's response until you pressed browser's stop button on the first one. If any of connected devices switched the camera to video recording mode or timelapse video recording mode, this HTTP preview streaming service will be terminated; and you will see the preview stop moving. However, switching between photo shooting and timelapse photo shooting mode (or set the same mode again while already in that mode), will not cause the service to terminate.

Shooting a Photo

In photo shooting mode, to shoot a photo, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=1001

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1001</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following photo shoot command status values:

Table 8.1. List of photo shooting command status values

Command status value Command status meaning
0 A photo is shot and saved.
-13 Shooting failed: the camera is not in photo shooting mode.
-22 Shooting failed: there's no MicroSD card in the camera.

Important notes:

  • If storage space left on MicroSD card is not enough for saving photo, the camera will not will not give HTTP response and will no longer respond to any commands. You would need to manually turn off WiFi access and turn it back on again if you wish to send more commands. See “Remaining Photos Status” section for how to check number of remaining photos the camera can take before the storage is full.

Starting Timelapse Photo Shoot

In timelapse photo shooting mode, to start timelapse photo shooting, open your web browser to the following URL (same URL as normal photo shooting):

http://192.168.1.254/?custom=1&cmd=1001

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1001</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following photo shoot command status values:

Table 8.2. List of timelapse photo shooting start command status values

Command status value Command status meaning
0 Timelapse photo shooting is started.
-13 Shooting start failed: the camera is not in timelapse photo shooting mode.
-22 Shooting start failed: there's no MicroSD card in the camera.

If the camera returned STATUS value 0 , the first shot will be taken immediately. The HTTP and XML response is returned without waiting for first photo to be ready first.

Stopping Timelapse Photo Shoot

In timelapse photo shooting mode, to stop timelapse photo shooting, open your web browser to the following URL (same URL as normal photo shooting and timelapse photo shooting start):

http://192.168.1.254/?custom=1&cmd=1001

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1001</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following photo shoot command status values:

Table 8.3. List of timelapse photo shooting stop command status values

Command status value Command status meaning
0 Timelapse photo shooting is stopped.
-13 The camera is not in timelapse photo shooting mode.
-22 There's no MicroSD card in the camera.

The HTTP and XML response is returned without waiting for last photo shot to be saved first (if it was already in process of shooting when the command is sent); it will be eventually saved when it's done.

As this command is identical to the one used for starting timelapse photo shooting, issuing the command while there's no timelapse photo shooting in progress will start timelapse photo shooting.



[6] See RFC 2046 for details on structure of multipart MIME message: https://tools.ietf.org/html/rfc2046#section-5.1

Chapter 9. Accessing Camera Configuration

Camera settings could be obtained or edited via camera's HTTP service (on TCP port 80). These settings correspond to items in camera's Setup screen. Most of them are stored on camera's nonvolatile memory, and retained when the power is off or battery is removed. Few settings are not stored and only have effect until the power is turned off, then return to their default value on the next power up; these will be noted explicitly.

While camera's behavior on configuration change in the middle of video recording and timelapse photo shooting are documented in each corresponding section, it is still advisable to avoid changing configuration relevant to the running camera operation, e.g. avoid changing video-related configuration while video is recording, and avoid changing photo-related configuration during timelapse photo shooting; to ensure portability on different firmware version in case the documented behavior changed. Notable exceptions are WiFi SSID and WiFi password which cannot be set while WiFi access is off.

To check whether the camera is recording video or shooting timelapse photos, see Chapter 10, Reading Camera Information or Chapter 11, Streaming Camera Status.

Obtaining Camera Settings

Current camera settings could be obtained in bulk by opening your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3014

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>COMMAND_01</Cmd>
<Status>STATUS_01</Status>
<Cmd>COMMAND_02</Cmd>
<Status>STATUS_02</Status>
.
.
.
<Cmd>COMMAND_NN</Cmd>
<Status>STATUS_NN</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character, including the last line.

Each COMMAND_NN is an configuration item number (e.g. 2002), and STATUS_NN is its numeric setting value. Known configuration items and meanings of their setting values are listed below:

Table 9.1. List of returned camera setting items

Item number Item meaning Setting value Setting value meaning
1002 Photo shooting resolution 0 4032x3024 (12 megapixels, 4:3)
1 3648x2736 (10 megapixels, 4:3)
2 3264x2448 (8 megapixels, 4:3)
3 2592x1944 (5 megapixels, 4:3)
4 2048x1536 (3 megapixels, 4:3)
5 1920x1080 (2 megapixels, 16:9)
6 640x480 (VGA, 4:3)
7 1280x960 (1.3 megapixels, 16:9)
1005 (Unknown) 0 (Unknown)
1006 Photo sharpness 0 Strong
1 Normal
2 Smooth
1007 Photo white balance mode 0 Automatic
1 Daylight
2 Cloudy
3 Tungsten
4 Fluorescent
1008 Photo color mode 0 Color
1 Black and white
2 Sepia
1009 Camera's ISO value 0 Automatic
1 100
2 200
3 400
1011 Anti-shaking mode 0 Disabled
1 Enabled
1012 Timelapse photo shooting interval 0 Shoot once every 3 seconds
1 Shoot once every 5 seconds
2 Shoot once every 10 seconds
3 Shoot once every 20 seconds
2002 Video recording resolution 0 1920x1080 at 30 FPS
1 1280x720 at 60 FPS
2 1280x720 at 30 FPS
3 848x480 at 60 FPS
4 640x480 at 60 FPS
2003 Loop recording mode 0 Disabled
1 Enabled, 3 minute per chunk
2 Enabled, 5 minute per chunk
3 Enabled, 10 minute per chunk
2004 Wide dynamic range mode 0 Disabled
1 Enabled
2005 Photo exposure number 0 +2.0
1 +5/3
2 +4/3
3 +1.0
4 +2/3
5 +1/3
6 0.0
7 -1/3
8 -2/3
9 -1.0
10 -4/3
11 -5/3
12 -2.0
2006 Motion-triggered mode 0 Disabled
1 Enabled
2007 Audio recording mode 0 Disabled
1 Enabled
2008 Timestamp overlay mode 0 Disabled
1 Enabled
2010 (Unknown) 3 (Unknown)
2019 Timelapse video capture rate 0 1 second/frame
1 2 second/frame
2 5 second/frame
3 10 second/frame
4 30 second/frame
5 60 second/frame
3003 (Unknown) 0 (Unknown)
3004 (Unknown) 0 (Unknown)
3007 Automatic power off time 0 Do not automatically turn off on inactivity.
1 Turn off after 3-minute inactivity.
2 Turn off after 5-minute inactivity.
3 Turn off after 10-minute inactivity.
3008 Interface language 0 English
1 French
2 Spanish
3 Polish
4 German
5 Italian
6 Simplified Chinese
7 Traditional Chinese
8 Russian
9 Japanese
10 Korean
11 Hebrew
12 Portuguese
3010 (Unknown) 0 (Unknown)
3011 (Unknown) 0 (Unknown)
3025 Power line frequency 0 50 Hz
1 60 Hz
3026 (Unknown) 0 (Unknown)

Setting items returned from the camera seems to be listed by following settings item number order: 2002, 2003, 2004, 1012, 2006, 2007, 2008, 2010, 2019, 1002, 1005, 1006, 1007, 1008, 1009, 2005, 1011, 3025, 3026, 3011, 3010, 3007, 3003, 3004, then 3008. It's best not to dwell on this though.

Despite being listed on the table, following settings are not editable via WiFi access:

  • Photo sharpness
  • Photo color mode
  • Camera ISO value
  • Anti-shaking mode

This is an example settings data when the camera is using all default settings:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2002</Cmd>
<Status>0</Status>
<Cmd>2003</Cmd>
<Status>1</Status>
<Cmd>2004</Cmd>
<Status>0</Status>
<Cmd>1012</Cmd>
<Status>0</Status>
<Cmd>2006</Cmd>
<Status>0</Status>
<Cmd>2007</Cmd>
<Status>1</Status>
<Cmd>2008</Cmd>
<Status>1</Status>
<Cmd>2010</Cmd>
<Status>3</Status>
<Cmd>2019</Cmd>
<Status>0</Status>
<Cmd>1002</Cmd>
<Status>0</Status>
<Cmd>1005</Cmd>
<Status>0</Status>
<Cmd>1006</Cmd>
<Status>1</Status>
<Cmd>1007</Cmd>
<Status>0</Status>
<Cmd>1008</Cmd>
<Status>0</Status>
<Cmd>1009</Cmd>
<Status>0</Status>
<Cmd>2005</Cmd>
<Status>6</Status>
<Cmd>1011</Cmd>
<Status>0</Status>
<Cmd>3025</Cmd>
<Status>1</Status>
<Cmd>3026</Cmd>
<Status>0</Status>
<Cmd>3011</Cmd>
<Status>0</Status>
<Cmd>3010</Cmd>
<Status>0</Status>
<Cmd>3007</Cmd>
<Status>0</Status>
<Cmd>3003</Cmd>
<Status>0</Status>
<Cmd>3004</Cmd>
<Status>0</Status>
<Cmd>3008</Cmd>
<Status>0</Status>
</Function>

Setting Video Recording Resolution

To set video recording resolution (and frame rate), open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2002&par=RESOLUTION

Substitute RESOLUTION with one of the resolution settings value:

Table 9.2. List of video recording resolution setting values

Setting value Setting value meaning
0 1920x1080 at 30 FPS
1 1280x720 at 60 FPS
2 1280x720 at 30 FPS
3 848x480 at 60 FPS
4 640x480 at 60 FPS

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2002</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Important notes:

  • For modes denoted with 60 FPS frame rate, they are actually captured at 30 FPS and doubled the frame rate using software.

  • This mode setting is supposed to apply to both video recording and timelapse video recording; but from experiments, it affects only normal video recording. Timelapse video recording seems to be hard-coded at 1920x1080 with 30 FPS playback rate.

    In case the resolution is set to any other value than 1920x1080 30 FPS, timestamp would not overlaid on the timelapse video correctly: timestamp seems to be generated according to the configured resolution, rather than the actual recording resolution. So you would see timestamp text being smaller than usual, and placed at the middle-right rather than bottom-right of the video. It is recommended that you either set the recording resolution to 1920x1080 30 FPS or disable timestamp overlay when you are doing timelapse video recording.

Extra trivia about the RESOLUTION value:

  • If the RESOLUTION number specified is out of a valid range, HTTP and XML response will still be the same, but after the response, weird things would start to happen:

    • If RESOLUTION is -1:

      • Resolution icon on camera's screen will be replaced by an empty battery icon (weird).

      • If you press record button, the video will be recorded in 320x240 resolution at 30 FPS but uses 16:9 aspect ratio; and timestamp overlay in the recorded video will be in alternative square-looking font.

      • Remaining recording time will reflect a remaining recording time in the 320x240 resolution at 30 FPS.

      • If you try to obtain camera settings right now, video recording resolution setting (number 2002) will have a value -1 too.

      • This special resolution does not survive reboot; when the camera is restarted, the resolution will be reset to 1920x1080 at 30 FPS.

    • If RESOLUTION is negative -2, -3 and beyond; or positive 5, 6 and beyond: camera's firmware will crash; camera screen will freeze, entire WiFi access point will stop, and all buttons will stop working except the power button which can still be used for powering off; once the camera is powered on again, video recording resolution will be at the last valid resolution set.

Setting Loop Recording Mode

Loop recording function (dubbed CyclicRecord in camera's Setup screen), when enabled, will make the camera record video in a series of small chunks, allowing the camera to continue recording when the MicroSD card is full, by removing the oldest recording chunk; so you can leave the recording run indefinitely and always have the latest video on hand. This is an essential feature in dashboard camera and CCTV, which you want to leave the camera running continuously, but only interested in the most recent part of video where the incident happened.

To set camera's loop recording mode, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2003&par=LOOPMODE

Substitute LOOPMODE with one of the following loop mode numbers:

Table 9.3. List of loop recording mode numbers

Loop mode number Loop mode number meaning
0 Disable loop recording
1 Enable loop recording, 3 minute per chunk
2 Enable loop recording, 5 minute per chunk
3 Enable loop recording, 10 minute per chunk

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2003</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Notes:

  • If you change this setting while a video recording is in progress, HTTP and XML response will still be the same, but the camera will ignore your new setting (the old setting is retained).

  • Once you successfully set the new loop recording mode (and you're in video recording mode), you'll see that camera's loop recording indicator icon changes immediately to show the new loop recording interval.

Extra trivia on loop recording (when enabled):

  • During video recording, the elapsed time displayed on camera screen will be the time elapsed in current video recording chunk; it will reset to zero when the camera starts recording the new chunk.

  • During video recording, you'll see that recording will not switch to new chunk at the exact time it reached the configured interval, but will delay for few seconds.

Setting Wide Dynamic Range Mode

To disable or enable camera's wide dynamic range capture option, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2004&par=WDRMODE

Substitute WDRMODE with one of the following WDR mode numbers:

Table 9.4. List of wide dynamic range mode numbers

WDR mode number WDR mode number meaning
0 Disable wide dynamic range capture
1 Enable wide dynamic range capture

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2004</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Notes:

  • This setting affects only video recording, not photo shooting.

  • If you change this setting while a video recording is in progress, the camera will ignore your new setting (the old setting is retained).

  • In all cases, HTTP and XML response will be the same.

Setting Motion-Triggered Mode

The camera can be configured to start video recording when it saw a movement. When enabled, the camera will start video recording automatically (with ~1 sec delay) when a large movement is seen, and will keep recording as long as the movement continues. If the movement ceased, camera will keep recording for the next 8 seconds (or around 40 seconds in timelapse video recording mode), then stop if there's no more movement. This feature doesn't work in photo shooting mode, timelapse photo shooting mode, or while WiFi access is enabled.

To enable or disable this motion-triggered mode, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2006&par=MOTIONSENSEMODE

Substitute MOTIONSENSEMODE with one of the following motion trigger mode number:

Table 9.5. List of motion trigger mode numbers

Motion trigger mode number Motion trigger mode
0 Disabled
1 Enabled

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2006</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). In case you enabled it, the setting will take effect as soon as WiFi access is turned off.

Note:

  • SJCAM ZONE does not offer this setting option.

Setting Audio Recording Mode

To disable or enable audio in camera's video recording, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2007&par=AUDIOMODE

Substitute AUDIOMODE with one of the following audio mode numbers:

Table 9.6. List of audio mode numbers

Audio mode number Audio mode number meaning
0 Disable audio
1 Enable audio

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2007</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Notes:

  • Even when the audio recording is disabled, recorded video files will still have an (silent) audio track in them, which consumes space. The exception is timelapse video recording, which is always recorded without audio track.

  • If you change this setting while a video recording is in progress, no matter that it's normal video recording or timelapse video recording, the camera will ignore your new setting (the old setting is retained).

  • In all cases, HTTP and XML response will be the same.

Setting Timestamp Overlay Mode

To disable or enable timestamp (date-time) overlay in video recording and photo shooting, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2008&par=TIMESTAMPMODE

Substitute TIMESTAMPMODE with one of the following timestamp mode numbers:

Table 9.7. List of timestamp mode numbers

Timestamp mode number Timestamp mode number meaning
0 Disable timestamp overlay
1 Enable timestamp overlay

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2008</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Important notes:

  • In video recording mode, this setting would not take effect until camera's RTSP service is restarted (whether it's by video recording start or camera mode switch to non-video mode and back).

  • If you change this setting while a video recording is in progress, HTTP and XML response will still be the same, but the camera will ignore your new setting (the old setting is retained).

Extra trivia on timestamp overlay (when enabled):

  • In recorded videos, timestamp text will be white-colored and located at the bottom-left corner of each video. In photo shots, timestamp text will be red-colored and located at the bottom-right corner of each photo (exception are photos shot while camera's Color setting was Sepia; they would carry white-colored timestamp text instead).

Setting Timelapse Video Capture Rate

Camera's timelapse video capture rate setting could be edited via WiFi access. But unlike the corresponding item in camera's Setup screen, it does not enable or disable timelapse video capture by itself; you would need to use camera mode command to do that first (see “Switching Camera Mode” section).

To change camera's timelapse video capture rate, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2019&par=TIMELAPSEVIDEOERATE

Substitute TIMELAPSEVIDEORATE with one of the following timelapse video capture rate number:

Table 9.8. List of timelapse video capture rate numbers

Capture rate number Capture rate meaning
0 1 second/frame
1 2 second/frame
2 5 second/frame
3 10 second/frame
4 30 second/frame
5 60 second/frame

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2019</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Setting Photo Shooting Resolution

To set photo shooting resolution, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=1002&par=PHOTORES

Substitute PHOTORES with one of the following photo resolution numbers:

Table 9.9. List of photo resolution numbers

Photo resolution number Photo resolution meaning
0 4032x3024 (12 megapixels, 4:3)
1 3648x2736 (10 megapixels, 4:3)
2 3264x2448 (8 megapixels, 4:3)
3 2592x1944 (5 megapixels, 4:3)
4 2048x1536 (3 megapixels, 4:3)
5 1920x1080 (2 megapixels, 16:9)
6 640x480 (VGA, 4:3)
7 1280x960 (1.3 megapixels, 16:9)

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1002</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

If the camera is currently in photo shooting mode, you'll see that resolution display at top-left corner of the screen is immediately updated.

Note:

  • If you changed photo resolution aspect ratio while streaming photo preview, you would see that the new aspect ratio takes affect immediately.

Extra trivia about the PHOTORES number:

  • If you try to set resolution number to 8, the camera will ignore your new setting (the old setting is retained).

  • If you try to set resolution number to other out-of-range values (e.g. 9, or -2), resolution display on camera screen will show value 0, and when you try to shoot a photo or go to camera's Setup > Image Size, camera firmware will crash; screen and buttons freeze, you can only use power button to turn it off. When the camera is turned on again, the resolution will be set to 4032x3024 (12 megapixels, 4:3). If you just turned the camera off (skipped photo shooting or image size setup screen viewing), the setting will just reset to 4032x3024 (12 megapixels, 4:3) too.

Setting White Balance Mode

To set white balance mode for photo shooting, timelapse photo shooting, video recording, and timelapse video recording, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=1007&par=BALANCEMODE

Substitute BALANCEMODE with one of the following white balance mode numbers:

Table 9.10. List of white balance mode numbers

White balance mode number White balance mode meaning
0 Automatic
1 Daylight
2 Cloudy
3 Tungsten
4 Fluorescent

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1007</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Important notes:

  • If you try to set a new white balance mode while the camera is in photo shooting mode or timelapse photo shooting mode, the camera will ignore your new setting (but HTTP and XML response are still the same). This is an odd behavior.

  • If you try to set a new white balance mode while there is a video recording (normal or timelapse) in progress, the camera will ignore your new setting too (and HTTP and XML response are still the same).

Extra trivia on white balance setting:

  • SJCAM ZONE lists this setting in Photo category, but as already described, this setting affect both video and photo.

Setting Exposure Value

To set exposure value for photo shooting, timelapse photo shooting, video recording, and timelapse video recording, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2005&par=EXPOSURENUM

Substitute EXPOSURENUM with one of the following exposure number:

Table 9.11. List of exposure numbers

Exposure number Exposure value
0 +2.0
1 +5/3
2 +4/3
3 +1.0
4 +2/3
5 +1/3
6 0.0
7 -1/3
8 -2/3
9 -1.0
10 -4/3
11 -5/3
12 -2.0

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2005</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Important notes:

  • If you try to set a new exposure value while the camera is in photo shooting mode or timelapse photo shooting mode, the camera will ignore your new setting (but HTTP and XML response is still the same). This is an odd behavior.

  • If you try to set a new exposure value while there is a video recording (normal or timelapse) in progress, the camera will also ignore your new setting (but HTTP and XML response is still the same).

Extra trivia on exposure setting:

  • SJCAM ZONE lists this setting in Photo category, but as already described, this setting affect both video and photo.

Setting Timelapse Photo Shooting Interval

Camera's timelapse photo shooting interval could be set via WiFi access. But unlike the corresponding item in camera's Setup screen, it does not enable or disable timelapse photo shooting by itself; you would need to use camera mode command to do that first (see “Switching Camera Mode” section).

To set shooting interval in timelapse photo shooting mode, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=1012&par=SHOTINTERVAL

Substitute SHOTINTERVAL with one of the following photo shooting interval numbers:

Table 9.12. List of photo shooting interval numbers

Photo shooting interval number Photo shooting interval meaning
0 Shoot once every 3 seconds
1 Shoot once every 5 seconds
2 Shoot once every 10 seconds
3 Shoot once every 20 seconds

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1012</Cmd>
<Status>0</Status>
</Function>

Important notes:

  • You only can set this setting while the camera is in timelapse photo shooting mode. If you try to set it while on other mode, the camera will ignore your new setting; but HTTP and XML response will still be the same.

  • You can change this setting while timelapse photo shooting is in progress; timelapse indicator icon on camera's screen would immediately change, but the newly-set interval time will actually take effect on the next timelapse shooting (not the next shot of current shooting).

  • This setting does not survive reboot (it will reset to Shoot once every 3 seconds when the camera is turned back on). On the other hand, changing camera to other mode like video, timelapse video, or normal photo shooting will not reset it.

Extra trivia on timelapse photo shooting interval:

  • Setting SHOTINTERVAL to a positive value out of valid range, e.g. 4, 5, or 6 while you're on timelapse photo shooting mode will cause camera firmware to crash on the spot (no HTTP response, screen and buttons freeze, you can only use power button to turn it off). When you turn the camera on again, this setting will reset to Shoot once every 3 seconds.

Setting Power Line Frequency

To set power line (light source) frequency information used for reducing flicker in video recording, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3025&par=FREQNUM

Substitute FREQNUM with one of the following power line frequency number:

Table 9.13. List of power line frequency numbers

Power line frequency number Power line frequency
0 50 Hz
1 60 Hz

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3025</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Note:

  • Once the new setting is set, it will be effective after ~1 sec delay even while a video recording is in progress. You can see the difference on camera screen, live video feed, and in the recorded video too.

Setting Automatic Power Off Time

To set camera's automatic power off time, or turn off the camera, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3007&par=PWROFFMODE

Substitute PWROFFMODE with one of the following automatic power off mode numbers:

Table 9.14. List of automatic power off mode numbers

Automatic power off mode number Automatic power off mode meaning
0 Do not automatically turn off on inactivity.
1 Turn off after 3-minute inactivity.
2 Turn off after 5-minute inactivity.
3 Turn off after 10-minute inactivity.
4 Turn off now.

Automatic power off mode number 4 is a special value to signal immediate power off; it is not saved (original setting is retained). Also, if you try to read camera settings (using “Obtaining Camera Settings” section) shortly after the power off command was issued, you will get the original setting value.

Once the command is acknowledged, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3007</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). If automatic power off mode number specified as 4: after responding, the camera will turn off (and bring WiFi access point down with it).

Note that leaving WiFi access enabled with at least one device associated to the access point does count as activity, even the device does issue any data or streaming request to the camera. (Leaving WiFi access enabled without association does not count though)

Setting WiFi SSID

To set camera's WiFi access point SSID, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3003&str=WIFISSID

Substitute WIFISSID with the desired WiFi SSID name, which can be 1 to 27 characters long. Allowed characters are alphanumeric (A-Z, a-z, 0-9).

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3003</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Important notes:

  • This setting is write-only. SJCAM ZONE cheats by reading the setting from phone's own WiFi configuration, not from the camera; and it will show an incorrect value if any connected device in the same WiFi access session sets a new camera SSID.

  • This setting will take effect the next time WiFi access is enabled; current WiFi access session will continue to use the original SSID.

  • You can actually set SSID with non-alphanumeric or even non-English characters via percent encoding (provided that you encode them properly using UTF-8, and UTF-8-encoded length must not exceed 27), but it is not reliable; your mileage may varies. In any case, HTTP and XML response will be the same.

Extra trivia about WiFi SSID setting:

  • If you try to set SSID longer than 27 characters (but not longer than 71 characters), HTTP and XML response will still be the same, but when you turn off WiFi access and turn it on again, camera firmware will crash (screen and buttons freeze, you can only use power button to turn it off); and when the camera is turned on again, it will retain the old SSID setting. But if you just powered if off immediately after setting it (skipped re-enabling WiFi access), the new setting will also be saved, and camera firmware will crash every time you enable WiFi access. The persistent crash can be fixed by going to camera's Setup > WIFI SSID and set a new (shorter) SSID before starting WiFi access again.

  • If you try to set SSID longer than 71 characters, camera firmware will crash on the spot (no HTTP response, screen and buttons freeze, you can only use power button to turn it off). When you turn the camera on again, it will retain the old SSID setting.

  • If you try to set SSID to empty value, HTTP and XML response will still be the same, but the camera will retain the old SSID name setting. It's best not to count on this behavior though.

  • If you set a long SSID, camera's WiFi SSID/password display (the one that pops up when WiFi access is enabled) might not show your SSID properly, but the access point will still work.

  • Camera's default WiFi SSID name is SJ4000WIFI followed by 12 digits of some hexadecimal number (in lowercase form).

Setting WiFi Password

To set WPA2-PSK passphrase (password) of camera's WiFi access point, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3004&str=WIFIPASSPHRASE

Substitute WIFIPASSPHRASE with the desired WiFi password.

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3004</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Important notes:

  • This setting is write-only.

  • This setting will take effect the next time WiFi access is enabled; current WiFi access session will continue to use the original password.

  • If you try to set password that is shorter than 8 characters, the camera will ignore this new password (and use the old one instead); but HTTP and XML response will still be the same.

Extra trivia about WiFi password setting:

  • Camera's default WiFi password is 12345678.

Setting Date and Time

Date and time configuration is done using camera's HTTP service (on TCP port 80). SJCAM ZONE application will try to set your camera's date/time at the application start, before you can even select CONNECT YOUR CAMERA; it will set date first, followed by time, using current date/time of your Android device in local time zone.

However, when you write your application, the order between date and time command is irrelevant; you can set only date, only time, or time followed by date just fine. But take care when the time is few seconds before midnight, as camera's clock can cause race condition with your date configuration command and result in wrong date.

Extra trivia about camera's date and time:

  • If camera's battery ran out (or removed), camera's date will reset to 1-Jan-2014, and camera's time will reset to 00:00:00 (midnight).

Setting Date

To set camera's date, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3005&str=YYYY-MM-DD

Substitute YYYY with four-digit CE year (e.g. 2016), MM with two-digit month (e.g. 07 for July), and DD with two-digit date (e.g. 15 for 15th day of the month). From an experiment, specifying date or month in single digit seems to work too (but it's best not to dwell on that).

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3005</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

If you look at camera's screen, you'll see that date display is immediately updated.

If you try to set an invalid date, e.g. using a nonexistent leap day like 2015-02-29, using 32 as date or using 13 as month; the command will be ignored (the camera retains original date). Also, the command does not work properly if you set the year to before 2000. In all cases, HTTP and XML response will still be the same.

Setting Time

To set camera's time, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3006&str=HH:MM:SS

Substitute HH with two-digit hour (using 24-hour clock), MM with two-digit minute, and SS with two-digit second; e.g. 11:07:05 p.m. is written as 23:07:05 .

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3006</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

If you look at camera's screen, you'll see that time display is immediately updated.

If you try to set an invalid time, e.g. using 25 as hour, 99 as minute, -1 as second, or using hello! as the time value; the command will be ignored (the camera retains original time), but HTTP and XML response will still be the same.

Setting Interface Language

To change camera's language setting, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3008&par=LANGUAGENUM

Substitute LANGUAGENUM with one of the following language numbers:

Table 9.15. List of language numbers

Language number Language
0 English
1 French
2 Spanish
3 Polish
4 German
5 Italian
6 Simplified Chinese
7 Traditional Chinese
8 Russian
9 Japanese
10 Korean
11 Hebrew
12 Portuguese

Once the configuration is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3008</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Note:

  • SJCAM ZONE does not offer this setting option.

  • After applied the new setting, you won't notice any immediate change to the camera screen since it is the same in all languages. Only text in Setup screen is changed.

Resetting Camera Configuration

In order to reset all camera settings to their default values, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3011&par=0

Once the configuration reset is done, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3011</Cmd>
<Status>0</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Notes:

  • Like camera's own Setup > Default Setting command, it does not reset date, time, or camera name (License No in Setup screen).

  • Settings changes are immediately effective even it didn't show on camera screen, e.g. OSD's video recording resolution or photo shooting resolution icon might still showing the old one, but if you start video recording or shoot a photo, it will be in the new resolution; and the screen will update after recording/shooting is done or WiFi access is turned off (whichever comes first). Exceptions are WiFi SSID and password, which always take effect on the next WiFi access session.

  • &par=0 part of the URL is not strictly required (though it is best not to dwell on this behavior).

Formatting MicroSD Card

To format the MicroSD card inserted in the camera, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3010&par=1

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3010</Cmd>
<Status>STATUS</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). STATUS part of the response will be one of the following format command status values:

Table 9.16. List of MicroSD format command status values

Command status value Command status meaning
0 The MicroSD card is successfully formatted.
-52 Formatting failed: there's no MicroSD card in the camera.

Notes:

  • After the format is completed, available video recording length or number of remaining photos shown on camera screen might not immediately update. If will eventually refresh to show the correct value after you change camera mode, start video recording, shoot a photo, or turn off WiFi access.

Extra trivia about MicroSD formatting function:

  • The camera will not care how you previously formatted the MicroSD card. It will wipe out card's partition table (including boot records), and create a new MBR partition table, with full-card FAT32 primary partition type 0b (hexadecimal) which starts on beginning of the second 4 MiB block of the card. Reserved sectors and FAT areas are arranged to fill exactly first 4 MiB of the partition, leaving data area starts just after it. FAT OEM ID will be set to SYSTEMID , serial number will be set to 00000001 (hexadecimal), and volume label will be set to VOLUME1.

  • When you try to format the card from SJCAM ZONE, it will always show Success status, no matter that there's a MicroSD card in the camera or not.

Chapter 10. Reading Camera Information

Miscellaneous camera status and software information could also be obtained from camera's HTTP service (on TCP port 80).

Checking Recording and Timelapse Shooting Status

To check whether video recording, timelapse video recording, or timelapse photo shooting is in progress, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=2016

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2016</Cmd>
<Status>0</Status>
<Value>SHOOTINGSTATE</Value>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). SHOOTINGSTATE part in the response will be camera's continuous shooting status, which has following meaning:

Table 10.1. List of camera's continuous shooting status values

Shooting status value Shooting status meaning
0 No video recording or timelapse photo shooting in progress
1 Recording a video or timelapse video
2 Shooting timelapse photos

Note that although SHOOTINGSTATE value 2 means a timelapse photo shooting session is in progress, it does not imply that the camera is shooting one of the photos right now.

Checking Power Status

Camera's power status could be queried from camera's HTTP service (on TCP port 80), by opening your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3019

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3019</Cmd>
<Status>0</Status>
<Value>POWERSTATE</Value>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). POWERSTATE part in the response will be camera's power status value, which has following meaning:

Table 10.2. List of power status values

Power status value Power status meaning
0 Camera is running on battery, 100% charge.
1 Camera is running on battery, 75% charge.
2 Camera is running on battery, 50% charge.
3 Camera is running on battery, 25% charge.
4 Camera is running on battery, 0% charge.
5 Camera is running with external power.

Notes:

  • If the camera returned power status value 4, this means it is in the process of powering down (splash screen already appeared; few seconds before completely powered off).

  • If external power is plugged-in, returned power status value will be 5 regardless of current battery charge level.

Obtaining Firmware Information

Camera's firmware information could be obtained by opening your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3012

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3012</Cmd>
<Status>0</Status>
<String>VERSION</String>
</Function>

VERSION part will show your camera's firmware version, which is the same as one shown in camera's Setup > Version screen. (For my camera, VERSION is returned as G20140116V01) Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

Listing Supported Commands

To list all command numbers that the camera recognizes, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3002

The camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1001</Cmd>
<Cmd>1003</Cmd>
<Cmd>2016</Cmd>
<Cmd>2009</Cmd>
<Cmd>2001</Cmd>
<Cmd>2002</Cmd>
<Cmd>2003</Cmd>
<Cmd>2004</Cmd>
<Cmd>1012</Cmd>
<Cmd>2006</Cmd>
<Cmd>2007</Cmd>
<Cmd>2008</Cmd>
<Cmd>2010</Cmd>
<Cmd>2019</Cmd>
<Cmd>1002</Cmd>
<Cmd>1005</Cmd>
<Cmd>1006</Cmd>
<Cmd>1007</Cmd>
<Cmd>1008</Cmd>
<Cmd>1009</Cmd>
<Cmd>2005</Cmd>
<Cmd>1011</Cmd>
<Cmd>3025</Cmd>
<Cmd>3026</Cmd>
<Cmd>3011</Cmd>
<Cmd>3010</Cmd>
<Cmd>3007</Cmd>
<Cmd>3003</Cmd>
<Cmd>3004</Cmd>
<Cmd>3008</Cmd>
<Cmd>3012</Cmd>
<Cmd>2013</Cmd>
<Cmd>2014</Cmd>
<Cmd>2015</Cmd>
<Cmd>3001</Cmd>
<Cmd>3002</Cmd>
<Cmd>3005</Cmd>
<Cmd>3006</Cmd>
<Cmd>3013</Cmd>
<Cmd>3014</Cmd>
<Cmd>3015</Cmd>
<Cmd>3016</Cmd>
<Cmd>8001</Cmd>
<Cmd>8002</Cmd>
<Cmd>3017</Cmd>
<Cmd>3018</Cmd>
<Cmd>3019</Cmd>
<Cmd>3021</Cmd>
<Cmd>3022</Cmd>
<Cmd>3024</Cmd>
<Cmd>3028</Cmd>
<Cmd>3029</Cmd>
<Cmd>3030</Cmd>
<Cmd>4001</Cmd>
<Cmd>4002</Cmd>
<Cmd>4003</Cmd>
<Cmd>4004</Cmd>
<Cmd>3027</Cmd>
<Cmd>3023</Cmd>
</Function>

Each line is terminated by a single LF (ASCII 10) character, including the last line. See “Camera Commands Index” section for description of each command number returned from the camera. Commands that are not listed in the index are not found to be used by SJCAM ZONE, so their functions are unclear.

Note:

  • This command is not used by SJCAM ZONE (it was found as a result of trial and error).

Chapter 11. Streaming Camera Status

Apart from settings and status queries explained in previous chapters, the camera also provides a special channel where status changes could be continuously streamed instead of being periodically polled. This channel is provided by a network service located on TCP port 3333, which in this guide, I will refer to it as SJ4000WIFI Status Service. Some status information like elapsed video recording time and remaining photos count are exclusive to this channel.

The service provide these information:

  • Notification when each video recording is started or stopped.
  • Notification when timelapse photo shooting is started or stopped.
  • Time elapsed during video recording.
  • Number of remaining pictures that could be shot.
  • Notification when the MicroSD card became full while recording video or shooting photo.
  • Notification when the battery is running out.
  • Notification when the WiFi access is going down.

To listen to status stream, simply connect to 192.168.1.254 on TCP port 3333 using any raw TCP communication program like Netcat, Ncat, Socat, PuTTY, or even Telnet. This service is simplex, only the camera sends data to connected clients, the camera doesn't read any data sent from any clients.

Each status item will come in a single TCP packet, with content that looks like regular XML file, each line terminated with a single LF (ASCII 10) character except the last line of each message (which is not terminated). If you're writing application that parse this message stream, I would recommend that you use the end of root XML tag as a message delimiter, rather than the end of read block boundary; as when there are two or more messages coming at the same time, your OS or middleware library might combine them into a single data block before it reach your application.

General Camera Event Status

This status message is emitted to indicate general camera events like video recording or timelapse photo shooting start/stop, WiFi access shutdown, or battery level warning. The message has following format:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3020</Cmd>
<Status>EVENTNUM</Status>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). EVENTNUM part of the message will be one the camera event numbers:

Table 11.1. List of camera event numbers

Camera event number Camera event meaning
-11 Storage space on MicroSD card ran out while saving photo.
-10 Battery is going to run out.
-7 Storage space on MicroSD card ran out while recording video.
1 Timelapse video recording is just started.
2 Timelapse video recording is just stopped.
3 WiFi access is about to go down.
8 Normal video recording is just started.
9 Normal video recording is just stopped.
10 Timelapse photo shooting is just started.
11 Timelapse photo shooting is just stopped.

This status message will appear:

  • 1 time immediately after video recording (normal or timelapse) is started; just before elapsed video recording time status message.

  • 1 time immediately after video recording (normal or timelapse) is stopped; after last elapsed video recording time status message.

  • 1 time immediately after timelapse photo shooting timer is started; just a blink before the camera returns HTTP response for photo shooting command. This event does not imply that the first photo shot is finished and saved.

  • 1 time immediately after timelapse photo shooting timer is stopped; just a blink before the camera returns HTTP response for photo shooting command. This event does not imply that the last photo shot is finished and saved.

  • 8 times in succession before the battery ran out, with ~0.5 sec between each one; last one will emitted a blink before the WiFi access down message.

  • 1 time when the camera attempted to write to a full MicroSD card while recording video or timelapse video. If this happened at the start of video recording, it will be emitted after 0 sec elapsed recording time message. Also, video recording stop event status message will not be emitted in this case despite the fact that video recording is stopped.

  • 1 time when the camera attempted to write to a full MicroSD card while saving photo shot in normal photo shooting mode. When this message is emitted, the camera would stop responding to any further commands (it will hang/not responding to the HTTP request with command URI, but file access requests are still served normally). Disabling and re-enabling WiFi access would put it back in order.

  • 1 time when the camera attempted to write to a full MicroSD card while saving timelapse photo shot. When this happens, the camera would stop responding to any further commands like the similar situation in normal photo shooting. But in this case, the camera would also show a Card Full message in the middle of screen, and you cannot use Up button to turn off WiFi access anymore; you can only hold down power button to turn it off.

  • 1 time immediately when the WiFi access is going down. (No matter that it is caused by user manually turning off WiFi access by pressing Up button; or camera begins a process of powering down: user holding down power button, unplugging USB cable, removing MicroSD card, battery running out, or connected device issuing power down command via WiFi access)

Elapsed Video Recording Time Status

This status message is emitted to provide duration information about current video recording in progress; it is emitted only while the camera is recording video (both normal and timelapse video). The message has following format:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>2020</Cmd>
<Status>ELAPSEDTIME</Status>
</Function>

ELAPSEDTIME part of the message will be the number of seconds recorded on current video recording in progress; this time would be ahead of one shown on top-left corner of camera screen about 1 second. Note that this is not the amount of wall-clock time elapsed during recording, which differ greatly when recording video in timelapse mode. Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

This status message will appear:

  • 1 time immediately after video recording is started (but after the corresponding camera event status message), which shows 0 second elapsed.

  • Once every 1 sec while the recording is in progress. If you are recording timelapse video, it will report a lot of duplicate time values, as the amount of time recorded in the video changes slowly compared to wall-clock time.

Note:

  • If loop recording is enabled, the elapsed time emitted in this message will be the time elapsed in current video recording chunk; it will reset to zero when the camera starts recording the new chunk.

Remaining Photos Status

This status message is emitted at the beginning of photo shooting mode (both normal and timelapse) and after each photo is shot, to show how much space on MicroSD card is left for photo shooting. This status message has following format:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>1013</Cmd>
<Status>PHOTOCOUNT</Status>
</Function>

PHOTOCOUNT part of the message will be the number of photos that still could be taken (in current configured resolution) before the MicroSD card is full; the same number as shown on bottom-left corner of camera screen (but without leading zeros). Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated).

This status message will appear:

  • 4 times in succession just after you switched the camera to photo shooting or timelapse photo shooting mode, with ~1 sec delay at the beginning, and ~1 sec delay between each one. Attempting to change camera to photo shooting or timelapse photo shooting mode while already in that mode also cause this set of message to be emitted. If no MicroSD card is inserted, the reported number will be 0; so as one displayed on the camera screen.

  • 1 time immediately after a photo is shot and saved in both photo shooting and timelapse photo shooting mode. In photo shooting mode, it is emitted at the same moment that camera returns HTTP response for photo shooting command. If no MicroSD card is inserted, no message will be emitted after a failed photo shooting attempt.

Important notes:

  • When the camera returned PHOTOCOUNT value 1, it is likely not enough space left on MicroSD card to store the last photo. It is advisable to avoid shooting photo in this situation as the camera has a glitch which stops all camera command processing if there is not enough storage space to store the photo after it has been shot.

Appendix A. Camera Command Format

This appendix is a summary of camera command characteristics, which you probably already observed when you read main chapters of the guide. Camera receives control commands via its HTTP service (on TCP port 80). There are three kinds of command: commands with no parameter, commands with a numeric parameter, and commands with a string parameter.

To issue a command, open your web browser to one of the following URLs (depending on the command type):

  • Command with no parameter:

    http://192.168.1.254/?custom=1&cmd=COMMAND
  • Command with numeric parameter:

    http://192.168.1.254/?custom=1&cmd=COMMAND&par=ARGNUMBER
  • Command with string parameter:

    http://192.168.1.254/?custom=1&cmd=COMMAND&str=ARGSTRING

Substitute COMMAND with the camera command number you wish to issue (see “Camera Commands Index” section for a list of available commands) and, when applicable, substitute ARGNUMBER with a numeric integer parameter to the command, or ARGSTRING with a percent-encoded string parameter to the command. How exactly a command uses the supplied parameter varies, depending on the command number; which are already documented in main chapters of the guide.

Extra trivia about ARGNUMBER integer:

  • It can be positive integer, zero, or negative integer. But it is always in base 10.

  • If you omitted &par=ARGNUMBER part from the URL of a command that expects it, the result would be the same as specifying ARGNUMBER as 0.

  • The camera seems to parse ARGNUMBER in a manner similar to standard C library function atoi().

    • The camera will stop parsing ARGNUMBER at the first character that is not parsable. So 3A will be parsed as 3, 2.6 will be parsed as 2, -1.2B will be parsed as -1; and things like Hello, ABC123, NaN, -Inf, Infinite are not parsable.

    • If ARGNUMBER is not parsable, camera will act as if you gave 0 as ARGNUMBER.

Once the camera finished applying your command, it would return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>COMMAND_01</Cmd>
<Status>STATUS_01</Status>
<Value>VALUE_01</Value>
<String>STRING_01</String>
<Cmd>COMMAND_02</Cmd>
<Status>STATUS_02</Status>
<Value>VALUE_02</Value>
<String>STRING_02</String>
.
.
.
<Cmd>COMMAND_NN</Cmd>
<Status>STATUS_NN</Status>
<Value>VALUE_NN</Value>
<String>STRING_NN</String>
</Function>

Each line is terminated by a single LF (ASCII 10) character. Whether the last line is terminated or not, depends on the command: commands that return multiple <Cmd>COMMAND_NN</Cmd> line would terminate the last line, other commands won't terminate it.

Body part of XML response inside the <Function> tag will be one or more groups of lines described below. Lines in each group will also be returned in this order:

  • <Cmd>COMMAND_NN</Cmd>

    This line is always present, and is the first line in each group. COMMAND_NN integer will be the command number you just issued, a command number in the list, or the number of the configuration item you requested.

  • <Status>STATUS_NN</Status>

    This line is present in most cases. STATUS_NN integer will be an operation status returned from the command you just issued, or a value of the configuration item/status you requested. (The exception is where VALUE_NN is also returned: the requested status value will be represented there instead, and this line will represent an operation status of the request command itself)

  • <Value>VALUE_NN</Value>

    This line seems to be present only in a result of status query command. VALUE_NN integer will be the value of status item you requested. This line will not be be returned together with the line containing STRING_NN.

  • <String>STRING_NN</String>

    This line seems to be present only in a result of software information query command. STRING_NN will be the string value of information item you requested. This line will not be returned together with the line containing VALUE_NN.

Note that response structure of each command will be constant; giving it different parameters or issuing it in different situation will not change structure, number of groups, or whether each line would appear in each group of the response.

Examples of command response could be found throughout the main chapters. Also, you may notice that streamed status messages are also using the same data format as commands' response; though the line containing COMMAND_NN will represent an event identifier instead of command number.

Appendix B. Camera Commands Listing

Mysterious Command 3027

This command is not documented in the main chapters of this guide as it is not used for controlling the camera. It receives no parameter, and generates cryptic number. This command is used by SJCAM ZONE for an unclear reason.

To issue this command, open your web browser to the following URL:

http://192.168.1.254/?custom=1&cmd=3027

Once the command is acknowledged, camera will return HTTP 200 response, using text/xml content type with appropriate content length, and following XML content:

<?xml version="1.0" encoding="UTF-8" ?>
<Function>
<Cmd>3027</Cmd>
<Status>0</Status>
<Value>CHALLENGE</Value>
</Function>

Each line is terminated by a single LF (ASCII 10) character except the last line (which is not terminated). CHALLENGE part of the response will be a seemingly-random positive integer with large value (8-digits or so). This integer value seems to be dependent on camera's date/time, changing every 1 sec.

Due to the fact that SJCAM ZONE tries to synchronize camera's clock on its startup (as described in “Setting Date and Time” section), this value might be used as some sort of time-based challenge; possibly for checking authenticity of the camera.

Appendix C. Camera Setup Screen

This appendix lists all available items in camera's Setup screen and choices available in each item; quoted verbatim, listed in original order. Choices marked with bold text are default values. This information is also available (though in less complete form) from camera manual.

Note that Default Setting command does not reset camera's date, time, and License No (camera name) setting. And yes, Hebrew language choice in camera's Language option is really written backward; took me a while to figure this out.

  • Resolution

    • 1080FHD 1920x1080
    • 720P 1280x720 60 FPS
    • 720P 1280x720 30 FPS
    • WVGA 848x480
    • VGA 640x480
  • TV out

    • Off
    • On
  • OSD mode

    • Off
    • On
  • video lapse

    • Off
    • 1 Seconds
    • 2 Seconds
    • 5 Seconds
    • 10 Seconds
    • 30 Seconds
    • 1 Minute
  • Capture Mode

    • Single
    • 3S Timer
    • 5S Timer
    • 10S Timer
    • 20S Timer
  • Cyclic Record

    • Off
    • 3 Minutes
    • 5 Minutes
    • 10 Minutes
  • HDR

    • Off
    • On
  • Motion Detection

    • Off
    • On
  • Audio

    • Off
    • On
  • Date Stamping

    • Off
    • On
  • Image Size

    • 12M 4032x3024
    • 10M 3648x2736
    • 8M 3264x2448
    • 5M 2592x1944
    • 3M 2048x1536
    • 2MHD 1920x1080
    • VGA 640x480
    • 1.3M 1280x960
  • Quality

    • Fine
    • Normal
    • Economy
  • Sharpness

    • Strong
    • Normal
    • Soft
  • White Balance

    • Auto
    • Daylight
    • Cloudy
    • Tungsten
    • Fluorescent
  • Color

    • Color
    • B&W
    • Sepia
  • ISO

    • Auto
    • 100
    • 200
    • 400
  • Exposure

    • +2.0
    • +5/3
    • +4/3
    • +1.0
    • +2/3
    • +1/3
    • +0.0
    • -1/3
    • -2/3
    • -1.0
    • -4/3
    • -5/3
    • -2.0
  • Anti-Shaking

    • Off
    • On
  • Language

    • English
    • Français
    • Español
    • Polski
    • Deutsch
    • Italiano
    • 简体中文
    • 繁體中文
    • Русский
    • 日本語
    • 한국어
    • תירבעתפש
    • Portugês
  • Date/Time

    Year: 2012 ... 2050
    Month: 01 ... 12
    Date: 01 ... 31
    Hour: 00 ... 23
    Minute: 00 ... 59
    Second: 00 ... 59
    Display order: YY/MM/DD, MM/DD/YY, DD/MM/YY
  • Auto Power Off

    • Off
    • 3 Minutes
    • 5 Minutes
    • 10 Minutes
  • Beep Sound

    • Off
    • On
  • TV Mode

    • NTSC
    • PAL
  • screensavers

    • 30 Seconds
    • 1 Minute
    • 3 Minutes
    • 5 Minutes
    • Off
  • Frequency

    • 50 Hz
    • 60 Hz
  • Rotate

    • Off
    • On
  • Car Mode

    • Off
    • On
  • WIFI SSID

  • WIFI Password

  • License No set

  • Delete

    • Delete Current?
    • Delete all?
  • Format

  • Default Setting

  • Version

    Model: SJ4000WIFI
    Version: G20140116V01
    Date: Jan 16 2015
    Firm: SJCAM

Appendix D. Connecting Camera to Existing Network

Warning

Since camera's network access is protected solely by WiFi's WPA2-PSK passphrase, connecting the camera to other network will allow any machine on that network to access the camera without any authentication. Make sure you know who/what can access the network before connecting the camera to it.

If you need to connect the camera from a desktop or laptop, the simplest way (and intended way) is using wireless LAN card to connect directly to camera's WiFi access point. But this is not always possible, for example, when the machine you're trying to use the camera has only wired LAN connection.

IEEE 802.11 (wireless LAN) standards require that access point, when receiving wireless frames, respond to only to frames addressed from machines directly associated with it. So in general, you cannot bridge wired LAN network to wireless LAN if you are not the access point yourself; the access point will just discard all frames sent through the bridge. And that is exactly the problem, since the camera cannot act as anything but an access point.

So, in order to connect the camera to existing network, some special configuration is needed. There are several ways to make them work, and each of them has different advantages and limitations:

  • Using ARP proxy

  • Using NAT

  • Using 1:1 NAT with ARP proxy

All examples assume we want to use the camera from desktop PC, and use laptop for wirelessly connecting to the camera; desktop PC has only wired LAN interface, laptop has both wired and wireless LAN interface. If you use a different mix of devices, substitute them accordingly. Android mobile device can also be used as a substitution for laptop, but its handling will be slightly different; which will be discussed later on.

Using ARP Proxy

In this approach, we leave the camera in its own Ethernet network, separated from the main network. Then, configure a fake network bridge from IP level (rather than Ethernet level) by using static route and ARP proxy replies.

Notes:

  • Normal routing (which completely separate main network and camera network) won't work since we cannot set static route or default gateway on the camera; camera won't know how to send packets to the external network.

  • If we didn't enable ARP proxy, packets from camera won't reach the PC, even packets from PC did reach the camera first; this is because the camera didn't learn MAC address from incoming packets, thus limited to ARP for locating MAC address to send the reply frame, which won't work without ARP proxy in this configuration.

Advantages:

  • All camera's functionalities are usable.

  • No configuration needed from PC side.

Limitations:

  • Your network's address range must cover 192.168.1.0/24 .

  • PC must be in address range 192.168.1.0/24 .

  • Your network must not have any machine occupying address 192.168.1.254 .

  • Laptop's operating system must support ARP proxy.

Figure D.1. Example network configuration using static route and ARP proxy

Example network configuration using static route and ARP proxy

Steps to configure the laptop (other than configuring its IP address):

  • Set laptop's wired and wireless interface to use the same IP address and subnet mask.

  • Enable IP routing on laptop.

  • Make sure that there's no route to 192.168.1.0/24 through wireless interface on laptop.

  • Add static route to 192.168.1.254 via wireless interface on laptop.

  • Enable ARP proxy on both wired and wireless interface of laptop.

Example command line (run as root) to configure the GNU/Linux-based laptop, assuming laptop's wired LAN card is eth0 with IP address 192.168.1.12, and wireless LAN card is wlan0, and both interfaces are connected:

ifconfig wlan0 192.168.1.12 netmask 255.255.255.0
sysctl -w net.ipv4.ip_forward=1
route del -net 192.168.1.0 netmask 255.255.255.0 dev wlan0
route add 192.168.1.254 dev wlan0
sysctl -w net.ipv4.conf.eth0.proxy_arp=1
sysctl -w net.ipv4.conf.wlan0.proxy_arp=1

Please note that it is not recommended to enable DHCP on laptop's wireless LAN interface; even it would generally work if the IP address assigned by camera's DHCP server does not clash with other existing host on wired network. But when it does clash, effect is the same as setting up your machine's IP address to the one that other machine is already using; disrupting clashing machine's network communication.

However, if you know what you are doing (e.g. all machines in your wired network use static IP address out of camera's DHCP range), you could enable it; and omit ifconfig line in the configuration commands.

If your laptop is running Microsoft Windows, there is no built-in way to enable ARP proxy; so you would need to use third-party ARP proxying tool for this step instead. (These third-party tools are rather called ARP Spoofing or ARP Poisoning tools as they are originally used for hijacking network traffic from remote machine) Instruction for setting up these tools are not covered in this guide.

Using NAT

This approach configures the laptop as if it was sharing WiFi internet connection through wired LAN (a.k.a. tethering), with NAT. This method of NAT is more precisely called Port Address Translation (PAT) or NAT overloading, which masquerades PC's IP address as laptop's one- inside the camera network. Only configuration needed from the PC side is adding static route to 192.168.1.254 via the laptop.

Advantages:

  • Simple configuration.

Limitations:

  • Your network's address range must not overlap with 192.168.1.0/24 range.

  • Camera's live video feed is not likely to work unless your NAT implementation is aware of RTSP; or you can instruct your media player to use TCP for video transport:

    • In MPlayer, use -rtsp-stream-over-tcp command line option.

    • In VLC Media Player, select RTP over RTSP (TCP) as Live555 stream transport in Input & Codecs Settings preference.

    If you used TCP transport for live video feed, beware that the camera is not very robust in handling RTSP/RTP interleaved connection; problems in media player may cause the camera firmware to crash.

Figure D.2. Example network configuration using NAT

Example network configuration using NAT

If your laptop is using GNU/Linux, NAT could be configured by using following commands (run as root), assuming laptop's wired LAN card is using network address 10.0.0.0/8 (10.x.x.x), wireless LAN card is wlan0 using either static or DHCP IP address, and both interfaces are connected:

sysctl -w net.ipv4.ip_forward=1
iptables -t nat -I POSTROUTING -s 10.0.0.0/8 -j MASQUERADE -o wlan0

Please note that above configuration command alone is not RTSP-aware (hence needs workaround from media player side). If you would like to add RTSP support in NAT, you could install RTSP connection tracking module for Linux Netfilter.[7]

If your laptop is using Microsoft Windows, just configure Internet Connection Sharing using wireless LAN as internet, and wired LAN as local network.

From above configuration, you can configure a static route on the GNU/Linux-based PC side by running following command as root (assuming laptop's wired LAN IP address is 10.0.0.11):

route add 192.168.1.254 gw 10.0.0.11

If the PC is running Microsoft Windows, use the following command instead:

route add 192.168.1.254 10.0.0.11

In case the PC is connected directly to laptop, or there's no other machine/gateway on the wired network, you can just set PC's default gateway to laptop's IP address without configuring any static route.

Using 1:1 NAT with ARP Proxy

In this approach, we configure the laptop as a middleman to masquerade camera's address as an IP address in the main network, and masquerade PC's address as an IP address in the camera's network.

Advantages:

  • Your network can use any address range, and can be routed through any hop.

  • All camera functionalities are usable.

Limitations:

  • Complicated configuration.

  • Routing must be set up manually, one set for each PC that wishes to use the camera; 253 maximum.

ARP proxy configuration is required as you cannot add static routes on the camera.

Figure D.3. Example network configuration using 1:1 NAT with ARP proxy

Example network configuration using 1:1 NAT with ARP proxy

You might notice that this network diagram is apparently identical to NAT diagram in previous section; the difference is how the PC and camera see each other. Which in this case, both PC and camera are lured into believing that it is talking to a host in same network, even it actually is not.

Figure D.4. Layer-3 view of 1:1 NAT with ARP proxy example (PC perspective)

Layer-3 view of 1:1 NAT with ARP proxy example (PC perspective)

From this layer-3 diagram, you would see that the PC saw the camera as a machine in the same wired network as itself; the camera appears to have IP address belonged to PC's wired LAN.

Figure D.5. Layer-3 view of 1:1 NAT with ARP proxy example (camera perspective)

Layer-3 view of 1:1 NAT with ARP proxy example (camera perspective)

From this layer-3 diagram, you would see that the camera saw the PC as a machine in the same wireless network as itself; the PC appears to have IP address belonged in camera's wireless LAN.

Example command line show below is for configuring GNU/Linux-based laptop (run as root) in this scenario: assuming laptop's wired LAN card is eth0 with IP address 10.0.0.11, wireless LAN card is wlan0 with IP address 192.168.1.12, and both interfaces are connected; then map the camera to 10.0.0.128 in wired network, and map the PC to 192.168.1.128 in wireless network.

sysctl -w net.ipv4.ip_forward=1
route del -net 192.168.1.0 netmask 255.255.255.0 dev wlan0
route add 192.168.1.254 dev wlan0
sysctl -w net.ipv4.conf.eth0.proxy_arp=1
sysctl -w net.ipv4.conf.wlan0.proxy_arp=1

iptables -t nat -A PREROUTING -i wlan0 -d 192.168.1.128 -j DNAT --to-destination 10.0.0.10
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.254 -j SNAT --to-source 10.0.0.128
iptables -A FORWARD -s 192.168.1.254 -d 192.168.1.128 -j ACCEPT
route add 192.168.1.128 gw 127.0.0.1

iptables -t nat -A PREROUTING -i eth0 -d 10.0.0.128 -j DNAT --to-destination 192.168.1.254
iptables -t nat -A POSTROUTING -o wlan0 -s 10.0.0.10 -j SNAT --to-source 192.168.1.128
iptables -A FORWARD -s 10.0.0.10 -d 10.0.0.128 -j ACCEPT
route add 10.0.0.128 gw 127.0.0.1

Notes:

  • These command lines are used for routing connection for one PC. If you wish to use more than one PC, duplicate second and third block of command, but substitute 10.0.0.10 with the new PC's wired LAN IP address and increase 10.0.0.128 address by 1 (when you add the third and the fourth PC, increase it by 2, 3, and so on).

    If you wish to use a different address range in wired LAN, substitute them accordingly.

  • There are two set of iptables rules, as we are faking network address in both direction. (Conventional 1:1 NAT usually fake address in only one direction, allowing one party to see the real address of the other)

  • Lines containing iptables -A FORWARD are not strictly required; you can omit them if your laptop is not using strict default DROP firewall rule.

  • Seemingly-useless routes to 127.0.0.1 are required: they are for supplying eligible addresses for ARP proxy mechanism. (Linux ARP proxy uses a list of eligible address from routing table, not firewall rules where NAT configuration resides)

Connecting Through Android Device

Sometimes, when you didn't have other WiFi-capable device on hand, you can just use the Android device for connecting to the camera, and plug it to the PC via USB cable. Since Android is just another kind of Linux system, this is not an approach different from ones described earlier. It provides two means for the PC to connect:

  • USB Tethering option (if your device provides it): In this mode, your Android device will show itself as an USB Ethernet adapter, which is able to access the camera's WiFi network through NAT. The type of Ethernet adapter that device represents can be either Microsoft RNDIS or USB CDC Ethernet adapter; depending on the model of Android device used.

  • ADB PPP tethering: In this mode, PC will access the camera WiFi network through PPP connection running on Android Debug Bridge. This requires a rooted Android device, and the PC must run GNU/Linux system.

Figure D.6. Example network configuration using Android device's USB Tethering

Example network configuration using Android device's USB Tethering

The USB Tethering, once enabled (by going to Settings > Wireless & Networks > More option > Tethering & portable hotspot on Android device), will instantly operate in NAT way, all network setup and IP address allocation will be taken care of automatically by the Android device; and it provided DHCP server for PC's auto-configuration. Most NAT caveats apply, but it seems that Android's NAT implementation is aware of RTSP stream; live video feed should work. This configuration could be changed further via a use of command line shell if your Android device is rooted.

On the other hand, in ADB PPP approach, once the connection is established, will operate in normal networking; you still need to enable routing, edit network route, and enable ARP proxy from command line shell. But since Android Debug Bridge's PPP support is sparsely documented, and has a horrible error reporting facility (namely, none). Getting it to work and troubleshooting warrant a whole guide on its own; so this method is not recommended and not included in this guide.



[7] See https://github.com/maru-sama/rtsp-linux/ or install nat-rtsp-dkms package in Debian-based GNU/Linux distribution; then build, and install the kernel module.

Appendix E. Miscellaneous Trivia

This appendix documents miscellaneous facts about the camera that are found during my experiments, but are not related to any function accessible from WiFi access or any other topic elaborated elsewhere in the guide. They are not useful for writing control software, but some power users might still want to know about them.

Power On Trivia

  • The camera will always start in video recording mode, no matter which mode user (or connected devices) set it to at the last power off.

Video Recording Trivia

  • Video files recorded by the camera contains following metadata:

    Table E.1. List of metadata found in recorded video files

    Metadata name Metadata value
    Creation time (Date and time when the recording stopped)
    Comment CarDV-TURNKEY

Photo Shooting Trivia

  • Photo shots from the camera are in JPEG/EXIF format using baseline (i.e. non-progressive) DCT encoding with Huffman code compression; containing 3 color channels (RGB) and 8-bit resolution per channel. The encoding is done with YCbCr 4:2:2 (2 1) chroma subsampling, resulting in 16x8 pixel minimum coded unit block. EXIF version used is 2.2.

  • Photo shots from the camera are reported by ExifTool to carry following EXIF metadata:

    Table E.2. List of EXIF metadata found in shot photos

    Metadata name Metadata value
    Image Description CAMERA
    Make MAKER NAME
    Camera Model Name SJ4000WIFI
    Orientation Horizontal (normal)
    X Resolution 72
    Y Resolution 72
    Resolution Unit inches
    Software Verx.xx
    Modify Date (Date and time when the photo is shot)
    Y Cb Cr Positioning Co-sited
    Exposure Time (Varies)
    F Number 1.8
    Exposure Program Program AE
    ISO (Varies)
    Exif Version 0220
    Date/Time Original (The same value as Modify Date)
    Create Date (The same value as Modify Date)
    Components Configuration Y, Cb, Cr, -
    Shutter Speed Value (Varies)
    Aperture Value 1.7
    Brightness Value 1
    Exposure Compensation (Varies)
    Max Aperture Value 1.7
    Metering Mode Average
    Light Source Unknown
    Flash Off, Did not fire
    Focal Length 2.5 mm
    User Comment (None)
    Flashpix Version 0100
    Color Space sRGB
    Exif Image Width (Varies)
    Exif Image Height (Varies)
    Interoperability Index R98 - DCF basic file (sRGB)
    Interoperability Version 0100
    Sensing Method One-chip color area
    File Source Digital Camera
    Scene Type Directly photographed
    Custom Rendered Normal
    Exposure Mode Manual
    White Balance (Varies)
    Digital Zoom Ratio (Varies)
    Scene Capture Type Standard
    Sharpness Normal
    Compression JPEG (old-style)
    Thumbnail Offset (Varies)
    Thumbnail Length (Varies)

    Notes:

    • Digital Zoom Ratio field would be 0 if no digital zoom was used on shooting. Otherwise, the value will reflect the zoom level shown on camera's screen while shooting.

    • Camera's Rotation setting has no effect on EXIF metadata; if you set it to On, the camera will simply rotate the image data 180-degree before saving, and leave Orientation field as Horizontal (normal). Holding camera upside down or 90-degree wouldn't change it either, as the camera doesn't have orientation sensor.

    • The value of ISO field will reflect camera's ISO value chosen at the shooting time. This number varies from shot to shot if camera's ISO setting is set to Auto. However, if the setting is set to some manual value, the ISO field will reflect that value, give or take.

    • Exposure Compensation field will be the same value as camera's Exposure setting at the time of shooting.

    • White Balance field will be Auto if camera's White Balance setting is set to Auto. If this setting is set to any other white balance mode, the White Balance field will be Manual.

    • Camera's Color setting is not reflected in any field.

    • Camera's Sharpness setting is not reflected in any field.

Media Playback Trivia

Playback Interface

  • The camera's media playback interface does not have any file management capability; you cannot delete or rename any video or photo from here.

Playback Controls

When you started playing recorded video in the camera, playback controls might not be obvious; the camera supports playing, pausing, fast-forwarding (4x/8x/16x), and fast-rewinding (4x/8x/16x):

  • To pause the video, press OK button.

  • To resume playing the video at current speed, press OK button again.

  • To increase playing speed (fast-forward), press Down button single or multiple times while the video is playing; speed will shift from 1x to 4x, 8x, 16x (and stop there).

  • To decrease playing speed (fast-rewind), press Up button single or multiple times while the video is playing; speed will shift from 1x to reverse 4x 8x, 16x (and stop there).

  • Like conventional video playing software, there will be no sound while you are fast-forwarding or fast-rewinding.

  • To stop fast-forwarding/fast-rewinding, simply press the opposite speed decrease or speed increase button several times to step the playback speed back to the normal 1x.

  • While the video is playing (either normal speed or fast-forward/fast-rewind) or pausing, power button cannot be used for anything but turning the camera off.

  • To stop the video playback, press Up or Down button while the video is paused. This will stop the playback and switch to other video file; Power button would now be able to be used for mode change once this is done.

Note

While fast-forwarding/fast-rewinding, camera's OSD would say you are at 2x, 4x, or 8x speed; this is inaccurate. You really are playing at 4x, 8x, and 16x speed, accordingly.

Storage Trivia

  • If you inserted or removed MicroSD card while the camera is on, the camera will turn off. (If WiFi access was enabled, the WiFi access down message will appear on camera's status stream too)

  • As you probably noticed from Chapter 4, Accessing Stored Files, the camera stores files in following directories on the MicroSD card:

    • /DCIM/MOVIE for recorded videos.
    • /DCIM/PHOTO for photos shot.

    In case the needed directory is not exist, it will be created individually on first use (together with parent directory, if necessary).

  • The camera uses following filename pattern for storing recorded videos and shot photos:

    YYYY_MMDD_HHmmss_NNN.EEE
    • YYYY will be four-digit CE year (e.g. 2016).
    • MM will be two-digit month number (e.g. 09 for September).
    • DD will be two-digit date (e.g. 20 for 20th day of the month).
    • HH will be two-digit hour number in 24-hour clock (e.g. 17 for 5 p.m.).
    • mm will be two-digit minute number.
    • ss will be two-digit second number.
    • NNN will be three-digit sequence number showing that this video/photo is created as the Nth video/photo since camera's power on (e.g. 005 if the photo is shot as the 5th photo since the camera was turned on). This number will reset when the camera is turned off. Also, videos and photos are counted in separate.
    • EEE will be file extension: MOV if it is a video, or JPG if it is a photo.
    • This datetime is in local timezone.

    For example, a photo named 2016_1219_190832_005.JPG is taken on 19-Dec-2016 at 19:08:32 (07:08:32 p.m.), as the fifth picture since camera's power on.

  • The camera recognizes DOS MBR partition table, and not UEFI GPT partition table.

  • The camera is known to recognize these filesystems:

    • FAT32
    • FAT16
    • FAT12
    • exFAT

    And these filesystems are known not to be recognized:

    • Linux ext2
    • Linux ext3
    • NTFS

    In this guide, the camera is mainly tested with MicroSD card containing FAT32 filesystem. Using MicroSD card with an unrecognized filesystem or partition table would yield the same result as using a card containing no partition.

  • If you inserted MicroSD card with no partition table (zeroed out boot sector) or MBR partition table with no partition; the camera will show Please Insert Card message in video recording mode, and you won't be able to turn on WiFi access in that mode. If you change to photo shooting mode, you will be able to turn on WiFi access, though doing so will crash the camera firmware; screen and buttons will freeze, and you can only use power button to turn it off.

    You can still use Format command in camera's Setup screen to format the card. Once finished, the card will be in a state that is usable to the camera.

  • The camera seems to be allergic to MBR bootloader on the MicroSD card; if the code area of MBR is not zeroed out (e.g. containing bootloader like GRUB, or DOS MBR code), the camera would treat the card as if it does not have any partition table. This is an odd behavior.

Configuration Trivia

  • Once you configured the camera name (License No), you won't be able to reset it to an empty value ever again. If you try to set it to empty value, the camera will use 0 for it instead. As already said, camera's Default Setting menu won't reset this setting.

Appendix F.  GNU General Public License version 3

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. http://fsf.org/

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The GNU General Public License is a free, copyleft license for software and other kinds of works.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program—to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.

To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.

For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software. For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.

Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and modification follow.

TERMS AND CONDITIONS

0. Definitions.

“This License” refers to version 3 of the GNU General Public License.

“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.

“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.

To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.

A “covered work” means either the unmodified Program or a work based on the Program.

To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.

To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.

1. Source Code.

The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.

A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.

The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.

The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.

The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.

The Corresponding Source for a work in source code form is that same work.

2. Basic Permissions.

All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

3. Protecting Users’ Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.

When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work’s users, your or third parties’ legal rights to forbid circumvention of technological measures.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.

5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

  1. The work must carry prominent notices stating that you modified it, and giving a relevant date.

  2. The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.

  3. You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.

  4. If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

  1. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.

  2. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.

  3. Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.

  4. Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.

  5. Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.

A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).

The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.

7. Additional Terms.

“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:

  1. Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or

  2. Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or

  3. Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or

  4. Limiting the use for publicity purposes of names of licensors or authors of the material; or

  5. Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or

  6. Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.

All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

8. Termination.

You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).

However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.

9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.

10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.

An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.

11. Patents.

A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s “contributor version”.

A contributor’s “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.

In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.

If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.

A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.

12. No Surrender of Others’ Freedom.

If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.

13. Use with the GNU Affero General Public License.

Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.

14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.

If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.

Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

17. Interpretation of Sections 15 and 16.

If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

one line to give the program’s name and a brief idea of what it does.
Copyright (C) year name of author

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
  

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

program Copyright (C) year name of author
This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’.
This is free software, and you are welcome to redistribute it
under certain conditions; type ‘show c’ for details.
  

The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.

You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.

Glossary

ARP Proxy

A technique to emulate other machine's presence in local network, so that data sent to it could be picked up by the proxy router and forwarded to the intended machine located on different physical network. Read more at:

https://en.wikipedia.org/wiki/Proxy_ARP

cURL

A command line tool for issuing data request on common application protocols, including HTTP. More commonly used as a software library (libcurl) for handling such protocols inside other applications.

https://curl.haxx.se/

DHCP

Dynamic Host Configuration Protocol, a protocol used for automatically configuring network clients' IP address settings when joining TCP/IP network. Read more at:

https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol

EXIF

Exchangeable Image File Format, a metadata tagging format mostly used in JPEG files to store camera and scanner information. This metadata format can also be used in TIFF file or WAVE file too. Read more at:

https://en.wikipedia.org/wiki/Exif

ExifTool

A command line tool and software library to extract and manipulate metadata in variety of file formats (image, audio, video, document, archive, executable, and log files).

http://owl.phy.queensu.ca/~phil/exiftool/

Free Software

A class of software which user has rights to run, study, modify, and redistribute for any purposes. Read more at:

https://www.gnu.org/philosophy/free-sw.html

GRUB

GNU Grand Unified Bootloader, a bootloader commonly used for starting GNU/Linux operating system, or provide boot menu for multiple operating systems installed on the PC.

https://www.gnu.org/software/grub/

HTTP

Hypertext Transfer Protocol, an internet protocol used for fetching web pages and other resources across the internet and World Wide Web. Read more at:

https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

ICMP Echo

A built-in diagnostic service available on all TCP/IP network host, more commonly known as Ping service. Read more at:

https://en.wikipedia.org/wiki/Ping_(networking_utility)

LIVE555

A set of software tools and libraries for handling RTSP media streaming; including RTSP server daemon (LIVE555 media server) and RTSP client library (LIVE555 streaming media). The latter is also used inside VLC Media Player, and MPlayer.

MPlayer

A command-line based media player and streaming client, available on GNU/Linux, Unix-like systems, Microsoft Windows, Mac OS X, and DOS.

http://mplayerhq.hu/

NAT

Network Address Translation, a family of technique for remapping visible IP address of networked machine by editing IP packets in transit. The most common one is used in residential gateway router, for allowing multiple machines to share a single IP address from the perspective of external network; called Port Address Translation or NAT overloading. Read more at:

https://en.wikipedia.org/wiki/Network_address_translation

Ncat

A re-implementation of Netcat by Nmap project, with IPv6, SSL, and SOCKS proxy support.

https://nmap.org/ncat/

Netcat

A well-known raw TCP (and UDP) communication utility program written by Hobbit; capable of connecting/receiving connection, passing data to/from standard output/input, as well as redirecting communication to local shell or program. Often dubbed as a TCP/IP Swiss Army knife.

http://nc110.sourceforge.net/ (or http://sectools.org/tool/netcat/)

PTP

Picture Transfer Protocol, a communication protocol used for acquiring picture and video files from digital camera over USB. Read more at:

https://en.wikipedia.org/wiki/Picture_Transfer_Protocol

PuTTY

A cross-platform graphical terminal emulator software, emphasizing on supporting network-based remote terminal like Telnet, Rlogin, and SSH; while supporting raw TCP and serial port communication as well.

http://www.chiark.greenend.org.uk/~sgtatham/putty/

RNDIS

Remote Network Driver Interface Specification, a Microsoft proprietary protocol for USB-based network adapter (LAN or Wireless LAN card), available for uses on all version of Microsoft Windows with USB support, and also on GNU/Linux; Mac OS X requires third-party driver. Read more at:

https://en.wikipedia.org/wiki/RNDIS

RTP

Real Time Protocol, a communication protocol used for video, audio, and other real time data streaming over internet; sometimes as a part of RTSP. Read more at:

https://en.wikipedia.org/wiki/Real-time_Transport_Protocol

RTSP

Real Time Streaming Protocol, a communication protocol commonly used for initiating and controlling video streaming over internet. Read more at:

https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol

Socat

A network stream relaying software with functionality of Netcat, but supports passing data from one connection to another connection, and supports non-TCP/IP communication like Unix socket and Unix VTY as well.

http://www.dest-unreach.org/socat/

Telnet

A common TCP-based remote terminal program (and protocol), available on most operating systems. Read more at:

https://en.wikipedia.org/wiki/Telnet

USB CDC Ethernet

A type of USB device which represents an Ethernet-compatible network adapter; typically a LAN card, or Wireless LAN card. This type of network adapter can be used with Microsoft Windows Vista (or later), GNU/Linux, Mac OS X, or other operating systems. It is a part of USB Communication Device class, read more at:

https://en.wikipedia.org/wiki/USB_communications_device_class

USB Mass Storage device

A type of USB device which represents data storage, like hard disk, optical drive, or floppy drive. USB flash drive is the most common device in this category. Read more at:

https://en.wikipedia.org/wiki/USB_mass_storage_device_class

USB Video Class device

A type of USB device which represents live video source, like video camera, webcam, or video capture card. Read more at:

https://en.wikipedia.org/wiki/USB_video_device_class

VLC Media Player

A cross-platform media player and streaming client from VideoLAN project, with trademark orange traffic cone logo; available on GNU/Linux, Android, Microsoft Windows, Mac OS X, and iOS.

It was called VideoLAN Client (VLC) due to its original purpose as video streaming client for their VideoLAN Server software.

https://videolan.org/vlc/

Index