hi.
I want to download a little script in module GE863-GPS, so, I follow somes instructions in roundsolutions.com. I make the download, enable and exec. of my scipt. I just want to print a simple string like “hello world” in hyperterminal.
my script is:
import SER
a=SER.send(“hello world”)
I make de download of that script, and I see nothing?
Someone can help me?
thanks and sorry for my english
How do I stop a script in Python? I’m working on a small Python script, and I want the entire script to stop if an integer is a certain value. The problem is, this piece of code is at the beginning of the script, and I can’t find a way to stop the entire script properly (without erroring). I’d like to know if there is a command I can use within this if-statement that stops my script. Many thanks!
[yahoo keyword tool ~ [overture ~ [traffic estimator ~ [adwords traffic estimator](http://www.keywordspy.com/overview/keyword.aspx?q=adwords%20traffic%20estimator)](http://www.keywordspy.com/overview/keyword.aspx?q=traffic%20estimator)](http://www.keywordspy.com/overview/keyword.aspx?q=overture)](http://www.keywordspy.com/overview/keyword.aspx?q=yahoo%20keyword%20tool)
ee14508:
hi.
I want to download a little script in module GE863-GPS, so, I follow somes instructions in roundsolutions.com. I make the download, enable and exec. of my scipt. I just want to print a simple string like “hello world” in hyperterminal.
my script is:
import SER
a=SER.send(“hello world”)
I make de download of that script, and I see nothing?
Someone can help me?
thanks and sorry for my english
Although I think by now you have either successfully solved this problem (99% chance) or left this. But I want to reply to this post so that other people know the solution to this problem-
Here in your script-
-
you haven’t set serial port speed
-
You will have to send ‘\r’ to send the string in serial port.
So, your script will become-
import SER
SER.set_speed('115200','8N1')
SER.send('test\r')
And for debugging with print you can follow jasonharper’s simple but effective class from
viewtopic.php?t=6289&highlight=serwriter
That class is-
class SerWriter:
def write(self,s):
SER.send(s+'\r')
sys.stdout = sys.stderr = SerWriter()
Thanks to jasonharper. I still copy and paste this part in every project
Hi everybody,
fireball003 and for everyone who need this,
by default, telit modems with CMUX capabilities, have this feature enabled. It means that if you want to send some string out over the serial port when you are running your script from telit python core, unless you have running on your pc a CMUX tool, you won’t see nothing on hyperterminal.
So, if you use SER, you have to disable CMUX feature first. How?..easy…
send this command:
at#cmuxscr=0
this way, you will see any string you send over the serial port. Something else, SER do not need to use ‘\r’. Anything you use as argument on SER.send() will be send to the serial port.
Try this:
import MDM
debug=1
if debug:
import SER
tx="at#cmuxscr=0\r"
MDM.send(tx,0)
SER.set_speed('any_speed_you_want','8N1')
#
# now put your code from here
#
when you want to use SER, try this:
if debug:
SER.send('Sending something')
#you will see on hyperterminal: Sending something
or
var='test'
if debug:
tx="this is a %s" %var
SER.send(tx) #you will see on hyperterminal: this is a test
Hope this help you guys.
Si necesitan esto en español u otras consultas, envienme un email.
cherreram:
this way, you will see any string you send over the serial port. Something else, SER do not need to use ‘\r’. Anything you use as argument on SER.send() will be send to the serial port.
I apologize, I mixed up with MDM where ‘\r’ is must to send each AT command. Yes, SER doesn’t require ‘\r’
BTW ‘print’ command is handy than SER command to me. And the SerWriter class above redirects print command to serial port. And so, I prefer that.