dwilches / Ardity

Assets for integrating Arduino and Unity (or Unity and any hardware that communicates over a COM port)
331 stars 62 forks source link

Flooding queue when device is removed unexpectedly on linux #67

Closed MNS26 closed 1 year ago

MNS26 commented 1 year ago

Screenshot_20230202_225407

when disconnecting out of nowhere it will flood the queue and nothing can be done about it other than restarting

is it possible to fall back to checking for the serial device?

dwilches commented 1 year ago

Hi Do you know what is the reason the device gets disconnected? That can give a hint at what is happening. My guess is the device is not really disconnected, because otherwise there would be no messages arriving at the queue.

MNS26 commented 1 year ago

i pressed the reset button because i had to change the code its running (RP2040), it has builtin usb

MNS26 commented 1 year ago

Screenshot_20230203_165131 Screenshot_20230203_171556

as shown in the picture the 1st reset made it show up (only sometimes needed) but after the 2nd reset it floods the queue

MNS26 commented 1 year ago

@dwilches any thoughts on what to do?

dwilches commented 1 year ago

Hi After a reset you won't be able to reuse the same connection, but you may be able to detect from Unity that the connection is broken and then close it and re-connect. But I would only do this is pressing the reset button is a normal use-case of the application you are building, not if it's something that only happens during development.