树莓派连接DHT11采集温度与湿度

DHT11介绍 DHT11是一款有已校准数字信号输出的温湿度传感器。 精度湿度+-5%RH, 温度+-2℃,量程湿度20-90%RH, 温度0~50℃。 DHT11针脚说明 VCC 供电 3-5.5VDC DATA 串行数据,单总线 N/A 空脚,请悬空 GND 接地,电源负极 硬件连接 树莓派GPIO针脚说明 DHT11与树莓派链接 VCC连接+3V3 DATA连接GPIO4 GND链接GND 软件部分 安装wiringPi sudo apt-get install git-core git clone git://git.drogon.net/wiringPi cd wiringPi ./build 如果由于网络原因无法git clone成功,可以从此下载wiringPi http://unixetc.com/res/wiringPi_v2.3.1.zip 验证是否安装成功 gpio -v gpio readall 下载编译C语言程序代码 wget /res/sensor.c gcc -o sensor sensor.c -lwiringPi 运行程序 sudo ./sensor 24,39 输出结果,第一个为湿度,第二个为温度

六月 21, 2015 · JQX

入手树莓派2 Model B

树莓派 2 Mode B 配置详情 A 900MHz quad-core ARM Cortex-A7 CPU 1GB RAM 4 USB ports 40 GPIO pins Full HDMI port Ethernet port Combined 3.5mm audio jack and composite video Camera interface (CSI) Display interface (DSI) Micro SD card slot VideoCore IV 3D graphics core pi@raspi:~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye pi@raspi:~ $ cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 processor : 1 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 processor : 2 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 processor : 3 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 Hardware : BCM2835 Revision : a21041 Serial : 00000000d81b63a8 Model : Raspberry Pi 2 Model B Rev 1.1 pi@raspi:~ $ free -h total used free shared buff/cache available Mem: 921Mi 53Mi 784Mi 0.0Ki 84Mi 818Mi Swap: 99Mi 0B 99Mi pi@raspi:~ $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk0 179:0 0 29.3G 0 disk ├─mmcblk0p1 179:1 0 256M 0 part /boot └─mmcblk0p2 179:2 0 29G 0 part / pi@raspi:~ $ ➜ ~ neofetch `.::///+:/-. --///+//-:`` pi@raspi2b `+oooooooooooo: `+oooooooooooo: ---------- /oooo++//ooooo: ooooo+//+ooooo. OS: Raspbian GNU/Linux 11 (bullseye) armv7l `+ooooooo:-:oo- +o+::/ooooooo: Host: Raspberry Pi 2 Model B Rev 1.1 `:oooooooo+`` `.oooooooo+- Kernel: 6.1.21-v7+ `:++ooo/. :+ooo+/.` Uptime: 18 mins ...` `.----.` ``.. Packages: 624 (dpkg) .::::-``:::::::::.`-:::-` Shell: zsh 5.8 -:::-` .:::::::-` `-:::- Terminal: /dev/pts/1 `::. `.--.` `` `.---.``.::` CPU: BCM2835 (4) @ 1.000GHz .::::::::` -::::::::` ` Memory: 70MiB / 921MiB .::` .:::::::::- `::::::::::``::. -:::` ::::::::::. ::::::::::.`:::- :::: -::::::::. `-:::::::: :::: -::- .-:::-.``....``.-::-. -::- .. `` .::::::::. `..`.. -:::-` -::::::::::` .:::::` :::::::` -::::::::::` :::::::. .::::::: -::::::::. :::::::: `-:::::` ..--.` ::::::. `...` `...--..` `...` .:::::::::: `.-::::-` pi@raspi:~ $ screenfetch .',;:cc;,'. .,;::c:,,. pi@raspi ,ooolcloooo: 'oooooccloo: OS: Raspbian 11 bullseye .looooc;;:ol :oc;;:ooooo' Kernel: armv7l Linux 6.1.21-v7+ ;oooooo: ,ooooooc. Uptime: 3m .,:;'. .;:;'. Packages: 592 .dQ. .d0Q0Q0. '0Q. Shell: bash 5.1.4 .0Q0' 'Q0Q0Q' 'Q0Q. Disk: 1.5G / 30G (6%) '' .odo. .odo. '' CPU: ARMv7 rev 5 (v7l) @ 4x 1GHz . .0Q0Q0Q' .0Q0Q0Q. . RAM: 104MiB / 921MiB ,0Q .0Q0Q0Q0Q 'Q0Q0Q0b. 0Q. :Q0 Q0Q0Q0Q 'Q0Q0Q0 Q0' '0 '0Q0' .0Q0. '0' 'Q' .oo. .0Q0Q0. .oo. 'Q0Q0. '0Q0Q0Q0. .Q0Q0b 'Q0Q0. '0Q0Q0' .d0Q0Q' 'Q0Q' .. '0Q.' .0Q0Q0Q. '0Q0Q'

三月 12, 2015 · JQX

组装ATRIX 4G Laptop Dock和树莓派

清单如下: Raspberry Pi B+ Laptop Dock for Motorola ATRIX 4G Micro-HDMI 母对母转接头 HDMI-Micro HDMI 公对公连接线 Micro USB 母对母延长线 USB-Micro USB充电线一根 以下为实物图: 操作: 主要是将一个Micro USB母口和一对USB/Micro USb公口相连,然后就可以通过Laptop Dock进行供电,并且链接Laptop Dock键盘。 下图是一张Laptop Dock接口的照片: 以下为USB引脚定义: 红 电源+ 白 数据- 绿 数据+ 黑 接地 因此需要将Laptop上的Micro USB引出的电路进行改造,将其中的电源接到Micro USB公口上给树莓派供电,将数据接到USB公口上链接键盘,线路改造图示如下: 接下来就是考验动手能力了,完成后的实物图如下:

二月 28, 2015 · JQX

树莓派安装TP WN322G+驱动

首先查看usb设备 pi@raspi ~ $ lsusb Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 0ace:1215 ZyDAS ZD1211B 802.11g 注意,最后一行为无线网卡信息 打开https://wiki.debian.org/WiFi,查看是否有对照型号的固件 安装对应的固件 pi@raspi ~ $ sudo apt-get install zd1211-firmware 完成后使用iwconfig检查是否已经安装成功 pi@raspi ~ $ iwconfig wlan0 IEEE 802.11bg ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:off lo no wireless extensions. eth0 no wireless extensions.

二月 7, 2015 · jqx

树莓派安装Tonido打造个人云服务

树莓派安装Tonido sudo mkdir /usr/local/tonido cd /usr/local/tonido sudo wget http://patch.codelathe.com/tonido/live/installer/armv6l-rpi/tonido.tar.gz sudo tar -zxvf tonido.tar.gz ./tonido.sh start 浏览器打开http://ip:10001开始注册设置 ip为树莓派的地址 安装多媒体解码器 Tonido支持在线播放音频,但需要安装设置解码器 cd /usr/local/tonido sudo apt-get install ffmpeg sudo ln -s /usr/bin/ffmpeg ffmpeg.exe sudo ln -s /usr/bin/ffmpeg ffmpegv.exe 设置开机启动 下载脚本文件tonido wget http://qn.optipng.cn/res/tonido 设置脚本权限 sudo cp tonido /etc/init.d/ sudo chmod +x /etc/init.d/tonido 安装脚本 sudo update-rc.d tonido defaults Tonido客户端下载 Tonido Sync for Windows http://www.tonido.com/download.php?TonidoSync.exe Tonido Sync for Mac http://www.tonido.com/download.php?TonidoSync.dmg Tonido Sync for Linux http://www.tonido.com/download.php?TonidoSyncSetup_i686.deb Tonido for iPhone http://itunes.apple.com/us/app/tonido/id388726418?mt=8 Tonido for iPad http://itunes.apple.com/us/app/tonido/id388726418?mt=8 Tonido for Android https://play.google.com/store/apps/details?id=com.tonido.android Tonido for Windows Phone http://www.windowsphone.com/en-us/store/app/tonido/4eeacbe9-7405-47cc-acd0-f418471f992a Tonido for BlackBerry http://appworld.blackberry.com/webstore/content/18126?lang=en

八月 12, 2014 · jqx