RaspberryPi
Fixing GDBus.Error.org.freedesktop.PolicyKit1.Error.Failed
sudo nano /etc/xdg/autostart/lxpolkit.desktop
add the text 'LXDE' to the line 'NotShownIn' thus:
NotShowIn=GNOME;KDE;LXDE
Accessing Files from Mac
sudo apt-get install netatalk
Installs the appletalk protocol on the Pi. This lets you use the following (at the terminal prompt on the Mac) to connect to the Pi
open afp://192.168.0.11
Backup / Restore
- Instructions: http://raspberrypi.stackexchange.com/a/4213
- diskutils to check disk number
- dd of=OUTPUT if=INPUT bs=1M seems to take about 20m for 4g card
- disk generally /dev/rdisk1 BUT CHECK
- sudo dd if=/dev/rdisk1 bs=1m | gzip > /path/to/backup.gz
- gzip -dc /path/to/backup.gz | sudo dd of=/dev/rdisk1 bs=1m
- Try direct Raspian Wheezy install: http://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian/#.UP8YRKXaZcw
SD info
- Verified cards here: http://elinux.org/RPi_SD_cards
- SD Card: rumours that class 10 designed for fast sequential so not necessarily best for random access
- Sandisk class 4 16GByte has some good reviews
- Went for "SanDisk 16GB Extreme HD Video SDHC UHS-I Card" in the end, eg top end of class 10, 12.60 GBP - see how boots compared to original
VNC
- SSH and then Remote X Window session via VMC: http://myraspberrypiexperience.blogspot.co.uk/p/setting-up-vnc.html
- SSH: Start Terminal and run "ssh pi@192.168.0.11"
- VNC Server Run at bootup - script at /etc/init.d/vncboot, set up via instructions at: http://elinux.org/RPi_VNC_Server
- Modify the file permissions so it can be executed
- chmod 755 /etc/init.d/vncboot
- Enable dependency based boot sequencing
- update-rc.d /etc/init.d/vncboot defaults
- If enabling dependency based boot sequencing was successful, it says
- update-rc.d: using dependency based boot sequencing
- Modify the file permissions so it can be executed
- Current VNC on boot: /usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb56
- Mac Client: VNC Viewer, normal password, address is 192.168.0.8:1
Time Lapse
Use ffmpeg, they are more secure than avconv as of Jan15, and also haven't tried to edge their rivals out of Debian packaging with dubious error messages.
encoder
ls *.jpg > stills.txt
The mencoder software was then used to create a HD (1080p) MPEG-4 video file for upload to YouTube:
$mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o tlcam.avi -mf type=jpeg:fps=24 mf://@stills.txt
avconv
avconv -r 10 -i myimage_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelapse.mp4
The video will be the full resolution of the default image size (2592×1944). To crop the images and create a more standard 1280×720 resolution video you can use the following command :
avconv -r 10 -i timelapse_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 -vf crop=2592:1458,scale=1280:720 timelapse.mp4
- The “vf” option defines a video filter. In this case two filters which crop the incoming image to 2592×1458 and then scale them to 1280×720.
- The “r” option tells avconv to create a video with a frames per second of 10. It appears twice to prevent avconv dropping frames that it thinks are similar.
- The “crf” option tells avconv to aim for a quality level of “20” which is a good starting point. Lowers values are better but will increase the file size.
- The “-g” option sets the GOP value. The YouTube Advanced Encoding Settings page recommends that the GOP should be set to half the frame rate so this is set to 15.
The conversion process is very slow on the Pi compared to doing the same thing on a desktop PC. For long sequences with hundreds of frames I would recommend downloading an appropriate version of Libav on your desktop or laptop and build your MP4 files much faster!
ffmpeg
ffmpeg -r 18 -q:v 2 -start_number XXXX -i /tmp/timelapse/IMG_%d.JPG output.mp4
FFmpeg can make a sequence of JPEGs in a directory in to a movie, To make the video just use this simple one line command
ffmpeg -framerate 24 -pattern_type glob -i "*.jpg" output.mp4
I do not recommend doing this on a RPi, but this will sharpen the images and make the encoding as high quality as possible.
ffmpeg -framerate 24 -pattern_type glob -i "*.jpg" -b 10M -filter:v unsharp=5:5:1.0:5:5:0.0 -c:v libx264 -tune film output.mp4
If you plan on exporting to Youtube use this. Youtube use FFmpeg their side too, these setting will mean it wont get re-encoded again therefore keeping the video quality.
ffmpeg -framerate 24 -pattern_type glob -i "*.jpg" -filter:v unsharp=5:5:1.0:5:5:0.0 -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p output.mkv
Corrections: the change of exposure time at sunset ensures that each individual image is reasonably exposed, but when stitching them into a movie, this results in a little flicker each time the shutter time is ramped up. This can easily be adjusted for by running the following before ffmpeg:
for a in *; do echo $a;/opt/ImageMagick/bin/mogrify -auto-gamma $a;done
Projects
- snap-pin headers: try amplifier and sound processing
- try direct sound generation
- try pseudo-theremin with distance sensor
- power supply: try printer
- crimper: try piezo leads
- small speakers: leads with crimper
Things to do:
- ATMega - Voice
- Speaker OK but level very low
- Try with amplifier so can hear what is happening!
- See if can route ISD1820 through ATMega to get sound processing - check with Multimeter
- Printer
- Get 2A 5V switched power supply
- Set up and test
- Theremin! http://interface.khm.de/index.php/lab/experiments/theremin-as-a-capacitive-sensing-device/
- Ready-Made: http://www.ebay.co.uk/itm/THEREMIN-classic-sound-mini-analog-theramin-/290874837312?pt=UK_Musical_Instruments_Pro_Audio_Synthesisers_CV&hash=item43b97dc940
- Photocell
- http://www.ebay.co.uk/itm/XLPC-THEREMIN-QUICK-KIT-NO-SOLDERING-SCI-FI-SYNTH-/150984022466?pt=LH_DefaultDomain_0&hash=item23275959c2
- Readymade: http://www.ebay.co.uk/itm/THEREMIN-classic-sound-mini-analog-theramin-/290874837312?pt=UK_Musical_Instruments_Pro_Audio_Synthesisers_CV&hash=item43b97dc940
- Power Suuply Tests
- Run chip on breadboard with Voltage Reg board
- Run chip on breadboard with Voltage Reg Circuit (LE33CZ / HobbyTronics)
- LED
- Matrix: Find out how to use P10 controller
- Strip Controllers
- HL1606 a bit primitive
- WS2801 controller better
- LPD8806 seems best
- (maybe also LDP6803)
- overview from 2012: http://fw.hardijzer.nl/?p=158#more-158
- Adafruit OS Occidentalis has hardware SPI support: http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/overview
- Adafruit strip here: http://www.adafruit.com/products/306
- Arduino Tutorial: http://learn.adafruit.com/rgb-led-strips
- Pi Tutorial for LPD8806: http://learn.adafruit.com/light-painting-with-raspberry-pi/overview
- The hardware bit says you need to connect both ground and +5V, but cable is only matching ground
- So presume can still power Pi as usual as long as ground is shared via adapter jack
- Need strip power supply that can power LEDs, follow recommendations closely here
- Ada strip expensive compared to many but good to start
- GPIO Control: https://projects.drogon.net/raspberry-pi/wiringpi/
- boblight may be useful? http://code.google.com/p/boblight/ and http://code.google.com/p/boblight/wiki/LPD8806_on_Raspberry_Pi
- LPD8806 driving software: http://www.adafruit.com/blog/2012/09/07/raspberry-pi-library-for-the-lpd8806-piday-raspberrypi-raspberry_pi/
- Store
- Address: http://store.raspberrypi.com/
- Download RaspPi Mag?
- Media
- Raspbmc: Airplay streaming (via Firefly?)
- Home Media: may need to use powerplug (eg NetGear Powerline) and better router?
- NAS installation
- Games
- MAME: get keyboard shortcuts
- VPN
NAS:
- Level 1
- QNap TS-212 Turbo NAS 2-Bay 4TB Network Attached Storage Server: 326GBP: http://www.broadbandbuyer.co.uk/Shop/ShopDetail.asp?ProductID=10772
- Synology DS212J 4TB: http://www.amazon.co.uk/Synology-4TB-DiskStation-Desktop-Solution/dp/B005XXVMWE/ref=sr_1_5?s=computers&ie=UTF8&qid=1359386658&sr=1-5
- Level 2
- QNap TS-219 4TB: 453 GBP: http://www.amazon.co.uk/QNAP-TS-219P-4TB-Attached-Solution/dp/B005RO76Z6/ref=sr_1_2?s=computers&ie=UTF8&qid=1359386565&sr=1-2
- Synology DS212, 4TB Solution 453GBP: http://www.amazon.co.uk/Synology-4TB-DiskStation-Desktop-Solution/dp/B005XXVLZW/ref=pd_sim_sbs_computers_3
- General Search: http://www.amazon.co.uk/b?ie=UTF8&node=430553031#/ref=sr_st?bbn=430553031&qid=1359123690&rh=n%3A340831031%2Cn%3A!340832031%2Cn%3A429884031%2Cn%3A430553031%2Cp_n_feature_keywords_browse-bin%3A1034831031%2Cp_72%3A419153031&sort=reviewrank_authority
On Hold:
- Raspbmc: C4 (currently broken on encryption)
- Raspbmc: C5 (currently broken on encryption)
DONE
- MAME: http://blog.sheasilverman.com/2012/11/better-advancemame-debs-with-sound/
- Open Arena from Pi Store: http://store.raspberrypi.com/
- /usr/local/bin/indiecity/InstalledApps/openarena/Full
- ./oa.sh
- Setup Panasonic DVD player as monitor
- Get wireless working so can set up Pi anywhere within range: http://www.myraspberrypiexperience.com/wireless-on-the-pi/
- Raspbmc install: http://www.raspbmc.com/wiki/user/os-x-linux-installation
- Raspbmc: locatons here http://reviews.cnet.co.uk/desktops/how-to-turn-your-raspberry-pi-into-an-xbmc-media-centre-50008599/
- Raspbmc: iPlayer
- Raspbmc: ITV
- iPhone: install Remote app
- iPhone: install receiver
- See if can play iTunes via speakers with iPhone attached
- Quake 3
- Build: http://www.raspbian.org/RaspbianQuake3
- rpi-update 192 failed, did rest
- note there is a "1" at end of libsdl1.2-dev !
- when commenting out lines, octothorpe is Alt-3
- PAK Files: http://myraspberrypiexperience.blogspot.co.uk/p/quake3.html
- Build: http://www.raspbian.org/RaspbianQuake3
Useful links:
- Various fixes & installs: http://www.stuffaboutcode.com/p/raspberry-pi.html
- Original rpi-update link: https://github.com/Hexxeh/rpi-update
- Adafruit: http://www.adafruit.com/category/105
- MCM Electronics: http://www.mcmelectronics.com/content/en-US/raspberry-pi
Getting hostname setup
- alter /etc/hosts and /etc/hostname
- Follow these steps to get broadcast working
sudo apt-get install avahi-daemon sudo insserv avahi-daemon //makes it automatically start //Then create a config file: (attached my basic one) sudo nano /etc/avahi/services/multiple.service //There are a couple different variations of this on the web but this suits my ownCloud needs <?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_device-info._tcp</type> <port>0</port> <txt-record>model=RackMac</txt-record> </service> <service> <type>_ssh._tcp</type> <port>22</port> </service> <service> <type>_http._tcp</type> <port>80</port> </service> </service-group> //Then restart the service sudo /etc/init.d/avahi-daemon restart