GithubHelp home page GithubHelp logo

Port never seems to close about ardity HOT 6 CLOSED

dwilches avatar dwilches commented on July 24, 2024
Port never seems to close

from ardity.

Comments (6)

Naphier avatar Naphier commented on July 24, 2024

Further info: Sometimes when closing Unity I get a gc error dialogue that locks the editor.

from ardity.

dwilches avatar dwilches commented on July 24, 2024

Hello Naphier,

Which version of the library are you using?
Could you try with version serial-comm-unity-1.0.0 to see if the problem happens with that as well?

If the problem persists, is it possible to see your code?

from ardity.

Naphier avatar Naphier commented on July 24, 2024

My code is at the above gist in the first message. Execution flow to reproduce is connect to device, disconnect (i.e. SerialPortController.Shutdown()), and then reconnect. This is also happening even if I disconnect, stop the editor application, and then start a new connection. It's like the port is just never closing.

With 1.0.0 the problem persists, but now also getting a null exception on AbstractSerialThread.Runforever()'s SendToWire loop as serialPort is null at that point:

Unknown exception: Object reference not set to an instance of an object   at SerialThreadLines.SendToWire (System.Object message, System.IO.Ports.SerialPort serialPort) [0x00008] in E:\@Documents\Consulting Projects\VRR\FlexPointController-repo\FlexPointController\Assets\SerialComm\Scripts\Threads\SerialThreadLines.cs:34 
  at AbstractSerialThread.RunForever () [0x000a3] in E:\@Documents\Consulting Projects\VRR\FlexPointController-repo\FlexPointController\Assets\SerialComm\Scripts\Threads\AbstractSerialThread.cs:170 
UnityEngine.Debug:LogError(Object)
AbstractSerialThread:RunForever() (at Assets/SerialComm/Scripts/Threads/AbstractSerialThread.cs:179)

Thanks!

from ardity.

Naphier avatar Naphier commented on July 24, 2024

Further note on the exception from above:

This happens like so:

  • connect,
  • disconnect,
  • connect,
  • IO exception : operation aborted due to thread exit or application request), disconnect.
  • disconnect
  • Unknown exception: Object reference not an instance...

Still not sure if this is a device issue, driver issue, or .NET issue. I'm trying to get my hands on another device to eliminate at least one of those. Will also check on another PC to see if I can eliminate the possibility of driver issue. But it seems that serialPort.Close() just isn't doing its job 😦

from ardity.

Naphier avatar Naphier commented on July 24, 2024

I've confirmed with the manufacturer that it is indeed the device. I apologize for the bunk issue. Thanks for your hard work!

from ardity.

dwilches avatar dwilches commented on July 24, 2024

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.