Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


GPS - outofmemoryexception since WM6


Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 10-21-2007, 06:38 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

@Agrartec, try to read the data without first checking if there is any data:
Code:
Sub Timer1_Tick
s = serial.InputString
if StrLength(s) > 0 then GPS.GPSStream(serial.InputString)
End Sub
Set the timer interval for 1000 ms.
If there are errors because no data is available try to add an ErrorLabel in this sub:
Code:
Sub Timer1_Tick
ErrorLabel(Timer1Err)
s = serial.InputString
if StrLength(s) > 0 then GPS.GPSStream(serial.InputString)
return
Timer1Err:
End Sub
Reply With Quote
  #22 (permalink)  
Old 10-22-2007, 02:00 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default

OK, now I achieved that the "outofmemorxexception" -error doesn`t appear any more. The errorlabel works and somehow the portsplitter as well (maybe I used an older version at first, sorry).
But I don`t receive GPS-data any more. Also GPS4PPC disconnects after 5 seconds if I use the portsplitter-port.
Reply With Quote
  #23 (permalink)  
Old 10-22-2007, 02:37 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,689
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Agrartec View Post
The errorlabel works and somehow the portsplitter as well (maybe I used an older version at first, sorry).
In what way are they "working" when you are not receving any data? You are not really giving us much detail.

I assume that you have tried Erels' code. Does "serial.InputString" ever return any data at all or is it always a null string?
Reply With Quote
  #24 (permalink)  
Old 10-22-2007, 03:29 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default

Ok, sorry Agraham. I installed the latest JAL Portsplitter and now the error doesn`t appear any more. Also by using an errorlabel like Erel said above, I could get rid of the error. I think using the Portsplitter is the better way to solve my problem. The program opens the serialport and gps runs.
But now I don`t get any gps-data. I created a label to count the serial.inbuffercount, but it stays at 0.
Reply With Quote
  #25 (permalink)  
Old 10-22-2007, 05:43 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,689
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hmmm - stubborn problem isn't it.

It seems, from the gpstuner site, that using JAL Port Splitter on a P3300 does allow a .NET based program to read the GPS via the .NET serial port class. If we assume that this is so then there would seem to be no reason why a B4PPC app cannot do the same. As it presently cannot there would seem to be be two areas where the problem could lie.

a) The JAL Port Splitter is not configured properly.

I assume that you have the input port set to COM4 and the virtual output port to something different. GPStuner indicates that COM5 works so I assume you are using that. I don't know what other configuration might be needed


b) The B4PPC app is not using the serial port correctly.

I assume that you have altered the COM port that your app is using to be COM5. Your first post implies that you had a B4PPC program that worked previously before WM6. Have you tried that program with the Port Splitter exactly as it was before with only the COM port changed? Also have you tried Erels' GPS4PPC unmodified apart from changing the COM port to that of the Splitter?

However at the bottom of this thread where someone has a similar problem

http://www.gpstuner.com/forum/viewto...139dc7bb5065ef

I found this
Quote:
Of course, Jaluna also goes on to state that you may need to use the Port Splitter built-in to WinMobile 5.0 and point the two splitters at each other to make the final connection. This does not sound like a fun experiment, and I'm truly sorry you have to jump thru this many hurdles to get the software to work for you...
It doesn't mean anything to me as I have never used WM5 -but maybe WM6 has a similar built-in splitter.

What I don't understand is how your application worked at all under WM5 on a P3300 as all the posts I have found imply that .NET apps won't work. Maybe it was because it was using the old serial library that is not .NET based. In the serial help Erel states that the old libraries don't work under .NET 2.0 yet I thought that WM5 came with .NET 2.0 included. I'm puzzled, any comments Erel?

I'm afraid this is looking like a fundamental problem with the P3300

EDIT:- I've since seen a suggestion, I don't know if it is true, that the P3300 with WM5.0 didn't have .NET installed. Was this so? Did you have to install the Compact framework yourself? If so it must have been .NET 1.0. Does WM6 come with .NET 2.0 in ROM? You could always try installing .NET 1.0 SP3 and go back to the old serial libraries to see if that will work.

Last edited by agraham : 10-22-2007 at 05:50 PM.
Reply With Quote
  #26 (permalink)  
Old 10-22-2007, 07:42 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default

At first, thank you very much for taking your time to help me Agraham.

Of course I know that sometimes very little mistakes or malconfigurations happen and the search for it is a long way.
But I think, I configured the portsplitter and the progs correctly.
When I used GPSTuner some month ago under WM5 then I had to use the portsplitter as well, but the b4ppc-progs worked without the splitter. I use port 4 as incoming gps port and port 5 as virtual port.
Erels GPS4ppc worked without help on WM5.
With WM6 now: Also the installed Version of GPS4ppc (not changed by me) disconnects after the timeout of 5 seconds because serial.inbuffercount stays at 0. And I used the portsplitter too.

What did you mean here:
Quote:
Have you tried that program with the Port Splitter exactly as it was before with only the COM port changed?
which serial.dll should I use then? I changed ervery prog to serial2.dll. Or is there a way to use the old serialdevice.dll?
My device has .net cf 1.0 installed with WM5 and .net cf 2.0 with WM6. I never had to install CF by Hand. Is it possible to install .Net 1.0 now? I thought it is already within .Net 2.0.

I think there is an error with .Net 2.0 and some buildIn GPS-receivers. I found similar problems in a .Net-forum. I just don`t understand why it works very good with some progs or at least by using portsplitter. Maybe other gps-progs, developed with microsofts devolpment tools on .net cf, wouldn`t work either? But except of GPSTuner I don`t know any.
Reply With Quote
  #27 (permalink)  
Old 10-23-2007, 06:49 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

WM5 comes with .Net CF 1.0 in ROM and WM6 comes with .Net CF 2.0.
You could try to install .Net CF 1.0 on your device and then use SerialDevice instead of Serial2.
.Net CF 1.0 can be downloaded here.
After installing .Net CF 1.0 check Hardware.NetVersion to make sure you are running .Net CF 1.0.
Reply With Quote
  #28 (permalink)  
Old 10-23-2007, 09:20 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,689
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Agrartec View Post
What did you mean here: which serial.dll should I use then? I changed ervery prog to serial2.dll. Or is there a way to use the old serialdevice.dll?
I meant toally unmodifed but forget that. Now that we have more information the summary of your situation is that :-

a) Your application worked with WM5 under .NET 1.0 using the original serial library.

b) Your application breaks under WM6 using .NET 2.0 and the serial2 library because of an unresolved incompatibility between the .NET SerialPort class and the P3300 hardware/firmware. Other .NET based software trying to use SerialPort also suffers from this problem but this is not likely to be fixed by HTC as they only support TomTom on the device.

c) Your solution (hopefully) is to install .NET 1.0 SP3 and go back to your original software with the original serial library. I hope this works as it is all that I think that can be done.
Reply With Quote
  #29 (permalink)  
Old 10-23-2007, 01:26 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default

Oh, it`s so annoying. The installation of .Net 1.0 SP3 tells me that it couldn`t find a correct .Net-Version suitable for my device. (sounded strange to me, but finally it won`t install .Net 1.0)
I tested an old prog with serialdevice.dll and it couldn`t open the serialport.

So, the last and unlikeliest solution would be to go back to WM5?!

And I can`t give my progs to other people using WM6.
Reply With Quote
  #30 (permalink)  
Old 10-23-2007, 01:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,689
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Look at this thread towards the end - last three messages.

http://www.gadgetapps.net/forum/viewtopic.php?t=287

At first he got the same error as you but eventually got it going but he doesn't know how!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:36 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0