GithubHelp home page GithubHelp logo

Queue is Full Droping about ardity HOT 13 CLOSED

dwilches avatar dwilches commented on August 27, 2024
Queue is Full Droping

from ardity.

Comments (13)

tinyboxxx avatar tinyboxxx commented on August 27, 2024 1

I found its relate with framerate, I use [Graphy] to monitor the player's FPS. When I disable Vsync, the frame rate rises from 60 to about 500, and the Queue is Full Dropping problem disappears.

Although I think the drop old message kinda works anyway.

I think it's a processing problem. I think processing speed should be faster than render speed.

from ardity.

dwilches avatar dwilches commented on August 27, 2024

Hi Bramichou,
I'm glad you've found Ardity useful.

I don't quite get your question. How are you using Ardity? Is it:

  • Your Arduino program prints those numbers, and you want them to appear in Unity's console?
  • Or, you're seeing those numbers in Arduino's Serial Monitor (so Ardity is not involved).

And, what do you mean by "it drops lot of times"?

from ardity.

Bramichou avatar Bramichou commented on August 27, 2024

Hello @dwilches Thanks answering me fast :)

First of all, i will explain you what i want to do : I have a plant connected to my arduino, and i have number which explain the distance between my hand and the plant with a capacitive touch sensor :)

So i use the Serial controller on Ardity with a Gameobject as Message Listener where i use the event 'OnMessageArrived' to read the messsages.

So as you saw in the first screen, its what i have on the Arduino's Serials Monitor when i start to listen with unity, and in the Debug Log, i lost a lot of data like this :

Capture d’écran 2019-05-01 à 18 09 25

And when i mean "It drops a lot of times", i mean that i lost a lot of time data like have nothing, or have a half of the number ...

SerialMonitor has 1 as Max Unread Messages, and 1000 as Reconnection delay

Thank you for your help and to be available to helping me

from ardity.

Bramichou avatar Bramichou commented on August 27, 2024

So did you find why ? @dwilches

from ardity.

dwilches avatar dwilches commented on August 27, 2024

If I'm understanding correctly, your program generates messages like 521521521, 521 and even and all of them are valid (that's what I see in your first image).
And, the problem is when the messages are received in Unity there are some of those that are lost. Is that correct?

The only reason I can think for messages being lost is that there is a disagreement between the baud rates in the Arduino and Unity, can you make sure both are set to 9600?

Also, after each of your Arduino messages, do you have a new-line character?

from ardity.

Bramichou avatar Bramichou commented on August 27, 2024

It's the same baudrate 9600 in Unity and 9600 in Arduiino.

And to answer to your last question, in the Serial Monitor, i got lines with 521521, or only 5, 52 or nothing, so when i want to see what is displayed in the unity logs, i have those lines .. :/

from ardity.

dwilches avatar dwilches commented on August 27, 2024

Good that you found the issue. You can also try with different standard baud rates, like115200, the higher the number the quicker the data will be transferred.

from ardity.

tinyboxxx avatar tinyboxxx commented on August 27, 2024

But can we make processing more time per frame?

For example, if my scene is 60 frame per second, can we receive more than 60 messages per second?

I'm testing with about 105 messages per second (all send from Arduino UNO), when 60 fps, it drops messages, when about 140 fps, it's ok, not dropping.

from ardity.

tinyboxxx avatar tinyboxxx commented on August 27, 2024

image

image

Here is my Serial:
image

image

from ardity.

Bramichou avatar Bramichou commented on August 27, 2024

@dwilches i have questions about the build :

Before to build, to test my app, my workflow was to run my unity game, then i run arduino and open the serial monitor to read data on unity.

But when i build, then i run the app builded for mac, i run after that arduino and opening the serial monitor, but nothing happens ! Do you know why ?

from ardity.

dwilches avatar dwilches commented on August 27, 2024

Hello,
So you needed to open the serial monitor in the Arduino IDE for data to be seen in Unity?
That shouldn't be necessary, and can even cause issues as there are 2 programs connected by serial to your Arduino. I didn' t even think that was possible.

I don't understand the difference between te 2 scenarios you explain, wasn' t the first one on a Mac too?

Notice the Arduino board is reset and your program restarted when one opens the Serial Monitor, so I wonder if that may be related to the issue you experience.

from ardity.

Bramichou avatar Bramichou commented on August 27, 2024

Okay my bad now it works after building the app but still need to open the serial monitor :D

How can i say in code, to detect USB port automatically my arduino usb port, to connect directly ? @dwilches

from ardity.

dwilches avatar dwilches commented on August 27, 2024

I don't know how to detect when a device connects via USB from Unity (or Arduino) but you can try repeatedly sending a command to Unity/Arduino and when it responds successfully then you know the other end of the communication has appeared. I mean, like a ping.

from ardity.

Related Issues (20)

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.