Controlling Raspberry Pi Expansion Pins With A Web Interface

For the lucky few who have a Raspberry Pi board in their hands, you can now use the GPIO pins as a web interface (German, google translation). [Chris] is turning this magical board is turning a small device that can play 1080p video into something that can blink LEDs via the web.

The build started with an example of driving GPIO pins under Linux. [Chris] cobbled together a bit of PHP and Javascript on the Raspberry pi. Whenever he goes to the website hosted on the Pi, he’s greeted with the status and direction of a couple of expansion IO pins.

On a semi-related note, [Tony] is building a GPIO MIDI interface for his Pi. Yes, he could just get a USB to MIDI adapter and call it a day, but this is a far more professional looking solution to all the MIDI goodness the RasPi will deliver. If you’ve got any info on other RasPi breakout boards you’ve seen, send them in on the tip line.

61 thoughts on “Controlling Raspberry Pi Expansion Pins With A Web Interface

  1. who the fuck cares about this device ? it’ll be at least another 6 months to a year, if EVER, that anyone actually gets theirs delivered.

    Moderator’s edit: Because enough HaD commenters hit the ‘report’ button (thank you), WordPress sent this comment into the nether-reaches of trashed comments. The comments in reply to this comment brought up some good points, so I’m re-approving it so the comment threading isn’t thrashed.

    By the way, we’re working on an improved commenting system. In the mean time, don’t feed the trolls.

    1. Especially when there are much more open solutions available, albeit not with HD video.
      The RasPI is a monument to closed source, therefore thanks but no thanks: I’ll wait for similar alternatives.

      1. I do agree with you about closed source digital blobs inside this is pure evil. But I also would prefer children be exposed to something that is in some way open, rather than being thought by morons how to use excel, word and powerpoint on a fully closed platform. This is the primary purpose of this hardware platform. And I do believe it is a noble cause, to try and stop schools from pouring out mindless drones. Yes it is not perfect by a long shot, but it is better that what is already there. I would prefer if it could run OpenBSD which rejects all software blobs.

    2. Yeah I really want a Raspberry Pi because of the cost but having to wait for it is giving me sour grapes. For my embedded stuff I just use a hacked pogoplug with arch linux. By the time I can get one I probably won’t care anymore.

    3. Why are there (a few) such strong negative reactions to the raspberry Pi, it’s almost as if it’s disturbing the force, the number comments about it being vapour ware, or not much good at something, or it’s closed source etc. Is the numbers of people interested in it shaking some exclusivity tree, making the nerdship weaker.
      Is it a not invented in the USA problem?
      Is it a I didn’t get one immediatly so it/they must be shit problem?

      I would guess (at the price)it may become the goto hack hardware, possibly upsetting those that think an arduino/beagle board/anyother, plus all the shields is a great bit of kit, it is, but in many ways it is an expensive way of getting a led to light up, and requires another device to program it.
      If you don’t like it, well thats fine but I don’t understand the requirement to be so negative and so vocal about it,what’s the problem.

      It’s not even aimed at you, it was designed as a cheap bit of kit to encourage kids to program.

      To be honest in a school environment it’s not that cheap – yet, once you have a place to work (i.e. a desk), power supply, monitor, keyboard, mouse, connecting cables, power point, ethernet point, and storage box or permanant place, the
      cost of the processor is tiny.

      No I don’t have a Raspberry Pi yet, but I will once it is easy to get one.

      1. I agree there are lots of bad-mouthing comments simply due to the poor availability.

        The open hardware complaints are misplaced – place the blame where it belongs with the copyright and patent dweebs. I do not believe HDMI is free and I am sure there are other technologies used that are not free to the world.

        All of the Americans I am talking to are excited about the Pi – don’t think it is a “not made here” thing so much.

        Cheers!

      2. The US didn’t actually do too badly from what I’ve heard – but the availability and pricing in much of mainland Europe was apparently atrocious, with both massive price hikes and their official distributors refusing to sell to ordinary consumers in many EU countries at all for a couple of weeks after the launch.

        The RasPi Foundation also forced all discussion of pricing and distributors into the off-topic section of their official forum and basically said “not our problem”. Their fanboys even blamed the pricing on customs charges and import taxes and were quite rude about it – and the moderators were fine with this up until the point where politely pointed out there were no import taxes between EU states. At that point they locked the thread with a generic message about how their pricing doesn’t include import charges, and we should all just pay whatever their partners deign to sell to us or walk away and buy something else.

        Lovely bunch.

    4. hahaha, are you mad brother?

      they are just some dudes from the UK, not an experienced manufacturing operation. people need to shut up and realize the goddamn thing costs $35. that is the selling point, period.

    1. It has the hardware decoding to do 1080p flawlessly, however it’s not very good at pretty much everything else in that area…
      Eg. If you’re playing video that’s not in a codec it has support for, you’ll find it will have a good deal of trouble with it.
      But if your content is the right codec, it will be a glorious HTPC :D

    2. Western Digital WD TV Live: full 1080p, not much bigger than a PI, linux based as well, alternative firmwares available. Price down to $58, remote included.

    3. My brother has an Asus O!Play, wonderful little box capable of playing a great range of video formats (ISO,MKV,FLV,AVI,MP4,etc. etc.) to his HD TV, completely silent as it has no fan and plays from network or USB drive (flash or spinning type)

  2. jimbob:

    I’ve been told my pi will be delivered by the end of this month (May). Looking forward to it. I have so many uses for these little boards. When they allow it I will be ordering more. I will also donate a few to a school close to me.

  3. I got my pi about a week ago, kinda useless at the moment as there is not even 2d acceleration in any of the distros yet…. And it will suck as a HTPC as they didn’t license MPEG2… so it will do HD but not SD. /rant

      1. Gee thats funny. I must have missed the part where my ZTE V9 (a 600Mhz ARM11) had no problems decoding SD mpeg2 video.

        Also just because it isn’t available on launch doesn’t mean it won’t happen. Or someone else won’t do the dirty and add in the gpu.

  4. Does anyone know if this thing has gotten a through “stress” test? If so, where can I find the data? I’m only going to buy in if the stats are good enough.

    1. Yeah, seriously. I expect mine in June and I’m pretty excited. For the price, why not buy one? Even if I have to wait so what. I got it to play around with. It’s a relatively inexpensive toy.

  5. no what is the largest reliable toggle frequency? This decides if is a suitable cnc/3dprinter controller board.
    How difficult is it to drop the operating system, and just use it for one piece of code?

    Honest questions, I would really like to know that.

    1. It would be pretty difficult to drop the OS and run a single piece of code on the RPi. You would have to build or modify all of the hardware support drivers as well as build firmware from the ground up to get it to act like a small scale microprocessor. You might as well just get a pic or an arduino. If you are concerned about speed there are pic based arduino clones with much faster processors you can get here.

    2. It’s not designed for that kind of real time control. You are better off using arduino for ‘real time systems’.

      The reprap community is thinking instead of using rasp pi as a ‘brain’ that commands the ‘spine’ which is the arduino, to run the ‘muscles’ which is the motors of the CNC or 3d printer.

      1. Just having one fast processor really is more tidy. For slicing, this “brain” would be dead slow. For calculating acceleration profiles and path blending, the rapsberry is having more calculation power than the controlling microcontroller maybe, but adds a level of abstraction, causing additional overhead, buffering, and headaches.

        I am not really sure if it would be any good. I followed most discussions on linuxcnc and reprap-dev, but I am quite unhappy of with the current state of new arm-based hardwares for step generation. There should be pure c/c++ modular libraries that are hardware-independent: communciation, gcode interpretation, trajectory planning, buffering, step generation, heating controlling. One of this things=one library. They could be used by all different hardwares. Instead, soo many people are cooking there own soup. Linuxcnc with the classicladder stuff, grbl, all the new arm based stuff.
        Single minded libraries would be the way to go. With clean, performant, and fixed interfaces.

        Of course they would need to be optimized for small footprint, or at least tuneable footprint.

      2. You can use linux for even hard realtime control. Look into xenomai, it’s not difficult to port to a new board if the timer facilities are somewhat decent.

        Make sure none of the drivers you use in linux use the global kernel lock as that completely destroys realtime performance.

  6. RS in the UK sent me a 40 digit code to access
    the RS one PI per customer order, yes nearly there.

    DARN TOONTIN’ web store crashed, and it rejected
    the 40 digit code on retry. You wanna see my war face RS yeah. Hand me my cup of rage!
    RS I hate you so so much right now.

  7. The closed source blobs aren’t evil, they’re just the way things are done with that chip, otherwise we’d have access to all of the codecs that the chip can handle and we haven’t paid for those.

    Get over yourselves. It wasn’t built for you, it was built for education, we just got lucky that they want us to play with them too. Quit whining and make it do the things you think it can’t.

    1. The closed source blobs aren’t just required for hardware acceleration. According to the publicly available information you need to use a closed source binary blob that runs on an undocumented processor living somewhere in the VideoCore hardware in order to even boot the Raspberry Pi, even if you don’t want to use video for anything once you’ve booted it.

    2. It’s funny (to me) how ppl whos principles are conveniently “flexible” (or somewhat non-existent) like to marginalise those who have the courage of their convictions.

      1. It’s funny how you characterize people who accuse you of tilting at windmills or trying to both have and eat your cake of being amoral cowards.

  8. Wow why so much hate on this thing.

    Maybe I am too new or knowledge too lacking, but something with as many features as this and for such a low price should be given some courtesy.

    Maybe it takes awhile to be delivered, so what? I waited for a month before on a laptop. I waited for more than a month on some kitchen containers I bought online… Did I die without them or feel compelled to rip on them?

    If it’s features don’t meet your requirements, state it’s limitation and move on. If it is slow delivery state approximate wait time, state how long it took you to receive it and move on.

    Absolutely no reason to rip on this item or anything else for features it states clearly it does not have or support or slow shipping when they have right on their website their current stocking efforts with their resellers.

    To me this thing seems like a pretty cool, and hacker friendly gadget. I would suggest you don’t look a gift horse in the face(or some stupid thing like that). Like another person said we got lucky that we were thought about at all, and as such I for one am going to happily buy one and thank the creators of it for the opportunities and enjoyment I can get out of it.

    For $25-$35 I certainly am not going to whine about any shortcomings considering the features it offers, nor am I going to whine about shipping time when they outright say themselves that the timeline for delivery is slow but they are working on it.

  9. It’s my understanding that some of the RPI team are Broadcom employees, and Broadcom supports the project in a number of ways, including supplying chips at very near cost; otherwise the RPI wouldn’t be available at such a low price.

    That’s pretty darn generous, if you ask me. Even if they’re holding back low-level access to the GPU to avoid some hairy issues with competing consumer products, licensing fees, NDAs, and content protection.

    My advice to the complainers is this: STOP THINKING OF THE RASPBERRY PI AS AN HTPC! Sure, it may make a good one under some circumstances. But there are other, better options for that; and SO MANY other possibilities for the Pi.

    My personal list of things I’d like to try with a Pi: home automation, advanced aquarium automation, wireless IP camera server, robotics, car MP3 player, and probably a few others I’m forgetting. All can easily be done by a Pi, with power to spare.

    I can even leverage my career .NET programming skills on it with Mono, and that is just awesome to me.

    And all at a price point never before seen.

    Show some imagination, folks!

  10. it’s got as much going for it as all of the lower spec. embedded devices out there that people love to hack and code for, canoo,gp2x wiz etc. when you’ve had to deal with other retail products for hacking about on embedded devices, the rpi closed blobs pale into insignificance. It’s a very open device for it’s intended target audience, even for embedded linux coders and tinkerers it’s got a lot going for it.

  11. Mine’s due on the week beginning 28th of May, ironically I have an A2 exam on the 31st that helps determine whether I go to university or not. I suspect the Pi might actually doom my education instead of helping it :P

    Any work with advanced uses of those GPIO pins is good in my book as I want to hook my Pi up as a HTPC with ‘learning’ IR remote support. The current HTPC doesn’t have serial so is a bit painful to do low level stuff with, and I have 3 files with unsupported codecs (i.e. WMV) out of 1250 videos so I don’t care about support for weird codecs.

  12. The Raspberry PI with it’s proprietary Broadcom chip and ill-decision-making “foundation” has got an uphill battle. The Allwinner A10 (Boxchip) is very popular in china and already heavily mass produced.. cheaper too. Google it.

    1. Go on them, design a RasPi-like clone or something better using the Allwinner A10, complete with full OS software stack, complete with CE / FCC et al compliance and sell it worldwide for $35 plus delivery and taxes. Oh and with an advertising budget of ~= $0 why not get over 200,000 pre-orders as well.

      1. Given that “shipping+taxes” is closer to $20:

        http://www.youtube.com/watch?feature=player_embedded&v=jrPduixi4iw

        mm, so lets see. Proprietary Broadcom chip soldered on bare a PCB with *nothing* else for $55, or a fully assembled tablet (capacitive, camera, 512mb, hdmi out (accelerated 2160p), usb host mode, and so on), for $63 from SZ.? The A10’s chip’s mass volume price is ~$7. How can the Raspberry PI even begin to compete with this?? Short time will determine the fate of this ‘foundation’. best of luck.

      2. I spent some time looking into the A10 myself after you mentioned it.

        NO option for English on A10 chip manufacturer’s website. NO datasheets, except for one posted on a few forums that is claimed to be the only one in English; I didn’t bother with registration for download because at only 1.15mb, I already know it’s going to be a marketing sheet listing features, rather than a detailed datasheet that gives you any information on how to actually use them.

        NO experimenter’s boards similar to the Pi available. Rhombus is planning one, price and release date unknown, little visible progress or updates on their website since they announced it at the beginning of the year. It may end up vaporware like so many others. Estimated component costs are less than the Pi, but unlike RPI, Rhombus is a for-profit organization; so that will add to the price.

        Tablets are complete consumer products, not experimenter’s boards; the Pi is obviously not meant to compete with that, nor does it need to. A tablet’s camera, and maybe even the screen, will be wasted as an HTPC or in any number of other projects; so why pay extra for it? And if your project needs I2C/SPI/GPIO, or any other way to interface low-level components, you will NOT find that easily accessible (if accessible at all) on a tablet.

        REAL price on the A10-based tablets/set-top boxes is ~$100 USD through Ebay, DealExtreme, AliExpress, and several other popular retailers of Chinese products; not $63 as you claim. Price of a delivered Pi is also typically less than you claim.

        When I invest my valuable time in a project, I want it to last as long as I will find it useful; which may be a decade or more. What’s the chance of a Chinese tablet, in which every component is sourced as cheaply as possible from any fly-by-night manufacturer AND contains far more components, doing that? Or that returns will even be accepted if it’s defective out of the box? Too low to consider, and many here can speak from direct experience on that. I could wallpaper my entire house with the things I’ve seen fail prematurely due to junk Chinese components.

        So best of luck to you, too.

  13. The low voltage low power consumption and connectivity should facilitate a wearable version
    of a system named The vOICe (seeingwithsound.com).
    This blindness facility is ten years old, based on PC and now Android..
    Think of a hat-mounted sight substitution device, as good as anything else currently on offer, all up cost under $100.
    Also imagine a personal power pack to generate the 3 watts required to drive it..

    1. The Raspberry Pi works from those little hand sized solar charger things really well. Just for the crack I ran mine outside in “English Sun” for several hours until “English Rain” stopped it ;)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.