GPS Serial2 problem

SarahWard

Banned
Some of the people who are using my pocket freeware have reported that they cannot get the gps to work.

I am using Andrew's excellent gpsserial2 library.

What happens is that they open the gps port successfully and then wait forever for data to stream through. I have tested the code and it seems no valid sentences come from the gps.

It works just fine for me using WM5 and either built-in gps or bluetooth gps.

I tried it successfully with .NETcf2.0 and .NETcf3.5.

Is this a WM6 problem (they are using WM6.1 and WM6.5)

In an attempt to solve this problem I wrote a small test routine with BOTH old and Andrew's new gps library (i.e. GPSdriver and GPSserial2). It works but it won't compile. The compiler talks of a 'GPS namespace already contains a definition' error: CS0101.

It seems there isn't any way to universally cater for gps in b4ppc because you cannot use the old and new gps libraries together.

If I can't find a solution I will have to take the gps feature out of all 6 of my nature freeware. :sign0148:

I have attached the gps tester source if anyone is interested. Try to compile it to see the error.
 

Attachments

  • gps tester.sbp
    6.8 KB · Views: 187
Last edited:

agraham

Expert
Licensed User
Longtime User
It seems there isn't any way to universally cater for gps in b4ppc because you cannot use the old and new gps libraries together.
You omitted the images :(. However having worked round that it compiles for me. Post the complete set of files and I'll see if it compiles without me touching the code.

However you aren't intended to use the two together, they are meant to be alternatives. Some (all?) HTC devices don't like the .NET SerialPort implementation which was the main reason GPSDriver was written (by me) on Erels' request. This is probably the reason why GPSSerial doesn't work on some devices - it's odds-on they are HTC or rebranded HTC devices. There is a long thread somewhere on the forum about these troubles which also affect other .NET programs, not only Basic4ppc.

For WM5.0 and above GPSDriver should be used. GPSSerial was written so that WM2003 devices and desktops could use the same code with only one minor change.
 

SarahWard

Banned
Thank you, Andrew.

For what it is worth your gps serial 2 libraries are excellent. They allow bluetooth connectivity where the older gpsdriver library failed.

HTC hardware/firmware sounds like an answer to these errors. I have tested the code on a built-in gps device and on a bluetooth device and both work just fine. It puzzled me why it worked just fine for me but others had no luck getting it to work. :(

I will ask these people about the HTC/clone possibility.

Much appreciation for all your excellent libraries, Andrew. :)

Sarah
 
Last edited:

CARTHO

Member
Licensed User
Longtime User
GPS Serial problems!

Dear Sarah

I've just read your question about gps problems.
I just ran into a similar problem.
Have written a GPS-application that runs well on WM 6.1 but not at all on WM 6.5.

The only thing that is changed is a new mobile with WM 6.5 and Ublox-5 chip in it.
The old one was WM 6.1 and SIRF-chip.

Does anyone know any more about this?

CarTho
Thomas J
 

agraham

Expert
Licensed User
Longtime User
Sorry, but as this thread is titled "GPS Serial problems" and you didn't state otherwise I made that assumption.

It should work on WM6.5. The only thing I can think of is that the Windows GPS Intermediate Driver is looking at the wrong hardware. Do you get any error messages?

Try dropping in GPSserial instead of GPSDriver and point it at the GPS program port and see if that works.
 

CARTHO

Member
Licensed User
Longtime User
Wm 6.5...

Sorry, but as this thread is titled "GPS Serial problems" and you didn't state otherwise I made that assumption.

It should work on WM6.5. The only thing I can think of is that the Windows GPS Intermediate Driver is looking at the wrong hardware. Do you get any error messages?

Try dropping in GPSserial instead of GPSDriver and point it at the GPS program port and see if that works.

OK, thanks for your quick reply.
I'll try that and then come back with the result, as I think it could be of help to any other...

CarTho
Thomas J
 

SarahWard

Banned
I have found that the GPSdriver Library seems to work with HTC with built-in GPS.

Andrew's GPSSerial2 Library works with NON-HTC built-in GPS (like my Mitac P350) and importantly Bluetooth GPS.

This is what I have found when I sent out test programs to users of my freeware programs.

And you cannot use both Libraries in the same program without a low-level naming conflict. Pity as users could have chosen the option that works for them. :(

I have gotten around this by releasing an 'HTC' CAB (which uses the GPSdriver code) and a standard CAB using GPSserial2 Library code. ;)

HTC users seem to think this does the trick. :)

I am still not convinced these two CAB choices will cover every eventuality.

Sarah
 

CARTHO

Member
Licensed User
Longtime User
Gps

OK, thanks for your quick reply.
I'll try that and then come back with the result, as I think it could be of help to any other...

CarTho
Thomas J

Sorry, didn't see your question about error message.
No, no error message.
It seems that if I have contact with the Ublox-5 chip on COM 3 but no (valid) data is streaming.
The gps is only found when I set it to work on COM3 with baud 9600.

CarTho
Thomas J
 

agraham

Expert
Licensed User
Longtime User
I am still not convinced these two CAB choices will cover every eventuality.
It should do. Your so-called HTC CAB should work with any WM5.0 device or later with internal or external GPS as I believe all these devices come with the GPS Intermediate Driver. My iPAQ 214 has it although it does not have a GPS. It is called "External GPS" in Settings -> System and you point it to the COM port of the GPS on the Hardware tab and points your apps at the COM port on the Programs tab. The GPS Intermediate Driver allows more than one application to use the GPS at once whether they use the direct API as GPSDriver does or a serial port as most non-recent applications do. For example you can have a sat-nav app running alongside your app, or in my case Anquet Maps running alongside Pocket Streets on my HTC Diamond (which won't run GPSSerial!).

Only WM2003 devices should need GPSSerial to run your app because they don't implement the GPS Intermediate Driver so you should distribute your HTC CAB as standard and reserve GPSSerial for older devices.
 
Last edited:

SarahWard

Banned
Sorry, didn't see your question about error message.
No, no error message.
It seems that if I have contact with the Ublox-5 chip on COM 3 but no (valid) data is streaming.
The gps is only found when I set it to work on COM3 with baud 9600.

CarTho
Thomas J

Hi Thomas

FWIW, the users who had trouble with the GPS in my freeware apps had the same error. The gps port opened but no data was forthcoming. This seems to be the problem.

Sarah
 

CARTHO

Member
Licensed User
Longtime User
.NETcf2.0 was the problem in my case !

I have found that the GPSdriver Library seems to work with HTC with built-in GPS.

Andrew's GPSSerial2 Library works with NON-HTC built-in GPS (like my Mitac P350) and importantly Bluetooth GPS.

This is what I have found when I sent out test programs to users of my freeware programs.

And you cannot use both Libraries in the same program without a low-level naming conflict. Pity as users could have chosen the option that works for them. :(

I have gotten around this by releasing an 'HTC' CAB (which uses the GPSdriver code) and a standard CAB using GPSserial2 Library code. ;)

HTC users seem to think this does the trick. :)

I am still not convinced these two CAB choices will cover every eventuality.

Sarah

I found a solution to my problem!
I removed (uninstalled) the .NETcf2.0, restarted the device and "poff" the gps is working like a clock (a clock ?). What ever...
I am using a Sunno U6 (HTC touch look alike) with a Marvell PXA310 @624 MHz, 128 Mb RAM, 256 Mb ROM, Memorycard of 8 Gb, GPS U-blox-5.

I've set the gps to COM3/9600 pgmport: COM2
My program use the GPSDriverlibrary and is "pulling" gps-data (position, speed etc...) every 30 seconds and sends them to my server for further push into MS-Mappoint and being drawn as figures moving around "in the world".

This is an application ordered by a customer of mine, they are having a taxi-company with nearly 55 cars...

Nothing was ever changed in the program, I just copied it into the U6 and started it.

Hope for the best of luck with your project !

CarTho
Thomas J
 

agraham

Expert
Licensed User
Longtime User
It seems HTC & Clones DO work with the GPSdriver Library. Nice.
Of course they do! I've been trying to tell you that. The spur to writing GPSDriver was the known problem with HTC devices and the .NET Serial Port. That's the main reason Erel asked me to write it.

I removed (uninstalled) the .NETcf2.0
Whatever the problem was you must still have CF2.0 on your device as the GPSDriver and Basic4ppc require it. The Sunno U6 comes with WM6.1 which has CF2.0 ready installed in ROM and can't be uninstalled. If you tried to install it separately it should have given you an error message so I am puzzled as to what you uninstalled.
 

CARTHO

Member
Licensed User
Longtime User
Of course they do! I've been trying to tell you that. The spur to writing GPSDriver was the known problem with HTC devices and the .NET Serial Port. That's the main reason Erel asked me to write it.

Whatever the problem was you must still have CF2.0 on your device as the GPSDriver and Basic4ppc require it. The Sunno U6 comes with WM6.1 which has CF2.0 ready installed in ROM and can't be uninstalled. If you tried to install it separately it should have given you an error message so I am puzzled as to what you uninstalled.

This is a "special" Sunno U6 direct from China. It has WM 6.5 Pro.
I installed CF2.0 without err-mess because some program told me it was needed. Then I tried my own program and so it was.

Maybe I triggered something when I installed and uninstalled CF2.0 ?
I really can't tell.
I'm happy it works so well.

Thanks for all support!

CarTho
Thomas J
 
Top