Instructions for installing the cloud client on the IP camera



Fast start

Sample my camera.

My camera config:

Local rtsp access

rtsp://127.0.0.1/mpeg4

and

rtsp://127.0.0.1/mpeg4cif

writable energy safe nand /mnt/nand

  1. Download binray for you platform http://ipeye.ru/firmware/client/ my platform
    http://ipeye.ru/firmware/client/hisilicon/arm-hisiv100-linux-uclibcgnueabi.run
    
  2. Copy arm-hisiv100-linux-uclibcgnueabi.run to firmware any patch.
  3. Update RC add line end file.
    /mnt/files/arm-hisiv100-linux-uclibcgnueabi.run
    -debug=0
    -sleep=5s
    -http_camera_mode=1
    -vendor=ipeye
    -config_dir=/mnt/nand/
    -streams=rtsp://127.0.0.1/mpeg4,rtsp://127.0.0.1/mpeg4cif
    
  4. Make Firmware.
  5. Load to device.
  6. Open web browser http://CAMERA_IP:8282/.



Test run

A test run involves running a cloud client on an IP camera without booting into stored memory, and is typically used to debug the cloud. In the future, the cloud client is placed in the stored memory, and added to the device startup.

  1. Determine the version of your CPU, run the command on the device
    cat /proc/cpuinfo
    
    and pay attention to the line "CPU architecture", where your CPU architecture will be specified, often - 5TEJ, but in fact - ARM5.
  2. Make a choice of cloud client files from http server. On the IPEYE site, select the desired file in the directory http://ipeye.ru/firmware/client/, in our case this
    cloud_linux_arm_v5.run
    
  3. Go to your device via telnet or ssh, navigate to the directory where recording is possible, such as /tmp.
  4. Download the cloud client file using the wget utility
    wget http://ipeye.ru/firmware/client/cloud_linux_arm_v5.run
    
  5. Set the file permissions to execute. This can be done by command
    chmod 777 cloud_linux_arm_v5.run
    
  6. Knowing how to build an RTSP link, prepare two links without specifying passwords, and instead of IP, specify 127.0.0.1 on the primary and secondary stream, for example
    rtsp://127.0.0.1/mpeg4
    
    and
    rtsp://127.0.0.1/mpeg4cif
    
  7. Run the cloud file using the command
    ./cloud_linux_arm_v5.run
    -http_camera_mode=1
    -streams=rtsp://127.0.0.1/mpeg4,rtsp://127.0.0.1/mpeg4cif
    
  8. Open your browser and try to go to the address "http://IP_address_of_the_camera:8282" and you'll see a form to add to the cloud.



Real application

The procedure of real integration is slightly different from the test run, in this case, the cloud file is written to the autoload of camera, and is placed not in temporary memory, but in the stored non-volatile nand-flash memory.

  1. Determine the version of your CPU, run the command on the device
    cat /proc/cpuinfo
    
    and pay attention to the line "CPU architecture", where your CPU architecture will be specified, often - 5TEJ, but in fact - ARM5.
  2. Make a choice of cloud client files from http server. On the IPEYE site, select the desired file in the directory http://ipeye.ru/firmware/client/, in our case this
    cloud_linux_arm_v5.run
    
  3. Put the file in the firmware, which storage directory, say "/mnt/falsh/cloud".
  4. Set the file permissions to execute. This can be done by command
    chmod 777 cloud_linux_arm_v5.run
    
  5. Knowing how to build an RTSP link, prepare two links without specifying passwords, and instead of IP, specify 127.0.0.1 on the primary and secondary stream, for example
    rtsp://127.0.0.1/mpeg4
    
    and
    rtsp://127.0.0.1/mpeg4cif
    
  6. Write down in the camera startup rc command
    /mnt/falsh/cloud/cloud_linux_arm_v5.run
    -sleep=5s
    -http_camera_mode=1
    -config_dir=/mnt/flash/productinfo/
    -streams=rtsp://127.0.0.1/mpeg4,rtsp://127.0.0.1/mpeg4cif
    
    where:
    • "/mnt/falsh/cloud/cloud_linux_arm_v5.run" - the path to the file clouds;
    • "-sleep=5s" - wait 5 seconds after turning on until the device is fully loaded and mounted;
    • "-http_camera_mode=1" - camera interface;
    • "-config_dir=/mnt/flash/productinfo/" - the path to the stored memory where the RW-access configuration is typically stored (read / write);
    • "-streams=rtsp://127.0.0.1/mpeg4,rtsp://127.0.0.1/mpeg4cif" - the list of streams through (,) the main and additional (if there are special characters, you want to enclose them in "").
  7. Reboot your device.
  8. The form is available on the port: 8282.



Customization of Web-interface

Implemented by example http://deviceIP:8282, the only point is how to obtain flow data, which can be implemented in two ways.

  1. The most correct - to create in the www directory a symbolic link to the file status.cloud, which will be created in the directory -config_dir, and provide access to it in the camera UI (read and build the form).
  2. Data on flows can be obtained from the link "http://deviceIP:8282/status/json".
Example:
  <script>
  function add(actionid){
    $("#b"+actionid).attr("disabled", true);
    jdata = ` + json + ` //data from either a file or a device port, an array of threads
    var dataToSend = {
        'action':'add',
        'login':$("#login").val(),
        'password':$("#password").val(),
        'data': JSON.stringify(jdata.chanels[actionid-1])
    };
    $.ajax({
      type: 'POST',
      url: 'http://ipeye.ru/addcamera.php', //path to the add script
      data: dataToSend,
      success: function(data) {
        jdata = JSON.parse(data)
        if (jdata.status == 1) {
          $("#d"+actionid).html(jdata.message)
        }else{
          $("#b"+actionid).attr("disabled", false);
          alert("Adding Failed " + jdata.message)
        }
      },
      error: function(data) {
        $("#b"+actionid).attr("disabled", false);
        alert("Adding Failed " + data)
      }
    });
  }
  </script>



Using a MAC as the UUID of the camera

For faster and easier integration it is possible to use a mac, but you need to be sure that it is unique.
Upload the cloud client file to the camera and start with a combination of keys.

Possible options:
  1. Without explicitly specifying a mac
    -streams="rtsp://admin:admin123@127.0.0.1/mpeg4,rtsp://admin:admin123@127.0.0.1/mpeg4cif"
    -enable_mac="1"
    -http_camera_mode="1"
    -vendor="noname"
    
    in this case, the mac will be taken from the first interface of the ifconfig camera.
  2. With the indication line
    -streams="rtsp://admin:admin123@127.0.0.1/mpeg4,rtsp://admin:admin123@127.0.0.1/mpeg4cif"
    -enable_mac="1"
    -mac_string="MM:MM:MM:SS:SS:SS"
    -http_camera_mode="1"
    -vendor="noname"
    
    in this case, the mac will be taken from the line " mac_string".
  3. Specifying the file
    -streams="rtsp://admin:admin123@127.0.0.1/mpeg4,rtsp://admin:admin123@127.0.0.1/mpeg4cif"
    -enable_mac="1"
    -mac_file="/mnt/flash/productinfo/mac"
    -http_camera_mode="1"
    -vendor="noname"
    
    in this case, the mac will be taken from the "mac_file" file.



A list of all the keys/options

A list of all keys/options can be viewed using the command " - help".

Example:
  -api_port string
    	Custom API Server Port (default "8111")
  -api_server string
    	Custom API Server IP Address (default "171.25.232.2")
  -cloud_port string
    	Custom Cloud Server Port (default "5511")
  -cloud_server string
    	Custom Cloud Server IP Address (default "171.25.232.11")
  -config_dir string
    	Full Patch dir example /mnt/flash/productinfo/ need end /
  -enable_api string
    	EnableAPI - Enable Api Registration (default "1")
  -enable_debug string
    	Enable Debug Out
  -enable_http string
    	Enable HTTP Server (default "1")
  -enable_mac string
    	Enable MAC replace cloud request UUDI to use mac need options string or file
  -enable_speek string
    	Enable audio imput chanel port 90
  -http_add_url string
    	Custom ADD Process Server IP Address (default "http://ipeye.ru/addcamera.php")
  -http_camera_mode string
    	HTTP Camera mode mrage stream1+stream2 to second
  -http_disable_add string
    	HTTP Disable Add Page
  -http_logo_text string
    	HTTP Form Logo Text (default "IPEYE")
  -http_port string
    	HTTP Server Port (default "8282")
  -http_reg_site string
    	site to reg new client (default "https://ipeye.ru")
  -mac_file string
    	Full Patch dir example /mnt/flash/productinfo/mac the file must contain only the address line MM-MM-MM-SS-SS-SS or MM:MM:MM:SS:SS:SS
  -mac_string string
    	enter mac string MM:MM:MM:SS:SS:SS or MM-MM-MM-SS-SS-SS
  -model string
    	Model
  -sleep duration
    	Start Wait timer sapmle 10s
  -streams string
    	Streams list split (,) if use & list split ("1","2")  (default "rtsp://admin:admin@127.0.0.1:554/mpeg4,rtsp://admin:admin@127.0.0.1:554/mpeg4cif")
  -vendor string
    	Vendor (default "ipeye")
*- For some cameras you may need to enable the option sysctl -w vm.overcommit_memory=1