473,387 Members | 1,530 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,387 software developers and data experts.

read and write in a serial port with python

How can I read and write a radio connected to the computer with a serial port with python, the same way a hyperterminal does ?
I wrote this:

from Tkinter import *
import serial
se = serial.Serial()
se.baudrate = 9600
se.bytesize = 8
se.parities = 0
se.stopbits = 1
se.xonxoff = 0
se.rtscts = 0
se.timeout = 1
se.port = 0
print se.portstr
print se
se.close()

It seems to work, but when I try to communicate using
se.write('at')
se.readl([20])

I don't receive the expected answer, and it just reads what I wrote.

Someone can help me?
Apr 10 '08 #1
3 9787
Hi Charlotte1,
I have the same problem! Have you resolved it?
Sep 25 '09 #2
Glenton
391 Expert 256MB
Hi

I've used pySerial successfully in the past, though not with a radio. I found it to work pretty well in general, or at least the python part! Can you give us some more details? For example, what was the print out from the first bit of code you gave? Is there a particular reason for the parameters you choose there? Can you give us the exact print out for the second piece of code, and what you were expecting?
Sep 29 '09 #3
Hi!
I have resolved the problem. there was an error into the schematic of my board.
thanks.
Sep 30 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: collinm | last post by:
hi i send a command to a led display, the led display is suppose to return me some character i write a string on a serial port void ledDisplayExist() { char msg={'\0', '\0', '\0', '\0',...
6
by: Casey Bralla | last post by:
I'd like to read ASCII data from a serial port, but (once again) I'm having trouble getting started. (Can't seem to find the basic level of docs to get going <sigh>) I'd like to use only...
4
by: rowan | last post by:
I'm writing a driver in Python for an old fashioned piece of serial equipment. Currently I'm using the USPP serial module. From what I can see all the serial modules seem to set the timeout when...
3
by: newbie1 | last post by:
Dear All, I am new to python. I need to write ctrl-z to a serial port to signal the end of input. This is required by the message format. I use: ser =...
0
by: ghjk | last post by:
I want to read sms from GSM modem using C# in serial communication. I wrote the code. But i want to do it automatically. I put my code here and please tell me how can i do it automatically. ...
1
by: ghjk | last post by:
I'm write code to read data from GSM modem. but it couldn't read modem response. Could you please help me? I'll post my code. using System; using System.Collections.Generic; using...
2
by: mmrasheed | last post by:
Hi, I am newbie in python. I am working on Telit GM862 GPS/GPRS module which has python interpreter built in. But it seems this problem is pretty much related to general python structure. I...
6
by: brianrpsgt1 | last post by:
I am new to scripting. I am trying to read the settings from a serial device using Python. I have been able to successfully connect to the device and change baud rate settings, ect... with...
1
by: rfarley | last post by:
Hi, I am using the pyserial module and am trying to read the serial port from an accelerometer (LIS302DL). It has an option in which you write "*debug\r\n" and then you read the data (three...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.