background preloader

Raspberry Pi - run program at start-up

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 Related:  Rasberry Pi

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. 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. On your pi, the files in the directory /usr/share/doc/wpa_supplicant explain what all these parameters mean, and there are various example files for different configurations. Here are my config files: A) /etc/network/interfaces: Code: Select all

Raspberry Pi No-ip Tutorial Gegevens Categorie: Tutorials Dynamic IP adres? No problem! Note - Its important you create yourself an account and add a host on no-ip before installing the client as you will need your account details as part of the install. Install no-ip client: Create a directory for the client software mkdir /home/pi/noip[ENTER]cd /home/pi/noip Download the client software wget Extract the archive tar vzxf noip-duc-linux.tar.gz[ENTER] Navigate to the archive directoryNote - use 'ls' to check the directory name create when the archive was extracted, it was noip-2.1.9-1 when I installed the client. cd noip-2.1.9-1[ENTER] Compile and installThe client was compiled and installed on the Raspberry Pi, using the following commands: sudo make[ENTER]sudo make install During the install I was asked to proide my login, password and a refresh interval.Run the clientThe client is run using the following command: sudo /usr/local/bin/noip2[ENTER]

Silverlight Developer » Blog Archive Bare Metal GPIO on the Raspberry Pi - Silverlight Developer The Raspberry Pi is classically used as a single board computer running Linux but it also offers the possibility of using the board without Linux (known as bare metal development). Add to this the availability of free ARM development tools and we have the opportunity to develop on a high speed ARM processor at a reasonable cost. This post explores the steps necessary to toggle a GPIO pin on the Raspberry Pi by directly accessing the registers without the presence of an operating system. Project Description For this simple project the software will need to perform three operations: Configure the GPIO portSet the GPIO pins for the selected portReset the GPIO pins for the selected port The application here will toggle two GPIO pins, one connected to one of the LEDs on the board (GPIO16 connected to the OK/ACT LED) and the second connected to a pin on the header (GPIO18 connected to Pin 12 on header P1). Resources Hardware Physical addresses range from 0x20000000 to 0x20FFFFFF for peripherals. and

R-Pi Troubleshooting Back to the Hub. This page lists the most common problems and suggests some solutions. See RPi_Bugs for problems that are bugs. Power / Start-up A good power supply that will supply 5 volts and at least 1 amp (5V 1A) is vital. Note that the Pi has no BIOS, so nothing will be displayed on screen unless the Pi successfully boots! Normal LED status There are five LEDS near the USB connector. See the next sections for how to interpret other statuses. Red power LED does not light, nothing on display The power is not properly connected. Red power LED is blinking The red power LED should never blink, because it is hard-wired to the 3.3V power supply rail. Red power LED is on, green LED does not flash, nothing on display Note: A faintly glowing steady green LED means no boot code has ever been executed, as almost the first thing the boot code does is to turn the faint glow off! The Raspberry Pi cannot find a valid image on the SD card. Green LED blinks in a specific pattern Coloured splash screen xset -r #!

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. You need to pick an address for your Pi – something like, 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. Your PC’s IP is so you pick for your PiYour PC’s IP is so you pick for your Pi Go back Appendix B: The Linux Filesystem naich@raspberrypi: ~ $ ls naich@raspberrypi: ~ $ Eh? Go back

Installing Transmission-daemon in Raspberry Pi running Raspbian - Robert Setiadi Website Transmission is a tool to download files using torrent service. Transmission-daemon is basically the same, but without user interface. We install it in always-on server (like Raspberry Pi), then access it from different computers. This guide assumes you already have Raspbian OS installed in your Raspberry Pi with LAN setting properly established. My Raspbian image file is dated 9 Feb 2013. Before installing new application or service in Raspbian, make sure to always type this into terminal :sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade If you’re installation is not the latest version, it might take a while as Raspbian will download the latest files from Internet. Now, open terminal again and install Transmission-daemon:sudo apt-get install transmission-daemon Ideally, we need two folders to contain Transmission files:mkdir /home/pi/progress (for incomplete downloads)mkdir /home/pi/completed (for completed downloads) You shall see many setting lines. 1. All done.

dwelch67/raspberrypi RPi Resize Flash Partitions This page describes activities relating to partitions on the Raspberry Pi for Linux based operating systems, such as Raspian Linux. It may also apply to other operating systems too, but you should check. Incorrectly using the following instructions is likely to corrupt your system. The prepared images for the Raspberry Pi are created for SD cards of the size of 2GB. The SD card can be resized or restructured to use the full size of a SD card that is greater than 2GB. Raspi-config If using the Raspian or Debian images the raspi-config utility can be used to resize the main partition to fill the SD card. This will happen automatically. Explanation Backup You might want to backup your SD before resizing partitions. Manually resizing the SD card on Linux Tutorial video here: Following on from the instructions above, keep the newly-written SD card in the card reader, but unmounted. Show partition information to find your SD card $ df -h Unmount the partition You're done!

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 Bare-metal Raspberry Pi Programming This book aims to be a guide and reference to low-level programming on the Raspberry Pi. If you are interested in porting an existing operating system, writing a new operating system, or just curious about the gory details of the Raspberry Pi then you've found the right place. The idea is to bring all the bits and pieces that are out there now together into a single place. Topics to be covered include Hardware detailsThe bootup sequenceARM assembly languageObtaining a toolchainPeripheral interfaces (graphics, network, usb, gpio, etc.)Memory mappingLow-level debuggingRaspberry Pi Hub Wiki Examples[edit] David Welch's Raspberry Pi bare metal examples References[edit]

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