搜集一些别人做好的应用,有助于了解树莓派的性能,还有助于自己快速学习树莓派。
1. PiFM 树莓派发射 FM 音频
使用 GPIO4 发射 FM 调频音乐
- http://oszine.com/using-pifm-to-transmit-audio-on-any/
- http://www.icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter
2. 获取树莓派当前状态和数据(温度、CPU、内存、硬盘)
本篇介绍如何使用Python编写一个能输出树莓派各种状态和数据的脚本,包括CPU温度、CPU占用情况、内存占用情况和硬盘占用。
3. 给Raspberry pi 安装看门狗程序让它永不死机
看门狗程序就是一个健康监控程序,每间隔一定时间(默认10秒)检查一次是否在设定的健康工作范围内,如果超过即启动硬件复位程序,让设备重新启动,恢复健康。
国内转载的文章似乎参数设置不够齐全,需要综合下面几个链接
- http://www.eeboard.com/bbs/thread-6763-1-1.html
- http://www.switchdoc.com/2014/11/reliable-projects-using-internal-watchdog-timer-raspberry-pi/
- http://www.danward79.doesntexist.org/howto/Raspberry%20PI/rPI%20Hardware%20Watchdog
4. QEMU – Emulating Raspberry Pi the easy way (Linux or Windows!)
使用虚拟机QEMU,可以运行Raspberry Pi的系统,可用于学习和测试系统。
- 安装:http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
- 扩容:http://bbs.ickey.cn/group-topic-id-35428.html
- 改变分辨率为800*600:http://www.soslug.org/wiki/raspberry_pi_emulation
sudo nano /etc/X11/xorg.conf
Section "Screen" Identifier "Default Screen" SubSection "Display" Depth 16 Modes "800x600" "640x480" EndSubSection EndSection
不能模拟所有硬件,如SND随机数发生器,I2C,SPI ,GPIO等功能,但是对于软件功能应该是完美模拟了。
- 关键步骤
可参考 http://www.silef.de/2013/08/15/enlarge-and-run-raspbian-image-with-qemu-under-ubuntu/ http://www.wilderssecurity.com/threads/working-with-raspian-vms-in-qemu-in-ubuntu-14-04-x64.373224/ https://github.com/dhruvvyas90/qemu-rpi-kernel
使用
cd qemu start qemu-system-armw -kernel ..\raspbian\kernel-qemu -cpu arm1176 -m 256 -M versatilepb -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -hda ..\raspbian\raspbian.img -redir tcp:22::22 -rtc base=localtime
启动镜像
输入下面命令,新建文件
# nano /etc/udev/rules.d/90-qemu.rules
输入
KERNEL=="sda",SYMLINK+="mmcblk0" KERNEL=="sda?",SYMLINK+="mmcblk0p%n" KERNEL=="sda2",SYMLINK+="root"
然后,ctrl+o 保存,ctrl+x 退出nano。
再输入命令
nano /etc/ld.so.preload
将内容注释掉
#/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
ctrl+o 保存,ctrl+x 退出nano。
关闭QEMU,更改启动命令参数
cd qemu start qemu-system-armw -kernel ..\raspbian\kernel-qemu -cpu arm1176 -m 256 -M versatilepb -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ..\raspbian\raspbian.img -redir tcp:22::22 -rtc base=localtime
重新运行。
这样,QEMU应该能启动到配置页面,退出,再次启动,就是熟悉的登录界面了!
5. myRaspi 工具集
是 LT 特意搜集整理的 Raspberry Pi 的工具,使用 Github 托管。
6. 给树莓派添加时钟 RTC 模块
树莓派本身没有时钟模块,如果断电,且重启后无法通过ntp同步时间,则时间保持在上一次关机时刻。可以使用I2C接口的 DS1307 或者 DS3231来增加时钟功能。
- http://www.raspberrypi.org/forums/viewtopic.php?f=66&t=85683&p=647706
- http://drewkeller.com/blog/adding-hardware-clock-raspberry-pi-ds3231
7.使用http来同步时间
ntp无法穿越http代理,可使用http网站来同步时间
8.在树莓派 wheezy 上使用 Qt5
Qt5作为优秀的跨平台程序框架,目前在 Wheezy 上还没有,据说下个版本 Jessie 将会有(参考 QT5.7在树莓派3上的安装(Raspberry Pi 3 model B) )。无疑舍弃当前稳定的版本尝新不可取,那么只好自己编译了!
a. 在Raspberry Pi上编译
- 编译好的包:http://the.linuxd.org/qt-5-2-for-raspberry-pi/ (这个包好像没有xcb支持)
- 编译方法:http://qt-project.org/wiki/Native_Build_of_Qt5_on_a_Raspberry_Pi 和 http://qt-project.org/forums/viewthread/30331 需要30多个小时。补充 http://www.ics.com/blog/qt-raspberry-pi-2 补充 http://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi
- 相关信息:http://www.raspberrypi.org/forums/viewtopic.php?t=74899&p=540210 和 http://www.raspberrypi.org/forums/viewtopic.php?t=70784&p=526245 和 http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=83725&p=592590
LT尝试了别人编译好的包,但是发现不支持xcb,于是自己在树莓派上编译,编译过程花了30多个小时。可以从这里下载LT编译的版本:http://download.csdn.net/detail/robotics5/8284759

b. 在PC上交叉编译
c. 等待 Jessie 正式版本,拭目以待
$ sudo apt-get update $ sudo apt-get upgrade $ sudo rpi-update $ sudo apt-get install qt5-default
9. How to Write C# programs on a Raspberry Pi Using Mono
10. WiringPi
WiringPi is a GPIO access library written in C for the BCM2835 used in the Raspberry Pi. It’s released under the GNU LGPLv3 license and is usable from C and C++ and many other languages with suitable wrappers (See below) It’s designed to be familiar to people who have used the Arduino “wiring” system
11.Xbmc-GameBox
<TODO>