source_id
int64
1
4.64M
question
stringlengths
0
28.4k
response
stringlengths
0
28.8k
metadata
dict
266
I know that Raspberry Pi does not come with a system clock to save money. How can I keep system time though?
Software Solution The most popular method of keeping system time is via the Network Time Protocol daemon (NTPd). NTPd is the most common method to synchronize the software clock of a GNU/Linux system with internet time servers using the Network Time Protocol. NTPd should already be installed and set up on the default operating system, Debian Squeeze. You will need to install and configure it manually though for Arch Linux. First you should install NTP. $ sudo pacman -S ntp Now you can manually update it via the command line. $ sudo ntpd -qg Or you can add it to the list of daemons on start up by adding it to your /etc/rc.conf file. Like so. # /etc/rc.conf DAEMONS=(!hwclock ntpd) Note that you need to disable hwclock by preceding it with an exclamation mark ( ! ) in the daemons list. Protip from mlp : If you add ntpdate to your list of daemons the time will be corrected after boot much faster. So your daemons list would look like so. # /etc/rc.conf DAEMONS=(!hwclock ntpd ntpdate)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/266", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/-1/" ] }
268
The quick guide says that the power supply for my Raspberry Pi model should provide at least 700mA. How about the upper bound? Is it fine to use a power supply with an high output current, say higher or equal to 1A? This is symmetric to my question: What happens if the power supply is 550 mA?
Just because a power supply is rated (ie. capable of) a higher current does not mean that this is what the 'sink' (ie. Raspi) will take. This is different to voltage, where excess voltage can indeed damage a circuit that doesn't have sufficient protection (eg. voltage regulators). Think of it with a battery. Most batteries are actually capable of quite high currents (albeit with a shortened life). However, something like a flashlight/torch will only take a current according to its design - and this is typically a lot less than what the batteries are capable of. After saying all that, you should try to avoid a power supply with an extremely excessive current rating because such a set-up will prove to be inefficient in operation and uneconomic (relatively expensive to buy - although it might be one you have spare). So 1 amp is fine and probably gives a healthy margin assuming you don't have many peripherals powered from it, but 5 amps would be excessive.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/268", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/91/" ] }
271
Raspberry Pi has a Micro USB port for power supply. My question is if this port is only for power purposes or can it be used for data as well? I would like to be able to attach my Raspberry Pi as a USB peripheral to another computer. Is this possible over a power port? If not, can this be done in another way?
I've had a look at the schematic ; the data pins for the micro USB connection are not connected to anything. Therefore, there is no way to mount the RPi as an external device. It could be possible to mount the RPi's hard drive or login over the network by using SSH. The GPIO pins include a set of UART data lines, which could be used to form a serial connection to the RPi from your PC. Bit-banging USB Bit-banging USB has been done ( AVR V-USB ), however, you would need to design your own expansion board that added another USB port. It is conceivable this port could power the RPi. Having done this, you would need to write some sort of driver. Good Luck. If you are prepared to go to all this trouble, it might be worth looking at an FTDI Chip instead. You would connect this to the UART pins of the RPi. From a software perspective, you would communicate with the computer as if it was a serial device.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/271", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/-1/" ] }
298
Can I use the GPIO as a pulse-width modulation output? If so, how would I go about doing it and how many concurrent, distinct PWM outputs can I have?
As suggested by Alex Chamberlain , the WiringPi library appears to support both hardware PWM output on one or two GPIO pins depending on model, and software PWM on any of the other GPIO pins. Meanwhile the RPIO.PWM library does PWM by DMA on any GPIO pin. Effectively this is a halfway house between hardware and software PWM, providing a 1 µs timing resolution compared to 100 µs with WiringPi's Software PWM [1] . Which of these is suitable for your applications depends on how many PWM outputs you need and what performance you want out of those outputs. If your application is tolerant of low-timing resolution and high jitter then you could use a software or DMA assisted timing loop. If you want higher precision / lower jitter PWM then you may need hardware assistance. When might software PWM be suitable? If you want to flash a bunch of LEDs with different human visible cadences (10's of hertz) with soft real-time response requirements then the software loop could handle as many PWM's as you have GPIO pins. When might hardware PWM be suitable? If you want to control a servo motor with hard real-time response requirements then you will need to use hardware PWM. Even then you may have problems ensuring a real-time response for the servo loop which ties encoder input to PWM output. A stable servo loop need to read encoders at a regular rate (low jitter), write out revised PWM output values at a regular rate and the latency between these should be fixed (low jitter overall). If you can't do this, then you will have to undertune (soft tune) your motor to prevent it becoming unstable under load. This is hard to do with a multi-tasking operating system without low-level support. What if I need more hardware PWM outputs? If you need to run more servo loops than you have hardware PWM outputs, then you are probably going to need to offload them to another device to ensure hard real-time performance, relegating your Raspberry Pi to being a soft real-time supervisor . One option, would be something like the Adafruit 16-Channel 12-bit PWM/Servo Driver - I²C interface - PCA9685 which would allow you to control 16 PWM outputs with just a few pins of GPIO for the I²C bus. For an example of its use, check out the I²C 16 Channel PWM/Servo Breakout - Working post on the Raspberry Pi forums. 1. Thanks to dm76 for the suggestion, however Auden Young says that RPIO.PWM may no longer work for newer pi models.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/298", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/93/" ] }
311
I have been writing programs for my Raspberry Pi (running Raspbian) for a few weeks now and would like to make sure I protect the work I have done. How can I backup the files I have created? Can I simply plug the SD card into my Windows (XP or 7) PC and copy it either to the hard drive or another SD card?
If you want to preserve all of the data, you will probably have to create a disk image. Furthermore, Windows cannot recognize typical Linux filesystems, so you probably won't even be able to see your files, when you plug in your SD card. Creating a disk image will preserve not only files but also the filesystem structure and when you decide to flash your new SD card, you will be able to just plug it in and it will work. Linux On Linux, you can use the standard `dd` tool: dd if=/dev/sdx of=/path/to/image bs=1M Where /dev/sdx is your SD card. Note: An of image created from a mounted partition on if may be corrupted. This risk is due to the fact that changes made to if may be incomplete when copied by dd . To avoid risk, the if should be un-mounted during dd . Mac On Mac, you can also use the standard `dd` tool with a slightly different syntax: dd if=/dev/rdiskx of=/path/to/image bs=1m Where /dev/rdiskx is your SD card. (using rdisk is preferable as its the raw device - quicker) To find out which disk your device is type diskutil list at a command prompt - also, you may need to be root; to do this type sudo -s and enter your password when prompted. Windows Option 1 On Windows, you can use the reverse process that you used when flashing the SD card. You can use Win32 Disk Imager , which is the preferred tool for flashing a SD card of the Foundation. Just enter the filename (the location and name of the backup image file to be saved), select the device (the SD card) and press read: Of course, you can also use RawWrite , dd for Windows or similar tools, the process is quite similar. Option 2 If you don't want to back up your entire system, but only specific files, I suggest you connect to your Raspberry Pi via SFTP and copy the files to your local computer (You can use the WinScp client). If you have SSH enabled, SFTP usually requires no special configuration on the Raspberry Pi side. Another option is to copy the files to a remote system using rsync . You can also install special drivers so your Windows can read ext filesystems (and will thus be able to read the whole SD card), such as ext2fsd but it is probably not worth the effort. Since the image will be of the same size as your SD card, you may want to compress it. This can be achieved simply by using your favorite compression tool, such as gzip , 7zip, WinZip, WinRar ...
{ "source": [ "https://raspberrypi.stackexchange.com/questions/311", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/56/" ] }
320
How long does the RasPi take to boot when using the standard Debian distribution on a typical SD card? Are we talking less than a second? A couple of seconds? 10 seconds? 100 seconds? This isn't too important for most users and applications, but could be important for embedded solutions which are not permanently switched on.
This is completely dependant on the Class of SD card you are using. A Class 4 card, which is the minimum recommended has an average read/write speed of 4 MB/sec. If you spend a little extra and buy a Class 10 card, you should find that the boot time is approximately 25% of the Class 4, as it should read at 10MB/sec. Using finnw's estimate that 24 seconds pass while using a Class 6 we can guess this could be reduced to 14.4 seconds with a Class 10 device. Classes 2-10 will give you boot times something like this: Update: With the release of new hard float distributions boot time has been significantly reduced. In addition, Arch Arm Linux is now using systemd instead of init which starts processes in parallel and is considered to be much faster. As a result my Class 10 SD card now boots Arch to a login prompt in about 6-7 seconds.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/320", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/104/" ] }
322
Is there a way to find the current firmware version number? Either the running version or the version currently installed in /boot ? uname -a shows only the kernel version, not the GPU "binary blob." Related: How do I update software and firmware?
You can check the GPU's firmware version by entering the following on the command line: sudo /opt/vc/bin/vcgencmd version
{ "source": [ "https://raspberrypi.stackexchange.com/questions/322", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/54/" ] }
325
I would like to run a headless machine to perform some basic automation and statistical generation (e.g. generating netstats, uploading to pvoutput.org), as well as any other trivial batch jobs that may spring up. As the RaspPi has been designed primarily as a learning device, is it still a good candidate for 100% up-time? I'm not sure if the unit's classroom-friendly design lends itself to such operational parameters (i.e. 'childproof' design = more robust; is the device built to run for the length of a school lesson etc). For the purposes of this question, I am assuming the RaspPi is housed in a case and located in a 'safe' operating environment (i.e. indoors). - 21 Oct 2012 : There is a useful related thread here re: SD card life: How can I extend the life of my SD card?
Yes, absolutely. Draws very little power Can be used for a number of server tasks that imply continuous uptime, eg. DHCP server Few people seem to have had issues through running them this way (and the passage of time is now definitely at a point where this is worth noting) Historically, there were a few negatives I could think of, I'll leave them here for reference: SD card has limited lifespan You could potentially find stability issues with some drivers Limited resources mean if there is a memory leak somewhere, or a process that suddenly eats lots of RAM, it won't be long before performance drops and / or a reboot is required. All of these points are now (June 2018) somewhat moot, though. A decent SD card in practice these days won't have a problem unless it's under very heavy use, almost all the early stability issues with drivers have been ironed out, and 1GB of RAM is heaps more than the original (original boards had 256MB, and up to half of that was eaten by the GPU.) I still wouldn't use it as a device that needed to be up 24/7 for some form of critical operation, but then again that's the same with any consumer grade PC.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/325", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/103/" ] }
336
Say I wished to have Debian Squeeze and Arch Linux ARM on my SD card. Would it be possible to dual boot from Grub?
While it is possible to put multiple operating systems on the SD card, there is no boot manager at the moment that runs on the Pi and can handle switching operating systems at runtime. What you could do though, is to have a shell script, located in /boot , that sets which operating system you want to use on the next boot. You could accomplish this by storing the boot files for different operating systems in another directory, like so. /boot/debian /boot/fedora /boot/arch Note: The needed files that have to be copied are /boot/cmdline.txt and /boot/config.txt . Then have your shell script copy the files from the appropriate directory and into /boot . That way, when you restart it boots into the desired operating system. References Raspberry Pi, using different distros.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/336", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/40/" ] }
340
I know that my USB powered Hard Drive doesn't work, but what is the minimum power requirement that the Raspberry Pi can fulfil for devices that connect via USB?
Recommended: 100mA You should not draw more than about 100mA from the USB ports. Source In reality, it is more complicated than this. I've taken two screenshots from the Device B schematic (released here ): Power in (fig A): We can see that the 5 volt line (+5V0) is powered directly from the USB input power, through a 1.1A, 6V Polyfuse (miniSMD). I believe this means that the 5V input is current limited to 1.1A (maximum hold current, not peak). Let's assume that you're powering the device from a regulated 5V supply capable of supplying at least 700mA. USB Power out (fig B): As we can see from fig B, the USB ports are current-limited by polyfuses (miniSMDC014) to 140mA (constant draw). Some users have discovered that their polyfuses at 100mA have approx 5 Ohm resistance, causing a voltage drop of V = iR = 0.1*5 = 0.5 V. This isn't ideal, as this means the output USB voltage would be 5 - 0.5 = 4.5 V. (This may cause some devices to not function if they expect 5.0 V) As the current draw on the USB increases (ie to 150mA), voltage drops further - 0.15*5 = 0.75 V, resulting in an output voltage of 5 - 0.75 = 4.25 V, which is below the USB spec minimum voltage of 4.40V ( source ). This is assuming the resistance doesn't increase with current draw, although in reality the resistance/current draw plot will look something like this: ( Source ) From a Q/A with Pete Lomas: The fuses kick in hard around 280mA and fold back and limit to 140mA. If you remove them then all you have for protection is the 700mA inbound fuse. The tracking on the board is good for 500mA+ so you could if you really wanted to. What about a powered hub – to power the Pi and bigger USB devices. To power higher power devices: (i.e. USB 2 devices) You should use a powered USB hub, that can supply >= 0.5A per USB port. This means if your USB hub has 4 ports, it should use at least a 2A power supply. Other options: If you don't want to use a USB hub with a second power supply, you can do one of the following options: These methods are not recommended, and may damage your board/devices. Create/buy a split USB cable that uses a separate 5V source (such as your input source). Raspi USB out (pins TX, RX, GND) ___ \_____ device 5V supply (pins 5V, GND) ___/ Join the output of the two polyfuses (solder a jumper across). As the polyfuse current is being split, this will allow up to ~200mA for one USB device, or 50/150 across two. You could also join the VCC of both USB ports: (untested) Connect the input VCC to the output VCC (disconnect the polyfuses first?). This will allow you to draw as much (combined) as your input can supply. Disclaimer: I am not involved in the design of the Raspberry Pi, and am not an expert on polyfuses. Modifying your Raspberry Pi is not recommended, will void your warranty, and may damage things. Please do not sue me. Please feel free to correct any mistakes I have (probably) made!
{ "source": [ "https://raspberrypi.stackexchange.com/questions/340", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/40/" ] }
344
How can I emulate the Raspberry Pi on Windows? Related: Emulation on a Linux PC
I found a rare gem of a tutorial while trying to find updates for the RISC OS distribution for the RPi. It goes in-depth on how to emulate the RPi in Windows using QEMU . The tutorial is also generous enough to provide a link to the Win32 binary for QEMU . I plan on following this tutorial myself when I find the time.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/344", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/35/" ] }
357
Is there a way to programmatically monitor the temperature of the BCM2835 SoC? If so, would it do any good? i.e. would temporarily suspending CPU-intensive processes have any chance to reduce the temperature? I know that one answer is that it should not matter because air cooling is sufficient. However, this is for a situation where air flow in the enclosure is very limited (and the SoC and ethernet controllers are not necessarily the primary heat sources.)
The ability to monitor the temperature of the GPU has been added to the firmware. /opt/vc/bin/vcgencmd measure_temp temp=48.7'C
{ "source": [ "https://raspberrypi.stackexchange.com/questions/357", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/54/" ] }
360
I would like to use my Raspberry Pi as a file server (NAS/SMB). Will I be able to attach a SATA/RAID controller?
You can build a NAS using... USB Hub Sata <> USB SATA Replicator / SATA Hardware Port Multiplier This is how you can chain the multipliers to RAID, RAID'ed RAID's. You can go 4 multipliers deep and choose from a few raid options. At the Start of the Chain where the blue arrow is your combined terabytes of storage, redundant in the way you configured it to be. This is the standard usage, where you can plug 5 hard drives and RAID them in a certain way, then connect that as a physical drive in 1 SATA port or USB SATA Interface. You just have to connect the Blue arrow to a SATA to USB converter. As long as you run at USB 2 speeds throughout, you can make quite a mean beefy NAS drive using a Pi. To power the unit there is a standard plug (good old 1.44" Floppy Drive Connector) It is used in all PC's power supplies for accessories now a days. In this picture is a MOLEX converter. It is the smaller connector. The voltages are: YELLOW - 12V RED - 5V You need to check how many amps it needs. But if you going to power 5X3.5" Hard drives then a 250Watt power supply will be the best option for powering everything, even the Raspberry from the 5V line! Good luck :) -EDIT- Specifically useful for Raspberry Pi 2+ and a nice alternative to untrustworthy RAID systems. Instead of using the RAID function on these boards, configure each drive in JBOD and use ZFS to create volumes. ZFS is very stable and guarantees you won't lose a 'bit' of data before it tells the system it's done. Most RAID controllers, like these possibly, usually tell the system the data is written, then flushes data to the drive, which may become corrupt during flush and then absolutely tells nobody, 'dirty' little secrets.. ZFS, firsts writes, verifies and then says everything is OK. Plus, you can always move your drives into a FreeNAS setup and import the volumes easily as if nothing has happened. Remember though, the bandwidth is limited to USB2 speeds. A great speed, and fairly well balanced setup is 4 HDD's setup as 2x2 mirrored. It gives you half the capacity with 1 to 2 redundancy. ie 4 x 1TB gives you 2TB total, but wait... ZFS talks to each drive separately, write speeds of 1 drive (~50mb/s) ... read speed of 2 drives (~100mb)!!!! A blazing fast combination would be mirror 1 X 4. ie 4 x 1TB gives you 1TB BUT, read speeds of up to 200mb/s!!! Write speeds of 1 drive still.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/360", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/35/" ] }
374
When I go to download Google Chrome from http://www.google.com/chrome in Midori on the Raspberry Pi , I am presented with a modal dialogue box, Please select your download package: 32 bit .deb (For Debian/Ubuntu) 64 bit .deb (For Debian/Ubuntu) 32 bit .rpm (For Fedora/openSUSE) 64 bit .rpm (For Fedora/openSUSE) Not Debian/Ubuntu or Fedora/openSUSE? There may be a community-supported version for your distribution here . Is it possible to install Google Chrome on the Raspberry Pi? How would I go about it?
You can't install Google Chrome, but you can install Chromium. As other people have posted, Chromium is the code base out of which Google Chrome is compiled. Chromium is an open-source version of this browser. Simply type the following. Debian $ sudo apt-get install chromium-browser If you receive any errors running this command, try running $ sudo apt-get update and then rerun the first command again. Arch $ sudo pacman -S chromium
{ "source": [ "https://raspberrypi.stackexchange.com/questions/374", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/181/" ] }
381
Should I just pull the plug? Or is it best if I exit LXDE and any other running processes first?
You definitely don't want to just pull the plug. This can cause problems with the SD card and file system. From the command line When using the command line or a terminal window, you can enter the following to do a clean shutdown: sudo shutdown -h now From the LXDE GUI Click the shutdown button (red power button) in the menu bar at the bottom right corner of the screen. Click shutdown (or "logout" as shown on newer versions, then issue the shutdown command listed above). Once it says System halted , you can remove the power cord if needed.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/381", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/181/" ] }
387
I am aware that Linux distributions usually have 'package managers' to allow me to download and install software from the command line, and that I should also be able to download and compile source code from the Web. But I am not sure about how best to do either of these things on the Raspberry Pi.
Debian APT is the package manager under Debian, for Raspberry Pi or any other system. The command line tool curl is installed in this example. You need to be connected to the Internet. If you haven't done so recently it is worth running, sudo apt-get update This updates the list of packages that are available to apt-get. Then use apt-cache to search for the package that you want to install, in this case, apt-cache search curl Every package name or description with the word 'curl' in it will be displayed in a list. This is useful in cases where you are not sure as to the exact name of the package that you want to install. Once you have the name of the package that you want, install it as follows, sudo apt-get install curl If you're not sure what you're looking for or just wish to browse through what's available, you can alternatively use the menu-driven tool Aptitude: sudo aptitude
{ "source": [ "https://raspberrypi.stackexchange.com/questions/387", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/181/" ] }
487
Are there any security implications for creating (or not creating) a new user? If need be, how do I create a new user or change the default user?
Debian The official Debian image ships with at least 2 users, root and pi . You will only be able to login to the pi account. How do I change pi 's password? At the very least, you should change the password for the pi account, as anybody with a RPi will be able to log onto yours. To do this, run passwd from the command line and follow the prompts. How do I change pi 's username? If, like me, you want to use your own name, you want to use usermod like this: usermod -l newname -d newname -m oldname There are more options for usermod , which can be found by running man usermod . Should I set a password for root ? Debian's root does not have a password and is inactive - you cannot login to it or su to root . You should not change this, as it is a security risk and sudo is more secure. So, are my files secure once I change the password? Don't be too relaxed with your RPi's security though, the filesystem is not encrypted, by default, and therefore, anyone with physical access can just remove the SD card and read it using another machine. Related questions Why do I have to sudo ?
{ "source": [ "https://raspberrypi.stackexchange.com/questions/487", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/181/" ] }
499
Even though my SD card is 16GB, the image I flashed onto it was only 2GB and now I can only see 2GB of storage space on the disk. How can I resize the image so that I have more space on my root partition?
Assuming you are using Debian. The Short Version: Backup your system Remove the main and swap partitions (leaving the boot partition alone) Recreate the main partition to utilize the remaining disk space (excluding the boot partiton). Make sure to reuse the same start sector as the original root partition. reboot the system resize the new boot root partition to utilize the full partition size. Step by Step Instructions First make a backup of your SD Card using the instructions found here in case something goes wrong. From the command line or a terminal window enter the following sudo fdisk /dev/mmcblk0 then type p to list the partition table you should see three partitions. if you look in the last column labeled System you should have W95 FAT32 Linux Linux Swap make a note of the start number for partiton 2, you will need this later. though it will likely still be on the screen (just in case). next type d to delete a partition. You will then be prompted for the number of the partition you want to delete. In the case above you want to delete both the Linux and Linux swap partitions. So type 2 then type d again and then type 3 to delete the swap partition. Now you can resize the main partition. type n to create a new partition. This new partition needs to be a primary partition so type p . Next enter 2 when prompted for a partition number. You will now be prompted for the first sector for the new partition. Enter the start number from the earlier step (the Linux partition) Next you will be prompted for the last sector you can just hit enter to accept the default which will utilize the remaining disk space. Type w to save the changes you have made. Next reboot the system with the following command: sudo reboot once the system has reboot and you are back at the commandline enter the following command: sudo resize2fs /dev/mmcblk0p2 Note: this can take a long time (depending on the card size and speed) be patient and let it finish so you do not mess up the file system and have to start from scratch. Once it is done reboot the system with the following command: sudo reboot You can now verify that the system is using the full capacity of the SD Card by entering the following command: df -h Why This Works: The real magic here is that you delete the root and swap partitions, then recreate only the root partition (using the original start sector) before writing the data to the disk . As a result you don't erase the existing data from the root partition. By removing the swap partition you allow the root partition room to grow beyond its current size and fill the unused portion of the disk (because of the placement of the partitions -the root partition is sandwiched between the boot and swap partitions - it can't simply be resized leaving the swap partition alone). You then resize (which is safe to run on a mounted disk) the file system to use all the space in the new root partition. ref: http://www.youtube.com/watch?v=R4VovMDnsIE http://www.raspberrypi.org/phpBB3/viewtopic.php?f=5&t=5584
{ "source": [ "https://raspberrypi.stackexchange.com/questions/499", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/40/" ] }
508
With the large number of Raspberry Pis in the wild, and the fact that large groups of them are configured identically (when a newly-flashed SD card is installed with one of the few available images), they are likely to be a tempting target for malware, including botnets. What can be done to mitigate this? It is reasonably well known that one should change the password for the "pi" user (Debian) and "root" (Arch.) But how about other system accounts (e.g. "tli", "pnd"?) Do any of them have universal passwords that are presumably the same for all units? And are there any known vulnerabilities in other packages that are installed in the SD images available for the Pi (e.g. because of hardware limitations, or cut-down versions of those packages?) In particular I am worried about ssh , mysql and any other services that may be running on a newly-installed image.
Things I've noticed so far about the stock Debian Squeeze image: /etc/shadow contains a bunch of password hashes for accounts that aren't the pi account (buildbot, etc). Change the password on the pi account, naturally, if you haven't already (or make a new user account for yourself and delete the pi account) but also edit the other entries and replace the hashes with *s. Note /etc/passwd contains duplicate entries for the pi account, which confuses the hell out of adduser / deluser, just delete one. the default ssh daemon configuration permits remote root login. This should be disabled. worth using netstat to check the set of things listening for connections; a surprising amount of stuff is running compared to a typical minimal Debian netinst. It's generally a good idea to reduce exposure to just the things you need , so first either disable or firewall off everything , then expose just the services you deliberately want visible on the public internet (typically just ssh or ssh+http). you'll want to change the ssh host keys rather than using the ones in the image (AIUI the latest image actually regenerates them on first boot)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/508", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/54/" ] }
510
Arch Linux has the AUR (Arch User Repository), a collection of user-built packages. How do I install these packages on Arch Linux ARM though?
According to the Building Packages page from the Arch Linux ARM, you need to. Install the build essentials. These are needed to compile packages on Arch Linux ARM. $ sudo pacman -S kernel26-headers file base-devel abs Obtain the PKGBUILD . You need to download the tarball that you want. You can find the tarballs for programs at the AUR . Make the packages. Next you need to run makepkg in order to generate a package that pacman can install. $ makepkg -Acs The -A option ignores the target Arch architecture. The -c option cleans up the directory after makepkg is done, and -s installs the needed dependencies. It is advised that you do NOT run makepkg as root as it can cause permanent damage to your system. If you really need to run it as root though, use the --asroot option. Install the package. makepkg should have create a file in the directory with the filetype .pkg.tar.xz . You should install this package by using the -U option with pacman. $ sudo pacman -U x.pkg.tar.xz Make sure you replace x.pkg.tar.xz with the actual package name.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/510", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/-1/" ] }
520
I've launched into X using startx , but now can't shutdown my pi, as I have no mouse, and I can't seem to access anything with the keyboard alone. What can I do?
Try pressing Ctrl + Alt + F1 . This will switch you to a different tty. After logging in on this you can run commands as normal Any F key under 6 will do.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/520", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/160/" ] }
534
What is a definitive list of operating systems that work with the Raspberry Pi? I know of the distributions listed on their sites of course, but it could be beneficial to have a complete list of everything known to work (broken down by OS, and then distribution).
The OS distributions that are available as an SD card image are marked with . Beware not everything on this list will work on all models of Pi; non pi-specific GNU/Linux distros are usually for ARMv7+ and therefore only viable on the Pi 2/3. Some pi-specific images are also model 2/3 only, but this should be clearly indicated on the homepage if not here. There are also (non pi-specific) ARMv8 64-bit ("aarch64") GNU/Linux distros that should be viable on the Pi 3 but this is largely untested. Non pi-specific images (not having a dedicated SD card image is a clue to this) will probably at a minimum require you install the Raspberry Pi kernel; a generic ARM kernel will not work. See here for an example methodology regarding this. Alpine Linux , no SD card image but only require to extract tarball in the FAT32 partition ; works using multiple disk modes , "disk less" by default on RPi Android (emteria.OS) An unofficial port of Android in an installer for the RPI 3. Originally RTandroid. Commercial use only. Android (LineageOS) An unofficial port of LineageOS(Android 8.0) for the RPI3 Android (RTAndroid) actively updated, and here is a video tutorial Angstrom Linux Arch Linux ARM Images are no longer maintained for Raspberry. Installation is done from tarballs now with manual setup of partitions and file systems, see here . CentOS , Pi 2/3 only. Chromium OS [Daylight Linux] 11 Debian ARM DietPi , a lightweight Debian based distribution Fedora ARM Pi 2/3 only. Fedora for the Raspberry Pi Pi 2/3 only. FreeBSD Gentoo IPFire Kali Linux LibreELEC Lubuntu Raspberry Pi 2 & 3 Version Manjaro ARM for Raspberry Pi Meego MER + XBMC Minibian , a minimal Raspbian image Moebius , a minimal Linux distribution under development with a focus on speed and minimal memory footprint motionEyeOS , a Linux distribution that turns the Raspberry Pi into a video surveillance system. Nard SDK (Embedded systems) NetBSD OpenELEC + XBMC OpenWrt OSMC , Open source media center piCorePlayer PwnPi , a Raspbian clone for penetration testing. Does not seem to be actively maintained. Last version from 2012 works on Pi 1. Replace the files on the /boot partition with those of latest Raspbian to make it work on Pi 2. QtonPi Pi-topOS , a distribution specifically for the pi-top modular laptop Plan 9 Raspbian , a Debian derivative Raspbmc is now OSMC RaspBSD RetroPie Risc OS Slackware ARM also known as SARPi , a Slackware ARM Linux for the Raspberry Pi 1, 2, or 3. SliTaz Ubuntu Mate Void Linux Windows 10 IoT Core XBian , a small, fast and lightweight media center distribution based on a minimal Debian References This is a comprehensive list of OS available for the Raspberry Pi. The official site links to this eLinux wiki , so I presume this might be the most complete list at the moment. Distribution List on eLinux Wiki Official Downloads Raspberry Pi on Wikipedia - includes an extensive list
{ "source": [ "https://raspberrypi.stackexchange.com/questions/534", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/220/" ] }
542
I'm interested in using the Raspberry Pi as a pure embedded CPU unit, for the development of embedded applications. Since the Raspberry Pi has a powerful CPU with quite a bit of memory, it makes an excellent embedded board. Is it possible to use the Raspberry Pi without a Linux OS? How can I do this?
I've looked into bare metal programming on the Raspberry Pi and it sounds like what you want to do. There are several good forum topics about bare metal programming with some people who have put in a lot of effort to get their code to work. Check these out for getting started: Guide to Beginning Bare Metal on Raspi Programming the RPi on the bare metal Programming in Basic on Bare Metal Tutorial 1 or in general you can go to Raspberry Pi's Bare Metal Forum and just browse around. My understanding is that you will have to boot from the SD card due to the boot sequence built into the Broadcom chip. I'm trying to find the link for the boot sequence but my google fu isn't working, I'll edit later if I find it.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/542", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/226/" ] }
545
There are a few articles around that say it is best to use soft float algorithms on ARM devices, because very few ARM chips have hard float coprocessors. So, does the RPi have hard float support? If so, is it quicker that soft float? (It should be, right?)
According to the FAQs , the Raspberry Pi uses an ARM 11 chip with floating point support: What SoC are you using? The SoC is a Broadcom BCM2835. This contains an ARM1176JZFS, with floating point, running at 700Mhz, and a Videocore 4 GPU. The GPU is capable of BluRay quality playback, using H.264 at 40MBits/s. It has a fast 3D core accessed using the supplied OpenGL ES2.0 and OpenVG libraries. This will be quicker than soft float (if it isn’t, I’d be amazed!), though on systems without hardware support it’s often a better idea to leverage fixed point processing if you don’t specifically need the range offered by floating point precision.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/545", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/86/" ] }
547
I would like to hookup a GPS receiver to my Pi so that I can: Get my geographical position Synchronise clock when not connected to network What are my options? Will any hardware supported by gpsd work with the Pi?
GPS Receiver I would go for a generic usb GPS receiver such as the BU-353 It works with the Raspberry Pi, just like a normal linux computer. Most usb GPS receivers are just USB-to-Serial adapters that read the NMEA data from the GPS receiver. Look into pl2303 (many units i've seen use this particular chip) drivers, should be available. You can also use GPIO and a traditional NMEA 0183 GPS receiver, but then you need to worry about power, and the prices are often higher. GPS antannas are common onboard boats and ships, and usually consume 12v. The usb solution is cheaper. Software The gps receiver I mentioned is compatible with gpsd . sudo apt-get install gpsd gpsd-clients python-gps This will install gpsd and related software. Check gps status with cgps -s . NTP Clock To synchronize the clock with NTP , you need to install ntp. sudo apt-get install ntp See this blog post: http://blog.retep.org/2012/06/18/getting-gps-to-work-on-a-raspberry-pi/ . It covers ntp in detail.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/547", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/188/" ] }
625
I have a USB-Mains power adapter for charging up an iPod, which I thought I would use to power my Pi. It looks like this: with USB one side, and Mains the other. I was wondering if there are any dangers I need to be aware of when connecting my Pi to an adapter like this? I assume it is fused and everything, but better safe than sorry. Just realising I may be answering my own question, but it has 1A, 5V output.
Looks perfect to me (1000mA, 5V DC output). The point is that you are not connecting directly to the mains. The plug contains a transformer which converts the high-voltage AC input to low voltage DC output suitable as a USB power source. Directly connecting to the mains would be very dangerous!
{ "source": [ "https://raspberrypi.stackexchange.com/questions/625", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/186/" ] }
660
The first time I boot up my Raspberry Pi I get a login screen. What username and password should I use? That is, what is the default password for Raspberry Pi?
This depends on the distribution you have downloaded. The default passwords for common distributions are as follows: Distribution | Username | Password ---------------|------------|------------- Debian Squeeze | pi | raspberry Arch | root | root QtonPi | root | rootme Raspbian | pi | raspberry OpenElec | root | openelec Straight after logging in you should change your password by using the passwd command at the shell prompt $ passwd
{ "source": [ "https://raspberrypi.stackexchange.com/questions/660", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/188/" ] }
667
I would like to install VLC on my Raspberry Pi and wonder if it is possible? I can not find a distribution that supports it, but wonder if anyone has done this or knows a link to a site or group who has done it. My search on google didn't give much help.
Yes, VLC can be installed on the recommended Debian image using sudo apt-get install vlc . As far as I understand, VLC (>= 1.1) uses the VAAPI to decode video, if it is available. VAinfo should tell you whether hardware decoding is available and since all packages are available for armel, hardware acceleration should work from the technical side. Since omxplayer (part of XBMC) can utilize hardware acceleration VLC should be able to do so too, I guess.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/667", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/226/" ] }
673
I read that it's possible to allocate either 128MB, 64MB or 32MB to the Raspberry Pi's video memory. Given that my primary use case for this machine is educational: I will be running lightweight python scripts and web-browsing. Is it likely to suffer any loss of features by switching to only 32MB of memory for me? I do not anticipate wanting to use any 3D or playing any video.
I would expect you to not experience a noticeable difference unless you are doing graphically heavy tasks, such as playing video. However, it's difficult to gauge the optimal settings, as performance limits will vary depending on what applications are executing and user expectations. The best thing you can do is experiment. If you do want to change the split, then there are two different methods, depending on the firmware you have. If possible then make sure you have the latest firmware . If it is not possible for you to update for whatever reason, then I have included both options below: New Firmware (after October 2012) Edit /boot/config.txt and add or edit the following line: gpu_mem=16 The value can be 16 , 64 , 128 or 256 and represents the amount of RAM available to the GPU. Old Firmware (before October 2012) In order to alter the video memory you need to replace the start.elf file on the /boot/ partition of the image. The possible .elf files should be in the /boot/ directory on your Pi. You make the switch by replacing the start.elf file with one of the others. There are three memory models, and here are the recommendations taken from the Raspberry Pi discussion board : 224MB RAM and 32MB VRAM for a Linux desktop distro, or a heavy (non GUI) applications that don't need to play video, nor render 3D. 192MB RAM and 64MB VRAM (default) for desktop distro's that want to play video or have 3D effects. 128MB RAM and 128MB VRAM for applications and games that do extensive multimedia or play 3D rendered games. And one more: 240MB RAM and 16 VRAM for almost zero graphical power. There is enough GPU memory to render the screen, but not much else. Use this when you need a further non GUI performance boost.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/673", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/286/" ] }
697
There are 5 LEDs on the RPi: OK, PWR, FDX, LNK, 10M. I'd like to know if it's possible to control any of these from software i.e. turn them on, or change intensity (or even change colour gasp ). And if so, where can I read up about it? The LEDs could be quite handy way of signalling user application status when they are not required for the original use.
The OK LED can be controlled from user space software. Details here: Re: Can we control the on-board leds Summarised from the above (all credit to BrianW): The OK LED is available as /sys/class/leds/led0/ . The kernel LED driver has "triggers" which let some other part of the kernel control the LED. The default trigger for the LED is ' mmc0 ', which makes it come on when the SD card is accessed. root@raspberrypi:~# cat /sys/class/leds/led0/trigger none [mmc0] You can deactivate the mmc0 trigger as follows: echo none >/sys/class/leds/led0/trigger The LED can be turned on and off using the ' brightness ' file. The minimum brightness is 0, and the maximum is 255. As there is no variable brightness support, any value greater than 0 will turn the LED on. echo 1 >/sys/class/leds/led0/brightness echo 0 >/sys/class/leds/led0/brightness Setting the brightness to 0 automatically sets the trigger to "none". If you want the LED to go back to its default function: echo mmc0 >/sys/class/leds/led0/trigger There are a couple of kernel modules you can load up ( ledtrig_timer and ledtrig_heartbeat ) which will flash the LED for you. modprobe ledtrig_heartbeat echo heartbeat >/sys/class/leds/led0/trigger Once you have turned off the mmc0 trigger, you can use GPIO16 to control the LED. It's active-low, so you need to set the pin low to turn the LED on, and high to turn it off. From Python, you can use the module RPi.GPIO to control pin 16. There is also a C# driver. Sample code #!/usr/bin/python import RPi.GPIO as GPIO from time import sleep # Needs to be BCM. GPIO.BOARD lets you address GPIO ports by periperal # connector pin number, and the LED GPIO isn't on the connector GPIO.setmode(GPIO.BCM) # set up GPIO output channel GPIO.setup(16, GPIO.OUT) # On GPIO.output(16, GPIO.LOW) # Wait a bit sleep(10) # Off GPIO.output(16, GPIO.HIGH)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/697", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/188/" ] }
702
How can I talk to digital sensors over the I²C interface? Hardware: Which pins on the Raspberry Pi's GPIO can I use? Software: What I²C libraries are available?
There's a lot of information about RPi's GPIO here: http://elinux.org/Rpi_Low-level_peripherals According to it, you can program any GPIO pins for I²C, but: Pin 3 (SDA0) and Pin 5 (SCL0) are preset to be used as an I²C interface. So there are 1.8 kilohm pulls up resistors on the board for these pins. That wiki page also has some low-level GPIO code examples for various languages that should get you started. If you need a refresher on what I²C actually is, here's one which also takes the RPi into account. For specific I²C controlling, this python library might be helpful, it's discussed in this blog post , which includes a code sample.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/702", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/35/" ] }
715
Is it possible to modify the Pi, so that it can receive it's power via Power over Ethernet (PoE)? I would like to be able to power my unit via the ethernet cable, so that I don't have to worry about running power cords around the place.
As previously discussed RPi does not support PoE. And yes you could use a PoE module to hookup power to GPIO. But if you're not up for hardware hacking you could just get a Ethernet/USB power splitter off the shelf. For up-to-date product list Google is your friend. Searches to use include: power over ethernet splitter 5V power over ethernet micro usb Sample products include: http://www.cjemicros.co.uk/micros/individual/newprodpages/prodinfo.php?prodcode=TPL-POE+ADAPT http://www.dabs.com/products/axis-poe-active-splitter-5v-af-5008-001-4GQM.html http://hardware.deals/buy/raspberry-pi-802-3af-poe-splitter-adapter N.B: All second one will need 2.1mm to micro-USB adapter as well.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/715", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/387/" ] }
752
I am running the Debian wheezy beta and using my Pi to display my geckoboard dashboards using midori, as a result I want to prevent the screen from going blank, which it does after 10 minutes (though it doesn't seem to turn off the backlight). I have searched through the menu options and can not find how to prevent this. I came across a post on raspberrypi.org suggesting that the following: sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0" would solve the problem, but it does not work. I have also tried changing BLANK_TIME to zero in /etc/kbd/config without success.
This is an X power-saving thing. Firstly, you may need to install xset , a lightweight application that controls some X settings. apt-get install x11-xserver-utils Now open up your ~/.xinitrc file (if you don't have one then create it) and enter this: xset s off # don't activate screensaver xset -dpms # disable DPMS (Energy Star) features. xset s noblank # don't blank the video device exec /etc/alternatives/x-session-manager # start lxde This file runs once every time X starts and should solve the problem. I copy and pasted it from my own .xinitrc and can confirm that my screen does not blank.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/752", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/56/" ] }
796
I know it's possible to use FTP and various version control systems to upload or commit code developed on a full computer to the Raspberry Pi. Another possibility would be to simply use SSH and Vim (or Emacs). Is there an IDE that supports real-time remote file editing (or is there a better alternative)? Would putting a web server with a page running Ace on the Raspberry Pi and using a browser from another machine be feasible (or sensible)?
The IDE (probably) isn't the right place to be looking at this from. The simplest solution is to work with shared filesystems of some sort. For exporting from the Rapsberry Pi the easiest way to export to a Linux (or I think Mac) host is to use sshfs . You'll need to install that on the computer you want to work on (there are Debian/Ubuntu packages at least), but you won't need to alter the configuration of the Raspberry Pi itself at all. You can then mount your home directory on the device on your other computer by simply doing: sshfs [email protected]: /mnt/test Where 192.168.1.2 is the address of your Raspberry Pi. After that it's just a matter of taking your favorite IDE and making it work in the directory you just mounted. You could also install and configure Samba on the Raspberry Pi to export the filesystem as something Windows understands natively, or conversely mount a Windows share on the Raspberry Pi itself: aptitude install samba to install Samba smbpasswd -a pi to set a password for Windows file sharing with the pi user On the windows machine navigate to \\192.168.1.2\pi and enter the username/password you just configured. (Optionally) map the drive more permanently to a letter by going to tools->map network drive in explorer Doing it at the filesystem layer avoids needing to have a customised IDE to support what is otherwise a pretty standard system, so leaves you more choices to work with the tools you're comfortable with.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/796", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/20/" ] }
855
It seems silly to use our limited SD write cycles to upgrade the software shipped on the images. Can we upgrade the software and install new software before flashing an image to the SD card?
Yes The answer's always yes, right, just takes a while to work out how! The Hard Way I will be running this on a VPS, provided by Brightbox.com . I used a Nano Server (2 CPUs, 512MB RAM, 20GB disk space) and a Ubuntu Precise 12.04 LTS server image. It should work on EC2's or Linode's equivalents, and of course, on your home Linux machine. I have now tested it on my (x86) Arch installation, but know it doesn't work on Ubuntu 10.04 LTS because some of the packages are too old. Preparing your system - Debian/Ubuntu Ensure your own system is up to date. $ sudo apt-get update $ sudo apt-get upgrade Install some new software $ sudo apt-get install binfmt-support qemu qemu-user-static unzip qemu is an ARM emulator, and qemu-user-static and binfmt-support allows us to run ARM executables without emulating the ARM kernel. (How cool is that!?!) Preparing your system - Arch I can't find a statically linked qemu in the Arch repositories, so we will have to compile from source. Download the latest release from http://git.savannah.gnu.org/cgit/qemu.git Unzip and run ./configure --disable-kvm --target-list=arm-linux-user --static Build using make and install using sudo make install . Run the following as root echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register Warning You shouldn't run arbitrary commands you find online as root - these were taken from qemu-binfmt-conf.sh under the ARM cpu type. Please extract the commands from this file and run those. Download and unzip the image Go to raspberrypi.org and download the image you want. Unzip it and save the .img file somewhere useful. $ sudo mkdir -p /images/debian-squeeze $ sudo wget "http://files.velocix.com/c1410/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip" -O "/images/debian-squeeze.zip" $ sudo unzip "/images/debian-squeeze.zip" -d /images/debian-squeeze $ sudo rm /images/debian-squeeze.zip Find the correct partition The .img will contain 3 partitions, including the boot partition. $ cd /images/debian-squeeze/debian6-19-04-2012/ $ fdisk -lu debian6-19-04-2012.img Disk debian6-19-04-2012.img: 1949 MB, 1949999616 bytes 4 heads, 32 sectors/track, 29754 cylinders, total 3808593 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000ee283 Device Boot Start End Blocks Id System debian6-19-04-2012.img1 2048 155647 76800 c W95 FAT32 (LBA) debian6-19-04-2012.img2 157696 3414015 1628160 83 Linux debian6-19-04-2012.img3 3416064 3807231 195584 82 Linux swap / Solaris We need to know the offset of the Linux partition, in this case it is 157696 sectors, and the boot partition, which is at 2048 sectors. Each sector is 512 bytes, so the root offset is 157696*512=80740352 bytes and the boot offset is 2048*512=1048576 . Mount the image as a loopback device Next, we need to mount the image as a file system. This can be done using a loopback device. We use the offset from the previous section to tell mount which partitions to mount and where. The order of these commands is important. $ sudo mount -o loop,offset=80740352 "/images/debian-squeeze/debian6-19-04-2012/debian6-19-04-2012.img" /mnt $ sudo mount -o loop,offset=1048576 "/images/debian-squeeze/debian6-19-04-2012/debian6-19-04-2012.img" /mnt/boot Preparing the filesystem. We're nearly ready to chroot into our file system and start installing new software. First, we must install the emulator into our image, as it won't be available once we use chroot . Debian/Ubuntu $ sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/ Arch Linux $ sudo cp /usr/local/bin/qemu-arm /mnt/usr/local/bin/ All host systems We also need to provide access to certain other parts of the system. $ sudo mount --rbind /dev /mnt/dev $ sudo mount -t proc none /mnt/proc $ sudo mount -o bind /sys /mnt/sys chroot We are done! chroot away... $ sudo chroot /mnt You are now in your Raspberry Pi, but the services aren't running etc. Be careful, you are root! Update/Install software - Debian Image To update the software, we use apt-get . # apt-get update # apt-get upgrade You can also install software using apt-get install as per usual. Update/Install software - Arch Image To update the software, we use pacman . # pacman -Syu You can also install software using pacman -S as per usual. NOTE You can run pacman natively by following the instructions on How do I run my native pacman against a mounted image? . Exiting You can exit the chroot by using Ctrl + D and unmount the system by running sudo umount /mnt - you will have to unmount each mount point separately.. You should remove qemu-user-static from /usr/bin or qemu-arm from /usr/local/bin on the RPi, then the image is ready to be flashed. Final Words This is a little long and tedious, but do it once and you'll learn loads about how this all works! Note on latest images When trying to run do this on the latest images, you will get an error qemu: uncaught target signal 4 (Illegal instruction) - core dumped Illegal instruction (core dumped) To fix this error, simply comment out the contents of the /etc/ld.so.preload file The Easy Way - piimg I've started work on a utility for doing a lot of this for you. It is called piimg and can be found at github.com/alexchamberlain/piimg . So far, it can mount the SD card for you by running piimg mount /images/debian-squeeze/debian6-19-04-2012/debian6-19-04-2012.img /mnt and unmount them again by running piimg umount /mnt You just need to install qemu and chroot away. DISCLAIMER I, Alex Chamberlain, am the lead developer of piimg . As such, I may be biased towards the use of piimg in relation to other methods. References Running ARM Linux on your desktop PC: The foreign chroot way Getting 'illegal instruction' when trying to chroot
{ "source": [ "https://raspberrypi.stackexchange.com/questions/855", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/86/" ] }
858
I started out with a 2GB SD card, but I'm finding this a bit cosy, so I've bought a 16GB card to replace it. With a single Pi, can I transfer all my work between the cards, or do I need to start from scratch?
You should be able to copy the image, using the same application you flashed it with (or the dd command in Linux): dd if=/dev/sdx of=/path/to/image Where sdx represents the SD card. This can then be flashed onto the new SD card just like the original one: dd if=/path/to/image of=/dev/sdx For more information, see this question: How do I backup my Raspberry Pi? And you can see how to increase the size of the image here: How can I resize my / (root) partition?
{ "source": [ "https://raspberrypi.stackexchange.com/questions/858", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/160/" ] }
871
There are 5 status LEDs on the Raspberry Pi board. While I can guess what the POWER LED signifies (the power being attached), I am not sure about other four. So, what do OK , FDX , LNK and 10M signify?
According to http://elinux.org/RPi_Hardware Rev. 1.9 Boards D5(Green) - OK - SDCard Access (via GPIO16) D6(Red) - PWR - 3.3 V Power D7(Green) - FDX - Full Duplex (LAN) (Model B) D8(Green) - LNK - Link/Activity (LAN) (Model B) D9(Yellow) - 10M - 10/100Mbit (LAN) (Model B) Rev.2.0 Boards label the LEDS as ACT PWR FDX LNK 100
{ "source": [ "https://raspberrypi.stackexchange.com/questions/871", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/-1/" ] }
931
I have just ordered my Raspberry Pi, and I want to prepare my SD card. How do I install an OS image onto an SD card?
This Answer was useful in 2012 (and is still mostly valid) but has been superceded by superior methods. Users are recommended to follow the official Foundation documentation The process is pretty simple. Download the image First, go to the Raspberry Pi Foundation's Download page and download the image you want. The latest image is Raspbian Stretch, which is the official distribution for all Pi models. Alternatively, the Arch Linux image is great if you want a minimal install or if you've had a bit of experience with Linux before. Verify the Download The Raspberry Pi Foundaton provide the SHA-256 hash of the download, which we can use to verify the file was downloaded correctly and wasn't tampered with on the way. Windows You can use a utility provided by Microsoft called fciv or another provided by Frozen Logic called Summer Properties . Linux Run sha256sum 2018-06-27-raspbian-stretch.zip . The generated hash should match the one given on the website; for the 2018-06-27 zip, this is 8636ab9fdd8f58a8ec7dde33b83747696d31711d17ef68267dbbcd6cfb968c24 . For other versions, change the file name above as appropriate and verify against the hash on the website. Extract the img file Extract the .img file and remember where you put it. Take note of the image file name—you will need to use this later . In the case of a Linux host, check that your PWD is the directory in which the image file is stored. Linux You can use unzip from the command line. Installation The installation differs depending on whether you are using a Linux or a Windows host to flash the image onto the card. Windows Insert your SD card into your computer and note down the drive letter it is assigned. Download and install the Win32DiskImager . Select the image file you extracted earlier and the drive letter of the SD card. Warning There is a significant risk you could damage your file system if you select the wrong drive letter. Make sure you get it right! Click "Write" and watch the pretty progress bar. Linux Insert your SD card into your computer. Locate the device, by running sudo fdisk -l . It will probably be the only disk about the right size. Note down the device name; let us suppose it is /dev/sdx . If you are in any doubt, remove the card, run sudo fdisk -l again and note down what disks are there. Insert the SD card again, run sudo fdisk -l and it is the new disk. Unmount the partitions by running sudo umount /dev/sdx* . It may give an error saying the disk isn't mounted - that's fine. Copy the contents of the image file onto the SD card by running sudo dd bs=1M if=your_image_file_name.img of=/dev/sdx Of course, you'll need to change the name of the image file above as appropriate. Warning There is a significant risk of damage to your filesystem if you use the wrong /dev/sdx . Make sure you get it right! Have fun! Once you have installed the OS eject the SD card properly and insert it into the Raspberry Pi. Attach power and enjoy. References RPi Easy SD Card Setup
{ "source": [ "https://raspberrypi.stackexchange.com/questions/931", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/86/" ] }
949
It's fairly easy now to run headless from scratch with a Raspberry Pi. One area that might have an issue though is debugging issues with devices that have been added to the Raspberry Pi. Often you get indication of these problems in the messages that scroll through during boot. Are these messages echoed anywhere - to a log - or are they only available if you connect a monitor during boot?
Yes, there are logs for everything. If you connect a new device to the Pi then the module being loaded will show in dmesg . Eg; $ dmesg | tail [16037.102139] Initializing USB Mass Storage driver... [16037.102299] scsi4 : usb-storage 2-2:1.0 [16037.102422] usbcore: registered new interface driver usb-storage [16037.102425] USB Mass Storage support registered. All other logs will have their place in /var/log/ . Some important ones include: /var/log/boot - For all boot messages, such as daemons starting. /var/log/Xorg.0.log - All Xorg logs. Including any errors. /var/log/errors.log - Any system error will also be logged here.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/949", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/339/" ] }
1,010
Can I install the Ruby Version Manager (RVM) on my Raspberry Pi?
Yes! First, you'll need to install curl , git , and build-essential for your operating system. If you don't know how to install software for your system please refer to How do I install new software? . Next you need to download and run the bash script they provide. $ curl -L https://get.rvm.io | bash -s stable --ruby Next you can do one of two things. Close and reopen your terminal session, or Source the rvm script like so. $ source ~/.rvm/scripts/rvm Now you can check if RVM is installed by running the following command. $ type rvm | head -n 1 rvm is a function If you get a response like the above one RVM has been loaded and you can install a specific Ruby version. It is recommended that you install the latest stable release; which is Ruby 1.9.3 as of July 11, 2012. $ rvm install 1.9.3 Now the final the step is to tell RVM which version to use. In order to use a specific Ruby version for the duration of the current terminal session run the following. $ rvm use 1.9.3 If you want to use that specific version every time you open a new terminal session though you are going to have to tell RVM to set it as the default Ruby. Like so. $ rvm use --default 1.9.3 Congratulations, you have successfully installed RVM on your Raspberry Pi! Note build-essential is Debian's group for gcc , g++ , make etc. Arch includes a similar group called base-devel .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1010", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/167/" ] }
1,036
I have a big magnetic sheet that my Raspberry Pi is sitting on. It seems fine, but are there any dangers?
As far as I'm aware, nothing in the Pi uses magnetic storage, so it shouldn't pose a problem. The SD card uses electric charge to store data (as does all flash media), and the ROM is either the same (if it can be reflashed) or it's burnt in at the factory and impervious to most external fields. If you had a really strong magnet, it's possible you could induce some electric currents in the circuit as you moved the Pi in and out of the magnetic field, which could cause damage (if they are large enough currents), but I suspect the magnetic field would have to be so strong it would rip the Pi out of your hand first. So in short, outside of a laboratory setting or an MRI machine, no magnet should cause any problems for the Pi.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1036", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/571/" ] }
1,042
I've never used linux before, so this may be a problem with that, but I'm trying to simply SSH into my friends webserver using the info he gave me. I looked up that the linux command to ssh is ssh username@hostname . I'm not trying to type that into LXTerminal but everytime I hold shift and hit the number two I don't get @ I get " . Any ideas?
You need to remap your keyboard. By default it is set to a UK map. at the command line type: sudo nano /etc/default/keyboard and hit enter. locate the following line XKBLAYOUT=”gb” Change the gb to us (This assumes you want a us mapping, if not replace the gb with the two letter code for your country) and reboot your machine. if it pauses for a long time during the keyboard mapping stage, enter the following at the command line: sudo setupcon Your next reboot should be much faster. Reference: http://elinux.org/index.php?title=R-Pi_Troubleshooting&oldid=147362#Re-mapping_the_keyboard_with_Debian_Squeeze
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1042", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/571/" ] }
1,085
There are several articles with suggestions what to do with a Raspberry Pi but many of them are only ideas without any instructions. Is there a directory of projects that actually have been realized with list of required parts and steps how to do it with your own device? For example a collection similar to "Thingiverse" or "Solderpad" would be great!
Project directories with instructions: RaspberryPi.org 's official resources, mostly directed at students and teachers, but of very high quality. Instructables ' Raspberry Pi channel. They have A LOT of projects. Hackaday.io 's curated list for Raspberry Pi. You'll actually find a lot more by doing a search for "Raspberry Pi". Not all have instructions, but many are really cool. Hackster.io 's Raspberry Pi hub. They have fewer projects than the previous two but all have instructions and parts required. Adafruit 's Raspberry Pi section is brilliant and full of high quality tutorials. An open search for "Raspberry Pi" brings even more. Other sources for instructions and inspiration: You can run a YouTube search for Raspberry Pi (If you do this regularly you will want to sort by date uploaded). This will turn up a lot of breadboard experiments, including hooking up an LCD Screen . Be sure to check the comments section for build details. You can subscribe to the Raspberry Pi sub Redddit . Anything new an interesting will surely show up there. You can check out Mag Pi magazine . they have a few build and coding tutorials. You can also browse the Raspberry Pi forums , especially the projects section, and the Projects, Guides & Tutorials section of the R-Pi Hub at elinux. You can search github and github gists for Raspberry Pi. You can subscribe to tumblr's raspberry pi tag . You can also set up a Google alert to email you once a day with a list of resources the Googlebot has found while indexing the web. You can also join the Raspberry Pi community on Google+. You can like the Raspberry Pi Facebook page . You can search for Raspberry Pi on Pinterest Finally you can check out the Raspberry Pi User Guide that was recently announced. I realize this may not be the answer you were hoping for, but as I said the Pi is new and it will take some time to develop a community and ecosystem around it. Don't forget that you can always ask specific questions here as well. UPDATE 8/23/2015 OP's question was specifically about directories of projects that contain required parts and instructions. There are new ones that did not exist 2 years ago, so I've put them at the top of the list since they best answer the question. I've also updated resources that have moved or closed. (ben)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1085", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/626/" ] }
1,132
I've downloaded the newest Raspbian release and it is a little bit different than the original one. In particular, it gives a whole bunch of options to configure it the first time you boot it up. I'm just trying to do something simple like change the locale and I just don't understand what is happening. I hit enter on locale then it asks to choose a locale to be generated, so I scroll down to en-US.UTF8 UTF8 and hit enter again. Rhen it brings me to a screen that says lets you select default locale for the system enviorment: None or en_GB.UTF8 Which one should I select?
Since you are in the United States I would enter none . You can change this after your Raspberry Pi has finished the setup process if needed. In order to set the locale after you've setup Raspian run the following command to select the locale you want to generate. $ sudo dpkg-reconfigure locales It will then ask you which one should be the default. If you access your system via SSH it's advised to set it to none . References Locale - Debian Wiki
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1132", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/571/" ] }
1,177
I have tried Debian on VirtualBox and would like to check out Raspbian. How do I install Raspbian on VirtualBox?
VirtualBox lets you run x86 virtual machines on an x86 processor. Raspbian is a distribution for ARM processors. Raspbian cannot run in VirtualBox. Raspbian is essentially Debian with binaries compiled to match the Pi's processor more closely than the official Debian binaries. So if you're going to your system in a virtual machine rather than on Pi hardware, there is very little reason to run Raspbian and not Debian. If you really want to run Raspbian in a virtual machine on your PC (again, for most purposes, you might as well run Debian x86), you need one that emulates the hardware, such as QEmu . See Emulation on a Windows PC
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1177", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/634/" ] }
1,179
Raspbian claims to have "35,0000 Raspbian packages", which is great, but I'm only looking for a package or two before I install it. Is there a browsable repository package list that I can search with a web browser without being on the device itself? If there isn't a browser-friendly method, is there a way to download the package lists and browse through some other method?
From the Raspbian.org FAQ, The current list of packages in the Raspbian repository can be found in the text file linked below: http://archive.raspbian.org/raspbian/dists/wheezy/main/binary-armhf/Packages WARNING The download is 32MB. The file is plain text and a list of packages can be obtained with the following pipeline: grep -P '^Package:' Packages | cut -d' ' -f2
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1179", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/314/" ] }
1,187
I know it's not possible to directly boot from an external USB stick / drive, but instead you have to boot from the SD card and then the external device can take over. What's the easiest and preferred way to set this up, therefore boot from SD card and then let an external device take over?
If you have an existing OS running on the Pi, then firstly it would be useful to know if the USB device is supported. You can do this by mounting it like normal: mount /dev/sda1 /mnt If that fails then you wont be able to use the USB device as a root partition without enabling the kernel modules for it. And for that you may need to compile your own kernel. If it suceeds then it should work fine with some tweaking of the boot parameters that the Pi uses: On an existing image, open cmdline.txt , which can be found on the boot partition, and enter the following lines: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 rootwait text All you must then do is flash that image to the SD card and boot the Pi. If all is well, /dev/sda1 should be the location of the USB drive when the Pi boots, and thus it should attempt to use that location as root. The rootwait parameter is important as it will make the boot process hang until the USB drive is recognised. Without it the Pi may complain that the location doesn't exist. I suggest that you copy the root partition from an existing Raspberry Pi image to your USB drive and use that to boot from. Let me know if you need any further information.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1187", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/743/" ] }
1,217
Being new to Linux, maybe this is a stupid question! I don't quite understand how this distro thing all works, is Raspbian just compiled packages with source code taken from the individual repositories of the respective packages? Are there source code changes required to make a distribution, if so is there a branch or GitHub repository for instance? And lastly how does it relate to the 'linux' here github.com/raspberrypi/linux ?
Raspbian is a Linux Distribution . Anything that is built on top of the Linux Kernel can be called a Linux Distibution. Rather than a brand new OS, Raspbian is a modified version of the popular Debian Squeeze Wheezy distro (which is currently in stable testing ). It runs on a patched version of the Linux Kernel, which is what can be found on the Raspberry Pi GitHub . This version adds several Raspberry Pi optimisations to the kernel sources. is Raspbian just compiled packages with source code taken from the individual repositories of the respective packages The most important difference of Raspbian is that it is built with Hard Floating Point support, which drastically improves performance. Packages tend to be provided as source, and can be compiled with any compiler, in this case each package (apparently currently in the region of 35000), has had to built especially for the Raspberry Pi using a hard float compiler (and some other optimisations). Are there source code changes required to make a distribution, if so is there a branch or GitHub repository for instance? Are you interested in making a distribution? You could start by reading the processes that the Raspbian developers went through when starting out. Here is an interesting post on the forums that is worth reading. And then consider taking a couple of days to get to grips with a Linux From Scratch project.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1217", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/85/" ] }
1,219
I've been trying to get an accurate reading of my Raspberry Pi's MHz, since I overclocked it in /boot/config.txt My /boot/config.txt is as following: pi@raspbmc:~$ cat /boot/config.txt arm_freq=900 gpu_freq=350 disable_overscan=1 List of things I already tried: Look at the /proc/cpuinfo - No MHz listed, does have BogoMIPS at 697, while CPU speed is set at 900. The sysstat package - returns 0.00 MHz. cpufreq-info : no or unknown cpufreq driver is active on this CPU Any ideas?
Updated (much has changed): BogoMIPS is not useful for the new ondemand overclock config in raspi-config. It will provide 697 (which means 700MHz here) if you overclocked to 1GHz, because it is still in idle mode. 800 MHz are about 795.44 BogoMIPS . maximum CPU frequence (e.g. when your CPU is under load) sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq minimum CPU frequence (when your CPU is idle) sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq current CPU frequence: sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq If this doesn't exist, then your Raspbian is outdated. Try updating it using apt-get update and apt-get upgrade Overclock: Nowadays you can easily overclock the Pi with the help of raspi-conf to ondemand 1GHz at maximum, your pi may fail to boot afterwards.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1219", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/238/" ] }
1,247
Having tens of thousands of Raspberry Pi's connected to the internet is eventually going to capture the interest of some people who would like to do unsavory things to the little computers especially when many people are using their Pi to do network servers. Linux is a solid OS out of the box security wise, but aside from just changing the password what should be done to "harden" the Raspberry Pi if I intend to host internet facing services on the device? Just to support my "tens of thousands" quip, Eben Upton has said that "The Raspberry Pi has sold over 200,000 of its basic computer modules and is currently shipping 4,000 units a day" . Its probably safe to assume tens of thousands of those 200,000 have been connected to the internet. It is less safe to assume that tens of thousands of those internet connected Raspberry Pis are hosting a public facing web service, but the potential for hacker enthusiasm still exists.
Securing a computer is not a simple process, entire books are written on the topic. The Pi's size does not reduce the security threat or attack surface presented to a possible attacker. As a result, I will describe the steps involved and provide links to more detailed instructions and tutorials. Since you have not mentioned what distro you are using I will assume the recommended Raspbian Distro. Change the default password. The Raspbian distro includes this as an option in the initial startup script. If you did not do this already you can use the passwd command to change it. Make sure to choose a strong password . Disable unused services . I saw that the recommended Raspbian distro includes the Apache web server and enables it at startup (can someone confirm this) . Do you really need a web server running? If not disable it. If you do need to run Apache be sure to secure it , and do likewise for other service (e.g. FTP, NGINX, MySQL etc.), A google search should turn up several resources. Install and configure iptables . Keep your system up to date. You can automate this using cron or using cron-apt . Configure logging to monitor logins and failed login attempts. If possible use an external Hard drive to host you /var partition, this will give you more space, avoid the log files from filling up the SD Card and extend the life of your SD Card. Some additional things you may want to consider: Install virus protection . Setup and configure SELinux . You should also read this related question How can I protect against intrusion and malware before connecting it to the internet (especially on a public IP address)? . This is only the bare minimum steps for securing your Pi. For more info you may want to read the Securing Debian Manual .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1247", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/769/" ] }
1,262
I know that exact benchmark numbers will vary between manufacturers, but in general if you only consider higher end flash drives, SD cards, and USB HDDs and your Raspberry Pi is connected to a network via an ethernet switch what is the fastest configuration from a network data transfer standpoint? I'm only looking for answers in which people have actually tried the configurations listed below and have real results, not theory. Obviously an SD card must be used because it is required for at least part of the boot cycle, but lets assume that you have an additional data partition on each of the devices listed below which has the highest network transfer speeds on the Raspberry Pi? The SD card A USB flash drive A USB HDD This question is non-trivial because at some point processing overhead associated with one of the storage devices coupled with ethernet communication may impact transfer rate, also the ethernet port on the Raspberry Pi is controlled by the USB bus so in general throughput should be impacted by the coordination of ethernet data transfer and USB media data transfer. I do not know if the SD card is on the same shared USB bus as the USB ports and the ethernet port but if it isn't I suppose that would be a pretty large benefit performance wise. Edited to include network transfer as requirement for benchmark
In benchmarking you must always establish what your limits are. Because if you expect to get 100mbs out of that lan than you are only fooling your self! Look at this Block design of the RaspberryPI Model-B So we establish a very important fact here. Ethernet is bottlenecked by the USB controller because form the block digram we establish it is connected to the USB hub. (No clear indication is it uses another bus or just simply USB2?) Ohh look - another block diagram, Now that sheds even more light on the situation. The 10/100 controller is connected to the USB hub- unfortunately, again, no where on the spec does it say how fast the hub communicates with the lan controller-- expect for the key fact that is says the usb speed and lan are negotiated for mixed speed usb environments. Where is the SD Card? It turns out the SD card is directly connected to the BCM2835 (page 65) and they go into great detail how performance is impacted from various configuration levels. One important thing to notice is that if the SD card has a dedicated Clock it can run independently of the core CPU/GPU at full speed.(of whatever card and standard is used - you can see it supported a few standards.) So what does that mean? It means if you benchmark the faster SD card and crappy pen drive(4gb/8gb) you will most likely get massive performance differences. So now it raises the question, how does the CPU/GPU handle communication with this wonderful embedded device (usb/lan chip) and what speeds is it capable of communicating at. You see how far theory can actually go before we actually do any benchmarking? Another key point here is -- How does the CPU control flow of data. Does it use the separate clock channel as recommended? IN an ideal world you would think that this LAN/USB would handle it. But that requires a MCU.. do we see an MCY anywhere in that block diagram.. NO! So the CPU has to request IO DATA send it the USB port then it goes to the LAN port (via the Same USB HUB) Yes.. so that is going to cause some speed issues somewhere. Also great thing to note what happens when you copy to a USB pen drive and from the SD card all via LAN.. it is going to cause some traffic. We need to benchmark various aspects In establishing what we are trying to benchmark we can ask a real world question. How fast does the internal USB handle data from SD? How much CPU is used to read/write to SD then to LAN? How much CPU is used to read/write to a USB Pen drive? Does copying any data directly influence the CPU usage? How well does the embedded USB/LAN chip handle reading data from 2 sources back into the LAN port and does it affect the CPU proportionally? There is no need to test if lan will get full 10mb/s because its bottlenecked by the state in which the USB hub is in. Now that you know what you are fighting for I challenge you to answer them your self. You might find this a very good starting point. References Sources of images and data from http://en.wikipedia.org/wiki/Raspberry_Pi and the LAN/USB is directly off the manufactures website! Raspberry Pi official schematic Broadcom documentation But mostly, my own technical knowledge and assessments I have made based on my own embedded experience. The OP asked a very good question but lacks to understand that without theoretical understanding of a system you are doomed in trying to assess/solve the practical problems. Results (4) This answer shows some down to earth piratical testing. And it proves that doing intense data transaction directly influences the CPU (just not sure if its the SD card or the process of shifting data inside the BCM chip to the USB/LAN chip) (6) It has been proved that the only bottle neck is going to be the source (for example a slow SD card) The USB hub manages to pump data at 90%+ but answer to questions 4 and 5 can directly influence this performance. So doing some research and contribution of other users we are starting to establish and get preliminary results. Here is a nice chart to help visualise what we are dealing with.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1262", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/769/" ] }
1,318
During the installation of Raspian I chose "Start X-Server after boot", but now I want to boot it once without starting the X-Server, so I've got more memory to run a program. How do I boot without starting the X-Server?
With the Raspbian image, you can re-run the initial start up script using: $ sudo raspi-config and entering your sudo password. This will bring up the same menu options that you got after first boot. You do not need to remake all your first boot choices, just use the arrow keys to move to the menu options you want to change. In your case, selecting: Start X-server after boot? and choosing: no or disable will sort you out. Editing to add non gui based options: As noted in the comments below by @mirk, the exact command for the raspberry is: sudo update-rc.d lightdm disable
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1318", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/617/" ] }
1,353
I am teaching my daughter Python (and myself to some degree) using the Pi, and we have had a great time so far - but the CLI can only take us so far. I have started looking at other toolkits, specifically wx , Qt and GTK . These all seem to have great bindings for Linux in general, though I am not able to find a lot of info specific to the Raspberry Pi. I am open to other toolkits as well - as long as the python bindings are good. Does anyone have any experience coding to one of these on the pi? Is there a simple apt-get command I need to run to install the necessary packages? Better yet, is there a toolkit ready to go with the stock Raspbian image? Note: I am currently using Raspbian without issue, though Arch is tempting due to the hard-float ABI issues with mono.
I would recommend Tkinter, it is the standard GUI library for Python, and as a result is already installed. The IDLE IDE (which is included with the Raspbian image) not only supports Tkinter but is itself a Tkinter app. In addition most Python books will include at least a chapter on creating GUI's with Tkinter. If you prefer web resources you will want to check out Pythonware's Tkinter tutorial . Additional information and resources can be found on Python.org's Tkinter page .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1353", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/857/" ] }
1,360
As we all know, the Raspberry Pi doesn't really use that much power (5v + 700mA is the spec). I'd like to build a battery backup for power outages in a DIY-ish fashion. I don't need surge protection or any other fancy options, just security from minor power outages and brownouts. How can I put a battery backup between the Raspberry Pi and the phone charger I'm using to run it?
You question is more suited for the Electrical Design Stackexchenge site - Because you can always rely on the Gurus there, like Oli, to help design easy, up to date circuits. I think that this question will be asked by many more Raspberrians to come so this is actually a very good place to answer your question. My answer will go more into engineering your own circuit so that you can have full control of what you want it to do. The circuit should handle... Initially deciding what kind of circuit you need. Powered by USB 5V? or maybe by a 12 volt source? You can also power it from a lower power source like 3.3V/1.5V but is very inefficient in converting power. This decision also fundamentally contributes to what kind of voltage regulator you are going to use... if any. Keeping the battery charged up during normal operation (also each type of battery requires have charging characteristics, Lead Acid, Ni-Cd, Li-Ion, etc) The circuit needs to sense when primary power (USB +5V) stops providing power or similar. The backup circuit to charge your type of battery and an embedded circuit to possibly route power back into the main circuit when the main power is off. Optional. Build a trigger into the circuit that connects to the Raspberry PI's I/O system to send you and email,text message, make a phone call, trigger an alarm or turn of your kitchen lights. Searching around the internet most UPS circuits and schatics will include a transformer to reduce 110V/220V down to DC 12 Volts. Here is a very simple circuit used with Lead-Acid batteries (They are easy to charge and they keep charge for a very long time) Do not attempt to charge any other kind of battery with circuit... they will blow it up! Part List: R1 - 39 ohms 1/2W D1, D3, D4 - 1N4001 or similar diode D2 - 13V zener rated 1W C1 - 220uF electrolytic capacitor rated 25V C2 - 10uF electrolytic capacitor rated 10V IC - 7805 or similar 5V regulator BAT - 12V lead acid battery rated 1.2Ah minimum DC Input - 12 Volt DC I found this circuit while rummaging through the internet. This guy pretty much rips apart a notebook and recycles a few parts to make a decent system - Just remember to regulate the output voltage to 5V Final circuit - one of the easiest and most probably the one that many people would prefer to use is a USB charged UPS circuit using some small lithium batteries. This was answered at Engineering SE, please refer to the answer for details . Do not feel like building your own circuits? There is this MUPS available for purchase (gone, sorry) that does pretty much what the final circuit design outlines. References You can find a lot more circuits on this website -- WebArchive https://web.archive.org/web/20161028081245/http://www.simple-electronics.com/2012/02/5v-ups-circuit.html (please donate) Using search engines will also find a lot of other interesting facts and solutions Visit Electrical Engineering Stack if you have any circuit design questions.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1360", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/878/" ] }
1,367
Is it legal to freely manufacture, distribute and modify Raspberry Pi? Does Raspberry Pi have a license? Are the hardware documentations and specs available to the public? Are there any restrictions on the usage?
Keep in mind that just because the Raspberry Pi runs Linux does not assume any F/OSS requirements on the RPi hardware just as your desktop running Linux likely does not have F/OSS hardware. That said the Raspberry Pi Foundation has talked about opening up the platform in the future. So far schematics for the Raspberry Pi and an image from the Pi's gerber file has been released. The Broadcom ARM chip is decidedly closed source and many of the driver binaries are at the moment closed source as well. Go to the Raspberry Pi FAQ page then search for hardware documentation to get an idea of how much influence Broadcom has on the freeness of the Pi's hardware. If you buy a Raspberry Pi you own it and you can do with it whatever you would with any other product you own, but as of right now when you purchase a Raspberry Pi there are no licenses included.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1367", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/902/" ] }
1,384
Whenever I leave my Raspberry Pi on overnight, it always seems to have entered some kind of suspended state. The red power light is still on but the light on the USB WiFi device is off and I can't access it with SSH. I have no peripherals attached except for a USB WiFi device. I just use it headless as an audio player. Anyone know how to completely disable any kind of suspend features?
You didn't provide a lot of details, but I'm going to assume you are using a WiFi adapter with the Realtek 8192cu chip, since that seems to be commonly used. Mine is the same and I have been experiencing what I think is the same issue: when leaving the RPi idle for an extended period of time, the WiFi seems to be disabled and you can no longer connect via SSH, etc. I have been searching for a solution to this for months and only just now found one here: https://github.com/xbianonpi/xbian/issues/217 . The solution is for xbian, but it worked for me on Raspbian. The problem seems to be that the adapter has power management features enabled by default. This can be checked by running the command: cat /sys/module/8192cu/parameters/rtw_power_mgnt A value of 0 means disabled, 1 means min. power management, 2 means max. power management. To disable this, you need to create a new file: sudo nano /etc/modprobe.d/8192cu.conf and add the following: # Disable power management options 8192cu rtw_power_mgnt=0 Once you save the file and reboot your RPi, the WiFi should stay on indefinitely.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1384", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1096/" ] }
1,401
How do I hard reset a Raspberry Pi? Obviously you can power cycle , but is there a more subtle way, like a reset pin? It would be very useful to connect a watchdog in case the Raspberry Pi crashes (mine crashed last night). EDIT: The rev 2.0 board has a header you can connect a reset switch to.
You can use the BCM2708's hardware watchdog. To use it begin by loading the module: sudo modprobe bcm2708_wdog Then edit the /etc/modules file: sudo nano /etc/modules and add the following line: bcm2708_wdog Next you will need to setup the watchdog daemon. Install and confiigure it to start on bootup: sudo apt-get install watchdog chkconfig chkconfig watchdog on sudo /etc/init.d/watchdog start Next configure watchdog: sudo nano /etc/watchdog.conf Uncomment the line #watchdog-device = /dev/watchdog so it reads: watchdog-device = /dev/watchdog The watchdog daemon will send /dev/watchdog a heartbeat every 10 seconds. If /dev/watchdog does not receive this signal it will restart your Raspberry Pi. This can be useful if you are accessing your Pi remotely, and it dies or locks up. However, this is not the preferred method of restarting the system, but can be used to restart a locked system, where the only other option is to remove power from the device. Be warned that this can result in filesystem damage that could prevent the Pi from booting and operating correctly. More info including a method to test this setup can be found in Gadgetoid's blog post Who watches the watcher? . Binerry's tumblr post Raspberry Pi Watchdog Timer should also be a must read.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1401", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/590/" ] }
1,409
After I've booted up, what's the easiest way to obtain and display the IP address that the device is currently using? I'm using Raspbian, and ifconfig doesn't appear to be installed. Are there any widgets that display this information in LXDE?
ifconfig (part of the package net-tools ) is being deprecated and replaced by the newer ip command. You can use one of the following from the command line to determine your IP address: ip addr show Or a shortened version of this: ip a s This will typically show every ip address the system has, including 127.0.0.1 or ::1 - the localhost address. The addresses remaining that are not the localhost address (or an IPv6 link local address starting with fe80::) will usually be network accessible addresses. The command hostname --ip-address will also return the network IP address if your computer has been assigned a domain name by the DHCP server or a domain name is otherwise configured, but may return the localhost address if this is not the case. Although being depreciated, ifconfig is often installed by default still. One reason ifconfig may not work is because it usually resides in /sbin which may not be in your path. You may be able to run ifconfig as a normal user by running: /sbin/ifconfig If this doesn't work, it means ifconfig is not installed. You can install it with: sudo apt-get install net-tools
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1409", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/314/" ] }
1,446
I wish to reformat my SD card to use normally again (it currently has one 78 MB FAT32 partition and one 3.9 GB Linux partition). How do I do this (on Windows/Mac/*nix)?
You can use DISKPART in Windows, or the equivalent fdisk command under Linux/Mac. DISKPART (Windows) Start a command prompt, and start the DISKPART console. List all of your disks by typing LIST DISK , then select the proper disk with SELECT DISK # (where # is the SD card). You can then type CLEAN to clear the partition table on the card, effectively blanking it. MAKE SURE YOU SELECTED THE PROPER DISK BEFORE RUNNING THE CLEAN COMMAND! To create a primary partition to reuse the space on the card, type CREATE PARTITION PRIMARY . This will then reallocate the previously "cleaned" space. To format, type FORMAT FS=FAT32 QUICK , and finally, to reassign a drive letter, type ASSIGN . If you're unable to determine the proper disk, remove the SD card, run DISKPART and LIST DISK , and then re-run it with the SD card inserted. The SD card is just the disk that has been added. Note that the above commands are not case sensitive; I used caps to match the convention DISKPART displays. FDISK / CFDISK (Linux/Mac) In a terminal, start fdisk /dev/sdx where /dev/sdx is your SD card device (may depend on the Linux distro you're using, see below). You can then delete all existing partitions on the device by typing d, and then adding a single new partition & format it. You an also just type n to create a new partition table, and start laying everything out. cfdisk is also another viable tool, which is basically fdisk with a greatly improved user interface. In both cases, once the drive is formatted, you will lastly need to mount it. If you're unable to determine the proper device, remove the SD card, run fdisk -l , and then re-run it with the SD card inserted. The SD card is just the device that has been added.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1446", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/160/" ] }
1,505
The Arduino website sums it up as Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. It can be a nice interface to control servos and provide other connectivity provided by its many optional shields. How do I connect one to a Raspberry Pi? How do I setup communication?
Arduinos usually appear as USB serial devices. The current boards use the USB serial driver built into the main microprocessor, but older Arduinos (and clones) used separate third-party USB-serial chips. To simply receive Serial.print data on the Raspberry Pi from the Arduino, I use the GNU Screen program as a basic terminal: screen [serial-port] [baud-rate] (for instance screen /dev/ttyACM0 9600 ). I tested three different Arduinos, and one rather different clone. The newer variants all appeared as /dev/ttyACM0 ports, and the older ones /dev/ttyUSB0 . This is what I found, under Raspbian: Duemilanove - Serial chip: FTDI FT232RL ; Serial port: /dev/ttyUSB0 Uno - Serial chip: Atmel ATmega16U2 (or 8U2 on older boards); Serial port: /dev/ttyACM0 Leonardo - Serial chip: Atmel ATmega32U4 (built-in); Serial port: /dev/ttyACM0 OMS Omega-328U - Serial chip: Silicon Labs CP210x ; Serial port: /dev/ttyUSB0 . The Raspberry Pi may not provide enough power to drive an Arduino, so you might need external power. For completeness, I also tested a Prolific PL2303 , even although it's not on any Arduino I know of. It appeared quite happily as /dev/ttyUSB0 . For more complex communications with sensors, you might consider Firmata , "a generic protocol for communicating with microcontrollers from software on a host computer". It has implementations for Arduino, and Python libraries to run on the Raspberry Pi side. Here's a small example using pyFirmata to read an LM35 and change the brightness of an LED: #!/usr/bin/python # -*- coding: utf-8 -*- # simple test of pyfirmata and Arduino; read from an LM35 on A0, # brighten an LED on D3 using PWM # scruss, 2012-08-14 - tested on Arduino Uno & Raspberry Pi (Raspbian) import pyfirmata # Create a new board, specifying serial port board = pyfirmata.Arduino('/dev/ttyACM0') # start an iterator thread so that serial buffer doesn't overflow it = pyfirmata.util.Iterator(board) it.start() # set up pins pin0=board.get_pin('a:0:i') # A0 Input (LM35) pin3=board.get_pin('d:3:p') # D3 PWM Output (LED) # IMPORTANT! discard first reads until A0 gets something valid while pin0.read() is None: pass for i in range(10): pin3.write(i/10.0) # set D3 to 0, 10%, 20%, ... brightness print "PWM: %d %% Temperature %.1f °C" % (i * 10, pin0.read() * 5 * 100) board.pass_time(1) # pause 1 second pin3.write(0) # turn LED back off board.exit() There are some caveats when using pyFirmata: Analogue reads and PWM writes are normalized to a 0 .. 1 range, and not the standard Arduino 0 .. 255 and 0 .. 1023. You really need to start a separate iterator thread to stop old readings overflowing the serial buffer Since the Arduino is read asynchronously, make sure that the pyFirmata connection is fully initialized before reading from ports. Otherwise, None values ensue.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1505", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/203/" ] }
1,575
I am looking for a simple solution to play videos and music stored on my NAS. I've found the Raspberry Pi and projects like OpenElec and RaspBMC which will run XMBC on the board. My problem is that I've found inconsistent reviews regarding the performance. Some sources say, the board isn't powerful enough to render the GUI, which results in lagging, while others say, they play HD videos without any issues. Although the price of the device is pretty low, I don't want to buy it simply to find out it isn't powerful enough for my needs. It would be ok for me if I don't need to wait a minute for a reaction in the XBMC menu I have to wait some time until playback starts If it doesn't play all videos (I could re-encode) It would not ok If videos are lagging Is the Raspberry Pi sufficient for this requirements or should I have a look for more powerful hardware? Please keep in mind that I am not a consumer and I am perfectly fine to play around with the device.
First of all, remember that software for RaspberryPi is in early state of development and there are a lot of problems with it. They are worked on all the time but still, it's not yet as polished as it could be. Currently RaspberryPi is more oriented to developers than to normal users. It was never designed to be media center it just happens to be possible to use it like that. So a lot of people are running raspberrypi as media center with success. However here are a couple of glitches you may encounter: The CPU of RaspberryPi is quite low-end and it can't really decode video at decent speed (even SD MPEG2). Hardware acceleration has to be used but by default only H264 can be hardware accelerated. You can buy a licence key to enable additional hardware decoders from RPi foundation (currently you can buy MPEG2 and VC-1 license). Graphics chip on RaspberryPi is VERY powerful and if video is encoded with a format supported by the hardware decoder, it can easily play HD content 1080p. But you will have to transcode all your material that is in different formats. And hardware decoding only works with dedicated video player (omxplayer). It is used by RaspBMC so if you plan on using this solution, you should have no problem. If you are planning on running your own distribution, you have to integrate omxplayer. Also bear in mind that omxplayer is quite young project and while it's quite stable, it's not perfect (like most things on RPi dedicated software). Normal graphical environment (X server) does not use accelerated graphics. This is why you found some informations about slow GUI rendering. AFAIK XBMC is using OpenGL ES which does use hardware acceleration so it's not a problem if you plan on using it. There are some problems with sound as it's drivers are not good quality right now. You may hear some glitches in audio. There are also problems with USB on Rpi, this wont let you use USB card to make audio problems go away. And since network chip is also connected using USB, there may be some glitches. Most of them are addressed right now in new versions of software but there may be some more. Because of the way USB on RaspberryPi was designed and because of the drivers issues, there may be problems with some USB keyboards or other remote contollers. You may need to use good active hub to connect USB devices. Especially if you are planning on using Wifi. Most of the issues mentioned above will be invalid after some time as it will probably be fixed. But this may take some time to get there. To sum up - you asked if it's powerful enough. I believe it's not a good question because it's not really power issue here. Hardware is powerful enough (if you can transcode everything to h264) but software is not mature enough and has some glitches. It may not be simple enough to get it working without problem and this is what you are looking for. So my suggestion is - if you plan on learning something about Linux, embedded devices, multimedia etc and are willing to spend some time reading about that and experimenting and having working multimedia device is only a bonus, Raspberrypi will be good choice. if all you need is multimedia player, buy something else, some finished product designed for this purpose.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1575", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1093/" ] }
1,617
I have seen some examples of people powering their Raspberry Pis by wiring a DC "barrel plug" style power supply to the 5V and GND GPIO pins. What considerations should be taken when doing something like this? Do I need to add any protective components or will any decent 5V power supply with a high enough current be fine for long term use and not destroy my Raspberry Pi?
By the looks of the schematic the GPIO pins are connected to +5v Rail ; I have copied part of the input schematic on the USB power. In this sub section the +5v supplied from the USB connector is filtered to give a nice stable 5v supply to the 5V0 Rail. By studying the schematic you come to realise there are 3 more voltages (4 in total) used on the Pi. 5.0v; HDMI (self protected)(now I know why my active HDMI to VGA works OK) 3.3v; BCM and LAN IC's 2.5v; DAC 1.8v; BCM(RAM) and LAN This sub circuit which is connected to the 5V0 rail has 3 voltage regulators with their own filter capacitors. IMPLICATIONS To answer your question. Yes you can supply 5v on the GPIO pin. BUT, it has no backward protection and it was not really designed to be a 5volt input pin. the 3.3v pin can also be powered with 3.3v as the regulator has build in protection- but again it leaves your BCM unprotected! Typically any power pins on GPIO area are used to power extended circuits. You need to realise that the USB schematic was carefully designed to be used as the primary +5V input and protects the Pi from getting fried. The GPIO pin does not offer this protection fully and you really need to trust your power supply if you want to do that! Usually people make another high powered PCB to drive other things. For example an H-Bridge used to drive motors for a robot. All it needs is TTL signals to control the motors but it runs of its own power supply; and most of the time it supplies power to the MCU/CPU via its own protective circuits isolating it from the high power circuit. ALTERNATIVE It is not ideal but you can connect +5v to the TP1 and GND to TP2 (TP = Test Point) Cut the micro USB cable and use the RED and BLACK colour coded cables and connect it to your power adapter. Using power adapters that are rate more than 1AMP (1000ma) is fine. The Raspberry Pi will not use more than 800ma any way- But the voltage HAS to be 5votls
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1617", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1158/" ] }
1,633
I though about using the Raspberry Pi to switch on and off other electrical devices which unnecessary consume power in stand-by mode. In short, I'd like to control an AC socket or multiple sockets. How can one let the computer "push the button": Image: CC-BY-SA 3.0 by Firstfreddy The physical solution is a relay, but I don't want to build all on my own and play around with 220V and sparks when switching on and off ;-) By the way the Raspberry Pi requires 2 Watt in idle mode, so only using it as a switch to save energy might not make sense, so it should be usable for other purpose at the same time.
EDIT 2018 Years later and the hobbyist microelectronics community has exploded thanks to the like of cheap and power embedded computers, like Raspberry Pi. This caused mechanical relays that work direct of GPIO on 5/3.3V allot cheaper and easier to get. You can get them as singles or premade (Bangood, Seeedstudio, Gearbest, eBay, etc) ranging from 4 to 48 "channels" I have even seen. These are much more compact size, very affordable, safe and easy to use. # * * * WARNING * * * # Switching mains involves interfacing with potentially lethal voltages . Due care and competence is required. Death is possible. YMMV. This paraphrases Russell McMahon 's advice on Electrical Engineering ---Original Answer 2012--- Well you could use a Solid State Relay which is much smaller and easier to control than a mechanical relay (The big 12 volt ones used in automotive industry) , using an MCU or in this case Pi's GPIO pin. You have to drive the input pin constantly to keep the relay on (just like a mechanical relay). So if something fails with that signal, then the power goes off. To avoid that you have to design another circuit that can sustain itself. But you can get these pretty cheap on eBay and they are completely safe (isolated), so they won't blow up the Pi and do not require a lot of power to drive them, about 3~10mA. Just check the details before buying one. It is also worth noting they can heat up if you load them heavily (close to the maximum rating)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1633", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/626/" ] }
1,747
I'm following a number of tutorials that explain how to setup an SD card that boots automatically enabling ssh in the process. I'm doing this as I only have a laptop and no spare keyboard, screen, etc. My problem is I cannot find the boot_enable_ssh.rc file. All of the tutorials I've read describe using dd (so doing this using Unix (Ubuntu)) to write the .img file to the SD card. Done like this: sudo dd bs=1M if=/path/to/2012-08-16-wheezy-raspbian.img of=/dev/sdb This completes successfully; the next step is to copy the file mv /boot/boot_enable_ssh.rc /boot/boot.rc boot_enable_ssh.rc is missing. I've run the dd action using the two most recent image files from the RPi official site - 2012-07-15-wheezy-raspbian.img - 2012-08-16-wheezy-raspbian.img but for both, there is no /boot/boot_enable_ssh.rc file. I've also tried searching with find ( sudo find /media/ -name boot_enable_ssh.rc ). Still with no success. Am I doing something wrong is there another way to get ssh going?
Although Raspbian used to enable ssh by default, from December 2016 it no longer does so. While there is still no boot_enable_ssh.rc file as the OP requested in 2012, ssh can be enabled on first boot by creating a file called “ssh” in /boot . As /boot can be written to by any OS that understands SD cards, this extra step is easily done on first installation. It does not need to be done again with the same card image. You can also enable it through raspi-config as before. The Raspberry Pi Foundation chose to do this as enabling ssh by default and having a well-known user name/password combination is a security risk .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1747", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1290/" ] }
1,792
I ran an update and an upgrade ( apt-get update and apt-get upgrade ) and I get the following message: The following packages have been kept back: alsa-base scratch What do I do to get these upgrades?
Execute: apt-get dist-upgrade That will fix your problem. This is a classic apt issue. The following is taken from the man pages: upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list . Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first so that apt-get knows that new versions of packages are available. dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1792", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/37/" ] }
1,836
After searching all over my house, all I could find was an LG "Travel Adapter" with an output of 5.1V == 0.7A. Will the extra tenth of a Volt harm the Raspberry Pi?
No. You have +5% tolerance. This means that the voltage should be between 4.75V and 5.25V. 5.1V should be fine. Moreover, you can find such adapter on a list of verified power adapters on RPIs wiki . Keep in mind, however, that 0.7A is quite low. It is recommended to have at least 0.7A but remember that you are on a low side of this parameter. Please also note that power adapters does not always provide what they say they are and there is some tolerance to it's values (and it's usually not specified by manufacturer). So if you have any problems with your board, I suggest you to do simple voltage test as described on this wiki page . Actually, I suggest to do this even if you don't see any problems and also test the voltage given without load on the PSU before connecting it to RPi.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1836", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1444/" ] }
1,841
I edited the file /boot/config.txt to increase the CPU speed to 800MHz. dmesg includes the following line bcm2835-cpufreq: Freq 800000->700000 (min=700000 max=800000 target=700000 request=700000) Sure enough, my CPU is only running at 700MHz. Why won't my Raspberry Pi overclock? I'm running Occidentalis 0.2.
There was a change in the firmware/kernel recently, that enabled kernel CPU frequency scaling. Now, you don't set static CPU frequency in config.txt, you set maximum frequency. If your system is on load, it will change CPU frequency to higher value (it is called turbo mode , you can see the max setting in your log line) but if your system is idle, it will lower the frequency to the minimal value (by default it's RaspberryPi default values - 700MHz for ARM, 250MHz for core, 400MHz for SDRAM). It will also lower voltage if you are using overvoltage settings. By default ondemand frequency governor is used. You can change default values (used when idle) with arm_freq_min , gpu_freq_min , core_freq_min , sdram_freq_min and over_voltage_min options in config.txt . You can also disable this behaviour and return to what it was working before this change was introduced to firmware with force_turbo=1 in your config.txt file. This way CPU frequency scaling will be disabled. There are also two more changes when force_turbo=0 (which is default default): h264/v3d/isp freqencies are not scaled so if you want to overclock them, you also need force_turbo=1 overvoltage max value is 6 (1.35V), instead of 8 Also note that you can change some of the frequency configuration (at least for ARM) dynamically using sysfs . Just take a look at: /sys/devices/system/cpu/cpu0/cpufreq/ You can read about this change here .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1841", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1312/" ] }
1,852
This question asks about using /proc/cpuinfo to identify the revision of the board I have. Are there any visual characteristics that differentiate between the different board revisions?
Wikipedia has a good graphical summary of the various board designs: Raspberry Pi 1 model A+ revision 1.1: Raspberry Pi 1 model B and B+ revision 1.2: The Raspberry Pi 1 model B revision 2: The Revision 2 board has holes for an additional header next to the main header P1 and also there are now mounting holes.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1852", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/314/" ] }
1,919
Since August 24 2012 , it is possible to buy a licence to hardware-decode MPEG-2 videos. Here are my questions: Does it mean that, without this licence, the RPi cannot handle at all MPEG-2 video, or it will struggle to play it smoothly? In what form comes the licence? Is it a file to install in the ditribution? Or is it a hardware activation or something? Thank you.
The license enables you to decode and encode (where applicable) the mentioned media types using the built in hardware encoders/decoders. H.264 Encode is enabled in the latest version (Included in Pi Price) which is great! For an extra £2.40 you can watch MPEG2 video, ie DVD's are encoded in MPEG2! For an extra £1.20 you can decode VC-1 video, ie Microsoft's Silverlight Video Hardware en/decoders are much faster and do not rely on the core CPU to process these files; rather the GPU is used to process the files. It talks directly to the Video Memory (decoding) or RAM (encoding) making it nice and smooth. You do not need this license and can use software versions. But it is really slow. The license will be a file you place somewhere or a key you define as a global variable for the system. The en/decoder libraries will request these and pass them into the hardware where they will be resolved on that chip; if the key matches the serial number and is valid you will be allowed to use the exposed API (I can see this getting hacked very quickly). Raspberry Pi did not include this to keep costs down. For us, a few quid is ok, but if they made a million units that is £3.6million extra they have to spend on something only a fraction of people will use.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1919", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/797/" ] }
1,976
I know this question may have been asked before. I just want to know if there are any alternatives to the Raspberry Pi. I want to use it as an XMBC station, but the reviews tell me that it's a bit buggy as of now. The video forwarding and the loading times are not very good. What I get from all this is that a Raspberry Pi is a good machine for beginners to learn programming, but power users might want to look somewhere else. Finally, here is my question: What are some other alternatives to the Raspberry Pi. They must be compatible with any flavor of linux. One I like is PandaBoard. Any other suggestion like that would be great. Price range is between $0-240
There are a lot of Embedded Linux boards/systems available, here is an overview. (This list is by no means complete, anyone that is missing something please add it to the list to make it as complete as possible.) x86 based VIA ARTiGO A1200 CPU: 1.0GHz VIA Eden™ X2 processor, GPU: VIA Chrome 9 RAM Memory: Up to 4GB of DDR3 1066 SODIMM RAM, NAND Flash: None, Storage: Built-in 2.5” SATA, Built-in CFast socket, I/O: HDMI, VGA, 4 USB 2.0, 2 GigaLAN, 2 COM, 1 CFast socket, Other Features: HD, MPEG-2, WMV9, VC1 & H.264 video decoding hardware acceleration, Site: http://www.viaembedded.com/en/products/minipcs/1850/1/ARTiGO_A1200.html Bare PCB: No VIA ARTiGO A1150 CPU: 1.0GHz VIA dual core Eden™ X2 64-bit processor, GPU: VIA Chrome 9 RAM Memory: Up to 4GB of DDR3 1066 SODIMM RAM, NAND Flash: None, Storage: 2.5” SATA, optional SD, I/O: HDMI, USB device port, 4 USB 2.0 ports, VGA, Gigabit LAN, Other Features: HD, MPEG-2, WMV9, VC1 & H.264 video decoding hardware acceleration Site: http://www.viaembedded.com/en/products/minipcs/1650/1/ARTiGO_A1150_(Pico-ITX).html Bare PCB: No ARM based Rikomagic MK802 CPU: 1.0GHz Cortex-A8 SOC: Allwinner A10, GPU: MALI400MP OpenGL ES 2.0, RAM Memory: 1GB / 512MB DDR3 NAND Flash: 4GB Storage: microSD I/O: HDMI, Wifi 802.11b/g, WAPI (Ralink8188), 2 (USB + mini USB OTG) Other Features: Site: http://store.cloudsto.com/rikomagic/rikomagic-mk802-detail.html Bare PCB: No Rikomagic MK802II CPU: 1.0GHz Cortex-A8 SOC: Allwinner A10, GPU: MALI400MP OpenGL ES 2.0, RAM Memory: 1GB / 512MB DDR3 NAND Flash: 4GB Storage: microSD I/O: HDMI, Wifi 802.11b/g, WAPI (Ralink8188), 2x Micro USB, 1x USB2.0, Other Features: Site: http://store.cloudsto.com/rikomagic/rikomagic-mk802-ii-detail.html Bare PCB: No Mele A1000 CPU: 1GHz+ Cortex-A8, SOC: Allwinner A10, GPU: MALI400MP OpenGL ES 2.0 RAM Memory: 512MB DDR3 NAND Flash: 4GB Storage: SD, SATA I/O: HDMI, CVBS, VGA, Audio R+L, optical SPDIF, Ethernet 10/100Mbps, Wifi 802.11b/g/n WAPI(Ralink8188), UART, USB Other Features: Site: ?? Bare PCB: No Rhombus-Tech A10 EOMA-68 CPU: 1.2ghz Cortex A8 ARM Core SOC: Allwinner A10 GPU: MALI400MP OpenGL ES 2.0 RAM Memory: 1GB DDR3 NAND Flash: 1Gb - 16Gb Storage: Micro-SD, SATA I/O: HDMI, TV-Out, GPIO, I2C, PWM, Keyboard Matrix (8x8), built-in Resistive Touchscreen Controller, 4 SDIO interfaces (SD 3.0, UHI class), USB 2.0 Host as well as a 2nd USB-OTG Interface, 10/100Mb Ethernet Other Features: Site: http://rhombus-tech.net/allwinner_a10/ Bare PCB: No Gooseberry board CPU: 1.2ghz Cortex A8 ARM Core (up to 1.5Ghz) SOC: Allwinner A10 GPU: MALI400MP OpenGL ES 2.0 RAM Memory: 512MB NAND Flash: 4GB Storage: Micro SD I/O: HDMI, 1x Mini Usb, Wifi, Audio 3.5mm Earphone Jack Other Features: Site: http://gooseberry.atspace.co.uk/ Bare PCB: Yes A13-OLinuXino CPU: 1GHz A13 Cortex A8 SOC: Allwinner A13 GPU: MALI400MP OpenGL ES 2.0 RAM Memory: 512 MB NAND Flash: optional 4GB Storage: SD I/O: 3 + 1 USB Host, 3 available for users 1 for (optional) WIFI RTL8188CU 802.11n 150Mbit module on board, 1 USB OTG which can power the board, VGA video output, LCD signals available on connector so you still can use LCD if you disable VGA/HDMI, Audio Output,Microphone Input,RTC PCF8536 on board for real time clock and alarms,5 Keys on board for android navigation,UEXT connector for connecting addtional UEXT modules like Zigbee, Bluetooth, Relays,GPIO connector with 68/74 pins and these signals: 17 for adding NAND flash; 22 for connecting LCDs; 20+4 including 8 GPIOs which can be input, output, interrupt sources; 3x I2C; 2x UARTs; SDIO2 for connectinf SDcards and modules; 5 system pins: +5V, +3.3V, GND, RESET, NMI Optional low cost 7" LCD with touchscreen Other Features: Site: https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI-DEV/ Bare PCB: Yes VIA APC 8750 CPU: 800 MHz ARM11 SOC: VIA WonderMedia 8750 GPU: OpenGL ES 2.0 RAM Memory: DDR3 512MB NAND Flash: 3GB Storage: microSD I/O: HDMI, VGA, USB 2.0 (x4), Audio out / Mic in, 10/100 Ethernet Other Features: Site: http://apc.io/ Bare PCB: Yes BeagleBoard Rev. C4 CPU: 720 MHz ARM Cortex-A8 SOC: TI OMAP3530 GPU: PowerVR SGX RAM Memory: 256 MB NAND Flash: 256 MB Storage: SD/MMC I/O: HDMI, S-Video, Stereo in and out jacks, 1 USB, USB OTGRS-232 port, JTAG, I2C, I2S, SPI, MMC/SD Other Features: Site: http://beagleboard.org/hardware/design Bare PCB: Yes BeagleBoard-xM CPU: 1 GHz Cortex-A8 SOC: TI DM3730 GPU: PowerVR SGX RAM Memory: 512 MB NAND Flash: 4 GB Storage: MicroSD I/O: HDMI, S-Video, Stereo in and out jacks, 4x USB, 10/100 Ethernet,RS-232 port, JTAG connector, Camera port, I2C, I2S, SPI, MMC/SD Other Features: Site: http://beagleboard.org/hardware/design Bare PCB: Yes BeagleBone CPU: (500MHZ-USB Powered, 720MHZ-DC Powered) Cortex A8 SOC: TI AM3359 Sitara GPU: PowerVR SGX530 RAM Memory: 256MB DDR2 NAND Flash: Storage: microSD I/O: USB 2.0 Client Port, Host Port, JTAG, more through Expansion boards Other Features: Site: http://beagleboard.org/hardware/design Bare PCB: Yes PandaBoard CPU: 1GHz Dual-core ARM Cortex-A9 MPCore SOC: OMAP4430 GPU: PowerVR SGX540 RAM Memory: 1GB DDR2 NAND Flash: Storage: SD/MMC I/O: HDMI, DVI-D, LCD, 10/100 Ethernet, 802.11 b/g/n (WiLink™ 6.0), Bluetooth v2.1 + EDR, General purpose (I2C, GPMC, USB, MMC, DSS, ETM), Camera, LCD, JTAG, UART/RS-232 Other Features: Site: http://pandaboard.org/ Bare PCB: Yes PandaBoard ES CPU: 1.2 GHz Dual-core ARM Cortex-A9 MPCore SOC: OMAP4460 GPU: PowerVR SGX540 RAM Memory: 1GB DDR2 NAND Flash: Storage: SD/MMC I/O: HDMI, DVI-D, LCD, 10/100 Ethernet, 802.11 b/g/n (WiLink™ 6.0), Bluetooth v2.1 + EDR, General purpose (I2C, GPMC, USB, MMC, DSS, ETM), Camera, LCD, JTAG, UART/RS-232 Other Features: Site: http://pandaboard.org/ Bare PCB: Yes Cotton Candy CPU: 1.2 GHz dual-core ARM Cortex-A9 SOC: Samsung Exynos 4210 GPU: MALI400MP OpenGL ES 2.0 RAM Memory: 1 GB NAND Flash: Storage: MicroSD SDXC I/O: HDMI with audio, Wifi 802.11 b/g/n, Bluetooth 2.1 + EDR Other Features: Site: http://www.fxitech.com/products/ Bare PCB: No CuBox CPU: 800 MHz ARMv7 SOC: Marvell Armada 510 (88AP510) GPU: Vivante GC600 RAM Memory: 1 GB DDR3 NAND Flash: Storage: MicroSD, 1 x eSATA I/O: HDMI, S/PDIF, 2 x USB, 1000baseT Ethernet, Infra-red receiver with LIRC support Other Features: Site: http://www.solid-run.com/products/cubox Bare PCB: No Hawkboard CPU: 300-MHz ARM926EJ SOC: TI OMAP-L138 GPU: ?? RAM Memory: 128 MByte NAND Flash: 128 MByte Storage: SATA I/O: VGA, Composite IN, USB 1.1 Host, USB 2.0 OTG, VPIF, UPP, PRU, LCDC, 2x UART, 2x SPI , 1x I2C , eCAP, eHRPWM, GPIO, JTAG Other Features: Site: http://www.hawkboard.org/ Bare PCB: Yes IGEP v2 CPU: ARM Cortex A8 1GHz SOC: Ti DM3730 GPU: SGX530 @ 200 MHz RAM Memory: 512 MB NAND Flash: 512 MB Storage: MicroSD I/O: DVI-D, TFT Interface 24 bit, Stereo audio in / out, USB host + Mini OTG host/slave, 10/100 Mb BaseT, Wifi 802.11 b/g, Bluetooth BC4 - Class 2.0, 3 x UART, Expansion boards available, McBSP, McSPI, I2C, GPIO Other Features: Site: http://igep.es/products/processor-boards/igepv2-board Bare PCB: Yes IGEP COM Proton & Module CPU: 1GHZ ARM CORTEX A8 (720Mhz for OMAP3530) SOC: DM3730 (optional OMAP3530) GPU: SGX 530 (200Mhz), (110Mhz for OMAP3530) RAM Memory: 512 MB NAND Flash: 512 MB Storage: MicroSD I/O: 1 x USB 2.0 OTG, JTAG, Expansion: USB, DDS, Camera, uart, SPI, McBSP, I2C, keypad Other Features: Site Module: http://igep.es/products/processor-boards/igep-com-module Site Proton: http://igep.es/products/processor-boards/igep-com-proton Bare PCB: Yes Gumstix Overo series CPU: ARM Cortex-A8 Up to 1GHz SOC: AM3703, DM3730, OMAP3503, OMAP3530 GPU: ?? RAM Memory: 512MB or 256MB NAND Flash: 0 - 512MB Storage: microSD I/O: Many, by using various Other Features: Site: https://www.gumstix.com/store/index.php?cPath=33 Bare PCB: Yes Origen Board CPU: 1.4GHz Dual Core Cortex-A9 SOC: Samsung Exynos 4 GPU: MALI400MP OpenGL ES 2.0 RAM Memory: 1GB (POP Type) NAND Flash: Storage: 2 x SD/MMC I/O: mini HDMI, LCD, SDcard, Serial, USB 2.0 Host x 2, USB 2.0 Device JTAG , Ethernet (10/100 Mbps), HDMI support, WiFi/Bluetooth Combo, RS232, JTAG, camera Other Features: Site: http://www.origenboard.org/wiki/index.php/Main_Page Bare PCB: Yes Nimbus CPU: ARM9E SOC: 1.2 GHz ARM Marvell Kirkwood 88F6281 GPU: ?? RAM Memory: 512MB DDR2 NAND Flash: 512MB Storage: I/O: USB 2.0 Host, Gigabit Ethernet Other Features: Site: http://www.ionicsplug.com/nimbus.html Bare PCB: No Stratus CPU: ARM9E SOC: 1.2 GHz ARM Marvell Kirkwood 88F6281 GPU: ?? RAM Memory: 512MB DDR2 NAND Flash: 512MB Storage: I/O: USB 2.0 Host, Gigabit Ethernet, 802.11 b/g (Micro-AP / Client) WPS support on Client Mode, Bluetooth 2.1 + EDR, ZWave (US, EU), ZigBee (802.15.4) Other Features: Site: http://www.ionicsplug.com/stratus.html Bare PCB: No Cirrus CPU: ARM9E SOC: 2.0 GHz Processor Speed Marvell Armada 88F6282 GPU: ?? RAM Memory: 1 GB DDR3 NAND Flash: 512MB Storage: SATA I/O: WLAN 802.11 b/g/n (configurable as client or uAP),WPS Support on Client Mode, Dual Gigabit Ethernet Ports at 10/100/1000 Base-T, USB 2.0 Host (Type A) Other Features: Site: http://www.ionicsplug.com/cirrus.html Bare PCB: No SheevaPlug dev kit (Basic) CPU: ARM9E SOC: 1.2Ghz Marvel Kirkwood 6281 GPU: ?? RAM Memory: 512MB DDR2 NAND Flash: 512 MB Storage: SDIO I/O: USB 2.0 Host, RTC w/ Battery Other Features: Site: http://www.globalscaletechnologies.com/t-sheevaplugdetails.aspx Bare PCB: No GuruPlug Server CPU: ARM9E SOC: 1.2Ghz Marvel Kirkwood 6281 GPU: ?? RAM Memory: 512MB DDR2 NAND Flash: 512MB Storage: MicroSD I/O: 1 x Gb Ethernet, 2 x USB 2.0, Wi-Fi, Bluetooth, RTC w/Battery Other Features: Site: http://www.globalscaletechnologies.com/p-49-guruplug-server-standard.aspx Bare PCB: No GuruPlug Display CPU: ARMv5 SOC: 800MHz Marvell ARMADA 168 GPU: ?? RAM Memory: 512MB DDR2 NOR Flash: 4Mb Storage: MicroSD Slot (w/ 4GB card), Internal MicroSD card – 8GB I/O: 1 x Ethernet 10/100 Mbps, 4 x USB 2.0 ports (Host),1 x USB 2.0 OTG micro-AB port (Device/Host),1 x MicroSD Socket (w/ 4GB card),1 x MicroSD Socket w/ JTAG I/F option, 1 x Internal MicroSD Socket (w/ 8GB card), 1 x Serial Port over USB (for console),1 x HDMI Output Port with CEC, RTC w/ Battery Other Features: Site: Bare PCB: No DreamPlug CPU: ARM9E SOC: 1.2Ghz Marvel Kirkwood 6281 GPU: ?? RAM Memory: 512MB DDR2 NAND Flash: 4 GB Storage: eSATA, SD I/O: 2 x Gigabit Ethernet 10/100/1000 Mbps, 2 x USB 2.0 ports (Host),1 x eSATA 2.0 port- 3Gbps SATAII, 1 x SD Socket for user expansion/application, WiFi: 802.11 b/g/n, Bluethooth 3.0, JTAG, S/PDIF Other Features: Site: http://www.globalscaletechnologies.com/p-54-dreamplug-devkit.aspx Bare PCB: No D2Plug CPU: ARM v6/v7 SOC: 800MHz Marvell PXA510 GPU: ?? RAM Memory: 1GB DDR3 NOR Flash: 16Mb SPI NOR FLASH Storage: SD, 1 x eSATAp, Powered eSATA & USB combo I/O: 1 x Ethernet 10/100/1000 Mbps, 2 x USB 2.0 Host port, 1 x eSATAp – Powered eSATA and USB 2.0 Host combo port, 1 x USB 2.0 Device port, 1 x SD card slot, 1 x HDMI 1080p Output port with CEC, 1 x VGA Output port, 1 x Audio Line OUT, 1 x MIC IN, 1 x S/PDIF optical out, WiFi: 802.11 b/g/n,Bluetooth 3.0 + HS, JTAG Other Features: Site: http://www.globalscaletechnologies.com/p-53-d2-plug.aspx Bare PCB: No Trim-Slice series CPU: dual-core ARM Cortex A9 @ 1 GHz SOC: NVIDIA Tegra 2 GPU: GeForce GPU RAM Memory: 1 GB DDR2 NAND Flash: Storage: SD, microSD, SATA, optional SSD or 2.5 HDD I/O: HDMI, optional DVI, S/PDIF 5.1, Stereo line-out, in, 4 USB 2.0, Micro USB device, Gigabit Ethernet, optional 802.11n, optional Bluetooth 2.0,optional video in, JTAG, UART Other Features: Site: http://trimslice.com/web/trim-slice-features Bare PCB: No Snowball CPU: 1GHz Dual Cortex A9 SOC: STEricsson Nova A9500 GPU: Mali 400 RAM Memory: 1GB DDR2 NAND Flash: 4 / 8GByte e-MMC Storage: Micro-SD I/O: HDMI, CVBS, Audio, 10/100Mbits Ethernet, optional 802.11 b/g/n, Bluetooth 2.1+EDR, GPS, Built-in WIFI (removable antenna) 802.11 b/g/n, optional video in, JTAG, UART, Li-Ion Charger, RS232, Expansion Connectors, A lot of sensors Other Features: Site: ?? (cannot find the official site) Bare PCB: Yes i.MX53 Quick Start Board CPU: 1Ghz ARM Cortex™-A8 SOC: Freescale i.MX535 GPU: ?? RAM Memory: 1GB DDR3 NAND Flash: Storage: SD/MMC, microSD I/O: VGA, LVDS, optional HDMI, 3-axis Accelerometer, JTAG, UART, SPDIF, 10/100 Ethernet, 2x high–speed USB Host port, 1x Micro USB Device port Other Features: Site: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=IMX53QSB Bare PCB: Yes Pineriver H24/MiniX CPU: 1GHz Cortex-A8 SOC: Allwinner A10 GPU: Mali400 RAM Memory: 512MB NAND Flash: 4GB Storage: Support External storage via USB host /Support External storage via TF card I/O: HDMI, CVBS, USB 2.0 host, USB OTG, Built-in WIFI module, Audio Other Features: Site: http://www.pineriver.cn/eshowProDetail.asp?ProID=1531 Bare PCB: No Smallart UHOST CPU: ARM®Cortex™[email protected] SOC: Allwinner A10 GPU: Mali400 RAM Memory: 1GB DRAM NAND Flash: 4 GB Storage: microSD I/O: HDMI, Wifi 802.11 b/g/n, Mini USB Other Features: Site: http://www.smallart.com.cn/en/pro.asp Bare PCB: No Genesi Efika MX Smarttop CPU: ARM Cortex-A8 800MHz SOC: Freescale i.MX515 GPU: ?? RAM Memory: 512MB RAM NAND Flash: 8GB Storage: 8GB Internal SSD I/O: HDMI, 2x USB 2.0, 10/100Mbit/s Ethernet, 802.11 b/g/n WiFi Other Features: Site: https://www.genesi-usa.com/store/details/11 Bare PCB: No Embest DevKit8600 CPU: 720MHz ARM Cortex-A8 SOC: TI’s Sitara AM3359 GPU: SGX530 RAM Memory: 512MB DDR3 NAND Flash: 512MB Storage: SD Card I/O: 10/100/1000Mbps Ethernet, TFT LCD, VGA via module, USB2.0 OTG, USB 2.0 host, WiFi/Bluetooth Module, Debug, 4x serial, RS485, CAN, GPMC, JTAG, ADC, SPI, I2C, Audio in, Audio out, buttons Other Features: Site: http://www.armkits.com/product/devkit8600.asp Bare PCB: Yes Embest SBC8018 CPU: ARM926EJ-S Core SOC: TI AM1808 GPU: ?? RAM Memory: 128MB Mobile DDR NAND Flash: 128MB Storage: SD card, SATA, SATAII I/O: LCD/Touch Screen interface, Two Camera interfaces, SPI, I2C, McBSP, 3x UART, GPIO, RTC w/ battery, buttons, 10/100Mbps Ethernet Other Features: Site: http://www.armkits.com/product/sbc8018.asp Bare PCB: Yes Embest SBC8530 CPU: 1GHz ARM Cortex-A8 SOC: TI DM3730 GPU: ?? RAM Memory: 512MB NAND Flash: 512MB Storage: SD Card I/O: UART, 4 USB Host, USB OTG, Ethernet, WiFi/BT, Audio, TF, Supports 24-bit TFT LCD, DVI-D and S-Video Output Display, Optional VGA, Camera, GPS, GPRS, WiFi and 3G Modules,10/100Mbps Ethernet Other Features: Site: http://www.armkits.com/product/sbc8530.asp Bare PCB: Yes Embest DevKit8500D CPU: 1GHz ARM Cortex-A8 SOC: DM3730 GPU: POWERVR SGX RAM Memory: 512MB NAND Flash: 512MB, optional 2GB iNAND Storage: I/O: UART, 4 USB Host, USB OTG, Ethernet, Audio, TF, Keyboard, Jtag, Supports 24-bit TFT LCD, DVI-D and S-Video Output Display, Supports VGA, Camera, WiFi, GPS, GPRS, 3G Functions through Modules, 10/100M Ethernet Other Features: Site: http://www.armkits.com/product/devkit8500d.asp Bare PCB: Yes Cubieboard CPU: 1GHz ARM Cortex-A8 SOC: Allwinner A10 GPU: Mali400 RAM Memory: 512MB/1GB NAND Flash: 4GB Storage: 1 micro SD slot, 1 SATA I/O: HDMI, 2 USB Host, 96 extend pin including I2C, SPI, RGB/LVDS, CSI/TS, FM-IN, ADC, CVBS, VGA, SPDIF-OUT, R-TP, 10/100M Ethernet Other Features: Site: http://cubieboard.org/ Bare PCB: Yes Note: Base for this list is the PDF created by omgfire, I added information where missing and corrected information from the original specifications provided by the company or organization that created the device.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/1976", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1600/" ] }
2,086
Where can I find the serial number of the Raspberry Pi I am currently using?
The serial number can be found in /proc/cpuinfo ; for example, pi@raspberrypi:~$ cat /proc/cpuinfo Processor : ARMv6-compatible processor rev 7 (v6l) BogoMIPS : 697.95 Features : swp half thumb fastmult vfp edsp java tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xb76 CPU revision : 7 Hardware : BCM2708 Revision : 1000002 Serial : 000000000000000d Bash You can use very basic bash piping cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2 Since tabs are used on the left side of the colon, cutting on the space character will reliably catch only the serial number. Prior versions of this answer cut on the colon, which produced a leading space in the variable. That leading space is not removed during variable assignment as was previously suggested. Bash/Perl In Bash, it is very simple to extract... by using Perl. Use cat /proc/cpuinfo | perl -n -e '/^Serial\s*:\s([0-9a-f]{16})$/ && print "$1\n"' For example, $ cat /proc/cpuinfo | perl -n -e '/^Serial\s*:\s([0-9a-f]{16})$/ && print "$1\n"' 000000000000000d Python Raspberry Spy provides a very useful Python example. def getserial(): # Extract serial from cpuinfo file cpuserial = "0000000000000000" try: f = open('/proc/cpuinfo','r') for line in f: if line[0:6]=='Serial': cpuserial = line[10:26] f.close() except: cpuserial = "ERROR000000000" return cpuserial References Licence key product pages Raspberry Spy: Getting Your Raspberry Pi Serial Number Using Python
{ "source": [ "https://raspberrypi.stackexchange.com/questions/2086", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/86/" ] }
2,150
Is it possible to re-boot my Raspberry Pi at midnight each night? I know in Linux, you'd use crontab , but I can't seem to find /etc/crontab .
To edit the root crontab: sudo -i crontab -e put the entries you want in; there's a handy template loaded by crontab that shows you what fields are what. Once you're done and saved out of the crontab editor: exit to get back to the user shell. To reboot the machine at midnight and 8 am, you need the line: 0 0,8 * * * reboot though really, Linux doesn't need to be rebooted much, if at all.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/2150", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1762/" ] }
2,169
I have a Raspberry Pi running Raspbmc connected through HDMI to a dumb HDTV. (Does not support HDMI-CEC). If I power on both the TV (both at source and display through remote) and Raspbmc at the same time then it all works fine. If I power on the Raspbmc and TV, but the TV display is not turned on. Sometime later I use the TV remote to power on the TV display, then I get a blank display on TV through HDMI. This is not the screensaver because using a XBMC remote does not change anything. The Raspbmc is active though, because I can ping it and connect to it using SSH . Is there a setting in Raspbmc I can change so that it always turns on HDMI , no matter if the TV display is on or off?
Add these two lines to /boot/config.txt and reboot Raspbmc: hdmi_force_hotplug=1 hdmi_drive=2 hdmi_force_hotplug=1 sets the Raspbmc to use HDMI mode even if no HDMI monitor is detected. hdmi_drive=2 sets the Raspbmc to normal HDMI mode (Sound will be sent if supported and enabled). Without this line, the Raspbmc would switch to DVI (with no audio) mode by default.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/2169", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1817/" ] }
3,247
I have Model B and connected via Ethernet and running Raspbmc. It's taking new IP address whenever I restart it, of course may be because of DHCP, but I want to configure this Raspberry Pi with a static IP address, so that I can use my XBMC remote.
Per the instructions found here : In XBMC, go to Programs → Raspbmc settings → Wired network configuration. Uncheck the Automatic DHCP option. Provide a static IP address. Make sure the IP address is far away from the IP addresses typically assigned by the router to the networked devices at home. For example, if a router assigns addresses starting from 192.168.0.10, then pick a static IP like 192.168.0.50 Scroll down and check the Update Now option. Raspbmc will take a few seconds to apply the new configuration. Make sure you can ping the static IP address you assigned. Voila, your Raspbmc now has a fixed IP address!
{ "source": [ "https://raspberrypi.stackexchange.com/questions/3247", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1814/" ] }
3,289
I've tried running running a disk check, then I got a complain pi@raspberrypi ~ $ /sbin/fsck fsck from util-linux 2.20.1 e2fsck 1.42.5 (29-Jul-2012) /dev/mmcblk0p2 is mounted. WARNING!!! The filesystem is mounted. If you continue you ***WILL*** cause ***SEVERE*** filesystem damage. Do you really want to continue<n>? no check aborted. pi@raspberrypi ~ $ umount -l /dev/mmcblk0p2 umount: it seems /dev/mmcblk0p2 is mounted multiple times Do I have to umount, what are the steps for a safe umount? Update: pi@raspberrypi ~ $ mount /dev/root on / type ext4 (rw,noatime,nodiratime,user_xattr,barrier=1,data=ordered) devtmpfs on /dev type devtmpfs (rw,relatime,size=118872k,nr_inodes=29718,mode=755) tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=23788k,mode=755) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=47560k) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620) /dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro) pi@raspberrypi ~ $ cat /etc/mtab rootfs / rootfs rw 0 0 /dev/root / ext4 rw,noatime,nodiratime,user_xattr,barrier=1,data=ordered 0 0 devtmpfs /dev devtmpfs rw,relatime,size=118872k,nr_inodes=29718,mode=755 0 0 tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=23788k,mode=755 0 0 tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=47560k 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0 /dev/mmcblk0p1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0 pi@raspberrypi ~ $ cat /etc/fstab proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime,nodiratime,nodiratime 0 1 # a swapfile is not a swap partition, so no using swapon|off from here on, use dphys-swapfile swap[on|off] for that I also see this in dmesg: [ 3.054577] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:3a:ff:c1 [ 4.592609] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 47900 [ 4.611794] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 31567 [ 4.630805] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 23732 [ 4.647041] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 4871 [ 4.662074] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 4653 [ 4.662256] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 4514 [ 4.662344] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 4465 [ 4.677977] EXT4-fs (mmcblk0p2): ext4_orphan_cleanup: deleting unreferenced inode 3989 [ 4.678142] EXT4-fs (mmcblk0p2): 8 orphan inodes deleted [ 4.685881] EXT4-fs (mmcblk0p2): recovery complete [ 8.631347] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 8.644244] VFS: Mounted root (ext4 filesystem) on device 179:2. [ 8.654677] devtmpfs: mounted [ 8.661103] Freeing init memory: 124K [ 10.414514] udevd[139]: starting version 175 [ 21.263308] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) [ 21.967590] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) [ 22.849536] bcm2835 ALSA card created! [ 22.855703] bcm2835 ALSA chip created! [ 22.875121] bcm2835 ALSA chip created! [ 22.885884] bcm2835 ALSA chip created! [ 22.894074] bcm2835 ALSA chip created! [ 22.902271] bcm2835 ALSA chip created! [ 22.910319] bcm2835 ALSA chip created! [ 22.918129] bcm2835 ALSA chip created!
/dev/mmcblk0p2 is the root file system, so it is not easily unmounted. It could probably be re-mounted as read-only, but a simpler way is to schedule a fsck at the next reboot. sudo touch /forcefsck then reboot. Or reboot with shutdown -rF now which does the same. (from https://superuser.com/questions/401217/how-to-check-root-partition-with-fsck ) Another option of course is to do the fsck on another linux computer with a card reader.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/3289", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1765/" ] }
3,291
I am trying to figure out how to set up my wifi/wired connections manually with raspbmc. I know the recommended method for noobs, like myself, is to use the wireless network plugin, but i bought the pi with the intention of learning a bit more about Linux. I was successful at setting up wifi manually on my raspbarian image using the /etc/network/interfaces file and a creating another file for my wireless settings. My question is, would the same settings possibly work with raspbmc or would i need to go about doing this another way? I can't find a good tutorial on manual configuration of wifi for raspbmc. The /etc/networ/interfaces file on my raspbmc image is empty and I have read somewhere that raspbmc uses a different method, but it didn't really go into details. The following is what my file looks like in raspberian's /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet static address 192.168.1.100 gateway 192.168.1.254 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.0 wpa-conf /etc/wpa.config iface default inet dchp /etc/wpa.config network={ ssid="*******" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP psk="*******" } I am assuming that my wifi dongle is already installed, because when I run ifconfig I get the following at the end: wlan0 Link encap:Ethernet HWaddr 00:18:4d:46:9c:ca UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Any advice, or suggestions on where to start, or explanations of what is different between how raspbmc and raspbarian work to connect to the internet would be greatly appreciated. I know that I COULD set up a static IP lease on my router and configure this with the wifi settings plugin, but I really want to learn. I just don't know where to start on this.
/dev/mmcblk0p2 is the root file system, so it is not easily unmounted. It could probably be re-mounted as read-only, but a simpler way is to schedule a fsck at the next reboot. sudo touch /forcefsck then reboot. Or reboot with shutdown -rF now which does the same. (from https://superuser.com/questions/401217/how-to-check-root-partition-with-fsck ) Another option of course is to do the fsck on another linux computer with a card reader.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/3291", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/2969/" ] }
3,617
I installed unrar-free , but I cannot extract a multi-file .rar archive ( my_archive.part01.rar , my_archive.part02.rar , etc.): $ ls my_archive.part01.rar my_archive.part02.rar my_archive.part03.rar $ unrar -x my_archive.part01.rar unrar 0.0.1 Copyright (C) 2004 Ben Asselstine, Jeroen Dekkers Extracting from /home/morgan/my_archive.part01.rar Extracting my_text_file.txt Failed 1 Failed I have read that I need unrar-nonfree to manage multipart archives, but It seems it is not included in the official Raspbian repo. How can I install unrar-nonfree ?
Uninstall unrar-free . $ sudo apt-get remove unrar-free Make sure you have a source repository by editing /etc/apt/sources.list . $ cat /etc/apt/sources.list # Default repository deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi # Source repository to add deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi Sync the apt database. $ sudo apt-get update Create a working directory and move into it. The unrar-nonfree command will be built in this directory. $ cd $(mktemp -d) Install the dependencies required by unrar-nonfree . $ sudo apt-get build-dep unrar-nonfree Download the unrar-nonfree sources and build the .deb package. $ sudo apt-get source -b unrar-nonfree Install the generated .deb package. Its name varies depending on the version of unrar-nonfree . $ sudo dpkg -i unrar*.deb The working directory you have created in step 4 will be removed at next boot; there is no use to delete it. Once installed, you can use either unrar or unrar-nonfree ( unrar is a simlink to unrar-nonfree ). Warning: unrar-nonfree and unrar-free options are different. For instance, to extract an archive: $ # with unrar-free $ unrar -x my_archive.part01.rar $ # with unrar-nonfree $ unrar e my_archive.part01.rar Please man unrar-nonfree for more details.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/3617", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/797/" ] }
4,120
I'm using my pi to monitor my power meters. Data is transferred to PC by WiFi connection using Edimax EW-7811UN USB adapter. When the Wifi connection drops (switched off over night, or shaky connection), the USB adapter remains disabled. Is there a way to restart the WiFi connection automatically without re-plugging the WiFi adapter?
I prefer to disable most of the network auto configuration and connection management daemon stuff and deal with it myself. Here's a (bash) script that will keep the connection up as long as the network is there and you do not have a glitchy wifi driver or power issues; the idea is to ping the router every N seconds, and if that fails, re-connect: #!/bin/bash # make sure we aren't running already what=`basename $0` for p in `ps h -o pid -C $what`; do if [ $p != $$ ]; then exit 0 fi done # source configuration . /etc/wifi.conf exec 1> /dev/null exec 2>> $log echo $(date) > $log # without check_interval set, we risk a 0 sleep = busy loop if [ ! "$check_interval" ]; then echo "No check interval set!" >> $log exit 1 fi startWifi () { dhclient -v -r # make really sure killall dhclient iwconfig $wlan essid $essid dhclient -v $wlan } ifconfig $eth down ifconfig $wlan up startWifi while [ 1 ]; do ping -c 1 $router_ip & wait $! if [ $? != 0 ]; then echo $(date)" attempting restart..." >> $log startWifi sleep 1 else sleep $check_interval fi done So, /etc/wifi.conf in this case might contain: router_ip=192.168.0.1 log=/var/log/wifi.log wlan=wlan0 eth=eth0 essid=someNetwork check_interval=5 This all presumes an open unencrypted network (if otherwise, you will have to add the appropriate commands). I've used this approach on various linux machines, including the pi, and it works flawlessly; it will keep a system online indefinitely, even if it periodically goes to sleep (which the pi cannot anyway). A decent check interval is 3-5 seconds; this activity will not significantly impact system resources at all. You absolutely do need to disable the network auto-configuration first , . including ifplugd and other networking daemons, or this will interfere with your efforts: How can I disable autoconfigured networking on Raspbian? I in fact used apt-get remove ifplugd . To start networking at boot (since I use the pi headless), I have this set to run on raspbian from /etc/rc.local : wifi_mod=`lsmod | grep 8192cu` if [ "$wifi_mod" ]; then echo "Starting wifi..." /usr/bin/nice -n -10 /usr/local/bin/wifi & else echo "Starting ethernet..." /sbin/ifconfig eth0 up /sbin/dhclient eth0 fi /usr/local/bin/wifi is the script. If you don't know what nice is for, read man nice . The point of the if is that if my wifi dongle is plugged into the pi, the 8192cu module will be loaded by the kernel at this point -- so wifi should start. If not, then it's assumed that the ethernet is plugged in and should be used (if it is isn't, dhclient will just crap out and there is no network access). For this to work you will probably have to So, this gets a headless pi onto the network at boot and keeps it there. If you wanted a way to switch to eth while running without logging in, you could do something with udev rules for pulling the wifi dongle out.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4120", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/3053/" ] }
4,144
I want to burn a .img file of Wheezy OS to my 8GB SD Card from Mac OS X but can't figure out how. Any help would be appreciated.
There is a faq/howto available that discusses all the various OS-es. For the Mac it is (nearly) the same as under the various other types of Unix versions. The use of dd. In short you type: sudo dd if=path_of_your_image.img of=/dev/rdiskn bs=1m N.B: the of=/rdev/diskn needs to be the SD card, if you do this wrong you might end up destroying your Mac system!!!! Be careful! Be sure to use /dev/rdiskn instead of just /dev/diskn . This way you are not writing to a buffered device and it will complete much faster . For a total step by step guide through this process please consult this explanation . There are 3 chapters for the Mac in this document. The most easy way is described on the first chapter on Mac ( Copying an image to the SD card in Mac OS X (Only with graphical interface) ), it involves an application that does everything for you, to be complete I copy the link to this application here
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4144", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/-1/" ] }
4,194
I was lucky enough to get a Raspberry Pi under the tree this year and I've had a bit of fun playing with Node.js on the device. However, Node.js is much more interesting when you can pull down packages and plug them into your applications - and this is where I am having some trouble. If I attempt to install NPM along with Node.js with the following command: sudo apt-get install nodejs npm I get the following error: pi@raspberrypi ~ $ sudo apt-get install nodejs npm Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: nodejs : Breaks: npm (< 1.1.4~dfsg-2~) but 1.1.4~dfsg-1 is to be installed npm : Depends: node-semver but it is not going to be installed E: Unable to correct problems, you have held broken packages. I'm pretty new to how package management works with Debian-based Linux operating systems and don't know much at all about how the node.js community has structured their specific packages. It is worth noting that installing node.js by itself works just fine, and if I try to install NPM just by itself this is what I get. pi@raspberrypi ~ $ sudo apt-get install npm Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: npm : Depends: nodejs but it is not going to be installed Depends: nodejs-dev but it is not going to be installed Depends: node-request but it is not going to be installed Depends: node-mkdirp but it is not going to be installed Depends: node-minimatch but it is not going to be installed Depends: node-semver but it is not going to be installed Depends: node-ini but it is not going to be installed Depends: node-graceful-fs but it is not going to be installed Depends: node-abbrev but it is not going to be installed Depends: node-nopt but it is not going to be installed Depends: node-fstream but it is not going to be installed Depends: node-rimraf but it is not going to be installed Depends: node-tar but it is not going to be installed Depends: node-which but it is not going to be installed E: Unable to correct problems, you have held broken packages. I'm not sure, but my gut is telling me that it is something to do with the node-semver package. If I install the nodejs package by itself and then attempt to install node-semver this is the output that I get. pi@raspberrypi ~ $ sudo apt-get install node-semver Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: node-semver : Depends: nodejs but it is not going to be installed E: Unable to correct problems, you have held broken packages. Any pointers?
Try installing them all together: sudo apt-get install nodejs npm node-semver
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4194", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4049/" ] }
4,296
Reading different posts and Can I emulate x86 to run Windows 95? it seems to be possible to some extent to simulate x86 CPU. In my special case I want to run a Teamspeak server, which isn't provided for ARM at the moment. Is it possible to emulate Teamspeak server? I know there exists the native alternative mumble. But that is no alternative for me, because in the game community I'm in Teamspeak 3 is the only one used.
I got Teamspeak 3 running using qemu running a x86 Debian squeeze. There is some room for improvement for sure, but for now that's what worked for me. I hope I didn't forget something. First of all thanks to Dietmar and meigrafd of the raspberry pi forum. Without their work I wouldn't have succeeded. How to Installing qemu We need some software apt-get install git zlib1g-dev libsdl1.2-dev Download the source of qemu ( wget 198.154.101.186/RaspberryPI/qemudidi2.rar ) already patched by Dietmar for Raspberry pi. It is qemu 0.15.50 from Thoronir, because the support for ARM host seems to be even worse with the current version. Unrar it unrar x qemuADLI.part1.rar . You have to use the unrar non-free version ( Link to howto ) Configure what to compile (takes about a minute) ./configure --target-list="i386-softmmu" --enable-sdl --extra-cflags="-O3 -mfloat-abi=hard -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -march=armv6zk" --audio-drv-list="alsa oss sdl pa" --audio-card-list="ac97 es1370 sb16 cs4231a adlib gus hda" Now compile make (takes half an hour at least) Now install make install Now qemu is installed successfully. Preparing Debian Image (using Windows as host) Download and install qemu for Windows ( Link ) Download Debian netinstall image ( squeeze ). I used squeeze, but wheezy might be also good. Create image using qemu-img.exe create -f qcow2 G:\debian.img 1500M (smaller size should be suffient too) Install debian x86. I recommend to choose no meta package. qemu -cpu 486 -hda G:\debian.img -cdrom G:\debian-6.0.4-i386-netinst.iso -boot d -m 512 -smp 1 After installation run the qemu command again, but with some changes qemu -cpu 486 -hda G:\debian.img -boot d -m 512 -smp 1 -redir tcp:9022::22 -redir udp:1234::9987 . -redir is used to redirect the network from the guest to the hosts ports. Now install less and your favorite editor (like nano, vim,etc.) you like to use apt-get install less vim Install OpenSSH Server apt-get install openssh-server Install Teamspeak like you usually would do. Connect to teamspeak from you windows host using localhost:1234 (remember above we redirected the port) Test to connect to it via ssh/putty using localhost:9022 Shutdown shutdown -hP now the image and copy it via scp(winscp) to your pi. Run it on the Pi (Use a SSH for the following commands) Get the missing qemu Bios wget -O /usr/share/qemu/sgabios.bin http://qemu.weilnetz.de/w32/2012-06-28/sgabios.bin Start it! qemu -cpu 486 -hda debian.img -m 150m -smp 1 -redir tcp:9022::22 -redir udp:9055::9987 --nographic If you get a memory error then try it a few times. If it says starting Grub then wait some minutes (it's booting in the background, but you will never get a prompt here!). Now login with a other SSH terminal to login 'ssh root@localhost -p 9022' Now start Teamspeak and try to log in on port 9055 of the Pi. Shutdown again the qemu guest. Start it again but add -daemonize, so it runs even when you log off. I also made a script to help me. Performance My Pi is the 256 MB version overclocked to 1000 Mhz using raspi-config. The Pi runs constantly at 70% CPU load average. It varies between 50% (using 700 MHz) and nearly 100% using 1000 MHz. But the load shows "0.77, 0.83, 0.80", which is okay. In the future I hope to either use a native Teamspeak version (my hope is still up) or to use qemu in user mode and better performance with more current version. Time will tell :) I have yet to test the performance of teamspeak itself, if it is usable for gaming situations. I noticed some milliseconds latence overhead, but not too much to worry yet.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4296", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/651/" ] }
4,355
I have a 512MB Pi. I am trying to make sure I am getting the most out of it. I just downloaded the latest version of Raspbian and installed it on the Pi. Do I also need rpi-update ? Is rpi-update meant for upgrading from one version of Raspbian to the next?
"In normal circumstances there is NEVER a need to run rpi-update as it always gets you to the leading edge firmware and kernel and because that may be a testing version it could leave your RPi unbootable". https://www.raspberrypi.org/forums/viewtopic.php?p=916911#p916911 Even the rpi-update documentation now warns "Even on Raspbian you should only use this with a good reason. This gets you the latest bleeding edge kernel/firmware." sudo apt-get update; sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel will put it back to the latest supported kernel/bootcode. I think you might be conflating two different operations. rpi-update is a tool to upgrade the firmware for your Raspberry Pi. Firmware is a small package of code that usually lives on a special chip of a computer that helps the software know how to talk to the hardware. However, in the case of the Raspberry Pi, the firmware will live on the first partition of the SD card. Raspbian is an operating system or the core software for your Raspberry Pi . Software (including the OS) lives on second partition of the SD card and is all the stuff that gets executed when you use your device. Both of these need updating independently. For convenience, the rpi-update tool is included in the Raspbian distribution of Linux because it is a useful software tool that manages the firmware of your Pi's. You should only run it if you need to, as per the warning above! Do not use it regularly. Separately, you need to keep your software up to date using the standard Debian software management tools like sudo apt-get update && sudo apt-get upgrade . Each of these functions is separate, and updating one will not update the other. Upgrading your distribution to the latest software packages might get you a new version of rpi-update , but unless you RUN rpi-update your firmware will not get updated. Since the place the firmware is stored is actually flashed to the first partition of the SD card (sort of like a BIOS), you will not need to run this on every device. Once you load a new version of software or firmware onto an SD card, any device you plug that card into will be running that version.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4355", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/561/" ] }
4,357
While looking for a basic task to get familiar with the Raspberry Pi and its GPIO pins, I decided that driving an LED sounded simple enough. While investigating how to go about this task I've noticed that most instructions indicate to place a resistor between the GPIO pin and the LED. The size of the resistor varies by instructions, but typically in the range of 260 ohms to 1 kilohm. However, none of the instructions indicate the reason for this nor do they indicate why they've chosen a (seemingly) arbitrary resistor size. Why is a resistor even needed, and how would you know what ohms it should be?
The reason is common to all LED applications, not just Raspberry Pi (or the GPIO pins). An LED can only pass so much current before it will destroy itself (very brightly!). The maximum current varies by the LED's size and colour, but for a medium-sized red LED can usually be assumed to be 20mA (check this value though, if you have the spec sheet for the LED handy - and tiny LEDs can only handle a tiny fraction of this). A standard red LED usually has a voltage drop of around 1.7v, and so the value of the resistor can be chosen to pass 20mA at (voltage - 1.7). Assuming an input of 5v, this means a resistor that will pass 20mA at 3.3v, which (using Ohm's Law) gives us an absolute minimum resistance of 165 ohms. The worst that can happen by using a larger resistor, is that the LED will be dimmer than its maximum brightness, and so in order to accommodate smaller LEDs that can only pass 10mA, it's not uncommon to use 330 ohms and above. I'd put a 470-ohm resistor in for a 5v supply for a medium-sized red LED, and if the LED is way too dim then reduce it slightly. If using a miniature red LED, then 1K ohms does not sound outrageous, and for more exotic colours (in particular blue, pink and white), you will want to calculate the value yourself.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4357", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4277/" ] }
4,370
I don't have to set the clock (besides the timezone) on the Raspberry Pi. Where is it getting the time from? About how accurate is it?
Raspbian gets the time from an NTP Server (a "time server"). Unplug your Raspberry Pi completely, pull out the network cable and start the Raspberry Pi up again. You will see that the date and time are incorrect. If you want/need the date and time to not be reset without being plugged into the internet, you'll need a Real Time Clock (RTC) - for example, something like this - which will keep the time current, by using a battery to run a clock. This is, also, how your computer keeps the time when it is not being powered. UPDATE Just a side note that the above RTC clock is not the only way to keep the time accurate between power losses. You could also use a GPS module and hook that up to the GPIO pins. Accuracy It's pretty accurate, although if your clock's time is off by quite a bit. It may take up to 3 hours to correct itself, as changes from the server are applied gradually to your local clock. Network stability has the biggest impact on the accuracy, as a unpredictable network (something more wireless, like 3G ) will make it very hard to be accurate. To put it simply: The accuracy is pretty good, the time difference between your computer and the actual time (from the NTP Server) is normally less than 100ms .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4370", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/561/" ] }
4,409
I have made several personal configuration changes to a Raspbian Wheezy install (more secure ssh, personal configurations, etc). It's been a couple weeks since I last touched it, and I completely forgot the password to login. What should I do?
Right off the bat, let me say that there is not a way to recover a password (without some actual cracking/hacking which I don't know how to do). Resetting your password is your best bet. So the first step will be to determine if you have any way to log in to the Raspbery Pi. If you're able to log in with a user that has 'sudo' rights (this includes SSH... perhaps you have keys set up properly but forgot the actual user password, which I ran in to), simply typing: sudo passwd should prompt you to create a new password (without having to enter your current password). Another option would be to run the starting config and change the password that way. sudo raspi-config If you're completely locked out, you can try the technique mentioned here , though I didn't have any success with the strategy. It just kept me from finishing booting up the RPi. I haven't found any good techniques to enable root access period (putting the conversation of why you'd even want to do that aside :) ), let alone if you can't log in. Somebody can correct me if I'm wrong. Hopefully this will save you from blowing away an image with a fresh one. If this saves one person, figure it's worth the time to post :)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4409", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4333/" ] }
4,444
I don't have a screen for my Raspberry Pi. I want to SSH into it, but I get Connection Refused, so I presume SSH is not enabled. As advised in other questions I have looked at enabling the boot_enable_ssh.rc script on the sd card. However I don't have a boot directory in my OS (or it is not visible via the card reader in my iMac) - 2012-12-16-wheezy-raspbian.img. I have also tried issuing the following commands via a usb keyboard: pi [enter] raspberry [enter] sudo /etc/init.d/ssh start [enter] raspberry [enter] But this hasn't worked. Now in some docs I see that raspi-config is the first thing to come on a newly booted RPi. Could someone tell me the keystrokes to enable SSH via raspi-config please? Or if I am on the wrong track, please advise. Thanks. EDIT: In trying to follow this advice https://raspberrypi.stackexchange.com/a/1706/4373 I am not seeing an etc directory when mounting the SD card on my iMac. If I run ls from the terminal I only get the following: bootcode.bin fixup.dat kernel.img start.elf cmdline.txt fixup_cd.dat kernel_cutdown.img start_cd.elf config.txt issue.txt kernel_emergency.img Have I screwed up the imaging of the SD card?
All you need is to place an empty file named 'ssh' onto the boot (FAT) partition of your SD card (no need to mount ext3). Tested with 2016-11-25-raspbian-jessie-lite.img. Source: https://www.raspberrypi.org/documentation/remote-access/ssh/ More info about Nov '16 security update: https://www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4444", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4373/" ] }
4,677
Let's assume that I am dropped into a room with a Raspberry Pi running either Debian or Raspbian. How do I find out if it has hard float support or if it is just using soft float?
Check for the existence of the directory: /lib/arm-linux-gnueabihf the soft-float version do not have this directory, they have: /lib/arm-linux-gnueabi instead, or you can list the packages installed using: dpkg -l and see the platform in the third column (all/armhf/armel)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4677", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/3610/" ] }
4,682
I have a problem with playing music on my XBMC (Raspbmc RPi 512MB RAM). It's connected to my AVReciever (Onkyo) through HDMI cable and in XBMC settings HDMI is set as output. Now, when I play some music from XBMC library, about 1 second of each song is cut from the beginning. Is this something connected to time needed for AVReceiver and PI to "negotiate" HDMI connection or something, or it's time which AV needs for figuring audio format. If so, do you know any way to fix that? Or maybe it's connected to something totally different. EDIT It must be my AV receiver issue, because when I connect RPi to TV directly, it works without gap at the beginning. It must be some time for receiver to "find out" which codec is used or something. In XBMC Frodo there should be new AudioEngine, which should have streamsilence option in advancedsettings.xml. I don't have it now on my Raspbmc (waiting for production release), so keeping that question open. EDIT 2 Ok, what I've learned so far. What Joshua answered looks to be true, so now you can check some options to minimize that: Try to use mentioned streamsilence option - look here http://forum.xbmc.org/showthread.php?tid=140051 . It didn't work for me on raspbmc, but maybe will work for you. Another solution could be to expose audio to jack output and video to HDMI, but for that moment XBMC doesn't support that. So, you can create two profiles in XBMC and add a switcher to main menu. On one profile, which can be called "music" you would expose audio through analog output, and video through HDMI.
Check for the existence of the directory: /lib/arm-linux-gnueabihf the soft-float version do not have this directory, they have: /lib/arm-linux-gnueabi instead, or you can list the packages installed using: dpkg -l and see the platform in the third column (all/armhf/armel)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4682", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/5412/" ] }
4,683
I am an experienced Java programmer who received the Raspberry Pi for Christmas. Unfortunately, it appears that only Python is installed in it. What command do I type at the start command line where I would usually type startx to install the JDK and JRE?
[Note: Later in 2013 the Pi Foundation announced Raspbian now ships with Oracle hard-float.] The oracle 8 preview works for me, thus far. Compiling is slow on the pi, surprise, but the jre seems to run quite fast once it loads. I think bearbin's answer is pretty definitive but if you want a simple way to try oracle: Download . You get a .tar.gz file, which is a gzipped tarball. Put the .tar.gz in /usr/local and unpack it: tar -xzf oracle8-blah-blah.tar.gz . This will create a directory with everything in it. You can rename the directory, mv oracle-jdk-whatever jdk1.8.0 . Everything in there is self-contained. Put the bin/ directory at the beginning of your executable search $PATH. If there are any other javas installed, that will make this one take precedence: PATH=/usr/local/jdk1.8.0/bin:$PATH . That will only work for your current shell. To make it the default from now on, add this to ~/.profile : export PATH=/usr/local/jdk1.8.0/bin:$PATH Note you must log in again to make .profile effective. However, if you are using lightdm , the default GUI login won't do this, see here for a solution .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4683", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/5630/" ] }
4,698
Is there a sort of update tool for my Raspbian Debian 7 (Wheezy) package? I installed php and lighttpd , and I want to keep those automatically updated for when bugs are found.
You need to enter some commands into the command line. First of all: apt-get update (this will update the sources of software) apt-get upgrade (this will upgrade everything to the latest version)
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4698", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/3575/" ] }
4,719
If I am running a Pi headless, is there a command I can use to safely shut down, or should I simply remove the power cord?
You can safely shutdown the pi using shutdown -h now The -h just halts all processes
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4719", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4311/" ] }
4,741
There are different blog posts and forum threads discussing this and the challenges encountered (Silverlight, DRM, etc.). Also read about the XBMC Flicks addon . But, did anyone succeed to stream Netflix content on the Raspberry Pi? Even more, through Raspbmc?
This essentially boils down to getting Netflix on Linux; which (except for Android) is intentionally not supported and difficult. I haven't seen any solution yet (for any Linux, RPi aside) that didn't involve serious and unstable hacks or some type of Windows emulation/re-implementation (which is not going to be a viable option with the ARM/x86 architecture difference). Your best bet is probably to wait for Android Pi to become stable and hope Netflix runs on it successfully (or hope Netflix finally supports Linux besides Android). Update Jan 2018: It's been 5 years and much good news is to be had. Netflix now supports HTML5-based playback, so Silverlight is no longer a blocker. The appropriate DRM-decrypting/decoding libraries have been written for Linux and include Raspberry Pi 3 support. You can probably use Firefox or Chrome at this point just fine, but even better for Kodi users: Kodi 18 (release date to-be-determined) includes a redesign of the video system which has opened up the ability to integrate DRM-ed content into Kodi playback. Presumably Raspbmc will have the changes integrated sometime after Kodi 18 is released. The end result is that Netflix on RPi should be feasible by the average user of Raspbmc once Kodi 18 is released. One catch however; I think any Linux-based library is still artificially limited to 720p resolution by Netflix, but I'm not sure on that. See https://github.com/asciidisco/plugin.video.netflix for details and updates.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4741", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/5556/" ] }
4,745
I'm using my Raspberry Pi as a headless server which I can ssh into. I don't need the X Server, LXDE etc. I'm running Raspbian "wheezy". I've already disabled "Start desktop on boot" using raspi-config as described here . But I keep getting lots of package updates for all the desktop stuff that I don't use (I run apticron to notify me of pending updates via email), so I'd like to completely apt-get remove all the unnecessary packages to avoid these unnecessary updates. Which package(s) should I remove? So far, I've come up with the following: sudo apt-get remove desktop-base lightdm lxappearance lxde-common lxde-icon-theme lxinput lxpanel lxpolkit lxrandr lxsession-edit lxshortcut lxtask lxterminal obconf openbox raspberrypi-artwork xarchiver xinit xserver-xorg xserver-xorg-video-fbdev I made the above list by looking in aptitude for all packages in the Installed Packages -> x11 -> main section that were not "automatic installs". For some reason when I run this, apt-get tells me that: The following extra packages will be installed: libutempter0 xbitmaps xterm which seems a little odd for a remove operation. Is there an easier way? Is there a "super" package which owns all of this graphical stuff and can be removed, taking all it's dependencies with it? From my understanding, it doesn't look like this is possible, because these things have not been automatically installed, meaning I need to track them all down and remove them all explicitly.
TL;DR or "Just scorch my pi" sudo apt-get remove --auto-remove --purge 'libx11-.*' sudo apt-get autoremove --purge (Repeat apt-get autoremove --purge until no orphans remain) Further explanation If a package foo depends on another package libfoo and you remove the libfoo package, the dependent ( foo ) is also removed. Because Foo has a depends line specifying libfoo , it would be broken to leave foo if libfoo were removed. The reverse is not true: removing foo does not delete libfoo automatically. Another package xfoo may also depend upon libfoo, so apt won't just remove it (although apt will track if it was installed only as a side-effect of installing foo and offer to auto-remove it if you ask it to, so long as no others still depend on it) Meta packages depend on a set of other packages in much the same way that foo depended on libfoo , so when you remove a meta-package, little else is typically removed. For example, there may be two meta-packages that depend on xterm (lxsession and xfsession perhaps), but uninstalling one or both won't uninstall xterm because xterm isn't broken without lxsession or xfsession. Meta-packages are generally at the top of the dependency tree, not at the bottom, and few things tend to depend directly on meta-packages. Meta-packages primarily provide a convenient way to install a sensible set of packages at once, but they aren't uninstall tools. So, if you want to scorch everything that depends upon X11, you will need to target the base set of libx11 libraries that all x11 apps must ultimately depend upon: sudo apt-get remove --dry-run --auto-remove --purge 'libx11-.*' sudo apt-get autoremove --dry-run --purge This will (simulate) remove everything that ultimately depends on libx11-.*, and will also remove any packages that were installed as a dependency of an X11 program even if they didn't directly depend on X11 itself (CUPS and Ghostscript are typically installed as a side-effect of installing a desktop environment). The second command will remove subsequent orphans until none remain. Remove "--auto-remove" if you want to do this step later or not do it at all, or just add back the packages manually after cleaning the GUI off. Remove the --dry-run option to actually perform the operation after you have checked that it won't remove packages you did not intend to be removed.) I prefer to clean and purge the side-effects, and add them back as needed. Also, I went ahead and tested this on my own pi, and it rebooted to a very spartan but functional server. :) Why does a remove install something? The above strategy solves the stated problem, but there is still the curiosity of why a remove operation results in packages being installed . At the heart of every package manager is a satisfiability solver of some kind. When you tell a package manager to install some packages, remove some packages, or upgrade some packages, what you are really asking it to do is to solve for the next desired state of software installation given an available set of packages. This solution may include installing additional packages (dependencies), removing existing packages (conflicts, breaks), downgrading/upgrading specific packages (compatibility level), or a combination thereof. So, while it is a bit counterintuitive that the solver determines that some packages need to be installed in order for other packages to be removed , it makes perfect sense. This is the nasty dependency management problem that package managers solve. A concrete example: Given a set of Java applications already installed, they all depend upon a java compatible runtime which currently happens to be openjdk-7-jre . You then ask the package manager to solve for installation of a new Java tool that declares a conflict with openjdk-7-jre but works with oracle-7-jre (both packages generically provide a java-7-runtime ). The solver will propose a removal of openjdk-7-jre and an install of oracle-java-7-jre as the solution to your desired state of having the new package installed while not breaking existing packages. In this specific case, xterm is a package that provides a virtual dependency called x-terminal-emulator ( xterm , lxterminal , and aterm all provide an x-terminal-emulator ), so it is likely that in removing lxterminal (as a part of removing lxde), the solver found an existing installed package ( transcode as a possible example) that required some kind of x-terminal-emulator , so the solver chose to install xterm (which requires libutempter0 and xbitmaps , explaining the other packages to install) to satisfy the otherwise broken dependency. Without seeing the package database, I would hypothesize that this is the most likely scenario. To discover the packages that are currently depending upon xterm (or an alternate), use the apt-cache rdepends command (using the --installed switch to limit to installed packages only): $ apt-cache --installed rdepends xterm xterm Reverse Depends: |xorg clusterssh |xinit |tk8.5 |tk8.4 |transcode Dependencies that start with the alternation character '|' mean that the package depends on xterm or something it provides (that something is x-terminal-emulator in this case). The clusterssh package depends on xterm explicitly , and does not allow for an alternative. This is the short list of the packages that are causing xterm to be required. What about deborphan? The functionality of tracking orphans was incorporated into apt-get via the 'autoremove' functionality in 2010 (Debian bug 582791 ) rendering deborphan mostly redundant and essentially obsolete. Unlike deborphan and other solutions like it, apt-get directly tracks which packages were explicitly installed and which packages were installed as a side-effect or dependency of an explicitly installed package. For example, if an administrator installs foo, libfoo is installed as a side-effect and apt-get autoremove will , in fact, remove libfoo if autoremove (or --auto-remove) is specified when removing foo. The approach taken by deborphan is a collection of guesses. For example, the guess that an installed library that does not have a dependent must be an orphan: If libfoo is installed, but neither foo nor xfoo are, deborphan may decide it must be an orphan. One failure mode here is that libraries might be specifically installed for the tools they provide (libxml2 for xmllint before it was repackaged into libxml2-utils) or simply available for development purposes. Such packages are not orphans. Additionally, deborphan focuses on libraries, so it misses a number of non-library orphans that apt tracks (Obsolete packages vs. orphaned packages) .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/4745", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4387/" ] }
5,033
My searching efforts have failed when trying to find this. On average, how much energy does the Raspberry Pi consume in 24 hours (minimal usage vs. max usage in a day and USB vs. Micro-USB powered) ?
My research began with the original thread on the Raspi forums: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6050&p=291334&hilit=watts+power#p291334 To summarize what we've learned there, the total consumption of a Raspberry Pi is probably not more than: 6 W * 24 h = 144 Wh (I guess that's 518 kJ) (note this is an energy value, not a power) and almost certainly more than 10% of that if you can get the power down to 0.4 W. Compared to a PC, even a tiny PC like Intel's Compute Stick, these are very small amounts of energy. On the other hand, compared to a dedicated low-power platform like a microcontroller board based on an ARM Cortex-M0, the Pi consumes power like a drunken sailor and, note, has no real sleep modes. It has no real shutdown mode either, for that matter. [0] The high usage figure is reasonable for a Raspberry Pi 2 Model B, or an original Raspberry Pi model B. The model A+ and Pi Zero consume the least power. Even at relatively high electricity prices you are looking at < $0.02 per day of running the box. Note, power consumption has been changing (for the better) with improvements in the software, because it's possible for the OS to power down some blocks of the machine when they are idle or perhaps if explicitly turned off. Updated: Following the release of the model 4 B, according to measurements by the awesome Alex Eames and the incomparable Jeff Geerling [1][2][3][4][5][6][7] B with keyboard = 1.89 W -> daily 45 Wh [8] B+ with keyboard = 1.21 W -> daily 29 Wh B+ with LAN/USB chip off (no i/o except GPIO) = 0.76 W -> daily 18.2 Wh B+ shut down = 0.26 W -> daily 6.2 Wh A idle = 0.7 W -> daily 17 Wh A+ idle = 0.52 W -> daily 12.5 Wh Pi2 B at idle = 1.15 W -> daily 28 Wh Pi Zero at idle = 0.51 W -> daily 12.2 Wh Pi3 B at idle = 1.15 W -> daily 28 Wh Pi3 B at 100% * 4 CPUs = 3.6 W -> daily 86 Wh Pi4 B turned off = 0.34 W -> daily 8.2 Wh Pi4 B at idle = 2.85 W -> daily 68.4 Wh Pi4 B at 100% * 4 CPUs = 6.4 W -> daily 154 Wh The Zero, A+ and B+ really offer huge improvements in the power circuitry. Wow! Note that the Pi 2 Model B is a 4-core machine with each core idling near 0 and maxing near 0.25 W power demand. Also please realize that although it's very little power, if you are buying a solar panel, battery, charge regulator, etc. just to run the pi, you are spending a lot more on power hardware than you are spending on computing. You can save as much as 200 mA of current by shutting off USB/LAN i/o for sleep/processing and then re-enabling it. See Disable LAN9512 [9] Regarding shutting off the HDMI interface if running headless or to sleep a display, saving about 20 mA of current, see https://volumio.org/forum/turning-off-hdmi-composite-save-power-t1503.html [10] If you have wondered how to get any input or output with the network and display powered off, as above, you might be interested in using the GPIO pins as a serial console. I'd recommend you read this: http://elinux.org/RPi_Serial_Connection Enjoy! [0] On shutdown, the ARM CPU will halt but the GPU, which also has a real power draw, is still spinning. [1] http://raspi.tv/2014/how-much-less-power-does-the-raspberry-pi-b-use-than-the-old-model-b [2] http://raspi.tv/2014/raspberry-pi-a-how-much-power-does-it-need [3] http://raspi.tv/2015/raspberry-pi2-power-and-performance-measurement [4] http://raspi.tv/2015/raspberry-pi-zero-power-measurements [5] http://raspi.tv/2016/how-much-power-does-raspberry-pi3b-use-how-fast-is-it-compared-to-pi2b [6] https://raspi.tv/2019/how-much-power-does-the-pi4b-use-power-measurements [7] https://www.pidramble.com/wiki/benchmarks/power-consumption [8] For comparison, a reasonable battery bank with 5 V output, similar in size to a lipstick case, contains a little over 11 Wh (3.2 Ah * 3.7V) and a 12 V car battery stores a total energy, fully charged, of about 1000 Wh. [9] echo 0x0 > /sys/devices/platform/soc/20980000.usb/buspower [10] /opt/vc/bin/tvservice -off
{ "source": [ "https://raspberrypi.stackexchange.com/questions/5033", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/6087/" ] }
5,258
I would like to know how to completely remove X.org and all GUI-related components from Raspbian or soft-float Debian. The most obvious solution would be sudo apt-get purge xorg , but I am afraid that that will leave some GUI packages lying around. How can I accomplish this?
I was able to remove the desktop environment include with Raspbian by first removing x11-common and then removing my 'stale' packages. sudo apt-get remove --purge x11-common sudo apt-get autoremove
{ "source": [ "https://raspberrypi.stackexchange.com/questions/5258", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/3610/" ] }
5,333
I'm used to mapping Caps Lock to Escape, particularly for use in Vim. In Ubuntu, this is simple from the GUI. In other distros, a utility like xmodmap can be used. I tried this, but it seems that xmodmap cannot be installed by apt . Can this sort of remapping be easily accomplished on the RPi?
On Raspbian, edit the file /etc/default/keyboard and then run sudo dpkg-reconfigure keyboard-configuration . You may have to restart your terminal and/or the Pi for everything to take effect. The particulars of what you need to enter depend on what you want to do. For me, this: XKBMODEL="pc105" XKBLAYOUT="us" XKBVARIANT="altgr-intl" XKBOPTIONS="terminate:ctrl_alt_bksp,ctrl:nocaps" makes sure I have US international keyboard layout and Caps Lock acts as Control (that's the ctrl:nocaps part). Find out more via man keyboard .
{ "source": [ "https://raspberrypi.stackexchange.com/questions/5333", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4311/" ] }
5,427
This question answers the question of how I use an external computer to create a backup of my RPi. I'm wondering whether I can create a backup image of the SD card that is currently in use, and copying it to a file on a USB storage device. Is this possible? If not, is there any way to create a backup of a RPi without involving another computer?
Here's an intro to using rsync for back-up on the Pi. Once the initial back-up is created, keeping it up to date this way is much much faster than constantly ripping the entire image. You can do this to a local hard drive or over a network. You actually do not want a complete copy of a running system as a back-up, since some of the stuff ostensibly in the filesystem exists only at runtime. Including that in a backup and then using it to recreate an image later may create problems for you. There are some other exceptions too. rsync can accept a list of ( glob ) patterns to exclude, and those can be read from a file, so let's first go thru what should be in such a file. Note that the entries are of the form /directory/* and not /directory . This is because we want them to exist, but we don't want to copy anything in them. /proc/* /sys/* These do not really exist on disk. They're an interface to the kernel, which creates and maintains them in memory . If you copy these and then copy them back into a system and boot it, it will be (at best) meaningless, since the kernel uses those as mount points for the interfaces [If you want to see what happens when you mount a filesystem partition on a directory with data in it, try. It works and won't do any harm, but the stuff that was in the directory is now inaccessible.] Note that it is critical that the /sys and /proc mount points exist. But they should not contain anything. Next: /dev/* The dev directory is not quite the same thing as proc and sys but for our purposes it is. If you believe that you should save this so you can have the same device nodes in your backup or something, you're wrong . Don't bother. Do not copy dev . Once upon a long time ago Linux did work that way, but it doesn't anymore. /boot/* This is sort of a special case with the most (perhaps all) of the Pi specific distros such as Raspbian. It's actually a mount point for the first, vfat, partition. We are going to deal with that separately. Whatever you do, don't bother including it here, because again, it's a mount point. /tmp/* /run/* /run is generally not on disk either, it's in memory. Perhaps /tmp could be too (this would save a bit of SD card action), but in any case, as the names imply, these are not places for storing persistent data. Applications which use them expect that they may be deleted at each boot. /mnt/* /media/* These are important particularly if you are planning to back up to a hard drive or USB stick and the device is in /mnt or /media (automounting tends to use the latter), because if you don't exclude the location of those devices in the filesystem you will create a loop backing up the content of the drive to itself, until it runs out of space. I think rsync might be smart enough to spot something that dumb but try to avoid testing the premise. On to the actual backing up: Create a directory to back up to on the locally mounted harddrive, USB thing, etc. -- e.g. "pi_backup". You can alternately backup to a remote location via ssh (see below) or using a network mounted filesystem, but this will probably take a while the first time. If the file containing the list to exclude is /rsync-exclude.txt 1 and your drive is /mnt/usbhd , to do the actual backup: rsync -aHlAXNv --delete --exclude-from=/rsync-exclude.txt / /mnt/usbhd/pi_backup/ Notice that there is a trailing slash on pi_backup/ . You may want to have a look at what all the switches mean in man rsync . This will take a while and produce a lot of output (if you want to examine that in a log instead, append > rsync.log ). --delete is meaningless the first time, but for keeping the backup updated use it. This ensures that stuff you've later deleted on the Pi also gets removed from your backup. The a sets recursion into directories and makes sure all the file attributes match. -H is to preserve hard links 2 , v is for verbose which is why you get some output (otherwise rsync is quiet). See man rsync for more. There is a shortcut whereby you can skip the --exclude-from file. If you are sure that all of the things you don't want to copy ( /tmp etc.) are on separate filesystems, you can just use: rsync -axHlAXNv --delete-during / /mnt/usbhd/pi_backup/ -x has been inserted. This is the short form of --one-file-system , which tells rsync not to cross filesystem boundaries. Personally I prefer the --exclude-from , but on e.g., default Raspbian, --one-file-system will work fine. You can use both if you want to be -x tra careful :D That's not quite a complete backup. It's enough if you haven't put anything in boot and you are fine with using the back up to just restore the system by sticking the card in a computer and running: rsync -av --delete-during /mnt/usbhd/pi_backup/ /mnt/sdcard_partition2/ You could also do this with a card with a new image on it (presuming it's the same as your base image) although that's a little inefficient if you have to create the image (because you're then going to overwrite most of it). You could also connect another SD card via a USB adapter with such an image on it, and use the above method to maintain a duplicate card. If you've put stuff in /boot (e.g., a custom kernel), including /boot/config.txt , you'll want to back that up too (pretty simple -- there's not much to it). Just do it separately, and when you restore, that stuff goes in the first partition. See here if you want to create a blank Raspbian style image which you could then backup into. You can use a similar methodology to create an empty Raspbian style card -- just rather than dealing with an .img file, you'd be dealing with a real device (e.g. /dev/sdb ), meaning all you have to do is create the partition table with fdisk and then format /dev/sdb1 and sdb2 (or whatever) with mkfs . But copying the whole image is easier! Why bother with this? It's not that hard; I restored to a blank card (formatted as per that last link) in 10 minutes. Yes, just using dd on the whole thing is simpler (if you find stuff like words confusing...), BUT then it takes quite a while every time you want to update your backup because you must do 100% of it every time. Using rsync , once a backup exists, updating it is much much faster, so you can set this up to happen painlessly everyday via cron. Over a network even. Every six hours. The more often you do it, the less time it will take. rsync via ssh Here's an example: rsync [options] --rsh="ssh [ssh options]" root@[the pi ip]:/ /backup/rpi/ "Options" would be, eg, -av --delete --exclude-from=/rsync-exclude.txt and "ssh options" is whatever you normally use (if anything). You must have root access via ssh to do this for the purposes of a system backup (set PermitRootLogin=yes in /etc/ssh/sshd_config and restart the server). 1 You should keep this file. You can put comments in it on lines beginning with # or ; . This could include the actual rsync command, which can be copy pasted later so you don't have to remember it each time. 2 Thanks to Kris for pointing out rsync doesn't do this automatically.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/5427", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/4311/" ] }
6,974
I have been given a pre-installed SD card. It boots fine, and I know it is running some version of Raspbian. Can I determine exactly which release it is running?
Open Terminal and type: cat /etc/os-release This results in the following output on my Raspberry Pi 2... PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
{ "source": [ "https://raspberrypi.stackexchange.com/questions/6974", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/-1/" ] }
7,088
I am looking for a well maintained Python library with allows me to play audio files on my Raspberry Pi using the standard audio output. So far I've tried several, but none of them seem to work. Although pyglet works on my regular computer fine, it causes an error on the Raspberry Pi. Is there a Python library which has been proven as easy to use?
I recommend the widely popular Pygame. I may be wrong, but I believe that it is pre-installed on the Pi. You can use the Pygame Mixer Music Module to play audio files. I have included some example code below. Assuming that we have an audio file called myFile.wav . import pygame pygame.mixer.init() pygame.mixer.music.load("myFile.wav") pygame.mixer.music.play() while pygame.mixer.music.get_busy() == True: continue NOTE: If this fails, please go to the terminal and update your system with apt-get update apt-get upgrade and try again.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/7088", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/617/" ] }
7,122
I have been working with embedded systems (mostly micro controllers) for about 3 years. I want to know how much of RPi of actually open source?? I know arduino gives us complete details of hardware /software etc. But what about RPi? This is important since my team and I want to do the following with the raspberry pi [this project intends to use the RPi exactly like an arduino => no OS] : Rewrite the primary bootloader (ROM) to boot from flash rather than external SD card. Have a secondary bootloader in the on board flash, this activates the usb port of the pi and listens to it. It must accept binary code (that it will get from my PC) and save it on the flash. later start executing it. Develop our own device drivers to handle communication protocols. Develop our own uploader and debug environment for the PI, along with our custom implementation of embedded C for ARM (necessary to control GPIO's etc). Implement our own OS for embedded systems if possible. Is this possible with the raspberry Pi? If not : -> Which of my five goals are not possible with raspberry pi. what changes must I make to my project if I have to work with the PI? -> What other boards are there in the market which will let me accomplish exactly what I want?
Some background The most important thing you should know is that the RaspberryPi is a strange beast where the ARM CPU is the not main CPU - it's only a co-processor to the VideoCore GPU . When the RaspberryPi starts, a GPU blob is read from the SD card to the L2 cache and executed. This code then brings up all the important peripherals (RAM, clocks etc) and starts the ARM CPU . Then the 2nd stage bootloader or some operating system itself can be run on ARM CPU . GPU blob is not only a bootloader. It's actually an operating system (Video Core OS) by itself. Some important elements of the system are not directly accessible by ARM CPU and it has to communicate with GPU (using mailbox messaging system) to use them. There is partial documentation about this available. Now Video Core OS ( VCOS ) is extended from time to time by Broadcom employees to enable features needed by Linux kernel, RISC OS or sometimes even some hobby OSes. There is no good documentation about this however, you would have to dig in the RaspberryPi forum , github and possibly other places to find information about this. But it's there.. somewhere. And there are a few people who write their own bare metal code or even OSes on the RaspberryPi to help you out. And of course a lot of open source code - RasbperryPi's Linux kernel for example. VideoCore is proprietary, there is no official documentation and development tools. So unless you want to put a lot of effort, you can't rewrite VCOS with your own code. There is, however, some effort to reverse engineer the Video Core, you can find some information here . Another problem is that the USB stack by Synopsys is proprietary and again there is no documentation for it and it seems that even with documentation it's hard to implement it reliably. But again, the code is available (Linux kernel, u-boot, CSUD ). Using advanced graphics capabilities of Video Core may also be hard - there is some open source code for the graphics libraries, but it's only for the ARM side. That being said, it was possible to make the RISC OS port from the information available (it's not entirely clear to me if they were using only publicly accessible information, though), some people are rewriting (independently from Broadcom) the Linux kernel for mainline, there is a FreeBSD port, 'U-boot` and others. So it is definitively possible to write your own OS. It's just not as easy as it might possibly be. Your goals Number 1 As far as I know, there is no way that the SoC could start in another way than the one described. So first stage bootloader has to be on SD card . And it has to be a GPU binary, not an ARM binary which is another problem. And there is no on board flash in the RaspberryPi which is also a problem. Number 2 The main problem is that there is no on-board flash on RaspberryPi. You could add one and it could be activated in your bootloader (which would have to be the 2nd stage bootloader already). Writing a USB driver could be problematic, however. Number 3, 4, 5 This shouldn't be much of a problem. Most of the peripherals (at least those accessible to the ARM ) are documented here . Existing bootloader makes this even easier since you get your SoC completely configured. You can look here and here for some code and documentation. Alternatives I don't know any other board as good as RaspberryPi so it's hard to recommend something but you may take a look at some mature projects like OMAP based Beagleboard / Beaglebone / Pandaboard or you can follow the development of some new boards like the Allwinner based Cubieboard or PCduino . It all depends on what exactly you want to accomplish.
{ "source": [ "https://raspberrypi.stackexchange.com/questions/7122", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/6277/" ] }