wireless keyboard problems
If you are having problems with wireless mice try adding
to cmdline.txt – this can be found in /boot
line to info on main Rpi site
link picamera site – for controlling pi camera from python directly
To play video files or view single images [and you don’t want to install a full media solution such as XBMC] then you can play directly from the command line using Omxplayer. This is a media player created by Edgar Hucek specifically for the Raspberry Pi and it takes advantage of the Pi’s GPU.
Omxplayer is installed on the latest Raspbian image so you may already have it installed. If not you can install it using :
sudo apt-get update sudo apt-get -y install omxplayer
Link to settings and instructions
To play a video file you just need to type :
If you are using HDMI you should use this command to pass audio over the HDMI interface :
omxplayer -o hdmi myvideo.mp4
PIR Motion Sensor HC-SR501 Infrared Detector
PIR sensor module with a single digital output. Operation – a 3.3V signal is output when motion is detected and is latched for an adjustable period of time. The output is then latched low for about 3s to avoid accidental re-triggering. Note unit needs 5v to operate
- VR1 controls the length of the latched high output when motion is detected. It can be varied from about 5s (default) to about 300s.
- VR2 controls the center of the detectable distance and can be varied from about 3m to about 7m.
- With the jumper set to the ‘H’ position (default), sensing is disabled after a sense event (ie. once output is high).
- With the jumper set to the ‘L’ position, sensing is enabled after a sense event. This allows for continuous motion detection. The output is still latched low for 3s once motion is no longer detected.
[ info source nooelec ebay shop, I purchased mine from AURA Hobby Electronics and Robotics on the UK ebay site ]
Setting where the sound goes, to change that, exit the script by typing CTRL+C and executing the following command to use the analog audio output:
$ sudo amixer cset numid=3 1
To send the audio through HDMI to the monitor, use:
$ sudo amixer cset numid=3 2
This can also be configured using sudo raspi-config, in the advanced options
links to info on RPi site
Setting the audio level
amixer sset PCM,0 90%
Playing sounds through python libraries seems can be problematic – sound wav files will play other won’t. for Simple stuff us the ‘os’ function and aplay
os.system('aplay xxx.wav &')
No sound after startx
Type this before startx
sudo modprobe snd_bcm2835 sudo amixer cset numid=3 <n> - where n = 1 to force audio to headphones