Martin J
Posts: 11
Joined: Wed Oct 26, 2005 12:02 pm
Location: Sweden

Connection problem

Mon Nov 07, 2005 5:31 pm

Hi!

In our program (for Pocket PC) we search for devices and then for each device we connect, ask for some information and then disconnect. Usually after a couple of searches we can't connect to any device anymore, although searching for devices still works as it should. The only way to get it to work again is to enter Bluetooth Manager, connect and then disconnect to any device. I guess something in the Widcomm stack is reset when I do a connect or disconnect in BT manager.

- Do you recognize this problem?
- Do you know when it will be fixed?
- Is there any way I can perform the described workaround programmatically?

Thanks for your help!

Kind regards,
/Martin J (Autocom Diagnostic Partner AB)

Martin J
Posts: 11
Joined: Wed Oct 26, 2005 12:02 pm
Location: Sweden

RE: Connection problem

Thu Nov 10, 2005 3:31 pm

Some more clues:

The searching and connecting works fine until we eventually catch exception "Connection timed out" or "Connection failed" thrown by

Code: Select all

mystream = myservice.Stream
We can also see that mystream is Nothing so no stream was opened, but after this we cannot connect to any device. The searching for devices still works though until we catch exception "The connection failed due to an unknown error" thrown by the same code line. After this we never find any devices until we perform the workaround described in my previous post.

We are very satisfied with all other functionality in BlueTools, but this is a fundamental function in our program so we cannot include BlueTools in our new version until we figure this problem out.

Do you have any ideas what the problem might be? Or how we can get around it?

Thanks!

Best regards,
/Martin J (Autocom Diagnostic Partner AB)

User avatar
johan
GpsGate
Posts: 15145
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Connection problem

Mon Nov 14, 2005 9:36 pm

Try Beta7 now released. The sensitive WidComm stack is now handled with even more care...

Regards,
Johan

Franson Support

Martin J
Posts: 11
Joined: Wed Oct 26, 2005 12:02 pm
Location: Sweden

RE: Connection problem

Wed Nov 23, 2005 5:12 pm

It still won't work unfortunately.

One strange thing that may be of help for you is that after these errors turn up, even a hard reset is not enough to make the program work again. I have to connect and disconnect to Bluetooth serial port on some device via Bluetooth manager to get it to work again. Are there any reset hardware-functions in the widcomm BT sdk?

Have you made any fixes that are not yet released?

Thank you!

Best regards,
/Martin J

User avatar
johan
GpsGate
Posts: 15145
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Connection problem

Wed Nov 23, 2005 5:45 pm

I guess you mean "soft reset" and not "hard reset"?

Is it the same scenario that leads to the error or has something changed?

Regards,
Johan

Franson Support

Martin J
Posts: 11
Joined: Wed Oct 26, 2005 12:02 pm
Location: Sweden

RE: Connection problem

Wed Nov 23, 2005 7:13 pm

No I mean "hard reset", as strange as it may sound. I have tried this many times and I was really surprised the first time I saw it.

With beta7 I have seen sometimes that we succeed to connect after a "Connection failed" or "Connection timeout" which I don't think I saw before beta7. But in most cases we cannot connect to any devices after this. Another difference is that fault number two, where we no longer can discover any devices, doesn't necessarily come after exception "The connection failed due to an unknown error" anymore. In that case we ususally get fewer and fewer discovered devices with each search and finally we don't get any discovered devices.

When trying to find a workaround I used the

Code: Select all

  mydevices = nwork.DiscoverDevices()
instead of working with the internal cache directly and found that I didn't always get an identic copy of nwork.Devices(). I believe you fixed this in beta6 since I had this problem with the example program. Anyway, here I had the same scenario. After a couple of searches mydevices started to differ from nwork.Devices() and with more searches the list of devices in mydevices shrunk until it was finally empty. Is this problem maybe related to the problem above?

Regards,
/Martin J

User avatar
johan
GpsGate
Posts: 15145
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Connection problem

Fri Nov 25, 2005 4:51 pm

Beta8 to be released next week, will be more stable.

Regards,
Johan

Franson Support

msbcas
Posts: 8
Joined: Fri Nov 25, 2005 6:53 pm

RE: Connection problem

Sat Nov 26, 2005 11:38 pm

Originally posted by Martin J

Hi!

In our program (for Pocket PC) we search for devices and then for each device we connect, ask for some information and then disconnect. Usually after a couple of searches we can't connect to any device anymore, although searching for devices still works as it should. The only way to get it to work again is to enter Bluetooth Manager, connect and then disconnect to any device. I guess something in the Widcomm stack is reset when I do a connect or disconnect in BT manager.

- Do you recognize this problem?
- Do you know when it will be fixed?
- Is there any way I can perform the described workaround programmatically?

Thanks for your help!

Kind regards,
/Martin J (Autocom Diagnostic Partner AB)


msbcas
Posts: 8
Joined: Fri Nov 25, 2005 6:53 pm

RE: Connection problem

Sat Nov 26, 2005 11:44 pm

Hi,

I have the same issue. An exception is thrown when interrogating the stream. I tried the chat example as written, and here is the exception that I get...
System.ApplicationException: The stream is closed.
at Franson.BlueTools.Toolkit.PullExceptions(IntPtr obj)
at Franson.BlueTools.ServiceStream.m_check_provider()
at Franson.BlueTools.ServiceStream.Flush()
at Chat.DataStream.Flush() in C:\Program Files\Franson\BlueTools SDK\dotNet\C#\Chat\DataStream.cs:line 314
The stream is closed.
at Franson.BlueTools.Toolkit.PullExceptions(IntPtr obj)
at Franson.BlueTools.ServiceStream.m_check_provider()
at Franson.BlueTools.ServiceStream.Flush()
at Chat.DataStream.Flush() in C:\Program Files\Franson\BlueTools SDK\dotNet\C#\Chat\DataStream.cs:line 314

I have an iPaq 2795 (widcomm) and I can't send data across a stream. I've tried the simplest of applictions and I always get an application exception originating from Bluetools. Any ideas would be appreciated.

Regards,

Mike

User avatar
johan
GpsGate
Posts: 15145
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Connection problem

Sun Nov 27, 2005 8:35 pm

We'll take a look at it.

The error message says the stream is closed. I guess it must have been some error in setting up te connection between the two devices.

Regards,
Johan

Franson Support

msbcas
Posts: 8
Joined: Fri Nov 25, 2005 6:53 pm

RE: Connection problem

Sat Dec 03, 2005 3:36 pm

Hi,

The connection between my LocalService and remote device is being broken. Once I successfully connect to the stream, the OnClientDisconnected event of the LocalService class fires and the stream is closed. If I try to connect again to the LocalService from the remote, the connection is successful (sometimes). However, it is sometimes necessary to do a soft reset of the pda to clear this. Once I do get a successful connection, the socket is very reliable. I am using beta 8 of bluetools

Here's the sequence..

--- connect (pda)
currentStream = currentService.Stream;

--- connection event fires (local)
OnClientConnected(Session session)

--- disconnect event fires (local)
OnClientDisconnected(Session session)

-- try connect again (pda)
success.

-- send data
o.k.

Regards,

Mike

User avatar
johan
GpsGate
Posts: 15145
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Connection problem

Mon Dec 05, 2005 8:29 pm

We got a solution to Mike's problem now. It will be part of the beta10 release. If you need an earlier update, please contact us.

Regards,
Johan

Franson Support

Return to “BlueTools”