sudo apt-get update and then sudo apt-get install python-rpi.gpio
Category Archives: Raspberry-Pi
用树莓派Raspberry pi+piCorePlayer做HiFi DSD播放端
Getting a Python script to run in the background (as a service) on boot
For some of my projects I write a simple service in Python and need it to start running in the background when the Raspberry Pi boots. Different Linux distributions use different ways of starting and stopping services (some now use Upstart, some systemd). I am using the “Wheezy” Debian distribution on my Raspberry Pi, and in this case the proper way to do this is using an “init script”. These are stored in the /etc/init.d folder. In there you can find scripts that for instance, start the networking system or a print server. Debian Wheezy uses the old Sys V init system which means that these scripts are run according to symbolic links in the /etc/rc.x directories. The Debian documentationexplains this. Continue reading Getting a Python script to run in the background (as a service) on boot
I²S Audio Support for Raspberry Pi
Raspberry Pi Setup I2S
Fast Install
Luckily its quite easy to install support for I2S DACs on Raspbian Jessie. Continue reading Raspberry Pi Setup I2S
How to fix Perl warning setting locale failed on Raspbian
Run a script on raspberry pi start up
Sometimes it’s useful to automatically run a script on a Pi when it boots up. You might want to start a script that monitors sensors, a Bittorrent client, or a program to back up your Pi to the internet. There are several ways of doing this, and each one has it’s benefits.
In the following examples I’m going to start a program called servod which manages a servo. The program runs in the background and uses the Pi’s GPIO pins to set the position of a servo. Continue reading Run a script on raspberry pi start up
树莓派用服务方式设置开机启动python
最近有个项目利用树莓派来完成,主要是在树莓派上用python写了个脚本来处理一些信息与逻辑。这边就遇到一个问题,即设置该脚本在开机的时候自动运行,而不是需要人登陆到树莓派上在执行这个程序,这样太麻烦了,顶多在实验室玩玩,拿不出去。本文主要讲诉设置该python脚本在树莓派上自动运行。 Continue reading 树莓派用服务方式设置开机启动python
无屏幕和键盘配置树莓派WiFi和SSH
不算是什么新功能了,在树莓派3B发布后不久,树莓派官方 Raspbian 系统久加入了允许在开机前对 WiFi 网络进行配置的机制。 Continue reading 无屏幕和键盘配置树莓派WiFi和SSH
raspberry pi 时间 同步
第一步:安装命令:sudo apt-get install ntpdate
第二步:输入命令tzselect
第三步:进入到/usr/share/zoneinfo/Asia 然后输入命令sudo cp Shanghai /etc/localtime
第四步:输入命令sudo ntpdate cn.pool.ntp.org