首先遗憾的事实、就是TeamSpeak 官方服务端并没有支持ARM linux平台、
也更不可能原生支持树莓派。
那么、自己动手的话、
想到的办法就是 ExaGear Desktop 来模拟x86的linux环境
那么首先我们来获取它
进入网站
https://eltechs.com/product/exagear-desktop/?utm_source=instructables.com&utm_medium=post&utm_campaign=none
(然后我看到要若干美元购买,然后emmmmmmmmmm.....)
然后不是很想考虑 QEMU模拟x86、因为ARM设备的性能本来就弱
执行以下命令xbian@xbian:/#sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=524288xbian@xbian:/#sudo mkswap /swapfile1xbian@xbian:/#sudo chown root:root /swapfile1xbian@xbian:/#sudo chmod 0600 /swapfile1xbian@xbian:/#sudo swapon /swapfile1xbian@xbian:/#sudo vi /etc/fstab添加以下内容到fstab文件尾/swapfile1 swap swap defaults 0 0查看是否有swap空间$ free -mok,重启后就可以用了
raspistill -o image.jpg -rot 180//拍照 输出到文件 旋转180°
这个只是用于举例、
比如你可以用类似方式提交树莓派采集其他数据、诸如土壤温度、家用电器数据等等提交到服务器进行记录。
准备:
家里的树莓派、
你的服务器、
(这里以公网数据库服务器和网站服务器为例)
首先在你的服务器搭建数据库用于存储数据
然后创建纪录树莓派CPU、温度、内存使用率等数据的表
CREATE TABLE `raspberry_basic_log` (`ID` int(11) NOT NULL AUTO_INCREMENT,`CPU_Use` double DEFAULT NULL,`RAM_Use` double DEFAULT NULL,`CPU_Temperature` double DEFAULT NULL,`DISK_Use` double DEFAULT NULL,`date` datetime(0) DEFAULT CURRENT_TIMESTAMP,PRIMARY KEY (`ID`) USING BTREE) ENGINE = MyISAM AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
接下来在你的服务器上的nginx或者apache之类的web服务器上写接受数据的接口(API)
这里以php为例,让树莓派以get方式提交数据、并写入到数据库
<?php$con = mysql_connect("127.0.0.1","你的用户名","密码");if (!$con){die('Could not connect: ' . mysql_error());}mysql_select_db("数据库名", $con);mysql_query("INSERT INTO `hunter_raspberry`.`raspberry_basic_log`(`CPU_Use`, `RAM_Use`, `CPU_Temperature`) VALUES (".$_GET["cpuuse"].",".$_GET["ramuse"].", ".
树莓派 python调用已编译的 ffmpeg推流到B站等直播间
实现 24小时 自动轮播、指定目录下面剧集
带有简易日志
#!/usr/bin/env python# Time-stamp: <2013-06-17 17:31:22 Monday by pein># Email: <pein0119@gmail.com> pytimport osimport os.pathimport iodir = raw_input("please input a directory:\n")nameList = []def listDir(dirTemp):global nameListif not os.path.exists(dirTemp):print "file or directory isn't exist"returnif os.path.isfile(dirTemp):nameList.append(dirTemp)returnresultList = os.listdir(dirTemp)for fileOrDir in resultList:listDir(dirTemp + "/" +fileOrDir)return nameListdef main():while True:List = listDir(dir)List.sort()for file in List:print filefw = io.open("mylog",'a+',encoding='utf8')fw.write(unicode(file,'utf-8'))fw.write(unicode('\n','utf-8'))os.system('ffmpeg -re -i
树莓派的GPIO接口总3.3V不能超过50ma,5.5V不能超过550ma
而如果只接一个LED,必然会导致电流过量,可能会烧坏树莓派
所以应该串联一个电阻,建议1KΩ左右
import os# Return CPU temperature as a character stringdef getCPUtemperature():res = os.popen('vcgencmd measure_temp').readline()return(res.replace("temp=","").replace("'C\n",""))# Return RAM information (unit=kb) in a list# Index 0: total RAM# Index 1: used RAM# Index 2: free RAMdef getRAMinfo():p = os.popen('free')i = 0while 1:i = i + 1line = p.readline()if i==2:return(line.split()[1:4])# Return % of CPU used by user as a character stringdef getCPUuse():return(str(os.popen("top -n1 | awk '/Cpu\(s\):/ {print $2}'").readline().strip()))# Return information about disk spac
http://shumeipai.nxez.com/2016/09/28/rpi-gpio-module-inputs.html