Techplex Labs
  • Home
  • Projects
    • Home Heating Automation
    • Plextex
    • ISTE Desgins >
      • A Modern OpenConcept Design
      • A Modern OceanView Design
      • A Modern Lloyd-esq Design
    • Desk Expander
    • Belgrade Public Library Renovation Project
  • Portfolio
  • Blog
  • Contact

Thoughts...

The need for a GPIO Kernel Module on the RPi

4/6/2013

2 Comments

 
Picture
The Raspberry Pi(RPi) is a credit card sized computer that is an amazing and affordable toy. Lest we forget the numerous uses in prototypes and experiments.

Anyone that has experimented with using the GPIO(General Purpose Input & Output) pins on the RPi may have noticed that their program must be run as root (with sudo). For me this is rather bothersome, I don't like running any program as root unless I absolutely have to. In my research I found that Gordon over at projects.drogon.net has an amazing Wiring like library for the Raspberry Pi called WiringPi ofcourse! He's also included a nifty GPIO command line utility which allows exporting GPIO to a "/sys/class/gpio/" interface thereby allowing user code to access the pins without being run as root.

I think we can do better! Lets talk Linux Kernel for a minute here, the kernel is a resource manager, the GPIO pins are a resource. The out of the box kernel doesn't support our gpio pins! Dang..... No problem we'll just write a Kernel Module to manage access to our GPIO pins.

There are a bunch of ways to provide access to the GPIO pins, in my case ioctl calls will work just fine. 

So there's the background, heres the news:
I'm developing a linux kernel module that will provide an ioctl interface to the Raspberry Pi's GPIO pins so that programs in userspace can access the pins without being run as root.

The next steps are to write a wrapper for my modules low level interface to make using it more appealing in everday code. Following that I'm hoping to integrate it into WiringPi for an even more streamlined approach.

Stay tuned! I hope you are excited as I am!

Raspberry Pi is a trademark of the Raspberry Pi Foundation

2 Comments
Gerrie link
11/10/2013 04:51:54 pm

I am also interested and have done some kernel debug and driver writing. How far did you get?, as I am also keen to use ioctl to access gpio, i2c and spi.

If acceptable I can assist, else I am going to write my own
Regards
Gerrie

Reply
Blake link
11/11/2013 05:22:00 am

Hey Gerrie,
I never did get around to writing my followup post. THe source to my Module is in this [1] github repo. Hopefully the comments in the code aid in understanding. Its been a while.

[1] https://github.com/TechplexEngineer/RPi-GPIO-Kernel-Module

Reply



Leave a Reply.

    Author

    Blake is a recent graduate of the University of Maine with a Computer Engineering degree. Blake set out to work closely with industry professionals to provide products and solutions specially tailored to some of the costliest problems. 

    Picture

    Archives

    February 2017
    January 2017
    April 2013
    March 2013
    April 2012
    February 2012
    December 2011
    November 2011
    August 2011

    Categories

    All
    Apache
    Code
    FRC
    Javascript
    Linux
    Nginx
    PID
    Robotics
    Web

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Home
  • Projects
    • Home Heating Automation
    • Plextex
    • ISTE Desgins >
      • A Modern OpenConcept Design
      • A Modern OceanView Design
      • A Modern Lloyd-esq Design
    • Desk Expander
    • Belgrade Public Library Renovation Project
  • Portfolio
  • Blog
  • Contact