Ref : https://github.com/MLAB-project/stl-thumbnailer
2017年6月29日 星期四
2017年6月21日 星期三
2017年6月20日 星期二
video stream2 on rpi
Ref : https://github.com/Tomtomgo/raspberry_livestream
Ref : http://engineer2you.blogspot.tw/2016/10/rasbperry-pi-ffmpeg-install-and-stream.html
Ref : https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=133871&p=1011437
ffmpeg youtube rtmp
ffmpeg -thread_queue_size 512 -f v4l2 -i /dev/video0 -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 128k -strict experimental -aspect 16:9 -vcodec h264 -preset veryfast -crf 25 -pix_fmt yuv420p -g 60 -vb 820k -maxrate 820k -bufsize 820k -profile:v baseline -r 30 -f flv rtmp://a.rtmp.youtube.com/live2/"your api key"
Ref : http://engineer2you.blogspot.tw/2016/10/rasbperry-pi-ffmpeg-install-and-stream.html
Ref : https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=133871&p=1011437
ffmpeg youtube rtmp
ffmpeg -thread_queue_size 512 -f v4l2 -i /dev/video0 -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 128k -strict experimental -aspect 16:9 -vcodec h264 -preset veryfast -crf 25 -pix_fmt yuv420p -g 60 -vb 820k -maxrate 820k -bufsize 820k -profile:v baseline -r 30 -f flv rtmp://a.rtmp.youtube.com/live2/"your api key"
2017年6月18日 星期日
2017年6月16日 星期五
install mqtt on centos
Ref : https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-centos-7
把 home-oojah-mqtt.repo copy到 /etc/yum.repos.d/
然後執行
sudo yum install mosquitto
sudo yum install mosquitto-clients
sudo yum -y install epel-release
sudo yum install mosquitto
sudo yum install mosquitto-clients
mosquitto_pub -h 192.168.0.103 -t test -m "forward"
把 home-oojah-mqtt.repo copy到 /etc/yum.repos.d/
然後執行
sudo yum install mosquitto
sudo yum install mosquitto-clients
CentOS
Download the repository config file for your CentOS version from below and copy it to /etc/yum.repos.d/ You’ll now be able to install and keep mosquitto up to date using the normal package management tools.
The available packages are: mosquitto, mosquitto-clients, libmosquitto1, libmosquitto-devel, libmosquittopp1, libmosquittopp-devel, python-mosquitto.
sudo yum -y install epel-release
sudo yum install mosquitto
sudo yum install mosquitto-clients
mosquitto_pub -h 192.168.0.103 -t test -m "forward"
2017年6月12日 星期一
mqtt on rpi
Ref : https://learn.adafruit.com/diy-esp8266-home-security-with-lua-and-mqtt/configuring-mqtt-on-the-raspberry-pi
Ref : http://www.instructables.com/id/Installing-MQTT-BrokerMosquitto-on-Raspberry-Pi/
用 stretch 的 iso
This is what I did as per your instructions:
To use the new repository you should first import the repository package signing key:
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
Then make the repository available to apt:
cd /etc/apt/sources.list.d/
Then one of the following, depending on which version of debian you are using:
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
Then update apt information:
sudo apt-get update
sudo apt-get install python-pip
sudo pip install paho-mqtt
- sudo apt-get install mosquitto mosquitto-clients python-mosquitto
sudo systemctl restart mosquitto
--------------------------------------------------------------
import os
import string
import paho.mqtt.client as mqtt
import time
localBroker = "192.168.1.120" # Local MQTT broker
localPort = 1883 # Local MQTT port
localUser = "mosquitto" # Local MQTT user
localPass = "mosquitto" # Local MQTT password
localTopic = "test" # Local MQTT topic to monitor
localTimeOut = 120 # Local MQTT session timeout
if "__main__" == __name__:
# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
# Subscribing in on_connect() means that if we lose the connection and
# reconnect then subscriptions will be renewed.
client.subscribe(localTopic)
# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
#(sensorID, sensorVoltage) = string.split(msg.payload)
print(msg.payload)
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect(localBroker, localPort, localTimeOut)
client.loop_forever()
quit()
----------------------------------------------------------------------------------------------------------
mosquitto_pub -h 192.168.1.120 -t test -m "hello world"
2017年6月8日 星期四
2017年6月3日 星期六
git 指令大全
基礎設定
- 查詢版本
- git version
- 查詢設定列表
- git config --list
- 輸入姓名
- git config --global user.name "你的名字"
- 輸入email
- git config --global user.email "你的email"
新增本地/遠端數據庫
- 在本地資料夾新增數據庫
- git init
- 複製遠端數據庫
- git clone 遠端數據庫網址
增加/刪除檔案
- 增加檔案進入索引
- git add 檔案名稱
- 增加全部檔案進入索引
- git add .
- 查詢狀態
- git status
- 顯示歷史紀錄
- git log
- 將索引提交到數據庫
- git commit -m '更新訊息'
還原指令
- 還原工作目錄與索引,會跟最後一次 commit 保持一樣
- git reset --hard
- 全部檔案取消索引
- git reset HEAD
- 單一檔案取消索引
- git reset HEAD 檔案名稱
- 恢復單一檔案到最新 commit 狀態
- git checkout 檔案名稱
- 刪除最近一次 commit
- git reset --hard "HEAD^"
- 上面語法如果刪除錯了可以再用此語法還原
- git reset --hard ORIG_HEAD
- 刪除最近一次 commit,但保留異動內容
- git reset --soft "HEAD^"
- commit 後發現有幾個檔案忘了加入進去,想要補內容進去時
- git commit --amend
分支
- 顯示所有本地分支
- git branch
- 新增分支
- git bracnch 分支名稱
- 切換分支
- git checkout 分支名稱
- 合併指定分支到目前的分支
- git merge 分支名稱
- 刪除分支
- git branch -d 分支名稱
遠端數據庫操作
- 複製遠端數據庫
- git clone 遠端數據庫網址
- 查詢遠端數據庫
- git remote
- 將本地分支推送到遠端分支
- git push 遠端數據庫名稱 遠端分支名稱
- 將遠端分支拉下來與本地分支進行合併
- git pull
標籤
- 查詢標籤
- git tag
- 查詢詳細標籤
- git tag n
- 刪除標籤
- git tag -d 標籤名稱
- 新增輕量標籤
- git tag 標籤名稱
- 新增標示標籤
- git tag -am "備註內容" 標籤名稱
暫存
- 暫時儲存當前目錄
- git stash
- 瀏覽 stash 列表
- git stash list
- 還原暫存
- git stash pop
- 清除最新暫存
- git stash drop
- 清除全部暫存
- git stash clear
訂閱:
文章 (Atom)