Comments (13)
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.
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.
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 :
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.
So did you find why ? @dwilches
from ardity.
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.
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.
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.
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.
from ardity.
@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.
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.
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.
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)
- queue is full dropping messege HOT 8
- Works In Editor but now on windows build HOT 3
- From Unity to Arduino HOT 2
- Working with BLE and Mobile HOT 3
- Can ardity read serial information from arduino attached to an android device via usb c (unity android build)? or is it only for windows?
- The Data is visible in Arduino serial monitor but not reciving in Unity3D HOT 1
- Can't compare strings (sorry am noob) HOT 1
- Game crashes when exiting HOT 2
- cant find the COM HOT 2
- PortMapper trial HOT 2
- Does Ardity work on Linux ? HOT 1
- Dropping too much messages when frame rate is below 100 fps HOT 3
- Flooding queue when device is removed unexpectedly on linux HOT 5
- how to use aridity to send byte HOT 6
- Use with Mobile HOT 1
- Unity Package contains un-update source
- Windows 11 - Exception: Access is Denied HOT 2
- Sending data from unity to arduino
- Thread is blocking for readTimeout even when no data is available
- A specific question HOT 1
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 ardity.