Comments (12)
Hi, I'm afraid I don't quite understand your issue yet... can you please mention more details about your problem?
Any project or code you can share so the problem can be reproduced?
Thanks,
Jorge
from unityosc.
I seem to have the same problem, even when I shut down my server (I'm sending from Processing) Unity keep telling me the same message over and over. Actually on closer inspection it seems that Unity only gets the first message and ignores any other message that's coming in.
For the code I am using the test code placed on an empty object in de gameworld.
If there is anything to show this behaviour I would be glad to provide anything.
from unityosc.
It would help if you share a project reproducing the problem please. In any case, you may also want to check whether the timestamp in each of the packets change (so you know that you have received a new packet). Also, have a look into the test here if you haven't done it already:
https://github.com/jorgegarcia/UnityOSC/blob/master/tests/oscControl.cs
from unityosc.
Hi, I encountered the same problem. Data is received by unity but only the first value is used in update. I've created a project for reproduction which you can download here:
http://www.yourule.nl/unityOSC/IncommingOSCtest.zip
Noteworthy:
In your oscControl.cs class the count of the items (item.Value.log.Count) never gets bigger than 1.
Maybe it's got something to do with this warning which pops up after pressing stop. (but not always):
Assets/OSCBundle.cs(89,41): warning CS0108: UnityOSC.OSCBundle.Unpack(byte[], ref int, int)' hides inherited member
UnityOSC.OSCPacket.Unpack(byte[], ref int, int)'. Use the new keyword if hiding was intended
I'm running Unity 4.5.5 (but also tried 4.3.0) on MacOSX 10.9.5
Same problem on Unity 4.5.3 on Windows 8.1
I also made a very small sending app for testing on Mac and PC using MaxMSP for debugging purposes
http://www.yourule.nl/unityOSC/toUnityOSC-apps.zip
BTW, i've been using the sending part for a while now, and I must say I'm impressed by your work!
from unityosc.
I encounter the same problem on Unity 4.6 Beta 20. Sending to OF works fine, but it does not update. It only updates when i start and stop the unity editor.
from unityosc.
Update:
If I Debug.Log(_servers[pair.Key].server.LastReceivedPacket.Data[0]); in public void UpdateLogs() I can see the values updating. The problem seems to be the timestamp always being 0, so the data is there but the writing in the dictionary fails due to the missing time stamp?
from unityosc.
Hack to make UpdateLogs() in OSCHandler.cs work:
public void UpdateLogs()
{
foreach(KeyValuePair<string,ServerLog> pair in _servers)
{
if(_servers[pair.Key].server.LastReceivedPacket != null)
{
//Initialization for the first packet received
if(_servers[pair.Key].log.Count == 0)
{
_servers[pair.Key].packets.Add(_servers[pair.Key].server.LastReceivedPacket);
_servers[pair.Key].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".",
FormatMilliseconds(DateTime.Now.Millisecond)," : ",
_servers[pair.Key].server.LastReceivedPacket.Address," ",
DataToString(_servers[pair.Key].server.LastReceivedPacket.Data)));
break;
}
//if(_servers[pair.Key].server.LastReceivedPacket.TimeStamp
// != _servers[pair.Key].packets[_servers[pair.Key].packets.Count - 1].TimeStamp)
//{
if(_servers[pair.Key].log.Count > _loglength - 1)
{
_servers[pair.Key].log.RemoveAt(0);
_servers[pair.Key].packets.RemoveAt(0);
}
_servers[pair.Key].packets.Add(_servers[pair.Key].server.LastReceivedPacket);
_servers[pair.Key].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".",
FormatMilliseconds(DateTime.Now.Millisecond)," : ",
_servers[pair.Key].server.LastReceivedPacket.Address," ",
DataToString(_servers[pair.Key].server.LastReceivedPacket.Data)));
//}
}
}
}
from unityosc.
Apologies for the delay on this reply.
@yourule Thanks for pointing out a fix. If you think it's appropriate (and you well-tested it) please fork and do a pull request. Then I can review/merge the changes and other users of UnityOSC can benefit from them.
from unityosc.
Thank you for your reply.
For now it's a quick fix. This method resolves another problem where different messages which arrive on the same time where not passed through. I'll do some thoroughly testing and will keep you updated!
from unityosc.
Hi everyone !
I got the same problem. The fix of yourule works.
I did it another way (but I'm not sure this is better :p)
Just add a variable in OSCServer that is incremented each time the server receives a message. I store this as a timestamp in the OSCPacket. It ensures you have a growing timestamp for each message on each server.
In my unity app, I check an internal timestamp compared with the UnityOsc packet timestamp.
The limitation I see is that you have to store a timestamp reference for each of your OSCServer. Which is annoying.
Hope this will be fixed in the best manner found :)
from unityosc.
I can confirm this issue both on Unity 4.6 and Unity 5 ( I've used it without any issues in older versions ). Timestamps for all packets are "0".
@jorgegarcia I've skimmed through the code and couldn't really pick out how timestamps are handled. Any insight would be very helpful.
from unityosc.
Hi @ntkeep and the rest,
Apologies for the slow response!
I've just commited the change 3dba77c for generating a timestamp using the machine time when it's zero. This would happen when receiving OSC packets from applications that don't send timestamps, or if the data is not deserialised properly.
I've been doing a bit of testing today and all seems OK. Please pull and check whether this fixes the issues mentioned above. As always, feel free to create a new issue if you have further problems with UnityOSC :)
Thanks,
Jorge
from unityosc.
Related Issues (20)
- Not working on Android HOT 4
- Timing Problem/Question (Packet loss?) HOT 1
- Too big latency when Recieving high rate OSC message. HOT 2
- Doesn't work on UWP (HoloLens) HOT 3
- Client Doesn't Exist HOT 1
- Get an OscBundle HOT 6
- Performance issues HOT 1
- OSCHandler GameObjects continue instantiating without being destroyed HOT 6
- Client doesn't exist HOT 5
- Send / Receive extended ASCII strings HOT 1
- Can't receive multibyte characters? HOT 1
- How to "message.add"? HOT 2
- Comparing OSC Message HOT 1
- Receiving from external IP HOT 1
- Assets/OSCHandler.cs(96,23): error CS0619: UnityEngine.Network' is obsolete HOT 1
- MIDI HOT 1
- Assets/Editor/OSCHelper.cs(41,29): error CS0246: The type or namespace name `ClientLog' could not be found. Are you missing an assembly reference? HOT 1
- Can't debug Data from Log. HOT 3
- value.GetType() use causes AOT compile issues on iOS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unityosc.