![Telit Wireless Solutions GM862GPS Series Technical Manual Download Page 47](http://html1.mh-extra.com/html/telit-wireless-solutions/gm862gps-series/gm862gps-series_technical-manual_1083661047.webp)
TECHNICAL MANUAL
Telit GM862-GPS
Quad Band GPS Data Terminal Module
Pag.47 of 79
Rev. 0
3.13.9 Executing a Python script
The steps required to have a script running by the python engine of the module are:
- write the python script
- download the python script into the module NVM
- enable the python script
- execute
it..
3.13.10
Write Python script
A Python script is a simple text file, it can be written with any text editor but for your
convenience a complete Integrated Development Environment (IDE) is included in a
software package that Telit provides called
Telit Python Package
.
Remembering the supported features described in 3.13.1, it is simple to write the script
and test it directly from the IDE.
The following is the "Hello Word" short Python script that sends the simplest AT command
to the AT command parser and waits for response, then ends.
import MDM
print 'Hello World!'
result = MDM.send('AT\r', 0)
print result
c = MDM.receive(10)
print c
3.13.11 Download
Python
script
The Script can be downloaded in the module using the #WSCRIPT command.
In order to guarantee your company know-how, you have the option to Hide the script text
so that the #RSCRIPT command does not return the text of the script and keeps it
"confidential", you can see only the name of the script with the #LSCRIPT command.
Remember that if you chose to hide the script text it's your responsibility to keep
information on what is executing the module, for example by naming the script depending
from the application and version of the script.
In order to download the script, first you have to choose a name for your script in the
module taking care that:
- it must have extension .py;
- the maximum allowed length is 16 characters;
- script name is case sensitive.
Then you have to find out the exact size in bytes of the script (for example right clicking on
the file and selecting “properties”)
The script download is done regardless the previous serial settings at 115200 baud 8-N-1
with hardware flow control active.
For example (script name and size are examples):
AT#WSCRIPT=”a.py”,110
wait for the prompt
>>>
and use “Send Text file” with ASCII Setup: Send line ends with line feeds in
HyperTerminal enabled.