The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

39

cat /proc/device-tree/model returns something like Raspberry Pi 3 Model B Rev 1.2


32

You put a leading / to your path names! That's the root directory, meaning what you write next is an absolute path. Your /myFolder/myOtherFolder is not on your USB if it's mounted inside /media/pi/MYUSB/ anyway. But you can use cd myOtherFolder in the case you're asking. I suggest reading some basic tutorial about Linux's (or Unix) file handling, ...


21

By CPU Type You could check the RPi version with the command, uname. The different RPi versions have different CPU architectures. The RPi 2 has an arm7, whereas the 3 has an arm8. uname -m By Hardware Revision If you need to be more specific, you can check the revision entry from the output of cat /proc/cpuinfo. If you want to just exact the revision ...


14

Edit this file sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart And add this: @xset s off @xset -dpms @xset s noblank @chromium-browser --kiosk http://google.com/ # load chromium after boot and open the website in full screen mode Then reboot. Chromium should automatically launch in fullscreen mode after the desktop has loaded.


13

Github.com gitlab.org bitbucket.org anywhere code related really


10

To go into a bit more detail — Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less). Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from ...


9

To have a jsfiddle-like shareable link for your scripts, create a Github account, and save your scripts as GISTs: https://gist.github.com/ You will be able to update them in the future if you need. Regarding a place to post them, I think you are looking for the wrong thing. You want a place to share Raspian stuff, not Raspberry right? RaspberyPI is just the ...


8

First, if the script is run by a system daemon and that daemon is running with root privileges, you do not need to use sudo. This includes init (and systemd), which includes rc.local. If that daemon is not running with root privileges, then sudo will not work unless /etc/sudoers is configured to allow such (and without a password). Raspbian users may be ...


7

Can someone enlighten me of why the /etc/environment is ignored on Raspbian? It isn't. Add this to /etc/environment: FOO=bar Login, and echo $FOO. It's there. /etc/environment isn't actually sourced by the shell, it's used by the authentication system (PAM) to set an environment before your login shell is executed. The idea here is to allow for ...


7

Don't install Node.js directly from apt—it's hideously out of date, and most of the features you're expecting to have won't work. The version in the repositories at the minute is v0.10.29, while the current release as of writing is v7.10.0. Instead, follow the advice given to install Node (and npm) from their website: curl -sL https://deb.nodesource.com/...


7

You need to use sudo !! instead of sudo!!. This is intended behaviour. The !! history expansion, as stated in the documentation: designates the preceding command. When you type this, the preceding command is repeated in toto. It is simply as if !! were replaced with a find/replace with the contents of the last line. Naturally, since your line didn't ...


7

All the repository URL's are in the apt source files. The main source file is /etc/apt/sources.list. You can edit the file with e.g. nano to remove the offending 'etcher' line(s): sudo nano /etc/apt/sources.list You also need to check the 'secondary' list files. That is any .list file in directory /etc/apt/sources.list.d/. You should find e.g. raspi.list ...


6

That is the bash history not a cache. It is stored in the .bash_history file in your home directory. By default it is limited to a set number of lines (1000) and the size of the file (2000). So even if you remove it you would gain very little. You can check the size of the file by doing an ls -lah in your home directory. I have a custom script that stores ...


6

One place to go to - if you care about some explaining of those scripts too - would be our official+ blog Piversify: Piversify is a blog dedicated to the Raspberry Pi, written by members of the raspberrypi.stackexchange.com community. Here's the procedure how to contribute. + Piversify is not hosted by or otherwise linked to StackExchange itself or ...


6

There are many methods (of varying reliability) to determine this. One of the most complete and reliable is gpio -v which produces the following output. gpio version: 2.44 Copyright (c) 2012-2017 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty Raspberry Pi Details: Type: Pi 3, Revision: 02, Memory: ...


6

The problem is the use of sudo. sudo will clear environment variables by default. You can use sudo -E (or --preserve-env) to not clear the environment. This can also be set in your sudoers file.


5

In case anyone was interested, I've now been able to make an install script that worked on my current vanilla Raspbian install. Plus, ascii art!: echo $" _________ d b d b d b d b d b ''':::.....:::''' fff .' '. ^ ^.'--. ...


5

You can use screen It allows you to run commands in virtual terminal and then deattach from it and use terminal normally. To install it use these commands: sudo apt-get update sudo apt-get install screen and then to start new session use screen -S qwerty you can use any command there and then press ctrl-a and d to deattach from session. If you want to ...


5

You can use a cron job. Cron is used when you want to schedule jobs to run at specific times, e.g. every hour, every Sunday at 3 a.m. It stores the details in a table for each user called a crontab which is read during boot. One of the "times" you can specify is at a reboot. To list your crontab use the command crontab -l To edit/create your crontab ...


5

It shouldn't be much more than: sudo apt-get install at


5

Your JAVA_HOME points to a different directory than where your java executable is located. Per your question, the JAVA_HOME directory is: /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt whereas java is located in /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt Note the arm vs. arm32.


5

Files inside /proc are not "installed". /proc is a virtual filesystem. No files inside /proc exist on the SD Card. They are created by Linux on every reboot and only exist inside RAM. Try the following command to get a model name, for example: cat /proc/device-tree/model Linux itself will create, delete and modify files inside /proc to represent ...


5

On your original working install you probably installed it with sudo. If you use sudo pip3 install esptool esptool.py works just calling it by name, but if you don't use sudo you have to specify the whole path and either set esptool.py as executable, run it with python 3 [path to esptool.py], or similar. pip3 show esptool will show you the path. If ...


5

You can use raspi-config non-interactively to get the SPI status: sudo raspi-config nonint get_spi Which returns 0 (enabled) or 1 (disabled) Similarly, enable with: sudo raspi-config nonint do_spi 0


4

As per man page of iwgetid, iwgetid is used to find out the NWID, ESSID or AP/Cell Address of the wireless network that is currently used. and usage is as follow : iwgetid [interface] [--raw] [--scheme] [--ap] [--freq] [--mode] [--protocol] [--channel] Since eth0 is not the wireless interface, it doesn't show any output. Try it with a wireless ...


4

If I remember correctly, Tk needs a window manager, so you probably need to export the DISPLAY variable. Try setting DISPLAY=:0.0 before running your script.


4

I found some information that I think will do what you are looking for. I have tried and had success with the following here. Please try it and see what you think. If you want your Raspberry Pi to be able to speak to you, in multiple languages, do the following. In a terminal window type the following (each on a separate line) sudo apt-get install alsa-...


4

If I remember correctly, the operating system will not move beyond an init.d script until it has finished running. Essentially, your system is trying to launch its init.d script, but since this script never exists, your system never moves past it. At this point you won't be able to log in via SSH or through the desktop. If you don't want to do a clean ...


4

The default bash prompt is set in a system wide file; for a complete explanation of how bash sources its configuration see INVOCATION near the top of man bash. In short, that system wide file is sourced by ~/.bashrc; it is pretty obvious. # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi Evidentally, what's deciding about ...


4

The redirection takes place before sudo takes effect. Try something like sudo sh -c "echo 'dtoverlay=pi3-miniuart-bt' >> /boot/config.txt"


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