beautypg.com

3 enable python script, 4 execute python script – Rainbow Electronics GM862-GPS User Manual

Page 65

background image





Easy Script

in Python

80000ST10020a Rev.8 - 01/10/08

Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved

page 65 of 100

If instead of Hyper Terminal you use Procomm Plus application the script text should be sent using
“Send File”, selecting “Raw ASCII” or “ASCII” as Transfer Protocol. If you use “ASCII” transfer
protocol, be sure the options “Expand tabs” and “Expand black lines” are not selected.

3.1.3 Enable Python script


Command: AT#ESCRIPT=“< script_name >“
AT#ESCRIPT?

• < script_name >: file name


Select the Python script which will be executed (the enabled script) from the next start-up and in every
future start-up using the AT#ESCRIPT command. In case the Python script consists of more than one
file only the main file should be executed.
First choose the script you want to enable between the ones you’ve downloaded:

AT#LSCRIPT? can help you checking the names of the scripts;
AT#ESCRIPT? can help you check the name of the script that is enabled at the moment

NOTE: There is no error return value for non existing script name in the module memory typed in
command AT#ESCRIPT. For this reason it’s recommended to double check the name of the script
that you want to execute. On the other hand this characteristic permits additional possibilities: like
enabling the Python script before downloading it on the module or non having to enable the same
script name every time the script has been changed, deleted and replaced with another script but with
the same name. Note also that the file extension must be .py.
For example:

AT#ESCRIPT=”a.py”

Wait for enable result: OK.

3.1.4 Execute Python script


The Python script you have downloaded to module and enabled is executed at every module power
on if the DTR line is sensed LOW (2.8V at the module DTR pin - RS232 signals are inverted -) at start-
up, (in this case no AT command interface is connected to the modem port) and if the script name you
enabled matches with one of the script names of the scripts you downloaded.

21

21

Note: Python script will be executed when the module is powered ON and if the serial cable has previously

been disconnected.