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.


Read NMEA from Server


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 01-22-2008, 07:22 PM
schimanski's Avatar
Knows the basics
 
Join Date: Oct 2007
Location: Germany
Posts: 63
Thumbs up Many thanks

Very best thanks, Erel. That what i'am looking for....
Reply With Quote
  #12 (permalink)  
Old 01-28-2008, 06:56 PM
schimanski's Avatar
Knows the basics
 
Join Date: Oct 2007
Location: Germany
Posts: 63
Default Only one small problem..

Hello Erel,

thanks for your code. It works very best. But now i have one problem with this code: When the server breaks the connection, my application will stop and I can't do anything. The only thing is to end the application with the task-manager. When there is no data, i can handle the problem, but when the connection breaks, i don't no, how to handle this error.




...schimanski
Reply With Quote
  #13 (permalink)  
Old 01-30-2008, 06:59 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Can you find the line that gets blocked?
Reply With Quote
  #14 (permalink)  
Old 01-30-2008, 07:31 AM
Senior Member
 
Join Date: May 2007
Posts: 197
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

I had a similar problem, as mentioned in your first post,that the string does not always start with "$GP..." so I am checking it using strindexof():

instring = Serial.InputString
...
sats() = StrSplit(instring,",")
..
If StrIndexOf (sats(0) , "SA",0) > -1 Then gsa 'for string $GPGSA

the complete application code is here
http://www.basic4ppc.com/forum/showt...=9108#post9108
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #15 (permalink)  
Old 01-31-2008, 07:01 PM
schimanski's Avatar
Knows the basics
 
Join Date: Oct 2007
Location: Germany
Posts: 63
Default Lock up when server-connection is interuppted

Hello Erel, hello Derez!

I can't say, in which line the application locks up. The only thing is to end the app with the task-manager. I think, that the problem is in the sub timer2_tick, because the image4 (it's a little icon 15x15) doesn't change after breaking the server connection.
My english is not so good, so I don't know the function of client.value=server.accept. Is it nessesary to use this line?

Reply With Quote
  #16 (permalink)  
Old 01-31-2008, 08:25 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

server.accept should be called in the server code.
It creates the connection with the client.
The client object that is returned should be used to communicate with the real client.
Can you upload your code file?
Reply With Quote
  #17 (permalink)  
Old 02-07-2008, 12:00 PM
schimanski's Avatar
Knows the basics
 
Join Date: Oct 2007
Location: Germany
Posts: 63
Default Lock up when the server send no data

Hello!

I have written a smal testapp to see, where the problem is. When the server sends no data, the application will stop as long, as the server sends data again. When there is data again, the Application runs without any problems. Is there no data, i only can stop the app with the task-manager. Here the code:

Sub App_Start
Form1.Show
timer3.Enabled=true 'timer3=1000 ms'
client.New1
Client.Connect ("87.139.??.???",11112)
filestream.New1(client.GetStream,false)
End Sub

Sub Timer3_Tick
If client.DataAvailable=true Then
filestream.ReadString
label5.Text="data!"
Else
label5.Text="no data!"
End If
End Sub

The server-connection is always available!



Now i have tested more:

The server sends every two seconds a NMEA-protocol. When the timer3 is 2000, the app will run without problems. Is the timer3 500ms, the app will stop, when there is no data. Is the timer3 1000ms, sometimes the app will lockup and another time, the app run without problems, when there is no data. But I need a timerintervall from 500, because when the timer is bigger than 500, i only get old data, not the actually.

Last edited by schimanski : 02-08-2008 at 03:59 PM. Reason: More tests...
Reply With Quote
  #18 (permalink)  
Old 02-08-2008, 02:45 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Your client code is fine and it should not be blocked.
Can you post your server code?
Reply With Quote
  #19 (permalink)  
Old 02-08-2008, 03:58 PM
schimanski's Avatar
Knows the basics
 
Join Date: Oct 2007
Location: Germany
Posts: 63
Default no server code

Hello Erel!

I can't post the server code, because it's not my application. It is a police-server with an GPS-application, that only provides GPS-data for every officer, who is in duty. Today we have only Notebooks with the same software to get this data. Now, i want' to write a client-application for PDA. I only can say, that the server provides every two seconds a NMEA-String (RMC & GGA) on one port and when there is no data, the server stops providing, but the connection is always available. I don't know the developer of this application, so I can't ask him.
I can' t understand the effects of the different timerintervalls.
Reply With Quote
  #20 (permalink)  
Old 02-08-2008, 05:07 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by schimanski View Post
I can' t understand the effects of the different timerintervalls.
This is is a wild guess but is it anything to do with the fact that if you wait two seconds then a full message is probably available but polling more often than that it is likely that only part of a message is available. Does your app make the assumption that a full message always arrives as a single read? My experience of the network library is that even small messages can arrive as separate packets so you have to be prepared to reassemble multiple reads into a single message - which is what I believe the GPS library GPSStream method does.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
One server adn more clients Byak@ Questions & Help Needed 2 08-12-2008 11:59 AM
Comunicating with a Telnet Server lu_ozzie Questions & Help Needed 16 05-05-2008 06:25 PM
Simple NMEA logger Bruno Share Your Creations 0 05-02-2008 08:43 PM
Checksum in nmea wolfgang Code Samples & Tips 0 02-15-2008 02:42 PM
New server Erel Forum Discussion 12 11-06-2007 05:21 PM


All times are GMT. The time now is 06:59 AM.


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