<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Serial Port Communication on Slackware using PySerial</title>
	<atom:link href="http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/feed/" rel="self" type="application/rss+xml" />
	<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/</link>
	<description>Linux enthusiast and Mac fan, ranting and raving about technical stuff!</description>
	<lastBuildDate>Sat, 02 Jan 2010 19:24:22 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: boyfarrell</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11502</link>
		<dc:creator>boyfarrell</dc:creator>
		<pubDate>Mon, 08 Jun 2009 09:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11502</guid>
		<description>Hi Nimit (and future people with this problem),

I managed to fix this my installing &lt;a href=&quot;http://pywin32.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;pywin32&lt;/a&gt;, an without changing PATHS.

Cheers,

Dan</description>
		<content:encoded><![CDATA[<p>Hi Nimit (and future people with this problem),</p>
<p>I managed to fix this my installing <a href="http://pywin32.sourceforge.net/" rel="nofollow">pywin32</a>, an without changing PATHS.</p>
<p>Cheers,</p>
<p>Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: at</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11434</link>
		<dc:creator>at</dc:creator>
		<pubDate>Sun, 18 Jan 2009 19:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11434</guid>
		<description>For solving win32file problems install pywin32 package for your Python from https://sourceforge.net/projects/pywin32/</description>
		<content:encoded><![CDATA[<p>For solving win32file problems install pywin32 package for your Python from <a href="https://sourceforge.net/projects/pywin32/" rel="nofollow">https://sourceforge.net/projects/pywin32/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shreekeerthi</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11407</link>
		<dc:creator>Shreekeerthi</dc:creator>
		<pubDate>Sat, 15 Nov 2008 11:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11407</guid>
		<description>Hi,
If i import serial, shell is generating a following error can u plz help me to get rid of this:
Traceback (most recent call last):
  File &quot;&quot;, line 1, in -toplevel-
    import serial
  File &quot;C:\Python24\lib\serial\__init__.py&quot;, line 18, in -toplevel-
    from serialwin32 import *
  File &quot;C:\Python24\lib\serial\serialwin32.py&quot;, line 9, in -toplevel-
    import win32file  # The base COM port and file IO functions.
ImportError: No module named win32file</description>
		<content:encoded><![CDATA[<p>Hi,<br />
If i import serial, shell is generating a following error can u plz help me to get rid of this:<br />
Traceback (most recent call last):<br />
  File &#8220;&#8221;, line 1, in -toplevel-<br />
    import serial<br />
  File &#8220;C:\Python24\lib\serial\__init__.py&#8221;, line 18, in -toplevel-<br />
    from serialwin32 import *<br />
  File &#8220;C:\Python24\lib\serial\serialwin32.py&#8221;, line 9, in -toplevel-<br />
    import win32file  # The base COM port and file IO functions.<br />
ImportError: No module named win32file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesca</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11384</link>
		<dc:creator>Francesca</dc:creator>
		<pubDate>Thu, 09 Oct 2008 11:00:47 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11384</guid>
		<description>Ho un problema con Python, in particolare con serial
Se lo importo nn mi da errori, se scrivi ser=serial.Serial() ancora ok ma quando scrivo ser = serial.Serial(0) mi genera errore C:\Python24\Lib\site-packages\serial\serialutil.py&quot;, line 156, in __init__
  File &quot;C:\Python24\Lib\site-packages\serial\serialwin32.py&quot;, line 55, in open
    win32file.SetupComm(self.hComPort, 4096, 4096)
SerialException: could not open port: (2, &#039;CreateFile&#039;, &#039;Impossibile trovare il file specificato.&#039;)

Come devo fare???</description>
		<content:encoded><![CDATA[<p>Ho un problema con Python, in particolare con serial<br />
Se lo importo nn mi da errori, se scrivi ser=serial.Serial() ancora ok ma quando scrivo ser = serial.Serial(0) mi genera errore C:\Python24\Lib\site-packages\serial\serialutil.py&#8221;, line 156, in __init__<br />
  File &#8220;C:\Python24\Lib\site-packages\serial\serialwin32.py&#8221;, line 55, in open<br />
    win32file.SetupComm(self.hComPort, 4096, 4096)<br />
SerialException: could not open port: (2, &#8216;CreateFile&#8217;, &#8216;Impossibile trovare il file specificato.&#8217;)</p>
<p>Come devo fare???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11365</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 23 Sep 2008 07:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11365</guid>
		<description>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

When you touch the input pins of the microcontroller the value changes real time in hyper terminal. But In the case of the pyserial module, even though you touch the input pins, the value does not change. We have actually noticed that python records and prints the input to the pins of the microcontroller before the code is executed in python. Hence, it does not record and print new inputs once the code was been executed.

What could possibly be wrong with this?

CODE:
import serial,csv,sys


print(&#039;Tactile Sensing Feedback for Medical Palpation in MIS\n Pyserial Testing Module\n&#039;)
ch= raw_input(&quot;Enter a to initialize pyserial module, b to quit:&quot;)

if ch == &#039;a&#039;:
    print &#039;Initializing Pyserial module&#039;
    ser = serial.Serial(0,baudrate=57600,timeout=0,xonxoff=0)
    print ser.portstr
    ser.flushInput()
    
    for x in range (0,100):
        s = ser.readline()
        print repr(s)
    ser.close()
    
elif ch == &#039;b&#039;:
    print &#039;closing port......\n&#039;
    quit()
 
else:
    print &#039;Invalid option please input a or b only&#039;</description>
		<content:encoded><![CDATA[<p>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</p>
<p>When you touch the input pins of the microcontroller the value changes real time in hyper terminal. But In the case of the pyserial module, even though you touch the input pins, the value does not change. We have actually noticed that python records and prints the input to the pins of the microcontroller before the code is executed in python. Hence, it does not record and print new inputs once the code was been executed.</p>
<p>What could possibly be wrong with this?</p>
<p>CODE:<br />
import serial,csv,sys</p>
<p>print(&#8216;Tactile Sensing Feedback for Medical Palpation in MIS\n Pyserial Testing Module\n&#8217;)<br />
ch= raw_input(&#8220;Enter a to initialize pyserial module, b to quit:&#8221;)</p>
<p>if ch == &#8216;a&#8217;:<br />
    print &#8216;Initializing Pyserial module&#8217;<br />
    ser = serial.Serial(0,baudrate=57600,timeout=0,xonxoff=0)<br />
    print ser.portstr<br />
    ser.flushInput()</p>
<p>    for x in range (0,100):<br />
        s = ser.readline()<br />
        print repr(s)<br />
    ser.close()</p>
<p>elif ch == &#8216;b&#8217;:<br />
    print &#8216;closing port&#8230;&#8230;\n&#8217;<br />
    quit()</p>
<p>else:<br />
    print &#8216;Invalid option please input a or b only&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayaz</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11218</link>
		<dc:creator>ayaz</dc:creator>
		<pubDate>Tue, 10 Jun 2008 18:27:30 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11218</guid>
		<description>Hi, Saurabh:

I don&#039;t know anything within PySerial that exactly matches your requirement.  However, if you set the &quot;timeout&quot; parameter to a reasonable enough value, and put the call to Serial.read() or Serial.readline() in an infinite loop, you can get away with needless polling.  This is how I did it for my RFID reader project.</description>
		<content:encoded><![CDATA[<p>Hi, Saurabh:</p>
<p>I don&#8217;t know anything within PySerial that exactly matches your requirement.  However, if you set the &#8220;timeout&#8221; parameter to a reasonable enough value, and put the call to Serial.read() or Serial.readline() in an infinite loop, you can get away with needless polling.  This is how I did it for my RFID reader project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saurabh</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11216</link>
		<dc:creator>Saurabh</dc:creator>
		<pubDate>Tue, 10 Jun 2008 12:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11216</guid>
		<description>Hi,
I am working on serial RFID Reader for which i am writing a software application too.

I am using pyserial to write that application.

I want the application to be such that it gets the data read from RFID reader only when the card is flashed to the rfid reader.

I dont want the application to keep on polling for the data from serial port.

What i want is one function which would read only when there is serial port interrupt and does not keep on polling for the serial port data.

Please help me on this.

thanks!

Regards,

Saurabh</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am working on serial RFID Reader for which i am writing a software application too.</p>
<p>I am using pyserial to write that application.</p>
<p>I want the application to be such that it gets the data read from RFID reader only when the card is flashed to the rfid reader.</p>
<p>I dont want the application to keep on polling for the data from serial port.</p>
<p>What i want is one function which would read only when there is serial port interrupt and does not keep on polling for the serial port data.</p>
<p>Please help me on this.</p>
<p>thanks!</p>
<p>Regards,</p>
<p>Saurabh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayaz</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11215</link>
		<dc:creator>ayaz</dc:creator>
		<pubDate>Sat, 07 Jun 2008 04:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11215</guid>
		<description>Hi Rupert:

I am not sure exactly what is going on.  Are you positive that the configuration settings, including the baudrate, you are specifying for the serial port are correct?  Do they match those set in HyperTerminal?

You could also use s.isOpen() to rule out whether the port is being opened by PySerial at all or not.  Instead of using s.readline(), how about reading specific number of bytes instead:  for example, s.read(number_of_bytes).

I have never tested PySerial on Windows.  I have only ever used it on Linux.  Please do let me know if it works out or not.</description>
		<content:encoded><![CDATA[<p>Hi Rupert:</p>
<p>I am not sure exactly what is going on.  Are you positive that the configuration settings, including the baudrate, you are specifying for the serial port are correct?  Do they match those set in HyperTerminal?</p>
<p>You could also use s.isOpen() to rule out whether the port is being opened by PySerial at all or not.  Instead of using s.readline(), how about reading specific number of bytes instead:  for example, s.read(number_of_bytes).</p>
<p>I have never tested PySerial on Windows.  I have only ever used it on Linux.  Please do let me know if it works out or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupert</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11214</link>
		<dc:creator>Rupert</dc:creator>
		<pubDate>Fri, 06 Jun 2008 19:05:22 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11214</guid>
		<description>Hi Ayaz,

I am trying to get Python to talk to my modem.
I am having some success but I can&#039;t get the modem to start an Auto Answer sequence.

It I run Hyperterm and type AT A 
the modem starts to answer.

But the following code only prints
Serial(port=&#039;COM1&#039;, baudrate=2400, bytesize=8, parity=&#039;N&#039;, stopbits=1, timeout=3, xonxoff=0, rtscts=1, dsrdtr=1)
AT A

I put the time.sleep(3) lines in to give things time to work but it does not help.




# python
import serial
import time

s = serial.Serial(
     port=0,
     parity=serial.PARITY_NONE,
     bytesize=serial.EIGHTBITS,
     stopbits=serial.STOPBITS_ONE,
     timeout=3,
     xonxoff=0,
     rtscts=1,
     dsrdtr=1,
     baudrate=2400
)

time.sleep(3)

s.write(&quot;AT A&quot;)
time.sleep(4)
a = s.readline()
b = s.readline()
print s
print a
print b

s.close()              #close port</description>
		<content:encoded><![CDATA[<p>Hi Ayaz,</p>
<p>I am trying to get Python to talk to my modem.<br />
I am having some success but I can&#8217;t get the modem to start an Auto Answer sequence.</p>
<p>It I run Hyperterm and type AT A<br />
the modem starts to answer.</p>
<p>But the following code only prints<br />
Serial(port=&#8217;COM1&#8242;, baudrate=2400, bytesize=8, parity=&#8217;N', stopbits=1, timeout=3, xonxoff=0, rtscts=1, dsrdtr=1)<br />
AT A</p>
<p>I put the time.sleep(3) lines in to give things time to work but it does not help.</p>
<p># python<br />
import serial<br />
import time</p>
<p>s = serial.Serial(<br />
     port=0,<br />
     parity=serial.PARITY_NONE,<br />
     bytesize=serial.EIGHTBITS,<br />
     stopbits=serial.STOPBITS_ONE,<br />
     timeout=3,<br />
     xonxoff=0,<br />
     rtscts=1,<br />
     dsrdtr=1,<br />
     baudrate=2400<br />
)</p>
<p>time.sleep(3)</p>
<p>s.write(&#8220;AT A&#8221;)<br />
time.sleep(4)<br />
a = s.readline()<br />
b = s.readline()<br />
print s<br />
print a<br />
print b</p>
<p>s.close()              #close port</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayaz</title>
		<link>http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11190</link>
		<dc:creator>ayaz</dc:creator>
		<pubDate>Sun, 18 May 2008 15:54:18 +0000</pubDate>
		<guid isPermaLink="false">http://ayaz.wordpress.com/2007/06/11/serial-port-communication-on-slackware-using-pyserial/#comment-11190</guid>
		<description>Hi, Ben:

You can use two features of pySerial to your advantage.  One is the
timeout parameter that you specify when creating a serial.Serial() object.  If you set timeout=None, and call method read() or readline(), pySerial will wait forever until there is data in its receive buffer.  The second feature is the inWaiting() method.  It tells you how many characters are waiting in the receive buffer to be read.

If you set timeout=None, run a loop, but call readline() once within the loop, your program will block until there are characters in the receive buffer.  You can, then, do what you want with the data received.  Or, you could loop around a call to inWaiting(), only calling read() or readline() whenever there are characters waiting in the receive buffer.

I hope this helps.</description>
		<content:encoded><![CDATA[<p>Hi, Ben:</p>
<p>You can use two features of pySerial to your advantage.  One is the<br />
timeout parameter that you specify when creating a serial.Serial() object.  If you set timeout=None, and call method read() or readline(), pySerial will wait forever until there is data in its receive buffer.  The second feature is the inWaiting() method.  It tells you how many characters are waiting in the receive buffer to be read.</p>
<p>If you set timeout=None, run a loop, but call readline() once within the loop, your program will block until there are characters in the receive buffer.  You can, then, do what you want with the data received.  Or, you could loop around a call to inWaiting(), only calling read() or readline() whenever there are characters waiting in the receive buffer.</p>
<p>I hope this helps.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
