Open source software and hardware tutorials, Raspberry Pi hints and tips, learn electronics and LPIC practice exams How to Customize XBMC 12 Frodo with All the Bells and Whistles Kodi (formerly known as XBMC) is a great entertainment center software. But, here’s the deal: Like many other open source projects, it is driven by a very technical community, and it is not necessarily user-friendly enough for the average person to use and customize. Fortunately, with a bit of time and the right skin, you can set things up properly and make Kodi (XBMC) very user-friendly and rock solid. I have spent countless hours crawling forums and websites, trying to get the live TV setup, premium online content, automatic light control, and all the other settings right. Note: These step-by-step instructions have been tested with Kodi v15, but they should also be compatible with v16 (codename Jarvis). In this extensive and updated guide, I will walk you through the relevant customization tips and tricks needed to take your Kodi installation to the next level. Free Step-by-Step Kodi eBook: You’re almost done! Jump to any section of this post Install Kodi and Configure Basic Settings: Now:
Support for GPIO-driven interrupts maddin1234 wrote:Ok, perhaps MY process is sleeping, but then POLL has to run to thedoor and wake me up when someone is there.I didn't have a look into poll.c, but from the name I guess it is polling. poll(), and the similar select(), are the standard system calls for checking and/or waiting for one or more files to become ready for I/O. With a timeout value of zero, poll() simply checks whether each of the files is in the requested state and returns immediately. So you can use it to make your own polling loops. But with a non-zero timeout value, and if none of the requested conditions are already met, poll() puts the current process in an (interruptible) sleep state until some asynchronous event elsewhere on the system changes the state of one of files, or causes the timeout to expire. Neither the user process nor the kernel is wasting any CPU during the period when it is waiting for the pin to change state.
Raspberry Pi | WiringPi | Functions | Wiring Pi WiringPi provides some helper functions to allow you to manage your program (or thread) priority and to help launch a new thread from inside your program. Threads run concurrently with your main program and can be used for a variety of purposes. To learn more about threads, search for “Posix Threads” Program or Thread Priority int piHiPri (int priority) ; This attempts to shift your program (or thread in a multi-threaded program) to a higher priority and enables a real-time scheduling. The return value is 0 for success and -1 for error. Note: Only programs running as root can change their priority. Interrupts With a newer kernel patched with the GPIO interrupt handling code, you can now wait for an interrupt in your program. Note: Jan 2013: The waitForInterrupt() function is deprecated – you should use the newer and easier to use wiringPiISR() function below. int waitForInterrupt (int pin, int timeOut) ; e.g. gpio edge 0 falling before running the program. int piThreadCreate (name) ;
Tutorial: Interrupt-Driven Event-Counter on the Raspberry Pi --D. Thiebaut (talk) 19:57, 23 July 2013 (EDT) Install the WiringPi Library Get the WiringPi library from drogon.net Follow the directions on the Web site to download to the Pi. In my case the Pi is connected to my Mac through an ethernet cable, so I downloaded the tgz archive from (download wiringPi-cbf6d64.tar.gz) sftp firstname.lastname@example.org sftp> pwd Remote working directory: /home/pi sftp> put wiring.tgz Uploading wiring.tgz to /home/pi/wiring.tgz wiring.tgz 100% 108KB 107.8KB/s 00:00 sftp> quit Connect to the RPI and build the library tar -xzvf wiring.tgz cd wiringPi-cbf6d64/ . Add the new library to the libray path, as explained in the INSTALL file of the wiringPi distribution. sudo nano /etc/ld.so.conf and add the following line to it: /usr/local/lib Tell the system to configure the libraries: sudo ldconfig Our hardware setup is the same as that presented in Introduction to accessing the Raspberry Pi’s GPIO in C++ (Linux Way / SYSFS) on hertaville.com. ISR Code sudo .
Raspberry Pi | wiringPi | Serial Library WiringPi includes a simplified serial port handling library. It can use the on-board serial port, or any USB serial device with no special distinctions between them. You just specify the device name in the initial open function. To use, you need to make sure your program includes the following file: #include <wiringSerial.h> Then the following functions are available: int serialOpen (char *device, int baud) ; This opens and initialises the serial device and sets the baud rate. void serialClose (int fd) ; Closes the device identified by the file descriptor given. void serialPutchar (int fd, unsigned char c) ; Sends the single byte to the serial device identified by the given file descriptor. void serialPuts (int fd, char *s) ; Sends the nul-terminated string to the serial device identified by the given file descriptor. void serialPrintf (int fd, char *message, …) ; Emulates the system printf function to the serial device. int serialDataAvail (int fd) ; int serialGetchar (int fd) ; In your program:
Five Basic Raspberry Pi Projects At $35, the Raspberry Pi is almost an impulse purchase. Once its in your hands, its basic nature calls out for it to be used in some great projects. While its always tempting to jump in and build something completely mindblowing, it pays to start with a few easy projects and learn the system before jumping in to the deep end and experiencing frustration. Easy Project Criteria We classified easy, basic Raspberry Pi projects as ones that required a limited amount of programming expertise and required only hardware that might be owned already. 1. Turning the Raspberry Pi in to a webcam server for remote access, or monitoring or recording events while you are away is a great use of the capabilities of the Raspberri Pi. 2. The onboard 10/100 ethernet on the Raspberry Pi is a good start for providing basic internet connectivity, but today we expect our devices to have wireless capabilities. 3. 4. The display options on the Raspberry Pi make it a prime candidate for driving digital displays.
RPi Low-level peripherals Back to the Hub. Hardware & Peripherals: Hardware and Hardware History. Low-level Peripherals and Expansion Boards. Screens, Cases and Other Peripherals. Introduction In addition to the familiar USB, Ethernet and HDMI ports, the R-Pi offers lower-level interfaces intended to connect more directly with chips and subsystem modules. General Purpose Input/Output (GPIO) The layout of the Raspberry Pi P1 pin-header seen from the top, containing pins useable for general purpose I/O. General Purpose Input/Output (a.k.a. The Raspberry Pi allows peripherals and expansion boards (such as the Rpi Gertboard) to access the CPU by exposing the inputs and outputs. For further general information about GPIOs, see: the wikipedia article. The production Raspberry Pi board has a 26-pin 2.54 mm (100 mil) expansion header, marked as P1, arranged in a 2x13 strip. GPIO voltage levels are 3.3 V and are not 5 V tolerant. All the GPIO pins can be reconfigured to provide alternate functions, SPI, PWM, I²C and so.
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
Windows Installation Windows installation is very simple and works on Windows 2000 / XP, Vista and Seven. First, fetch the Windows installer from this link here and extract the contents to a folder. Next up, run the program called “setup.exe”, you may receive a UAC prompt if running Vista or later. You will now be presented with an interface such as this: Your SD card should be shown on the list. WARNING: This program enumerates ALL removable devices on the system, data loss can occur and I will not be responsible if you image the wrong device. Note if you want to use your SD card for purposes other than Raspbmc and the card only appears to be about 60MB in Windows: That’s because Windows does not recognise the Linux partitions that Raspbmc uses.