Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [SOLVED] python parallel port

  1. #1
    Join Date
    Jan 2007
    Location
    ~/
    Beans
    71
    Distro
    Hardy Heron (Ubuntu Development)

    [SOLVED] python parallel port

    has ANYONE been able to get python to access the parallel port?

    I have been trying for days and have got know where except very frustrated. Whenever I try to do anything it just gives me a bunch of bull about how the device does not exist!?!?!

    Anyone?

  2. #2
    Join Date
    Sep 2006
    Beans
    2,914

    Re: python parallel port

    how are you trying to access it?

  3. #3
    Join Date
    Jan 2007
    Location
    ~/
    Beans
    71
    Distro
    Hardy Heron (Ubuntu Development)

    Re: python parallel port

    I am using the pyParallel module.

    import parallel
    p = parallel.Parallel()

  4. #4
    Join Date
    Sep 2006
    Beans
    2,914

  5. #5
    Join Date
    Jan 2007
    Location
    ~/
    Beans
    71
    Distro
    Hardy Heron (Ubuntu Development)

    Re: python parallel port

    I don't know, it always errors out after that. I get:

    Code:
    >>> import parallel
    >>> p = parallel.Parallel()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.5/site-packages/parallel/parallelppdev.py", line 189, in __init__
        self.setDataDir(1)
      File "/usr/lib/python2.5/site-packages/parallel/parallelppdev.py", line 509, in setDataDir
        self.PPDATADIR(out)
      File "/usr/lib/python2.5/site-packages/parallel/parallelppdev.py", line 458, in PPDATADIR
        fcntl.ioctl(self._fd, PPDATADIR, msg)
    IOError: [Errno 22] Invalid argument
    do you know of a different way to send data out of the parallel port in python? What am I doing wrong with pyParallel?

  6. #6
    Join Date
    Sep 2006
    Beans
    254
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: python parallel port

    i ran into this same issue during my thesis, in order to use pyparallel you will need to unload the lp driver and load the ppdev driver

    sudo rmmod lp
    sudo modprobe ppdev

    if you are going to be using the port all the time consider blacklisting the lp module.

  7. #7
    Join Date
    Sep 2006
    Beans
    2,914

    Re: python parallel port

    make sure you get all installation requirement correct. Have you installed Javacomm?

  8. #8
    Join Date
    Jan 2007
    Location
    ~/
    Beans
    71
    Distro
    Hardy Heron (Ubuntu Development)

    Re: python parallel port

    Quote Originally Posted by ghostdog74 View Post
    make sure you get all installation requirement correct. Have you installed Javacomm?
    yeah, it's there.

    sudo rmmod lp
    sudo modprobe ppdev
    It didn't seem to do anything, I keep getting the same error... What can I do to pinpoint the cause?

  9. #9
    Join Date
    Sep 2006
    Beans
    2,914

    Re: python parallel port

    other areas to check maybe your BIOS, make sure if there are options to turn on/off parrallel port. Or at the Operating System, see if there are any settings about parallel ports. Also you may need to add ppdev to /etc/modules.

  10. #10
    Join Date
    Jan 2007
    Location
    ~/
    Beans
    71
    Distro
    Hardy Heron (Ubuntu Development)

    Re: python parallel port

    could it be that the new kernel version has an incompatible version of fcntl, and that's why it is not working? It seems to be the end-of-the-line for the debug output....

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •