2018年4月17日 星期二

[RF] 從LoRa到TTN

這幾篇有非常清楚的介紹

https://www.hackster.io/ChrisSamuelson/lora-raspberry-pi-single-channel-gateway-cheap-d57d36

https://qiita.com/RfidHaraga/items/f8dcdec1d78997216f00

使用Dragin HAT
http://www.instructables.com/id/Use-Lora-Shield-and-RPi-to-Build-a-LoRaWAN-Gateway/
https://www.thethingsnetwork.org/forum/t/how-to-node-with-raspberry-pi-dragino-hat/4594/2

救全家
https://www.thingforward.io/techblog/2017-09-27-getting-started-with-lorawan-thethingsnetwork-and-platformio.html

MQTT
http://talk2lora.blogspot.tw/2016/11/using-mqtt-with-things-network.html
https://www.thethingsnetwork.org/forum/t/a-python-program-to-listen-to-your-devices-with-mqtt/9036/8


2018年4月16日 星期一

[RF] 天線好文

https://physics.stackexchange.com/questions/326727/how-can-an-antenna-pick-up-thousands-of-frequencies-at-the-same-time

http://120.101.8.4/lyhsu/database/grade/%E9%82%B1%E5%BB%BA%E6%96%87/%E6%89%8B%E6%8C%81%E8%A3%9D%E7%BD%AE%E5%A4%A9%E7%B7%9A%E8%A8%AD%E8%A8%88Ch2-RF%E6%A6%82%E5%BF%B5%E8%88%87%E5%A4%A9%E7%B7%9A.pdf


[RF] 用LoRa傳檔案

果然也有人做

http://cpham.perso.univ-pau.fr/WSN-MODEL/tool-html/imagesensor.html
http://cpham.perso.univ-pau.fr/LORA/RPIgateway.html
http://cpham.perso.univ-pau.fr/WSN-MODEL/tool-html/tools.html


不用考慮 ACK 和其他的嗎?

import serial
import sys

if len(sys.argv) < 2:
    thePort = "/dev/ttyUSB0"
else:
    thePort = sys.argv[1]

ser = serial.Serial(thePort, 115200, timeout=0)

# flush everything that may have been received on the port to make sure that we start with a clean serial input
ser.flushInput()

while True:
    out = ''
    sys.stdout.write(ser.read(1024))
    sys.stdout.flush()
http://cpham.perso.univ-pau.fr/WSN-MODEL/tool-html/source/115200SerialToStdout.py

2018年4月15日 星期日

[RPi] Learning Computer Architecture with Raspberry Pi

BJ4

https://www.educacion-holistica.org/notepad/documentos/Informatica/Hardware/Raspberry%20Pi/Learning%20Computer%20Architecture%20with%20Raspberry%20Pi.pdf

[RPi] 安裝JQ

照README做就可以了

git clone https://github.com/stedolan/jq
git submodule update --init # if building from git to get oniguruma
autoreconf -fi              # if building from git
./configure --with-oniguruma=builtin
make 
sudo make install
使用,假設有個輸出是json_str,第一個索引是.results,就可以這樣用
json_str | ./jq '.results'

2018年4月6日 星期五

[AWS] 加大EBS空間

EC2空間不知道怎麼了突然滿了(8G而已),只好加大Volume並且調整硬碟空間

大概這樣操作

1. 先調整 volume 大小,找到 "Modify Volume",從 8G 到 16G

2. 安裝軟體
$ sudo apt install cloud-guest-utils

3. 調整 partition 大小
$ sudo growpart /dev/xvda 1

4. 應用到 file system 上
$ sudo resize2fs /dev/xvda1

大概是長這樣
$ lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  16G  0 disk
└─xvda1 202:1    0   8G  0 part /

$ sudo growpart /dev/xvda 1
CHANGED: partition=1 start=2048 old: size=16775135 end=16777183 new: size=33552351,end=33554399

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       16G  7.7G  7.8G  50% /
 
https://kenichishibata.net/resize-aws-ebs-4d6e2bf00feb