PPC is hanging after switching GPS on/off

Discussion in 'Questions (Windows Mobile)' started by BerndB, May 18, 2008.

  1. BerndB

    BerndB Member Licensed User

    FS Loox 720
    GPS CF-Card: SysOnGPS
    WM 2003 SE

    GPS using Serial2.dll + optimized compilation is very unstable with my device.:sign0137:

    When switching GPS on/off several times, the PPC is hanging not later than after the 3rd time.

    It hangs after either PortOpen = true while starting GPS
    or PortOpen = false when deactivating GPS.

    It happens with the GPS CF-Card as well as if I take an emulation of a GPS-Log with the Serilot Port splitter. ( So I think it's not a problem of the CF-Card).

    There is NO problem with the same "GPS-Code" when using SerialDevice.dll and NOT optimized compilation.

    And there is NO problem with PortOpen and Serial2.dll in an other App without GPS but IR as serial input.

    Does anybody else have problems like that?
    Or does anyone even has a solution:sign0085:

    I'd rather like to use the optimized version.
    But it's not possible if it hangs again and again:sign0161:

    Thanks a lot,
    Cheers
    Bernd


    Code:
    Sub Globals
      
    'Declare the global variables here.

    End Sub

    Sub App_Start
      Form1.Show
      
    Serial.New2(4,4800,"N",8,1)
      
    GPS.New1
      timer1.Interval=
    1000
      timer1.Enabled=
    false
    End Sub


    Sub gpsON_Click
       
    Serial.PortOpen = true
       gpsON.Enabled = 
    false
       Form1.Refresh
       Timer1.Enabled = 
    true
       gpsOFF.Enabled = 
    true
       Form1.Refresh
    End Sub
    Sub gpsOFF_Click
       Timer1.Enabled = 
    false
       gpsOFF.Enabled = 
    false
       Form1.Refresh
       
    If Serial.PortOpen Then Serial.PortOpen = false
       gpsON.Enabled = 
    true
       ListBox1.Clear
       Form1.Refresh
    End Sub

    Sub Timer1_Tick
       
    If Serial.InBufferCount>0 Then 
       
    gps.GPSStream(Serial.InputString)
       
    End If
    End Sub

    Sub GPS_GPSDecoded
          ListBox1.Clear
          ListBox1.add(
    "status: "gps.status)
          ListBox1.Add(
    "Number Of Satellites: " & gps.NumberOfSatellites)
          ListBox1.Add(
    "Time: " & gps.UTCTime)
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What is the value of Serial.PortOpen after trying to close it?

    Can't you avoid closing and opening the port several times?
     
  3. BerndB

    BerndB Member Licensed User

    Hi Erel,
    thanks for taking care.

    I can't access its value, because the PPC hangs.
    So the last value displayed is TRUE
    from before Serial.PortOpen=false
    Code:
    Sub gpsOff_Click
       ListBox1.Add(
    "Off")
       Timer1.Enabled = 
    false
       ListBox1.Add(
    Serial.PortOpen)
       Form1.Refresh
       
    Serial.PortOpen = false
       ListBox1.Add(
    Serial.PortOpen)
       Form1.Refresh
    End Sub
    While having rests on hiking or cycling tours I need to shut off the PPC because of battery saving.
    Apart from that it would love to have it stable.;)

    regards
    Bernd
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. BerndB

    BerndB Member Licensed User

    in Basic4ppc about it says

    But I will reinstall and tell what happens.


    Edit:
    I deleted Net CF2.0 on the device and reinstalled the new downloaded one.

    But sadly nothing changed.
     
    Last edited: May 19, 2008
  6. Erel

    Erel Administrator Staff Member Licensed User

    Unfortunately there is not much to do. Serial2 is a simple wrapper around Microsoft SerialPort class.
     
  7. BerndB

    BerndB Member Licensed User

    :sign0161:
     
  8. agraham

    agraham Expert Licensed User

    Have you tried optimised compile with the old SerialDevice dll? I haven't actually tried it but I think it should work - unless Erel knows different ;)
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    The SerialDevice dll doesn't work properly with .Net CF 2.0 so you can't use it with the optimized compiler.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice