|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Yes, it's me again! I am trying to cleanly shut down my Serializer C# application but I must be missing something.
I am using a Bluetooth connection to the Serializer and everything works great in terms of firing up the application, connecting to the Serializer, retrieving senors values, etc. Then I close my Windows form and issue either a Serializer Shutdown() or StopCommunication() command--or both--during the "Form Closed" or "Form Closing" event handler. The application shuts down cleanly with no complaint (I'm running this all in Debug mode within Visual Studio 2005). However, if I fire the application up again, it connects to the Serializer but no longer sees any sensor values--in other words, the fields on my form that display the sensor values all show 0. With the application still running, if I reset the Serializer using the little white push button, then the sensor values show up again. This behavior always occurs--I can never run the application twice in a row without resetting or power-cycling the Serializer.
Any thoughts?
Thanks,
patrick
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
P.S. Usually, on the second attempt to launch the application (after cleaning shutting it down once), I get the following exception:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="RoboticsConnection.Serializer"
StackTrace:
at RoboticsConnection.Serializer.Internal.CommunicationTask.ThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
If I then kill the application, hit the white reset button on the Serializer, then launch the application again, it works fine--or sometimes, my form comes up, but I have to do a second white-button-reset to get the sensors to start reading. Then it runs fine until I shutdown the application again.
--patrick
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Just a quick followup: if I replace the Bluetooth comm module on the Serializer with the USB module, change the COM port in my code and run it without any other changes, I don't get the shutdown/restart problem. So it appears to be related to Bluetooth communications in particular...
--patrick
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Yesterday @ 8:31 AM
Posts: 270,
Visits: 396
|
|
Hmm... It sounds like we need to talk w/ A7Engineering to see why the COM port for the bluetooth module isn't getting closed properly. I don't know if it's a bluetooth driver/stack, or if it's a problem w/ the eb100 module we use on our Bluetooth modules. I'm pretty booked this weekend, but we will look at this early to mid week next week.I seem to recall another customer running into this last year...I guess we unfortunately let it fall through the cracks.  Best Regards,
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Hi Jason,
Thanks for your reply. Yes, it certainly seems like the A7 serial port connection is not being properly closed down. Can you think of a way to do this from the C# side? In other words, can I send some kind of reset command to the serial port from my application before shutting down the Serializer?
--patrick
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Saturday, August 02, 2008 3:55 PM
Posts: 35,
Visits: 141
|
|
Hi Jason,
Good news on the Bluetooth front. Looks like the shutdown issue is not the fault of your A7 module. I swapped out my Zonet USB Bluetooth dongle on my PC for a new one from Azio (BTD603-132) and it works perfectly. The Azio uses a driver from Toshiba which does not seem to require pairing with the A7 or entering the 0000 passcode. So I'm wondering if that's part of the secret. (To connect with the Zonet dongle, I had to pair using 0000.) In any event, if someone else runs into this problem, they might want to try a different USB/BT dongle on their PC.
--patrick
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Yesterday @ 8:31 AM
Posts: 270,
Visits: 396
|
|
| Patrick, That's good info to have! We've used our built in BT radio, as well as a Linksys USBBT100 dongle with success. Thansk for the update! Best Regards,
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|