Search code examples
linuxprogramming-languagesubuntuhardwareparallel-port

Which easy programming language to use for parallel port programming under Linux?


My father would like to use Ubuntu for LPT programming (via a relay card). He is used to QBasic and PowerBasic but willing to learn a new (simple) language for his goals.

What recommendations can you give me for this task?

Python would be my favourite if the module pyParallel worked. If there are other modules available for Python, let me know.

I cannot change the hardware, it's a requirement to only change software.

Thanks in advance for any hints!


Solution

  • The Python module pyParallel works. I had tried the release last time. Yesterday I used the HEAD revision and it works.

    For somebody trying to do the same procedure:

    1. Download & install the HEAD revision of pyParallel.
    2. Unload the kernel module lp and load ppdev. It lets you access the parallel port device file.
    3. a) Add your OS user to the group lp so it has write access to /dev/parport*.
      b) Otherwise execute this: # chmod a+rw /dev/parport*
    4. Hack your program!

    Steps 2., 3. b) and 4. must repeated every reboot. The blacklisting does not work properly (yet).
    You can create a udev rule for the parport device file so that every user has write access to it.

    Update: The blacklist now works. It was a bug in Ubuntu 9.04 with CUPS. In 9.10 it works perfectly.

    Happy hacking!