Open dilanshah opened 6 years ago
@bc
I can prevent these issues by by restarting the computer. If the SerialMonitor is opened at any time, even after closing it there are permission errors in Unity. Why is this?
I am also getting same kind of result like, I am uploading the code to Arduino. Then I run the unity file. It reads the thread perfectly and gives me data.
Then when I disconnect the arduino from Port and reconnect it, run the unity file , it throws this NULL value.
I am also getting this null value, with a simple program similar to the above.
This worked fine with one of my boards, and then after switching to a much faster Teensy 3,2 board it now returns Null only (with one Hello World getting in).
I found out that I can get it almost working if I introduce a delay in my Arduino code at the end of the loop.
Tested with various combinations of Arduino delay and wrmhl readTimeout, the best combination is delay of 5 in Arduino and readTimeout of 25 in wrmhl. This returns all values properly except for the very first one which is Null.
Thanks for the contribution, I will investigate the issue ! I close the issue for the moment but feel free to re-open any time !
Same problem here :(
Changing baudrate, timeouts of arduino and unity does change things a little. Sometimes you can get 3-4 successful reads before NULLs.
Also i have noticed that if you start Arduino IDE serial monitor, then close it, then play the Unity project, you get the first readings. If then you stop unity and play again, you get NULLs straight away. If you stop again, run Arduino IDE serial monitor, close it and then replay Unity project, then again you get the first readings.
I'm running a clone Arduino Nano on OsX High Sierra and Unity 2018.1.6f1 . I guess i should try another board or windows, but don't have them at the moment.
Please help 🙏
My system details:
Serial monitor shows normal function:
I closed arduino and serial monitor
Works for the first couple, but then null:
The issue is on this line:
I'm preparing a biology experiment where the communication would be very useful. How do I remedy this? thanks so much! -Brian