6 Replies Latest reply on Jul 21, 2015 2:34 AM by arfoll

    Python can't open serial port


      Hi, guys. I really need your help.


      I'm trying to get the data that Arduino  Breakout board shows. I'm using a Python scrypt. But when I execute the script:


      import serial

      edison = serial.Serial('COM8', 9600)

      while True:

        print edison.readline()


      The error is:


           ser = serial.Serial('COM8', 9600)

        File "/usr/lib/python2.7/site-packages/serial/serialutil.py", line 282, in __init__


        File "/usr/lib/python2.7/site-packages/serial/serialposix.py", line 289, in open

          self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)

      OSError: [Errno 2] No such file or directory: 'COM8'


      I don't know why COM8 doesn't exist, if the serial monitor shows the temperature through COM8. Hope you can help me.




      EDIT:: If I execute the Python script on Windows, it works fine, but if I try to execute the script from Edison (/home/root/)(putty console), I get the error mentioned above