Camera Management Server

From MiOS
Revision as of 22:41, 30 July 2011 by Micasaverde (Talk | contribs)

Jump to: navigation, search

Certain cameras come with custom firmware so that they automatically connect to the MiOS camera management server (cms), creating a tunnel the cms can use to send commands to the camera and to act as a relay so users can view and control the camera when outside the home without having to change their firewall.

Mios operates a camera server ("cs") which is available at crX.mios.com (ie cr1.mios.com, cr2.mios.com, etc.). Cameras which are shipped with this custom firmware will automatically connect to the cs and report their Mac Address and IP address. Cs stores this in a database along with the external IP that the connection came in on.

Locating the camera

To get the list of all cameras and MiOS systems on your current home network, read this URL: http://sta1.mios.com/locator_json2.php which returns the list in JSON format. To add to the list all cameras that are off the home network but which can be access remotely with a given username, add a ?username=x to the URL, such as http://sta1.mios.com/locator_json2.php?username=johndoe

A camera will look like this:

     {
           "serialNumber": "554",
           "Alive": 0,
           "name": "Good camera",
           "mfr": "Mios",
           "ipAddress": "192.168.2.27",
           "category": "2",
           "subcategory": "1",
           "users": "16782,3",
           "ImageUrl_LR": "img/snapshot.cgi?size=320x240&quality=4",
           "MJpegUrl_LR": "img/video.mjpeg",
           "MP4Url_LR": "img/video.asf",
           "ImageUrl_HR": "img/snapshot.cgi?size=640x480&quality=2",
           "MJpegUrl_HR": "img/video.mjpeg",
           "MP4Url_HR": "img/video.asf",
           "CanRelay": "1",
           "Port": "80",
           "local_remote": "1",
           "relay_remote": "1",
           "active_server": "cr1.mios.com"
       }

Local vs remote access

In the Json data above, "active_server" tells you which Cs the camera connects to. So to view or control this camera connect to cr1.mios.com. If the camera is on the same network as the client, then ipAddress will have an ip. Otherwise there is no ipAddress. If the ipAddress is specified, then you can access the camera on the local network, without going through the relay server, by using ImageUrl, MJpegUrl and MP4Url tags to fetch a JPEG Image, MJPEG stream, or MP4 stream. _LR are low res verseions, _HR are high res. If CanRelay is 1, then this camera connects to the cs and you can also view the camera remotely using the Cs.

request_video: Request video from a camera

To view the video from the camera, open this URL:

https://cr1.mios.com/request_video?cam=a&format=b&user=c&pass=d

where a is the serial number of the camera, 554 in the above example, b is "mp4" or "mjpeg", c and d are the username/password of the MiOS account the camera is paired with.

This will return another URL. If the viewer is on the same home network as the camera the URL will point directly to the camera. Otherwise it will be a Url, for example http://209.160.41.93:80/relay_viewer?cam=554&pass=2024848122, which points to the Cs with a use-once token. In this case the URL can only be used one time, and must be used within 1 minute of making the request.

Personal tools