GPS - outofmemoryexception since WM6

Agrartec

Member
Licensed User
Hello guys,

I have a problem that I can`t solve since I updated my PPC to WM6.
If I use a GPS-program then I get the error: "outofmemoryexception" in codeline :
If serial.InBufferCount>0 Then
GPS.GPSStream(Serial.InputString)

I`m already using the serial2.dll (didn`t work at all with the other one).
Same error occurs when I use the gps-example from erel.
And I didn`t have this error on WM5.

Does anyone have an idea what is going on there?

Cheers

(I hope this hasn`t been answered somewhere here, if so then sorry, I didn`t find it.)
 

Agrartec

Member
Licensed User
Hi Erel,
no this does not happen immediatly. It can take 5 to 50 seconds after starting the GPS-receiver.
And this also happens with your "GPS4ppc". :confused:
But first it disconnected the GPS again after 4 seconds. Reconnecting gave me the same error at line 363.

What can this be?
 

Agrartec

Member
Licensed User
Yes, I made a softreset and tried TomTom Navigator that works fine. But the B4ppc-programs still make the error.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Maybe updating the .Net CF will fix it.
There were some issues with the serial ports with .Net CF 2.0 / .Net CF 2.0 SP1.
Please make sure your device is installed with .Net CF 2.0 SP2.
You can create a new application, add the Hardware library and check Hardware.NetVersion value.
.Net CF SP2 value is: 2.0.7045
It can be downloaded here: http://www.microsoft.com/downloads/...2F-07B5-4A8C-8A44-B4E1B196D5C0&displaylang=en
 

Agrartec

Member
Licensed User
If I try to install this update then my device tells me that it already has it in the ROM.
The strange thing: I send my programm to a friend who owns a Asus P535 with WM6. He does not have this problem, but he doesn`t get a satfix (right after a satfix with another prog).

I have two HTC P3300 (artemis) and both show the outofmemory-error. I installed another Rom with a lot of free memory to one of my devices, but its the same problem.

Can someone else who has a device with WM6 try out Erels GPSApp, please. And tell me if it works.
 

Agrartec

Member
Licensed User
I`m still searching for an answer to this problem, so I found out that in the prog GPS4PPC follwing codelines seem to make trouble (however).

Sub Timer1_Tick
If serial.InBufferCount>0 Then
timeout = 0
GPS.GPSStream(serial.InputString) 'Takes the data received from the GPS to GPSStream.
Else
timeout = timeout + 1
If timeout = 5 Then mnuDisconnect_click
End If
End Sub

In my case the prog always disconnects the GPS after that 5 seconds and sometimes the errormessage from above occurs before.
So I think that the data doesn`t arrive. :sign0085:
 

agraham

Expert
Licensed User
Longtime User

Agrartec

Member
Licensed User
Thanks for that hint, agraham.

But in my case I could use the gps of my device under WM5 without any problems with Basic4ppc-progs. And every other gps-prog I found worked so far. Now, since I changed to WM6, I encounter this poroblem. Maybe it has to do with the new serial2.dll.
 

agraham

Expert
Licensed User
Longtime User
Thanks for that hint, agraham.

But in my case I could use the gps of my device under WM5 without any problems with Basic4ppc-progs. And every other gps-prog I found worked so far. Now, since I changed to WM6, I encounter this poroblem. Maybe it has to do with the new serial2.dll.
Exactly! - that was my implication. The serial2 library uses System.IO.Ports.SerialPort. This guy has got his code running under WM5 and 2003 on other devices so I suspect that his problem may also be under WM6 on an HTC P3300.
 

Agrartec

Member
Licensed User
I suspect that his problem may also be under WM6 on an HTC P3300.

I´m not sure, but I think not, because he wrote this message in January, but the update to WM6 for this device came out on 5th of October.

But maybe you are right that it depends on the code in the dlls. I`m not an expert in these things. I don`t know what changed from serialdevice.dll to serial2.dll.

It`s just bad luck for me. I need my progs often for work and share them with friends who do the same job and who have the same device (because I told them it would be so useful). Buying a software that can do the work which I need would cost more than 400 Euros.
I don`t hesitate now, there must be a way to get it running. It would be very helpful if some people with WM6 could try out GPS4PPC, so I know that it is only with my device.
 

agraham

Expert
Licensed User
Longtime User

Erel

B4X founder
Staff member
Licensed User
Longtime User
The Serial2 library is much simpler than the Serial library as it just wraps the SerialPort classes which where introduced with .Net CF 2.0.
It was tested with WM6.0 devices and it worked correctly.
Please try to use the Hardware library to check the allocated memory (GCAllocatedMemory).
The allocated memory should grow to a certain point and then the garbage collector should return it to a small value.
 

Agrartec

Member
Licensed User
The allocated memory should grow to a certain point and then the garbage collector should return it to a small value.

You are right Erel. That is happening, but at the point when the garbage collector frees the memory, this error comes up. The values are about 600000 at startup and about 200000 after the first reaction.
I also checked the .Net version --> it is the latest.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There seems to be a compatibility problem with the HTC p3300 and the .Net CF SerialPort class (which is used by Serial2.dll).

This quote is from: http://www.gpstuner.com/support.htm
It may have a solution for your problem.
Q: I have P3300 PDA (with integrated GPS).
When I launch GPS Tuner, I am asked to automatically configure GPS Settings.
After a few seconds the screen freeze and I have to soft reset my Pcket PC
A: Seems that the .NET Compact Framework's serial port reader is not fully compatible with P3300 device.
There is a workaround for this problem.
Please download the free JAL Port Splitter application and install it to your PDA.
Before starting GPS Tuner, please start Port Splitter and set your input GPS port (write manually COM4 into the box) and an output virtual port (for example COM5).
Then start GPS Tuner and set your GPS port same as Port Splitter's virual port.
 

Cableguy

Expert
Licensed User
Longtime User
Have You checkd for any driver updates for your gps device?
From what I could understand, there are only two possible causes to your problem....
An hardware issue, being it the firmware of the simple missbehavior of the gps chip, Or an software issue between .net cf and b4ppc (dll wise).

This put, have you tryed your previous v4 based app again?
Does it work?
Have you tryed diferent ports?
If so then it's problably a software issue.. but not b4ppc side..try looking deeper into the serial class...as for sure is were the problem resides
 
Top