Cov txheej txheem:

Raspberry Pi Nrog GSM Module: 5 Kauj Ruam
Raspberry Pi Nrog GSM Module: 5 Kauj Ruam

Video: Raspberry Pi Nrog GSM Module: 5 Kauj Ruam

Video: Raspberry Pi Nrog GSM Module: 5 Kauj Ruam
Video: Varying brightness of LED using PWM on Rpi 2024, Kaum ib hlis
Anonim
Raspberry Pi Nrog GSM Module
Raspberry Pi Nrog GSM Module

Qee lub sij hawm dhau los kuv tau sau ob peb nqe lus hais txog kev siv RPI los tshuaj xyuas koj lub tsev:

www.instructables.com/id/Home-Security-Wit…

Kuv cog lus tias yuav sau txog kev siv GSM "sai sai", uas qhov no tau siv 5 lub hlis.

Qhov laj thawj kuv xav tias nws yuav muaj txiaj ntsig hauv cov ntsiab lus ntawd (kev nyab xeeb hauv tsev) pom tseeb - muaj

tseem muaj cov khoom tsis muaj internet siv cable, piv txwv li uas yog rooj plaub nrog ntau lub tsev so hnub so hauv Norway uas kuv tam sim no nyob. 30% ntawm lawv tsis muaj kev nkag mus rau kab sib chaws - Kuv tau xav txog nws ib yam uas yuav siv sijhawm ntau dua (Arduino siv lub zog ntau dhau ib yam los tawm tswv yim daws teeb meem).

Hnub no tsuas yog kev qhia luv luv txog kev siv GSM module txuas RPI rau internet ntawm PPP, tawm ntawm "kev nyab xeeb hauv tsev" ib feem uas yuav xav tau me ntsis ntxiv - RPI tsuas muaj ib ntu (?), Yog li tej zaum koj yuav tsum siv USB -rau -serial hloov pauv xa RFID nyeem ntawv, yog tias koj xav tau.

Kauj ruam 1: Kev thaiv kab

Thaiv
Thaiv

Kuv yuav sim A-GSM module los ntawm itbrainpower.net. Qhov ntawd yog vim kuv tsis tau muaj sijhawm los txuas tus pin rau SIM800L. Kuv cog lus tias kuv yuav. A-GSM tsuas yog qhov ua rau ntau dhau rau txoj haujlwm yooj yim no, Kuv tau txais qhov khoom plig no los ntawm kuv cov npoj yaig thaum kuv tawm hauv Orange Poland, Kuv xav tias yuav tsum tau ua nws.

Ok - tsuas yog ua raws daim duab. Kuv tau txhawj xeeb tias tus tsim khoom Romanian tsis hais qhia txog TTL qib hloov pauv tab sis kuv ntsuas qhov ntsuas hluav taws xob thiab nws xa 3V. Thaum koj npaj txhij nrog cov xov hluav taws xob - nias modem hloov lub zog rau ob lossis ob.

Kauj Ruam 2: Txheeb Xyuas Pawg Thawj Coj-rau-GSM Kev Sib Txuas

Txheeb xyuas Board-to-GSM Kev Sib Txuas
Txheeb xyuas Board-to-GSM Kev Sib Txuas

Kuv vam tias koj daim npav SIM tsis tiv thaiv tus lej PIN. Nyob rau hauv rooj plaub nws yog koj tuaj yeem tshawb xyuas qhov txuas thiab koj tus lej PIN ib zaug (nws yuav tsis yog 1234;-)):

sudo apt-tau nruab minicom

sudo minicom -D /dev /ttyAMA0 -b 115200

AT

PAB+CPIN = 1234

Kuv xav tias modem ua haujlwm ntawm 115200 baud. Yog tias nws tsis yog thiab koj xav hloov nws-koj tuaj yeem rub tus Python tsab ntawv los ntawm Itbrainpower.net lub vev xaib (RPi_examples-v0.9-2014.09.30.tar) los teeb tsa qhov nrawm, piv txwv li:

sudo python setSerial.py 9600 115200

Ua ntej koj khiav nws tawm tswv yim tawm tag nrho agsm.open () kab, Kuv twv tias qhov no ua haujlwm tau zoo yav dhau los lossis qee qhov lwm yam Linux versions.

Raws li koj tuaj yeem pom ntawm daim duab - Kuv yuav tsum tua lub zog/ntawm GSM tus qauv kom nws lees txais tus lej PIN.

Kauj ruam 3: PPP Config

PPP kev teeb tsa
PPP kev teeb tsa

Cov ntsiab lus ntawm cov kauj ruam los ntawm a-gsm-RPI-piv txwv-py-library-based-v1_2.tar rub tawm los ntawm cov chaw tsim khoom. Hloov kho thiab luam tawm-muab cov ntsiab lus hauv qab no (italic) rau qhov chaw hauv qhov loj.

/etc/chatscripts/gprs

ABORT BUSYABORT VOICE

ABORT "NO CARRIER"

ABORT "Tsis muaj DIALTONE"

ABORT "Tsis muaj TONE TONE"

ABORT "Tsis muaj lus teb"

ABORT "QHIA"

RAWS LI "ERROR"

ABORT "+CGATT: 0"

"" UA

ZOO SIAB 12

OK AW

OK ATE1

OK AT+CGDCONT = 1, "IP", "telia"

OK ATD*99#

ZOO SIAB 22

Txuas ""

Koj tuaj yeem xa koj tus lej PIN ntawm no ib yam (AT+CPIN…). 'telia' yog lub npe APN, koj yuav tsum hloov nws mus rau koj tus neeg siv teeb tsa!

/thiab/ppp/peers/a-gsm

txuas "/usr/sbin/tham -v -f/etc/chatscripts/gprs -T telia"/dev/ttyAMA0

115200

noipdefault

usepeerdns

defaultroute

nyob twj ywm

noj

nocrtscts

hauv zos

Ntawm no koj yuav tsum hloov APN ib yam. Nco ntsoov qhov nrawm yog qhov koj tau tshuaj xyuas ua ntej! Qhov ntawd yog lub hauv paus ntawm qhov nyuaj nrhiav PPP ua tsis tau. BTW - cov kws sau ntawv thov cov npe yog 'pears' (tsis raug).

Kauj Ruam 4: Khiav PPP

Txhawm rau txuas rau internet koj tsuas yog ua:

sudo pon ib-gsm

Qhov teeb meem yuav yog tias koj muaj koj li RPI txuas nrog Internet lawm, yog li kom ntseeg tau tias nws ua haujlwm tsuas yog ua qhov no ua ntej (ntse ntawm Romanians los qhia nws!):

sudo txoj kev del default

Tam sim no koj yuav tsum tau nkag mus rau Is Taws Nem ntawm GSM network. Sim ping qhov chaw nyob!

Txhawm rau kaw PPP:

sudo poff ib-gsm

Yog tias tsis ua tiav koj yuav xav pib PPP hauv kev debug hom:

sudo pon a-gsm debug dump logfd 2 nodetach

Hauv kuv qhov teeb meem yog:

a) tsis teeb tsa APN

b) tsis raug ceev ceev!

c) ib yam dab tsi dai rau /dev /AMA0 - saib "Tsev Ruaj Ntseg" qhia kom paub yuav ua li cas thiaj pub dawb chaw nres nkoj!

Kauj ruam 5: Ua

1) xa cov duab ntawm cov neeg nkag los ntawm MMS, tej zaum yuav ruaj khov dua PPP (kom raug sim)

2) txheeb xyuas txhua qhov no nrog SIM800L

3) PPP, MMS thiab SIM800L nrog Txiv kab ntxwv PI

Nyob twj ywm!

Pom zoo: