Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[RELEASED] UniOSC - OSC solution for Unity

Discussion in 'Assets and Asset Store' started by _monoflow, May 21, 2014.

  1. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    As far as i know you have no way to get the ipaddress directly from the OSCMessage. UniOSC depends on OSCsharp and as far as i can read the code the ipaddress is not stored when creating the oscpacket from the raw UDP data.
    So the only options are :
    A) Sending the ipaddress as data inside the OSC message
    B) hack the OSCsharp lib : https://github.com/sloopidoopi/OSCsharp
     
  2. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    I'm on Unity 5.4.3f1 on MacOSX with the latest version of UniOSC. I'm sending messages from TouchOSC on my iPhone. I can get things to work with Multicast but I can't get things to work with UniCast. On startup the console window says:
    Error retrieving a valid local ipAddress:No such host is known/nPlease check your network settings or restart Unity.

    Why would that be?


    UnityEngine.Debug:LogError(Object)
    UniOSC.UniOSCUtils:GetLocalIPAddress() (at Assets/UniOSC/Scripts/UniOSCUtils.cs:143)
    UniOSC.UniOSCConnection:Init() (at Assets/UniOSC/Scripts/UniOSCConnection.cs:501)
    UniOSC.UniOSCConnection:Awake() (at Assets/UniOSC/Scripts/UniOSCConnection.cs:511)
     
  3. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    In vers 1.7.3 i changed the GetLocalIPAddress method . When you have errors retrieving an ipaddress then it returns now "127.0.0.1". Should fix your problems.
     
  4. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    Thank you, Monoflow. I think it may be a Unity issue: sometimes Unity does not pickup the Local IP address, even after a restart. Couldn't get it to work at home yesterday night. Today at work things work fine.
     
  5. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    One more issue: so far I've compiled apps using UniOSC for iOS which always worked fine. I'm now trying to compile a Windows 10 app but I get errors:

    error CS0234: The type or namespace name 'Timers' does not exist in the namespace 'System' (are you missing an assembly reference?)

    What can I do about this?

    Any help greatly appreciated,

    Tom
     
    Last edited: Dec 13, 2016
  6. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Check your publish settings. Do you have PC Standalone selected? Not Windows Store!
     
  7. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    Ah, ok: my challenge is that I'm compiling for Microsoft Hololens and that requires that I compile for Windows Store (Hololens is basically a fancy phone :).

    Is there any workaround?
     
  8. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    No advice on this, Monoflow?
     
  9. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    You can remove all the timer related stuff if you don't need them .(Is Dispatcher related) and test if it still works for you.
     
  10. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version 1.8 submitted:
    • uGUI elements to send OSC data
      • Button,Slider,Toggle
    • UnityEvent<OSCMessage> Relay component
      • Wire scripts together without some additional programming
    • UniOSCReceiver uses now a pool of UniOSCEventArgs to avoid garbage collection
    • Documentation update
     
    elbows likes this.
  11. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    Hi Monoflow,

    Unfortunately, this doesn't work. Stripping the Timer/Dispatcher just leads to more and more compiler errors. Do you intend to look into this? Why it so different for Windows Store? It works a charm for other target platforms.
     
  12. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    The problem is that Windows Store needs extra efforts as it uses other libs then the normal mono libs, that the other platforms use and there are not so many customers that need this platform. :( So i decided to not support this platform.
     
  13. Partomo

    Partomo

    Joined:
    Oct 7, 2013
    Posts:
    17
    That's a shame, but thank you for the reply.
     
  14. apolotary

    apolotary

    Joined:
    Feb 26, 2015
    Posts:
    11
    Using this plugin I can send messages FROM Android devices, but cannot receive any messages on Android, are there any clues on what might be the problem?
     
  15. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi,
    most of the time this is an issue with the right IPaddresses or port settings. Make sure that you sent your data to the right IPaddress and that your sender and receiver are using the same port.
     
  16. apolotary

    apolotary

    Joined:
    Feb 26, 2015
    Posts:
    11
    That was it, everything is working now, thanks!
     
  17. tomscreech

    tomscreech

    Joined:
    May 15, 2017
    Posts:
    2
    Hello, Im having a big issue with this for one of my University projects, I was wondering if there was an email or a phone number i couold use to talk to someone for some help?

    Im trying to get some data into unity from a peice of tech using OSC, but its not working!

    Thanks in advance.
     
  18. tomscreech

    tomscreech

    Joined:
    May 15, 2017
    Posts:
    2
    Hello, Im having an issue with making anything move with the scripts in the test level
     
  19. TheBarGuy

    TheBarGuy

    Joined:
    May 23, 2014
    Posts:
    5
    I'm having the same issue when it comes to receiving information. I send a message in an OSCBundle, but when I receive the message in an OSCEventTarget's OnOSCMessageReceived() method, I receive double the messages. I have confirmed that I am only sending a single Bundle by using an external app that can receive OSC messages, but when I receive an OSC bundle using the UniOSC plugin in Unity, it get double the messages. This is the case by using the OnOSCMessageReceived method, and using the OSCEditor window that UniOSC comes packaged with.

    Were you able to find a solution to this issue?
     
  20. harryhow

    harryhow

    Joined:
    Jun 22, 2015
    Posts:
    3
    Hi,

    I want to make sure how should I setup for 1 to many broadcast?

    I try setup as unicast but target to my network's broadcast IP. (I use ifconifg's result braodcast ip)

    Code (CSharp):
    1. en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    2.     ether 8c:85:90:9d:10:d1
    3.     inet6 fe80::148f:4bae:44c1:340d%en0 prefixlen 64 secured scopeid 0x6
    4.     inet 10.255.234.42 netmask 0xffffff00 broadcast 10.255.234.255
    5.     nd6 options=201<PERFORMNUD,DAD>
    6.     media: autoselect
    7.     status: active


    As for this setting, uniOSC can successfully sent out OSC messages to another computer's OSC program but CAN'T receive from the other computer's OSC message.

    I use Wireshark to sniffer OSC message to make sure incoming OSC on uniOSC computer is successfully coming but just can't get through into uniOSC's unity program. Maybe something went wrong? Please help!

    (I double check in/out ports are correct by using Wireshark. IP setting is broadcast IP)
     
  21. Cloudless-Rain

    Cloudless-Rain

    Joined:
    Jun 24, 2015
    Posts:
    12
    I'm struggling to get uniOSC to see my incoming data from TouchOSC (haven't tried outboud yet). I'm pretty new to Unity and C# but have been using OSC for a long time.

    I get a bunch of warnings when I open an OSC project, I'll paste them at the bottom. I'm sure it's not a Port typo. Just to check the connect I've closed Unity and then checked the connection between TouchOSC and Pure Data and everything's fine. :(

    Oh yeah, I'm using TouchOSC on an Android, Unity 2017.3.1f1 on Win10.

    warnings:
    Assets/UniOSC/Scripts/ScriptableObjects/UniOSCFileObj.cs(32,46): warning CS0067: The event `UniOSC.UniOSCFileObj.OSCMessageSend' is never used
    Assets/UniOSC/Scripts/UniOSCTransmitter.cs(48,49): warning CS0067: The event `UniOSC.UniOSCTransmitter.OSCErrorOccured' is never used
    Assets/UniOSC/Scripts/ClassBased/Demo/Editor/UniOSCScriptTestEditor.cs(70,22): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'
    Assets/UniOSC/Scripts/Editor/UniOSCEditor.cs(105,22): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (I tried changing the playmode to playMode as suggested in the warnings but it caused an error)
    thx
     
  22. Cloudless-Rain

    Cloudless-Rain

    Joined:
    Jun 24, 2015
    Posts:
    12

    harryhow, you figure out your problem?
     
  23. loquellega

    loquellega

    Joined:
    Dec 9, 2017
    Posts:
    1
    Hi! I have some troubles trying to move a GameObjet with a camera using UniOSC. I actually followed all the tutorials and I already have goods results. I mean, when I want to rotate a game objet I have no problem but when, at the same gameObjet attache the moveGameObjet scrip I got some weird behaviours. I want to control a camera via OSC using UniOSC. How could be the more easy way to do that. Do you have an example for that? Thanks!!
     
  24. Patrudoizero

    Patrudoizero

    Joined:
    Nov 30, 2018
    Posts:
    11
    Hi!
    How can I transmit osc data to another component than Transform? For example to the Intensity or Drag parameters from Visual Effect?
    Thanks!
     

    Attached Files:

  25. stf51

    stf51

    Joined:
    Mar 25, 2021
    Posts:
    8
    is there a chance to make it work in unity 2020 ?
    thx a lot
     
  26. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,454
    Amazing asset, will this work on WebGL?