473,769 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access serial port in python

hi
i hav written a code in python to send an SMS from a nokia 3310
connected to my PC...
i wanted to receive a msg on my PC. In order to do so, the PC must know
when it has to read data frm the serial port ...thus an interrupt must
be generated when the serial port receives data frm the phone .....HOW
CAN I DO THIS IN PYTHON ??
can anyone help me with this INTERRUPT HANDLING thing in PYTHON ???
thanks

May 26 '06 #1
6 2540
pyserial?

http://pyserial.sourceforge.net/

-Larry

vi************* @gmail.com wrote:
hi
i hav written a code in python to send an SMS from a nokia 3310
connected to my PC...
i wanted to receive a msg on my PC. In order to do so, the PC must know
when it has to read data frm the serial port ...thus an interrupt must
be generated when the serial port receives data frm the phone .....HOW
CAN I DO THIS IN PYTHON ??
can anyone help me with this INTERRUPT HANDLING thing in PYTHON ???
thanks

May 26 '06 #2
i can use the polling method to check for data on the serial port using
pyserial...but i need to use the interrupt driven method .....am workin
on a windows platform ....

May 27 '06 #3
i can use the polling method to check for data on the serial port using
pyserial...but i need to use the interrupt driven method .....am workin
on a windows platform ....

May 27 '06 #4
On 2006-05-27, vi************* @gmail.com <vi************ *@gmail.com> wrote:
i can use the polling method to check for data on the serial port using
pyserial...but i need to use the interrupt driven method .....am workin
on a windows platform ....


I don't think there is any way to so interrupt driven I/O under
Windows. You can do asynchronous I/O under Windows using the
normal Win32 FileIO API.

--
Grant Edwards grante Yow! Is it 1974? What's
at for SUPPER? Can I spend my
visi.com COLLEGE FUND in one wild
afternoon??
May 27 '06 #5

google for win32serialport .py
may be this is what you want

I.Haase
May 28 '06 #6
In article <11************ **********@i40g 2000cwc.googleg roups.com>,
<vi************ *@gmail.com> wrote:
hi
i hav written a code in python to send an SMS from a nokia 3310
connected to my PC...
i wanted to receive a msg on my PC. In order to do so, the PC must know
when it has to read data frm the serial port ...thus an interrupt must
be generated when the serial port receives data frm the phone .....HOW
CAN I DO THIS IN PYTHON ??
can anyone help me with this INTERRUPT HANDLING thing in PYTHON ???
thanks


Others have answered your direct question about serial handling.
Let me urge you to consider investigation of the gnokii and gammu
projects, which handle MANY other aspects of SMS handling that I
doubt you want to burden you. There turns out to be depressingly
more to SMS than you might imagine (although it's just possible
that you already have almost everything you need for the 3310).

When researching these two projects, note that gammu is already
aware of Python, but rather unstably so, and that gnokii's Windows
story has brightened immensely in the last month.
May 29 '06 #7

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

Similar topics

2
13195
by: willie | last post by:
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. However, I'm unsure of how exactly I should be designing the program, I thought I could use threading to start class: class scanner(Thread): def __init__(self,port):
14
4059
by: McBooCzech | last post by:
Hi I am just trying to analyze (parse) data from the serial port (I have connected GPS receiver to the ttyS0, so I can read ASCII characters in the CSV form on the serial port 1). I am doing this just to understand how Python works (yes, you can call me Python/Linux newbie :) My environment is Fedora Core 4, Python 2.4.1 CSV alone (to read CSV data from the file) and py-serial alone (to read data from the serial port) are working...
13
4833
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have been told it is not possible to access the serial ports from asp.net. The application is used to control custom hardware. The hardware is connected to a PC through serial ports. Our customer wants to control the hardware from a remote...
6
3590
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 standard "built-in" modules if possible. Could somebody offer a simple code-snippet to get me started reading from a serial port? Thanks!
15
8193
by: xkenneth | last post by:
Hi, I'm writing a couple python applications that use the serial port (RS-232) quite extensively. Is there any way I can monitor all activity on the serial port and have it printed as the transactions occur? I'm trying to reverse engineer a microcontroller serial routine and I'd like to see any response the chip sends back. Regards, Ken
38
9667
by: shussai2 | last post by:
Hi, I am trying to access Serial Port in XP. I am using Dev-C++ IDE that uses Mingw as a compiler. I just want to know how I can open up serial port on COM1 and write some data. I have searched quite a bit over the web and could not find anything useful. I don't want to use Visual C++ or Cygwin, linux, etc. If any of you guys have some little tid bit of code that would be great to look at.
13
6209
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I am sending a short message to a group of embedded boxes daisy chained via the serial port. When I send a 'global' message, all the connected units should reply with their Id and Ack in this format '0 Ack' To be certain that I didn't miss a...
5
5627
by: kkadrese | last post by:
hello group, how to get ttyS0 serial port for exclusive access? I have a python script that uses this device with AT commands. I need that two instances can call simultaneosuly this python script but only one of them gets the device. I tried fcntl.flock, it was just ignored, put writtable file LCK..ttyS0 in /var/lock, tried ioctl (but I may not know what are appropriate arguments), googled half a day for various phrases, error messages...
2
10402
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 need a promt/terminal when the device is connected to PC. If user enters a command by serial port and press "Enter" then the data is read by the device and work on the command. This is similar to readline() function. Unfortunately there is no...
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7404
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.