user14057: I'm having some trouble getting my arduino uno to communicate with a simple python script through pyserial.
Lets start with my arduino sketch:
void setup() {
  Serial.begin(9600);
}

byte i = 0;
void loop() {
  Serial.println(i);
  i = i + 1;
}

Really dead simple. It just spews the numbers from 0 to 255 over and over again. It works fine in the arduino serial monitor and gets me the expected result.
The python script comes from:
http://playground.arduino.cc/Interfacing/Python
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
while True:
    print ser.readline()

However running this script gets me:
$ python test.py 
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    print ser.readline()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 460, in read
    raise SerialException('device reports readiness to read but returned no data (device disconnected?)')
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected?)

I am using ubuntu 14.04 and python-serial_2.6-1build1_all.deb

user14282: This may be a kernel bug. See here: https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1501240
The workaround it seems is to use kernel 3.13.0-63-generic.
You can change the kernel for a one-time boot by holding shift while starting up. To make the change persistent, you need to edit /etc/default/grub: https://askubuntu.com/questions/262965/grub-timeout-set-to-0-cant-access-grub-menu-anymore?rq=1

14057: <p>I'm having some trouble getting my arduino uno to communicate with a simple python script through pyserial.</p>

<p>Lets start with my arduino sketch:</p>

<pre><code>void setup() {
  Serial.begin(9600);
}

byte i = 0;
void loop() {
  Serial.println(i);
  i = i + 1;
}
</code></pre>

<p>Really dead simple. It just spews the numbers from 0 to 255 over and over again. It works fine in the arduino serial monitor and gets me the expected result.</p>

<p>The python script comes from:</p>

<p><a href="http://playground.arduino.cc/Interfacing/Python" rel="nofollow">http://playground.arduino.cc/Interfacing/Python</a></p>

<pre><code>import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
while True:
    print ser.readline()
</code></pre>

<p>However running this script gets me:</p>

<pre><code>$ python test.py 
Traceback (most recent call last):
  File "test.py", line 4, in &lt;module&gt;
    print ser.readline()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 460, in read
    raise SerialException('device reports readiness to read but returned no data (device disconnected?)')
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected?)
</code></pre>

<p>I am using ubuntu 14.04 and python-serial_2.6-1build1_all.deb</p>
 14282: <p>This may be a kernel bug. See here: <a href="https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1501240" rel="nofollow noreferrer">https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1501240</a></p>

<p>The workaround it seems is to use kernel <code>3.13.0-63-generic</code>.</p>

<p>You can change the kernel for a one-time boot by holding shift while starting up. To make the change persistent, you need to edit <code>/etc/default/grub</code>: <a href="https://askubuntu.com/questions/262965/grub-timeout-set-to-0-cant-access-grub-menu-anymore?rq=1">https://askubuntu.com/questions/262965/grub-timeout-set-to-0-cant-access-grub-menu-anymore?rq=1</a></p>
