473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

pySerial

Hi,

I am using pySerial for communication with modem.

Does anyone knows which values are for what in these variables?

xonxoff=0
rtscts=0
dsrdtr=0

if xonxoff=0 is it hardware control on or of (logic says it would be off
, but who knows).
Second question is: do I need to send \n or soemthing when I use write().

I would like to do:

ser.write("AT")
print ser.readline()

and get "OK".

Am I doing soemthing wrong?

tnx in advance.
Dec 18 '07 #1
3 2400
On Dec 19, 10:49 am, __zip__ <z...@got.no.mailwrote:
Hi,

I am using pySerial for communication with modem.

Does anyone knows which values are for what in these variables?

xonxoff=0
rtscts=0
dsrdtr=0

if xonxoff=0 is it hardware control on or of (logic says it would be off
, but who knows).
Disclaimer: It's a long time since I bit-bashed a UART ...

Where those relate to bits in the control registers, I'd expect 1 maps
to 1 and 0 maps to 0. Where they relate to functionality provided by
the software, I'd expect 1 to mean "do it" and 0 to mean "don't do
it". Do you have any reason for assuming otherwise?
>
Second question is: do I need to send \n or soemthing when I use write().
That depends on what the modem is expecting.
>
I would like to do:

ser.write("AT")
print ser.readline()

and get "OK".
And what did you get"?
>
Am I doing soemthing wrong?
Probably what you are doing wrong is not reading the docs.
http://pyserial.sourceforge.net/
"""Be carefully when using "readline". Do specify a timeout when
opening the serial port otherwise it could block forever if no newline
character is received. Also note that "readlines" only works with a
timeout. "readlines" depends on having a timeout and interprets that
as EOF (end of file). It raises an exception if the port is not opened
correctly.
"""

When you have a problem, show all the code (including the opening and
configuring of the port) and tell us what did happen with that code.
Dec 19 '07 #2
Tnx for help. Done it.

The problem was that returning bytes were on few lines and I
didn't look after first \n :(

tnx.
Dec 19 '07 #3
__zip__ wrote:
Hi,

I am using pySerial for communication with modem.

Does anyone knows which values are for what in these variables?

xonxoff=0
rtscts=0
dsrdtr=0

if xonxoff=0 is it hardware control on or of (logic says it would be off
, but who knows).
Second question is: do I need to send \n or soemthing when I use write().

I would like to do:

ser.write("AT")
print ser.readline()

and get "OK".

Am I doing soemthing wrong?

tnx in advance.
Just a note:
Most modems expect CR (\r), rather than \n.

Dec 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Bob Greschke | last post by:
We have some equipment that communicates at 57600 baud RS232. The path from the PC is USB to a Phillips USB hub, then off of that a TUSB3410 USB/Serial converter. The driver for the 3410 chip...
4
by: Zarathustra | last post by:
Hi, where I can find the pyserial handbook?? THanks
8
by: Alejandro | last post by:
Hi: I'm using pySerial to talk to a RS232 to RS485 converter. In order to control the converter, I need to control the DTR line to enable/disable de RS485 driver. In particular, I need to : ...
2
by: Jon | last post by:
Hi, I wrote some code to read in info from a port using pyserial. the code reads info sent by a box that is connected to my computer by an rs232-to usb adapter. When I was writing the code and...
15
by: Lone Wolf | last post by:
I'm trying to get data through my serial port from a CMUcam. This gizmo tracks a color and returns a packet of data. The packet has nine data points (well, really eight since the first point is...
3
by: Ron Jackson | last post by:
I am using Python 2.5 on Windows XP. I have installed Pyserial and win32all extensions. When I try to run the example program scan.py (included below), or any other program using pyserial, as...
0
by: pauland80 | last post by:
<snip> <snip> Late thanks for your both answers! (Please excuse me for that) The problem was a bug in the device firmware. But before finding this, I dugg lightly in the pyserial source...
0
by: [david] | last post by:
http://pyserial.sourceforge.net/ "port numbering starts at zero, no need to know the port name in the user program" But the implementation in SerialWin32 is just (Portnum +1)
3
by: naveen.sabapathy | last post by:
Hi, I am trying to use virtual serial ports to develop/test my serial communication program. Running in to trouble... I am using com0com to create the virtual ports. The virtual ports seem to...
2
by: bryanleo | last post by:
We are trying to read data from a microcontroller and interface it through serial port. The output is then displayed in Python using Pyserial or the hyperterminal, the former is more important ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.