Announcement

Collapse
No announcement yet.

Read and control WiiMote Flash

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read and control WiiMote Flash

    I just started to use OSCulator for my project, and love how easy it is to setup a connection with the WiiMote. Actually its one of the few tools still working. But i need a bit of help. I read the manual but still the OSCulator interface is quite a mystery to me.

    What i want to do is quite simple. Read out the data of the WiiMote xyz axis and under conditions send a vibrate message to vibrate the WiiMote.

    But i'm having troubles with both the sending and receiving of the data.

    For the receiving end i had a simple max patch that gave me no trouble and gave me this output:


    But moving over to flash here it's getting weird. Just printing out the UDP port gives me these values:

    I don't know what happens, but the number value what i get in Max is now totally something weird.

    I tried messing around with the send arguments in OSCulator but that didn't seem to do anything.

    for sending the vibrate signal the manual is totally not clear.
    For now i'm connecting to the 8000 input port and tried sending:
    /wii/1/vibrate 1
    /wii/1/vibrate 1.0
    /wii/1/vibrate/1

    and some more variations. But OSCulator keeps giving me this error
    "Receive error occurred: OSC error 9913 in (null): Invalid Message path."

    but i have no idea what is wrong or what to do next
    The wiimote Vibrate examples are just mappings of a button press to the vibrate event. But how to set up such a event with incoming UDP messages?

    This is my setup:



    So does anyone has an idea how to fix this so i can move on with my project?
    Thanks!!

  • #2
    Hello Dahaka,

    The reason you have all these problems is because you need an OSC encoding/decoding library.
    The funny looking characters you saw are actually binary OSC data rendered to ASCII.
    OSC is not a character oriented protocol, therefore you need to encode the messages to binary packets which you can then send over UDP.

    Best,
    Camille

    Comment


    • #3
      Ok so i found a OSC library to encode the message correctly.
      And OSCulator is getting the messages i send but now another problem. Each time I send the message there is e new one popping up in OSCulator.
      This means i cannot set it to vibrate the wiimote. Any ideas on what im doing wrong?

      Comment


      • #4
        The code you have written adds a new OSC argument to the OSC message myMsg every time the fl_MouseClickHandler procedure is called.

        Comment


        • #5
          ohja how stupid of me. Ok so I made the message once outside of the function. However, now it shows up in OSCulator but triggers only once . Every time after that the indicator light in OSCulator does not light up when sending the message.

          I checked the message i send out. It's a float (1.0) and when I print out the message it shows the argument as the weird characters thus being a binary value rendered as ASCI text.
          I know i'm close but i don't know where i make the mistake.

          Last edited by Dahaka; 07-21-2014, 10:24 PM.

          Comment


          • #6
            OSCulator expects a failing edge value (1 to 0 for example), but you can simulate one by simply omitting the argument.
            Simply send a message like /flash/mouse/click without argument, OSCulator will trigger the event for you.

            Don't name your messages starting with /wii/1 because this is confusing since this is the same kind of messages sent by the Wiimote driver.

            Comment


            • #7
              Thanks for the help! It works now !

              Comment

              Working...
              X