Telit EZ10-GPRS/-PCS
Product Description
80269ST10014a, Rev. 3 – 26/09/05
Reproduction forbidden without written authorization by Telit Communications S.p.A.
Page 56 of 74
All Rights reserved – Right of modification reserved
send the string "hello" and receives a string of 10 bytes from SPI bus device on SS0 line, assigning
it to a.
3.3.6 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.3.6.1 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.3.4, 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.3.6.2 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.