cck56 / mijia-720p-ctrl Goto Github PK
View Code? Open in Web Editor NEWThe code controls the pan/tilt motors of Mijia 720p 360 degree version
The code controls the pan/tilt motors of Mijia 720p 360 degree version
Using
echo -n "MOVE,0,1" | nc -4u -w1 [Camera IP] 8888
enables relative motion control. Is it also possible to move the camera to a fixed absolute position using a single command?
Is it possible to explain how to run it ?
Hi,
I am triying to use this with Mijia 360 720p (wich is included in mijia-720p-hack). Once the service mijia_control start, I get this error:
./mijia_ctrl
Failed to open /dev/ftpwmtmr010
PWM initialization failed
UDP server started on 0.0.0.0:8888
Exit with Ctrl+C
Any ideas? Thanks.
Hi,
i would like to test the project but cannot find the mentioned toolchain.
Where can i get it?
Sorry for not taking the time to make it prettier, here's a very ugly hack in order to mijia_ctrl
to be called by a while:;sleep
loop and enable DAYNIGHT
if ev
value is below 1000
, which is the value corresponding for my cam (ieGeek):
diff --git a/mijia_ctrl.c b/mijia_ctrl.c
index dcd95b8..4933f02 100644
--- a/mijia_ctrl.c
+++ b/mijia_ctrl.c
@@ -267,7 +267,7 @@ int cmd_ircut(int argc, char *argv[], char *buf) {
}
int cmd_daynight(int argc, char *argv[], char *buf) {
- unsigned int val = -1;
+ unsigned int val = -1, ev = 0;
if ( fcntl(isp_fd, F_GETFD) == -1 ) {
strcpy(buf, REPLY_DEV_INIT_FAIL);
@@ -277,6 +277,17 @@ int cmd_daynight(int argc, char *argv[], char *buf) {
if (argc == 2) {
sscanf(argv[1], "%d", &val);
fprintf(stdout, "daynight mode:%d\n", val);
+ if (val == 2) {
+ get_ev(&ev);
+ fprintf(stdout, "ev:%d\n", ev);
+ if (ev < 1000)
+ val = 1;
+ else
+ val = 0;
+
+ ioctl(isp_fd, _IOW(0x6d, 0x0a, int), &val);
+ return 0;
+ }
if (val <= 1) {
ioctl(isp_fd, _IOW(0x6d, 0x0a, int), &val);
sprintf(buf, "OK,VAL=%d\n", val);
@@ -321,6 +332,11 @@ int cmd_ledstatus(int argc, char *argv[], char *buf) {
return 0;
}
+void
+get_ev(unsigned int *ev) {
+ ioctl(isp_fd, _IOR(0x65, 0x1f, int), ev);
+}
+
int cmd_isp_sta(int argc, char *argv[], char *buf) {
unsigned int converge = 0, ev = 0, sta_rdy = 0;
unsigned int awb_sta[10];
@@ -334,7 +350,7 @@ int cmd_isp_sta(int argc, char *argv[], char *buf) {
ioctl(isp_fd, _IOR(0x65, 0x23, int), &converge);
sleep(1);
}
- ioctl(isp_fd, _IOR(0x65, 0x1f, int), &ev);
+ get_ev(&ev);
while (sta_rdy != 0xf) {
ioctl(isp_fd, _IOR(0x63, 0x09, int), &sta_rdy);
After building with this patch, mijia_ctrl DAYNIGHT,2
will enable NIGHTMODE
when ev < 1000
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.