Giter VIP home page Giter VIP logo

mijia-720p-ctrl's People

Contributors

cck56 avatar ghoost82 avatar imilnb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mijia-720p-ctrl's Issues

Absolute position control?

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?

Failed to open /dev/ftpwmtmr010

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.

An ugly hack to mimic auto-nightmode

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.