openmiko / openmiko

Open source firmware for Ingenic T20 based devices such as WyzeCam V2, Xiaomi Xiaofang 1S, iSmartAlarm's Spot+ and others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run custom Python script and access camera.

jagunder opened this issue · comments

I don’t really need any of the fancy features of this firmware. I was just wondering if it can run custom python scripts which can access the camera feed and control pan/tilt, IR leds, speaker…
I basically want to do some very basic custom object detection with a Wyze Cam Pan.

This is not an issue with the firmware. It’s just a question of if this is possible and how I can do it.

I've attached the Python file for the API server that runs on the camera. You should be able to reverse engineer CURL requests in a Python script to get your intended functionality. I know for sure you can control IR LED and night mode. As for pan and tilt, it does not seem so. You may want to write you own API to replace the firmwares.

As for object detection I'm sure you could use the MJPEG or RSTP stream within python to pull images or video stream and then do all detection locally.

For example to turn the IR LED off

curl command:
curl -d value=0 http://_CAMERA_IP_:8081/api/ir_led

Python equivalent using requests module:
requests.post('http://_CAMERA_IP_:8081/api/ir_led', data={'value': '0'})

API Python file pulled from my Wyze Cam v2
app.zip