Camera

From Laramie Robotics Club
Jump to: navigation, search


Kaicong

Kaicong Network Setup

The Kaicong camera is a network security camera and requires a WPA / WPA2 wireless network or a wired ethernet connection (Some enterprise network solution will cause conflicts refer to Kaicong Network Setup (OFFLINE))

Connecting to the camera:

  • Initially, camera requires wired internet connection to be configured.
  • After connected, navigate to 485747.Kaicong.info (Note this can fail if so navigate to Kaicong Network Setup (OFFLINE))
  • Note the URL change:
IP1.png

Changes to

IP2.png

(Your URL should be an IP address)

  • You should be presented with a login page:
Authentication Image.png
  • Use Username: admin and Password: 123456 (Both can be changed later)
  • After logging in click on "Sign in" underneath Server Push Mode
Server Push Mode.png
  • Now you should be able to see a live feed from the camera
  • Click on the gear icon on the bottom right of the UI
Gear.png
  • Once there you can change the admin username / password and setup Wi-Fi if desired

Kaicong Network Setup (OFFLINE)

Offline setup can be used if there is no Wi-Fi network availabe to connect to and a wired internet connection is not possible. Requires Router

  • Connect camera to router via ethernet
  • Connect PC to router either wirelessly or via ethernet
  • Use CMD to find default gateway
ipconfig
CMD IP.png
  • Enter that into a web browser (You may need a username/password depending on the router) and a device table or DHCP reservartion chart
  • Look for something similar to uhcp.x.x.x or Unknown
  • Write down the IP: In this case 192.168.0.20
Camera IP.png
  • Enter that IP in a web browser followed by :81
IP2.png
  • You should be presented with a login page:
Authentication Image.png
  • Use Username: admin and Password: 123456 (Both can be changed later)
  • After logging in click on "Sign in" underneath Server Push Mode
Server Push Mode.png
  • Now you should be able to see a live feed from the camera
  • Click on the gear icon on the bottom right of the UI
Gear.png
  • Once there you can change the admin username / password and setup Wi-Fi if desired

Kaicong and Calico

  • Integrating the Kaicong camera and Calico is very straightforward
  • Import Myro, Graphics and urllib
from Myro import *
from Graphics import *
import colorsys 
from socket import *
import urllib
  • To take a picture on the camera an element known as snapshot.cgi is referenced
  • So to give calico access to that image that image must be downloaded locally and then accessed
  • We can do this with this line:
 urllib.urlretrieve("http://192.168.0.20:81/snapshot.cgi?loginuse=admin&loginpas=","img.jpg")
  • Change bolded text with your own IP
  • To save this image to a variable we can use makePicture
origPic = makePicture("img.jpg")
  • I would suggest to make this its own function to grab a new image:
 def newPic():
    #Downloads picture from Kaicong webui 
    urllib.urlretrieve("http://192.168.0.20:81/snapshot.cgi?loginuse=admin&loginpas=","img.jpg")
    global origPic
    origPic = makePicture("img.jpg")
  • The global is necessary for origPic to be used by any other functions throughout the code