How to: Raspberry PI WIFI card static IP setting

Edit command:

sudo nano /etc/network/interfaces

Static IP setting:

iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 192.168.0.10
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1

DHCP setting:

iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Refresh wifi card setting:

sudo ifdown wlan0
sudo ifup wlan0

How To: Battery powered Passive POE for Ubiquiti device

Ubiquiti device POE specifications: 10.5V ~ 25V DC

Network port pin out:
Pairs 4, 5 (+)
7, 8 (-)

For 100M device:
Use pin 4, 5 as +, pin 7, 8 as -.

For 1000M (1G) Device
We need transformers pass through data and inject power.

Plan A:
Li-ion battery x2 , 8.4V – 6V. DC-DC step-up to 14V (double volt)

Plan B:
Li-ion battery x3 , 12.6V – 9V. DC-DC step-up to 21V (double volt)

Plan C:
Lead battery x1 ,12V. DC-DC step-up to 24V (double volt)

24v passive POE power Injector:
Plan A:
ER-X SFP Gigabit POE port x5
Plan B:
千兆POE供电器 POE分离器 Gigabit Passive PoE PSI348G

P.S.
to do:
Protection?
ESD – Transient Voltage Suppression Diodes (TVS)
Lightning Surge
PTC Polyfuse 1.25A

gas tubes, reverse diodes and MOVs?
====================================================
2018 Aug 28 update:

802.3at/af :
TL-SG1005P 5 port 1000M switch (53.5V DC 1.13A input)
Single Port max 30W, Switch Max 57W.
$289 CNY

Link:
power over ethernet tutorial

DIY 1000M POE

Waterproof Ethernet Surge Protector High PoE+/ESD Gigabit 1000Mbs – Thunder/Lighting Outdoor Protection

Bourns Power over Ethernet (PoE) Surge Protection

Littelfuse : Circuit protection of IP-networked security camera systems

Protecting PoE Syste ms from Lightning and Other Electrical Hazards

RJ45 WITH INTEGRATED MAGNETICS for POE

Gigabit Passive PoE injector power over ethernet

千兆-POE供電模塊

How To: Ubiquiti NanoBeam as WIFI access point

1. 設定你的 Notebook / PC 的 network card 為固定 IP address (我選了 192.168.1.10 )
2. 連接你的 Notebook / PC 的 network card 到 NanoBeam.
3. Web login https://192.168.1.20 , user name / password: ubnt
4. Web :Ubiquiti Logo – airMax – Disable.
5. Web :Wireless : Wireless Mode : Access Point, DFS -Disable , Change SSID , Wireless Security – WPA2-AES,WPA Authentication – PSK. (有些手機只可用 20M bandwidth, 否則看到 SSID 但連不上)

1. 設定你的 Notebook / PC 的 network card 為固定 IP address (我選了 192.168.1.10 )

Windows:

windows command prompt :(找出 network card name)
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection :

(network card name = Local Area Connection)

windows command prompt :(設定你的network card 為固定 IP address)
netsh interface ip set address name=”Local Area Connection” static 192.168.1.10 255.255.255.0 192.168.1.1

windows command prompt :(之後復元 setting)
netsh interface ip set address name=”Local Area Connection” dhcp

4. Web :Ubiquiti Logo – airMax – Disable.

AP_Setting01

How To : Raspberry PI install Asterisk 13

Raspberry Pi OS: Raspbian

Terminal / SSH

sudo apt-get install -y gcc make perl
sudo apt-get install -y libxml2 libxml2-dev
sudo apt-get install -y speex libspeexdsp-dev libspeex-dev ncurses-dev bison openssl libssl-dev sqlite3 libsqlite3-dev
sudo apt-get install -y libncurses5-dev subversion git-core libjansson-dev uuid-dev build-essential libsrtp0-dev

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar zxvf asterisk-13-current.tar.gz
cd asterisk-13.0.5 (Path 會改的)
./configure
make menuselect
make -j 4 (用4個 core, for Raspberry Pi 2 ) / make (Raspberry Pi )
sudo make install
sudo make samples
sudo make config

sample dialplan

sudo nano /etc/asterisk/extensions.conf 加在最後面 (nano goto file end short-cut key : Ctrl + w + v )

[mycontext]
exten => _2XXX,1,Answer()
exten => _2XXX,n,NoOP(exten=${EXTEN})
exten => _2XXX,n,Dial(SIP/${EXTEN})
exten => _2XXX,n,Hangup

;For Text chat
[messages]
exten => _.,1,NoOp(SMS receiving dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
exten => _.,n,Set(CDR(message)=${MESSAGE(from)})
exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($[“${MESSAGE_SEND_STATUS}” != «SUCCESS»]?sendfailedmsg)
exten => _.,n,Hangup()
;
; Handle failed messaging
exten => _.,n(sendfailedmsg),Set(MESSAGE(body)=”[${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.”)
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)}) exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,Hangup()
exten => _.,n,Hangup()

sudo nano /etc/asterisk/sip.conf

[general]
videosupport=yes ;For video call
tcpenable=yes ;For mobile phone, Mobile phone can’t get incoming call when use UDP.
accept_outofcall_message=yes ;For text chat
outofcall_message_context=messages ;For text chat
auth_message_requests=yes ;For text chat

;加在最後面
[2001]
type = friend
context=mycontext
callerid = User One <2001>
secret =
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 2001
disallow = all
allow = speex,g722,ilbc ; Auido codec
allow = vp8 ; Video codec
transport = udp

[2002]
type = friend
context=mycontext
callerid = User Two <2002>
secret =
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 2002
disallow = all
allow = speex,g722,ilbc ; Auido codec
allow = vp8 ; Video codec
transport = udp

Re-load config:
sudo asterisk -r
reload

P.S.
Raspberry Pi 最好是用有線接 Network
因為要用 Compiler,Raspberry Pi 2 比較好.

Link:
Raspbian install Asterisk 13
Raspberry PiとAsteriskでIP電話システムの構築(その1)
Asterisk Project Home – Getting Started
Asterisk 13 SIP SIMPLE messages to CDR
Asterisk權威指南