Questions (#2) - no timeout on wii remote search? (#9) - Message List

no timeout on wii remote search?
 unsolved

Hi,

Im wondering if there's some way to make it so that the wii remote search will not time out when invoking wminput. Basically I have a MythTV box and would like to be able to pick up the wii remote, press 1 + 2, and have it automagically connect to wminput (if the Wii's not on, that is).

Right now I have a bash script in /usr/bin that just reads:

wminput -c mythfrontend & mythfrontend

... but it needs me to press 1 + 2 immediately upon starting the script.

Thanks for the help!

spiderworm

  • Message #33

    Sure - I'm going to tear into that part of the code pretty soon any way, that should be an easy option to implement while I'm there. Submit a ticket so I don't forget about it.

  • Message #50

    done

    • Message #24320

      Hi,

      Can I use this option from the python bindings?

      I tried some things like wiimote = cwiid.Wiimote("w")

      but it doesn't work.

      Thanks! Beau

      • Message #24321

        The Wiimote init function takes 2 optional arguments: a bluetooth address string, and a flag field.

        • Message #24322

          Thanks for the fast reply.

          Could you tell me what the flags are or where I can find them?

          • Message #24323

            The python documentation is lacking, but the functions closely mirror the C API.

            wiki:libcwiid#cwiid_enable

            • Message #24326

              So what flags should I use?

              I could find these flags: cwiid.FLAG_CONTINUOUS cwiid.FLAG_MESG_IFC cwiid.FLAG_NONBLOCK cwiid.FLAG_REPEAT_BTN

              but none seem to keep the init function from trying to connect only for a short time.

              • Message #24327

                Yup - that's it. You'll need to loop over the connect function to wait longer.

Attachments

No attachments created.