Click here to Skip to main content
15,906,816 members

Comments by fridrai raissi (Top 6 by date)

fridrai raissi 3-Jul-13 8:26am View    
thx for ur quick answer :)
no error message is mentionned, i just find the cursor blinking near dataadapt :O
fridrai raissi 28-Jun-13 14:40pm View    
target audience to excute the application are not simple people, to whom we should simplify the expression, they're security agents who manage the stolen articles' tracking :)
here is the python scrypt that i'll upload to gm8622 for tracking, would u like to take a view and tell me what's wrong? and should i make the ddmm.mmmm to real convertion directly on the tracker, so that the outgoing information be a "real number" one? i mean instead of converting on vb.net, i convert on python, i'll be gratefull if you agree to correct it :)
<pre lang="python">
##### Constants #####

TRUE = 1
FALSE = 0
LOOP = 1
SPEEDLIMIT = 30

##### Modules #####

#Use serial
import SER

#Use build in module
import MOD

#Use AT command interface
import MDM

#Use GPS
import GPS

###### General Functions ######

#Debug message
def errorsmg(msgtext):
somme = msgtext #msgtext = msgtext.replace('\r', '\\r')
#msgtext = msgtext.replace('\n', '\\n')
print (somme)

SER.send(msgtext + '\r\n')
#f = open('log.txt','ab')
#f.write(msgtext + '\n')
#f.close()

#GPS status
def gps_status(gpspos):
debugmsg('Retrieving GPS status')

gpspos_parts = gpspos.split(',')

if ( (gpspos_parts[5] == '2') or (gpspos_parts[5] == '3') ): #2D or 3D fix
#debugmsg('GPS fix "' + gpspos_parts[5] + '" ie valid');
status = TRUE
else:
#debugmsg('GPS fix "' + gpspos_parts[5] + '" ie not valid');
status = FALSE

return status

###### SMS Library Functions ######

#Setup SMS
def sms_setup():

debugmsg('Setting up SMS')

MDM.send('AT+CMGF=1\r', 0)
res = MDM.receive(50)#5 sec
MOD.sleep(1)#wait 0.1sec

debugmsg('SMS setup: ' + res)

def testspeed(gpspos):

#debugmsg('Test if speed is over limit')

gpsdataparts = gpspos.split(',')
currentspeed = gpsdataparts[7]
debugmsg('Time is ' + gpsdataparts[0] + ' UTC time')
debugmsg('latitude is ' + gpsdataparts[1])
debugmsg('longtitude is ' + gpsdataparts[2])
debugmsg('heading is ' + gpsdataparts[6])
debugmsg('Speed is ' + gpsdataparts[7] + ' km/hr')
debugmsg('date is ' + gpsdataparts[9])

if (gps_status(gpspos) == TRUE):
debugmsg('Has GPS Fix')
if (float(gpsdataparts[7]) < 60.0):
debugmsg('Speed UNDER the speed limit')

else:
debugmsg('Has NO GPS Fix to be tested for overspeeding')



SER.set_speed('115200','8N1')
SER.send('\r\n--------------------\r\n\r\n')

debugmsg('Running...');

#Set verbose error reporting
MDM.send('AT+CMEE=2\r', 0)
MDM.receive(50)#5 sec
MOD.sleep(1)#wait 0.1sec

#Setup SMS
sms_setup()

#Main loop
while (LOOP==1):

debugmsg('Entering loop')

#Retrieve current position
gpspos = GPS.getActualPosition()

debugmsg('Position: %s' % gpspos)

#Retrieve GPS fix status
gps_statusnow = gps_status(gpspos)

#Save last valid position
#If position fix valid, or none recorded already, use last retrieved
if ( (gps_statusnow == TRUE) or (gps_statusnow == FALSE) ):
testspeed(gpspos)

debugmsg('Powersave for 10 seconds')

#Powersave for 10 seconds
MOD.powerSaving(10)

</pre>
fridrai raissi 27-Jun-13 20:23pm View    
thx matt for answering :)
i would like to ask u about the textbox on which i'll paste the "gm862-lat" to convert through a button on a new one, what should i do to make the written lat convertable?
should i just copy and paste this text on the convert-button-onclick sub?
and what did you mean by this part:
rawVaue - Val("dddmm.mmmm") ' Use the actual number string here ?
is the notification related to the gm862answer that i'll insert in the first text box before clicking on convert button?
thanks again :)
fridrai raissi 8-Jun-13 18:48pm View    
another punctuation mistake, no need for the comma after the the longitude, i've replaced it by:
[code]
If txtlongitude.Text <> String.Empty Then
Longitude = txtlongitude.Text.Replace(" ", "+")
queryAdress.Append(Longitude & "+")
End If
[/code]
and now it works
last question: can i get how many satellites has my gps tracker detected ?
fridrai raissi 6-Jun-13 18:38pm View    
i've tried to replace it by
[code]'build latitude part query
If txtlatitude.Text <> String.Empty Then
Lattitude = txtlatitude.Text.Replace(" ", "+")
queryAdress.Append(Lattitude + "," & "+")
End If

'build longitude part query
If txtlongitude.Text <> String.Empty Then
Longitude = txtlongitude.Text.Replace(" ", "+")
queryAdress.Append(Longitude + "," & "+")
End If
[/code]
but it still do not find by geographical coordinates :'(