Hot answers tagged

284

There are some great answers here, but many are out of date. Even this one has aged somewhat. There are now (at least) two ways of doing this: 1: Raspberry Pi Imager The Raspberry Pi Foundation's Raspberry Pi Imager now has an advanced options menu which is accessed by the keyboard shortcut Ctrl+Shift+X: You can set hostname, allow SSH (including changing ...


124

This no longer works since ssh is not enabled. Using only the laptop's screen and keyboard (both before and after installation), install and configuration for headless operation using SSH is possible using NOOBS (they call it "silent install"). It does not require a separate screen or keyboard/mouse. It does require an SD card reader on the laptop (built in ...


44

This is only for command-line interface, not for the Graphical UI. The easiest way would be connecting via SSH with a program called PuTTY (Windows), M-remote (Windows) or using the Terminal application in OS X or any Linux (no installation, already available). Terminal: enter the command ssh pi@raspberrypi Putty: select protocol SSH and enter hostname ...


29

This is still not documented anywhere, but the rc_gui tool (I'm assuming it would be a graphical user interface to the raspi-config if I were to ever install the full desktop) uses command line options to the raspi-config bash script. You can see the full list of options in the C source code. UPDATE: The official repo has disappeared for some reason. This is ...


28

At least nowadays, raspi-config seems to support noninteractive mode: cat /boot/cmdline.txt # show original cmdline.txt raspi-config nonint do_serial 1 # disable serial console cat /boot/cmdline.txt # confirm changes raspi-config nonint do_serial 0 # enable serial console raspi-config nonint do_serial 2 # disable serial console, but ...


26

Some specific Instructions: Contents of /etc/network/interfaces: auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf post-up ifdown eth0 iface default inet dhcp Contents of /etc/wpa_supplicant/wpa_supplicant.conf: ctrl_interface=DIR=/...


21

That's a tough one. The WiFi won't automatically connect. So I would try the following: Image a micro SD card with the Raspbian OS image using Win32DiskImager. Manually configure your WiFi from another computer. In another computer running Linux (or PC with Live CD) you could edit the following file: /etc/wpa_supplicant/wpa_supplicant.conf And add the ...


20

Yes, you do understand correctly - Raspberry Pi does not run OS X. OSX is compiled for Intel chips; the Pi uses ARM chips. You are confusing OS X and Linux. Both are based on an old operating system called Unix, which is pretty much the mother of all OS's. I may be wrong, but even Windows has a bit of Unix mixed in. What is OS X? OS X is a proprietary OS ...


18

There is a tool called Etcher for Windows, Linux, and Mac. It has a simple GUI. A screenshot from the website: (source: etcher.io)


17

If you're in the console of the pi there is a way to get around this without having to make another user (or set a pw on root): Assuming nothing else is running with your username other then the shell on the console - no X session, no ssh login, etc: exec sudo -s cd / usermod -l newname -d /home/newname -m oldname The reason this works: sudo -s tells ...


15

Following massive botnet attacks in 2016 due to IoT devices being easily hacked with default passwords, Raspbian once again comes with SSH turned off by default (source). The fix is pretty easy, you just need to create a file in the boot partition (not the directory within the root filesystem) called ssh. To check if you're in the right partition, it ...


15

You are looking for information on running "headless". There are details on this on the raspberry pi site. https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=161202 Basically put a file, wpa_supplicant.conf, on the "boot" sector of the sdcard, that you can see from windows, and edit the file to include your wifi credentials: network={ ssid="...


13

Since November 2016 SSH has been disabled by default in standard Raspbian images for security reasons. To re-enable it, create a blank file called either ssh or ssh.txt on the sd card boot folder ( fat32 partition accessible from windows) To preconfigure the wifi settings, you also create a file called wpa_supplicant.conf there containing: ctrl_interface=...


13

Edit 1/1/2019: Since this answer continues to be popular, going to incorporate a change per bigjosh's comment. Around April 2017, Raspbian introduced a security change that no longer starts the SSH server by default (see this blog post). To enable the SSH server on boot, create a file named ssh on the boot partition of the Pi's SD card prior to trying ...


12

Distribution | Username | Password ---------------|------------|------------- Debian Squeeze | pi | raspberry Arch | root | root QtonPi | root | rootme Raspbian | pi | raspberry OpenElec | root | openelec Pidora | root | raspberrypi RISC OS | n/a | n/a raspbmc ...


12

There is a blog post, Raspberry Pi Remote Connections – Without A Network!, detailing what you are looking for. Basically, this involves assigning a static IP address to both the laptop and the Raspberry Pi, then setting up X-server to stream the screen from the Raspberry Pi to your laptop. As this is an extensive walkthrough, please reference the link for ...


11

/sys/firmware/devicetree/base/serial-number seems to be more universal nowadays. And it doesn't require any additional processing. # SN=$(cat /sys/firmware/devicetree/base/serial-number) # echo $SN 0000000061c8eda7 BTW, here is model as well (`/sys/firmware/devicetree/base/model`)


11

There is no requirement to use the tool provided by the SD Association. Formatting the card in Windows using the Windows formatter may also work. However, there is a strong recommendation to use the tool. At least for SD, SDHC and/or SDXC cards. Different OSes and different formatting tools may have varying ideas about how to format an SD-card, many of ...


11

For those of you running into this with the newer Raspbian images: there is a sshwitch systemd target, that checks for /boot/ssh, and if that file is present, it regenerates the SSH host keys and enables the SSH server. So, to enable SSH, just add a file called ssh in the root of the boot partition (the FAT one, with the bootcode.bin file), and boot your Pi!...


10

For a headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled, and the file is deleted. The content of the file does not matter: it could contain text, or nothing at all.


9

We (@RPi Awesomeness and @Dam Underscore) resolved this in the chat. None of the tutorials or answers he was trying were working, so we tried to figure it out and we did. Turns out the OP was using NOOBS and thus couldn't find the cmdline.txt file required for the tutorial he was following. So, I told him to download Raspbian & go with that. Whether or ...


9

The short answer is, make sure you download the offline install version of NOOBS, then edit the file recovery.cmdline and add silentinstall on the end of the first line. That will auto install raspbian, and reboot into the desktop when finished.


8

I got the answer from the raspberry pi official forum. Thanks to MrEngman There are two versions of this wifi adaptor. V1 has the driver included in most images, V2 requires you to download and install a driver as it is not included in the Linux images. It appears you probably have V2 and need to download and install the driver. You can determine the wifi ...


8

You don't mention which OS you are using, but there area couple of ways to do this: You can try ssh pi@raspberrypi or ssh raspberrypi.local (this will may need to be adjusted if not using Raspbian - the first part is the username (pi) the second is the host name). You can login to your router and check the device list. You can ping the entire subnet using ...


8

It is possible, I suggest you to use a lighttpd with a webservice for your app. After that - just switch between hostapd(AP mode) and wpa_supplicant(client mode). It is as simple as stop one service and start another wia shell command. UPDATE: Some tips. What is the simplest way is to use a systemd as a triggerhappy switcheroo, and let it be done like this :...


7

Jivings answer holds true if you happen to have an image of Arch Linux around. As of now however such images are no longer issued by Arch Linux. Instead the full file system is provided as a .tar.gz and has to be installed to the SD card from scratch. After preparation of the partition table using fdisk and creation of the file systems mkfs the root and ...


7

Extra trick on raspbian with usermod usermod command won't run if there are any processes of the to-be-changed user running on the machine when the command is run. If your on console of the pi there is a way to get around this without having to make another user (or set a pw on root): Assuming nothing else is running with your username other then the ...


7

NodeJS For anyone interested here is a way to get the Raspberry Serial Number using NodeJS: function getserial(){ var fs = require('fs'); var content = fs.readFileSync('/proc/cpuinfo', 'utf8'); var cont_array = content.split("\n"); var serial_line = cont_array[cont_array.length-2]; var serial = serial_line.split(":"); ...


7

To mark a locale in the long list you have to press spacebar, after that you go out with enter and select your default locale with enter again.


7

ps -lp 2104 will give you some information about what the process is. You can check that and kill 2104. Note you'll have to do this logged in as root, or some other user with the permissions to do it. It probably will not work via sudo, etc. You'll also have to rename the home directory. IMO you should just create a new user with whatever name, and ...


Only top voted, non community-wiki answers of a minimum length are eligible