background preloader

Bcm2835: C library for Broadcom BCM 2835 as used in Raspberry Pi

Bcm2835: C library for Broadcom BCM 2835 as used in Raspberry Pi
This is a C library for Raspberry Pi (RPi). It provides access to GPIO and other IO functions on the Broadcom BCM 2835 chip, as used in the RaspberryPi, allowing access to the GPIO pins on the 26 pin IDE plug on the RPi board so you can control and interface with various external devices. It provides functions for reading digital inputs and setting digital outputs, using SPI and I2C, and for accessing the system timers. Pin event detection is supported by polling (interrupts are not supported). It is C++ compatible, and installs as a header file and non-shared library on any Linux-based distro (but clearly is no use except on Raspberry Pi or another board with BCM 2835). The version of the package that this documentation refers to can be downloaded from You can find the latest version at Several example programs are provided. Running as root Installation tar zxvf bcm2835-1.xx.tar.gz . make Reboot.

GPIO Library Update: 14th May, 2013 wiringPi version 2 has been released and now has its own website ( to look after it. Most of the documentation on the projects site has been copied over to it the new site, but there may still be 1 or 2 pages that are still missing. I’d encourage you to use the new site if possible where there will be a forum and wiki (when I get time to implement them!) WiringPi is an Arduino wiring-like library written in C and released under the GNU LGPLv3 license which is usable from C and C++ and many other languages with suitable wrappers (See below) You may be familiar with the Arduino… Briefly; Arduino is really two things; one is a hardware platform, the other software, and part of the software is a package called Wiring. The Raspberry Pi has a 26-pin General Purpose Input/Output (GPIO) connector and this carries a set of signals and buses. WiringPi includes a command-line utility gpio which can be used to program and setup the GPIO pins. Pin numbering

Project - RaspyFi - Voyage mpd on Raspberry Pi - RaspyFi Project Dear beloved RaspyFi Users RaspyFi has evolved into Which is compatible with Raspberry Pi, Udoo, Cubox and Beaglebone Black. RaspyFi website will remain available for archive references, every new activity will be on Volumio.org See you there! Raspberry pi – Setting up auto-login and auto-loading the gui | Frustrated IT Engineer Home > How To, Raspberry pi, Technology > Raspberry pi – Setting up auto-login and auto-loading the gui Setting up Auto-Login In the GUI left click in the bottom left hand corner on the blue cross to display the options menu (Like the start button in windows) Go up to “other” and then scroll down the list until you get to “terminal” and left click You should now see the “terminal” window which is just like a cmd box in windows and enter the following command Sudo nano /etc/inittab This will open up the boot time system configuration script. Scroll down the file until you reach the line ’1:2345:resoawn:/sbin/getty 115200 tty1′ When you see that line, put a hash # in front of it to disable that line then scroll to the end of line and hit enter. In the blank line that appears add the following command 1:2345:respawn:/bin/login -f pi tty1 / dev/tty1 2>&1 Don’t forget to add the spaces and double check that the line enter is correct. Press Ctrl+X to exit followed by Y to accept the changes. Startx

Passwordless SSH Using Shared Keys This is something I use quite often to ease automated (ie, scripted) jobs that are run on a host that needs to connect to another host via SSH/SCP. Just an aside, my favorite alternative to using shared keys for (faux) passwordless connections is an expect script that "expects" a password prompt, which expect will hand back to the host. But that approach is almost always more difficult, requires an understanding of the expect language and is generally less secure. So, below is one method of implementing shared key authentication for passwordless SSH connections. Just tell me how to do it already! OK :-) For the purposes of this example, I'll refer to the host we're connecting from as host1 and the host we're connecting to (without a password) as host2 Generate a shared key on host1 (the shared key will be /home/user/.ssh/id_rsa.pub) user@host1:~$ ssh-keygen -t rsa -b 1024 Generating public/private rsa key pair. That's it!

Hacking a Raspberry Pi into a wireless airplay speaker - Jordan Burgess The raspberry pi is fully functional credit card-sized computer that is cheap enough ($25) that it can be used just for a single purpose. With this hack the computer imitates an airplay speaker, making it possible to send songs over to an old stereo wirelessly from your phone. The Raspberry Pi generated massive hype in nerdy circles this summer when it came out and we’re beginning now to see some amazing hacks from this tiny computer now. I’ve had mine for a few months now but I hadn’t got around to using it yet. So I’ve now decided to try to make something that I’ve wanted for a while: a product to bring my good but dated speaker system into the 21st century by enabling wireless streaming of music to it. A possible way to do this would be to buy an Airport Express or an Apple TV and connect the audio out to the stereo. Here’s a video of it in action. How to fake airplay compataility To get a Raspberry Pi looking like an airplay receiver I made use of Shairport. Raspberry Pi Graphical method

sweet pi – sweet home - Funksteckdosen mit dem Raspberry Pi und pilight schalten Funksteckdosen mit dem Raspberry Pi und pilight schalten Da sich hier einiges geändert hat, habe ich mich dafür entschlossen einen neuen Anleitung zum Thema Funksteckdosen schalten mit dem Raspberry Pi zu schreiben. Das Projekt von CurlyMoo auf das sich die alte Anleitung bezogen hat wurde vom Autor CurlyMoo mittlerweile um einiges verbessert und erweitert und heißt nun pilight. Nachtrag vom 25. November 2013: Nun ist die Anleitung auf pilight 2 angepasst. Hier beschreibe ich das vorgehen für die Intertechno Funksteckdosen welche auf 433MHz Basis über Funk schaltbar sind. Was wird zusätzlich benötigt: Die Empfänger sind nicht gerade die Besten, aber sie reichen aus (zumindest bei mir) um den Code der Fernbedienung einmalig auszulesen. 1. Zuerst muss man die für die Installation nötigen Pakete installieren: sudo apt-get install build-essential dialog cmake git Dann kann pilight von CurlyMoo heruntergeladen, kompiliert und installiert werden. Dann die setup.sh ausführbar machen und ausführen.

RPi Low-level peripherals Back to the Hub Hardware & Peripherals: Hardware - detailed information about the Raspberry Pi boards. Hardware History - guide to the Raspberry Pi models. Low-level Peripherals - using the GPIO and other connectors. Expansion Boards - GPIO plug-in boards providing additional functionality. Screens - attaching a screen to the Raspberry Pi. Cases - lots of nice cases to protect the Raspberry Pi. Other Peripherals - all sorts of peripherals used with the Raspberry Pi. Introduction In addition to the familiar USB, Ethernet and HDMI ports, the Raspberry Pi offers the ability to connect directly to a variety of electronic devices. Digital outputs: turn lights, motors, or other devices on or off Digital inputs: read an on or off state from a button, switch, or other sensor Communication with chips or modules using low-level protocols: SPI, I²C, or serial UART Connections are made using GPIO ("General Purpose Input/Output") pins. Note that no analogue input or output is available. Links Useful P2 pins:

Raspberry Pi - run program at start-up Anyway, I wanted to get my Raspberry Pi to start no-ip dynamic dns service when it started-up, so I wouldn't have to remember to start it every time it was powered up. For details on how to install no-ip on the Pi, see this post. There are loads of ways of running a command at start-up in Linux but my favoured approach is to create an initialisation script in /etc/init.d and register it using update-rc.d. This way the application is started and stopped automatically when the system boots / shutdowns. Create script in /etc/init.d sudo nano /etc/init.d/NameOfYourScript The following is an example based on starting up the no-ip service [/usr/local/bin/noip], but change the name of the script and the command to start and stop it and it would work for any command. #! Make script executable sudo chmod 755 /etc/init.d/NameOfYourScript Test starting the program sudo /etc/init.d/NameOfYourScript start Test stopping the program sudo /etc/init.d/NameOfYourScript stop

Auto-connect to wireless nets? lizdainis wrote:pjc123 can you share your script ? autoconnect First of all, don't expect to just copy my scripts and expect them to magically work for your application. You might find it a lot easier to use one of the gui applications like wicd, although I don't know their capabilities. For me, I like to know what is going on, so I usually work with simple files whenever I configure something. 1) The config files scan for multiple routers, in the order given in the wpa_supplicant file. 2) Scan for routers with a hidden SSID (Not broadcasted). 3) I have two different wifi dongles that I use (An Edimax and a TP-Link). 4) I am using DHCP. 5) I am using WPA2. 6) You need to enter your SSID (and PSK if using one of the WPA protocols). 7) Just a side note that I set several other parameters explicitly, rather than relying on multiple or default settings. Here are my config files: A) /etc/network/interfaces: Code: Select all auto loiface lo inet loopback allow-hotplug eth0iface eth0 inet dhcp

Raspberry Pi « Naich's crappy blog These are appendixes from the set of posts about setting up and using a Raspberry Pi. Appendix A: Selecting an IP Address As part of the boot process, your Pi used DHCP to get an IP address from the router. The problem with this is that it is an automated process which is invisible to you unless you log onto your router’s admin page to discover it. If only the Pi and your router know what its IP address is, you don’t know where to log on to your Pi. The easiest thing to do is change the IP settings on the Pi’s card to a static address, assigned by you. You need to pick an address for your Pi – something like 192.168.1.16, but you want to pick one that is not in the range of addresses your router assigns for DHCP requests. I’m going to leave it to you to find out what range of addresses your router assigns for DHCP and which ones are suitable for static IP addresses. Go back Appendix B: The Linux Filesystem Here’s a quick and dirty note about the way the Linux filesystem is arranged. Eh?

Inputs - raspberry-gpio-python - How to use inputs in RPi.GPIO - Python library for GPIO access on a Raspberry Pi My favorites ▼ | Sign in Project Home Terms - Privacy - Project Hosting Help Powered by Google Project Hosting How to use interrupts with Python on the Raspberry Pi and RPi.GPIO – part 3 Multiple threaded callback interrupts in Python We’ve been learning about interrupts this week because of the brand new interrupt capabilities of RPi.GPIO. We covered a simple “wait for” interrupt in part 1, threaded callback interrupt and button debouncing in part 2 and today we’re getting sophisticated with multiple threaded callbacks. “WoooooooooOOOOOOOOOOOOOOOooooooooooo”, I hear you say. ;) Well actually, we’re not doing much that’s very different from last time, except, now there’s more of it. We’re just building on what we did before and this is exactly how programs are made. Here’s the Circuit This circuit is a bit different from the previous one. Circuit for 2 threaded callbacks and one wait interrupt We’ve used all the same building blocks we developed in parts 1 and 2, including button debouncing. Do you need to update RPi.GPIO? If you didn’t do it for the first or second examples, you will quite likely need to update your RPi.GPIO package. And now onto the code #! Bounce

Frequently Asked Questions Ebook Format Conversion What formats does calibre support conversion to/from? calibre supports the conversion of many input formats to many output formats. Input Formats: CBZ, CBR, CBC, CHM, DJVU, DOCX, EPUB, FB2, HTML, HTMLZ, LIT, LRF, MOBI, ODT, PDF, PRC, PDB, PML, RB, RTF, SNB, TCR, TXT, TXTZ Output Formats: AZW3, EPUB, FB2, OEB, LIT, LRF, MOBI, HTMLZ, PDB, PML, RB, PDF, RTF, SNB, TCR, TXT, TXTZ Note PRC is a generic format, calibre supports PRC files with TextRead and MOBIBook headers. What are the best source formats to convert? In order of decreasing preference: LIT, MOBI, AZW, EPUB, AZW3, FB2, DOCX, HTML, PRC, ODT, RTF, PDB, TXT, PDF How do I convert my file containing non-English characters, or smart quotes? There are two aspects to this problem: Knowing the encoding of the source file: calibre tries to guess what character encoding your source files use, but often, this is impossible, so you need to tell it what encoding to use. What’s the deal with Table of Contents in MOBI files?

Nokia Pi LCD + Switch Shield board v2 Hi Texy / all, 1st off, many thanks for the speedy delivery of this excellent looking board - nice job. Finally had an opportunity to setup a fresh PI to start experimenting with the board. I've installed all the necessary programs and files and yay the test program works. As I'm completely new to python I am wondering if anyone has some code they wouldn't mind sharing so I can start to try and get my head around some of the possibilities the screen affords? I've bought it for an audio installation that I have been wanting to do for a while (I'm a composer) and one of the absolute joys of the Pi's is that 'disposable' computing is now an actuality - i.e. My aims are hopefully quite simple:I would like to display a few words of text on the screen (grey background/black text/can you set fonts???) There's a few libraries for Pd that act as a bridge with python so I'm going to be checking those out as well. Best wishes to all and thanks again Texy for all so far, Julian

Related: