# GM862-gps hangs after uploading a python script

**URL:** <https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652>\
**Category:** Development Boards\
**Created:** [February 26, 2011, 7:19pm UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652 "2011-02-26T19:19:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![juffyvega12590](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@juffyvega12590](https://community.sparkfun.com/u/juffyvega12590)\
**Post date:** [February 26, 2011, 7:19pm UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652/1 "2011-02-26T19:19:29Z")

</div>

I have GM862 -GPS evaluation kit. I bought it here in sparkfun a month ago.

[http://www.sparkfun.com/products/478](http://www.sparkfun.com/products/478)

At first there is no problem in uploading and executing python scripts in the module.

But after a couple of times writing and executing python scripts in the module, it then became unstable.

When DTR is set to high (programming mode) I have no problem in executing AT commands in the module, but after uploading a script and setting the DTR to low (Execution mode) and then rebooting the device, there is no reaction coming from the module.

I tried rebooting the device for a couple of times but it seems no reaction.

I am using Rsterm in uploading Python scripts into the module. And here is the code i made, it is not yet finish but it compiles and works fine.

##### Config

sms\_password = ‘jubela’

##### 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 debugmsg(msgtext):

msgtext = msgtext.replace(‘\r’, ‘\r’)

msgtext = msgtext.replace(‘\n’, ‘\n’)

print msgtext

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’)

##################################################################################

###### Init

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)

I don’t know why this is happening. It cost me a lot in buying this device and now turns out like this.

Is there any solution in making the module stable again?

Do I need to upgrade my firmware from .400 to 403?

Or maybe the problem is on my script?

---

<div class="post-metadata">

**Author:** ![njensen](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@njensen](https://community.sparkfun.com/u/njensen)\
**Post date:** [May 12, 2011, 9:12pm UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652/2 "2011-05-12T21:12:14Z")

</div>

What happens if you make a very simple script without the powersave… only a “print” or something like that ?

---

<div class="post-metadata">

**Author:** ![LoukakIS](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@LoukakIS](https://community.sparkfun.com/u/LoukakIS)\
**Post date:** [August 11, 2011, 8:30pm UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652/3 "2011-08-11T20:30:13Z")

</div>

Hello,

the function float() doesn’t work on me either. On pythonwin the function works, but on my gm862 it doesn’t and I need it. What should I do?

---

<div class="post-metadata">

**Author:** ![f1fan3584](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@f1fan3584](https://community.sparkfun.com/u/f1fan3584)\
**Post date:** [September 4, 2011, 12:49am UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652/4 "2011-09-04T00:49:19Z")

</div>

For floating point math, you can scale #'s or use a math co-processor, Sparkfun sells one (Floating Point Co-Processor uM-FPU v3.1).

---

<div class="post-metadata">

**Author:** ![mzed](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@mzed](https://community.sparkfun.com/u/mzed)\
**Post date:** [September 17, 2012, 10:48pm UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652/5 "2012-09-17T22:48:11Z")

</div>

Hello,

How did you solve the problem occuring on GM862-GPS with sparkfun EVK ?

Even a simple script doesn’t seem to be executed by the module.

import SER

a=SER.send(“hello world”)

The module hangs until I switch it off. No commands are accepted.There are some symbols displayed on the terminal screen.

Any idea or clue please ? It would be very helpfull.

Thanks

---

<div class="post-metadata">

**Author:** ![belkacem](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@belkacem](https://community.sparkfun.com/u/belkacem)\
**Post date:** [June 16, 2013, 2:10pm UTC](https://community.sparkfun.com/t/gm862-gps-hangs-after-uploading-a-python-script/19652/6 "2013-06-16T14:10:07Z")

</div>

I’m having some trouble to update my GM862-GPS Firmware :

after few moment the xfp tool shows the error message :

Error : FlashsendStream - Error rx (0x000061B2 -0x000161B1), Code:0 (Code: -9)

please can you help me to figure this out.
