Cov txheej txheem:

Txuas thiab rov txhim kho koj cov kev daws teeb meem txuas nrog Hologram Nova thiab Ubidots: 9 Kauj Ruam
Txuas thiab rov txhim kho koj cov kev daws teeb meem txuas nrog Hologram Nova thiab Ubidots: 9 Kauj Ruam

Video: Txuas thiab rov txhim kho koj cov kev daws teeb meem txuas nrog Hologram Nova thiab Ubidots: 9 Kauj Ruam

Video: Txuas thiab rov txhim kho koj cov kev daws teeb meem txuas nrog Hologram Nova thiab Ubidots: 9 Kauj Ruam
Video: 5-дневное путешествие на поезде через 3 000 км на север и юг Японии по очень низкой цене. (Кюсю) 2024, Kaum ib hlis
Anonim
Txuas thiab rov txhim kho koj cov kev daws teeb meem txuas nrog Hologram Nova thiab Ubidots
Txuas thiab rov txhim kho koj cov kev daws teeb meem txuas nrog Hologram Nova thiab Ubidots

Siv koj li Hologram Nova los kho kho vaj tse. Teeb Hologram Nova siv Raspberry Pi xa (ntsuas kub) cov ntaub ntawv rau Ubidots.

Hauv phau ntawv qhia hauv qab no, Ubidots yuav nthuav qhia yuav teeb tsa Hologram Nova siv Raspberry Pi li cas thiab tso saib qhov ntsuas kub hauv Ubidots Platform.

Kauj ruam 1: Yuav tsum tau ua

  • Raspberry Pi (Tau teeb tsa lawm)
  • Nova Ntiaj Teb USB 2G/3G Modem
  • Hologram Ntiaj Teb IoT SIM Card
  • Quad-band hloov pauv tau UFL antennas
  • Cov ntaub thaiv pob tshab - (xaiv tau)
  • OneWire Kub Sensor - DS18B20
  • Ubidots tus account - lossis - STEM License

Kauj ruam 2: Teeb Kho Vajtse

Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb

Hologram Nova1) Qhib Hologram IoT SIM daim npav. Txhawm rau qhib koj daim npav, mus ntsib hologram.io/start. Thaum tau qhib, ntxig SIM tom qab Nova.

CEEB TOOM: Tsis txhob ntxig lossis tshem tawm SIM thaum Nova tau ntsaws rau hauv - txwv tsis pub, koj tuaj yeem ua rau puas lossis puas rau SIM.

2. Raws li koj ib puag ncig muab lub kav hlau txais xov, yog xav tau. Lub kav hlau txais xov dub loj dua muab kev txais tos zoo dua, thaum lub kav hlau txais xov daj me dua muaj txiaj ntsig kom haum ntawm qhov haum sab hauv.

3. Yog tias xav tau, ntxig Nova rau hauv lub thawv ntim pob tshab. Nco ntsoov ntxig rau SIM thiab txuas tus kav hlau txais xov ua ntej kaw Nova. Nco ntsoov tias cov kauj ruam no tsuas yog xaiv tau thiab yuav tsis cuam tshuam rau kev ua haujlwm ntawm Nova.

4. Txuas Nova mus rau Raspberry Pi siv USB chaw nres nkoj.

Raspberry Pi Phau ntawv qhia no xav tias koj tus Raspberry Pi muaj Raspbian twb tau teeb tsa ntawm daim npav SD nrog kev nkag los ntawm SSH lossis nkag mus siv koj lub khoos phis tawj lub davhlau ya nyob twg. Yog tias cov teeb tsa no tseem tsis tau ua tiav ntawm koj lub khoos phis tawj, ua sai sai siv cov lus qhia pib sai no los ntawm Raspberry Pi Foundation.

Ua raws cov lus saum toj no txhawm rau txuas OneWire Kub Sensor mus rau Raspberry Pi.

NCO TSEG: OneWire qhov ntsuas kub tau muag nrog ntau qhov sib txawv uas muaj cov tiv thaiv. Thov saib "Kev teeb tsa kab" kauj ruam ntawm phau ntawv qhia no kom ntseeg tau tias muaj kev sib txuas zoo ntawm koj lub cim ntsuas.

2. Txuas Rasperry Pi rau nws lub zog siv thiab tos kom txog thaum nws ua tiav lub khau raj kom raug.

3. Thaum Raspberry Pi pib zoo koj yuav pib pom qee cov LEDs ntawm Nova muab cov lus tawm tswv yim hais txog dab tsi tshwm sim hauv tus qauv:

Blue LED = modem qhib lossis tua

Liab LED = qhov xwm txheej network tam sim no Siv rau cov lus hauv qab no kom paub meej ntxiv LED.

Kauj Ruam 3: Teeb Txoj Kev Hologram

Teeb Hologram Txoj Kev Teeb
Teeb Hologram Txoj Kev Teeb

Txhua lub sijhawm SIMCOM module xa cov lus hla lub xov tooj ntawm tes, nws thawj lub hom phiaj yog Hologram Cloud, tab sis cov lus taug kev tsis tas yuav xaus rau qhov ntawd! Siv Cloud Services Router (CSR) koj tuaj yeem xa koj cov ntaub ntawv mus rau Ubidots ntawm HTTP (S) rau kev pom cov ntaub ntawv thiab kev tshuaj xyuas ntxiv rau koj li IoT daws.

Txoj hauv kev Hologram platform muab txoj hauv kev yooj yim los ua cov haujlwm (Cov ntaub ntawv khaws cia, Email, SMS, Webhooks, thiab lwm yam) los ntawm qhov muaj lossis tseem tsis tuaj ntawm lub cuab yeej xov xwm lub ncauj lus. Hauv qhov no, peb tab tom ua kom muaj Webhook nqis tes los xa cov lus xa mus rau Ubidots rau kev suav thiab tso saib.

1. Mus rau Tshooj Lus ntawm Hologram Dashboard thiab nyem rau "+ Txoj Kev Tshiab" khawm.

2. Tom ntej no, muab txoj hauv kev los ua cov ncauj lus thiab nqis tes ua. Muab "Ubidots Platform" ua lub npe menyuam yaus rau txoj kev; qhov no yuav yog tus cim rau txoj hauv kev hauv koj daim ntawv teev npe.

3. Tom ntej no, xaiv cov ncauj lus uas txoj kev yuav ua raws. Hauv qhov no xaiv lub ncauj lus uas tau muab rau koj lub cuab yeej "SIMCOM (SIM-ID)" lossis "_DEVICE_ {Device-ID} _".

4. Tom qab ntawd, xaiv qhov Action App hu ua "Advanced Webhook Builder (Your Own App)" los ua ke Hologram's Cloud nrog Ubidots.

Tsim koj li Webhook

Tam sim no, koj yuav tsum teeb tsa kev teeb tsa uas yuav tsum tau ua los daws qhov kev thov. Thov muab cov kev txwv hauv qab no rau cov haujlwm tshwj xeeb:

  • URL (Destination URL):

    things.ubidots.com/api/v1.6/devices/ <>

  • PAYLOAD (Them nyiaj rau POST): <>
  • HEADERS: X-Auth-Token-Koj Ubidots TOKEN

Cov ntsiab lus -Hom - thov/json

NCO TSEG: Yog tias koj tsis paub yuav nrhiav koj li Ubidots TOKEN li cas, saib cov lus qhia hauv qab no.

Thaum koj tau nkag mus rau qhov ntsuas, siv daim duab saum toj no los txheeb xyuas.

5.- Kom tiav, nias Ntxiv txoj hauv kev.

Kauj Ruam 4: Txhim Kho Kev Ntseeg Siab

1. Nkag mus rau Raspberry Pi lub davhlau ya nyob twg los ntawm SSH lossis ncaj qha los ntawm Raspberry. xav tias dawb los xaiv tus uas koj paub tshaj plaws nrog.

2. Hloov kho koj lub tsev qiv ntawv Raspberry Pi:

sudo apt-tau hloov tshiab

3. Tom qab ntawd, teeb tsa lub tsev qiv ntawv xav tau:

sudo apt-tau nruab git git-core tsim-qhov tseem ceeb sej-dev python-openssl nab hab sej-smbus python3-pip python-pip screen

4. Nruab Hologram's Python SDK rau kev cuam tshuam nrog Nova:

curl -L hologram.io/python-install | tsoo

5. Txheeb xyuas Hologram's CLI (Command Line Interface) tau teeb tsa. Nws yuav xa cov ntawv ntau dua 0.6.0.

version ntawm hologram

Yog tias version qis dua 0.6.0, hloov kho rau qhov hloov tshiab kawg siv cov lus txib hauv qab no:

curl -L hologram.io/python-update | tsoo

Kauj Ruam 5: Teeb tsa GPIO Pins

Teeb tsa GPIO Pins
Teeb tsa GPIO Pins

1. Raspberry Pi los nruab nrog ntau yam ntawm cov tsav tsheb rau cuam tshuam. Hauv qhov kev qhia no, kom muaj peev xwm thauj tus 1-Wire sensor tus tsav tsheb ntawm GPIO pins, peb yuav tsum siv ob tus tsav tsheb hauv qab no. Cov tsav tsheb no yog li ntawd khaws cia raws li cov loadable modules thiab cov lus txib modprobe tau ua haujlwm los khau raj lawv rau hauv Linux ntsiav thaum xav tau.

Khiav cov lus txib hauv qab no:

sudo modprobe w1-gpio

sudo modprobe w1-kub

2. Tam sim no, peb yuav tsum hloov cov npe rau peb 1-Wire ntaus ntawv nplaub tshev thiab sau cov cuab yeej txhawm rau txhawm rau xyuas kom ntseeg tau tias peb lub sensor tau thauj khoom raug. Luam, muab tshuaj, thiab ua raws cov lus txib hauv qab no hauv pi lub davhlau ya nyob twg los ntawm nias "nkag" tom qab txhua tus los ua cov lus txib.

$ cd/sys/npav/w1/khoom siv/

$ ls os

Lub sijhawm no koj lub sensor twb tau sib sau ua ke thiab txuas nrog thiab yuav tsum tau teev tseg ua cov lej thiab cov ntawv. Hauv peb qhov xwm txheej, lub cuab yeej tau sau npe ua 28-0000056915de, tab sis koj cov ntaub ntawv yuav txawv ntawm cov tsiaj ntawv thiab tus lej, yog li hloov koj tus lej xov tooj nrog koj tus kheej thiab khiav cov lus txib.

$ cd 28-0000056915de

Tus ntsuas ib ntus sau rau w1_slave cov ntaub ntawv, txhawm rau nyeem koj lub ntsuas kub, thov khiav cov lus txib hauv qab no:

$ miv w1_slave T

nws cov lus txib yuav qhia koj ob kab ntawv ntawm cov ntawv t = qhia qhov ntsuas kub (hauv degrees Celsius). Thov nco ntsoov tias yuav tsum muab tus lej zauv tom qab thawj ob tus lej (qhov no tau muab qhia hauv qhov chaws kawg- tsis txhob txhawj); piv txwv li, qhov ntsuas kub peb tau txais yog 25.875 degrees Celsius.

Tam sim no koj tuaj yeem pom qhov ntsuas kub, nws yog lub sijhawm los tshaj tawm lawv rau Ubidots!

Kauj Ruam 6: Xa Cov Ntaub Ntawv mus rau Ubidots

Xa Cov Ntaub Ntawv rau Ubidots
Xa Cov Ntaub Ntawv rau Ubidots
Xa Cov Ntaub Ntawv rau Ubidots
Xa Cov Ntaub Ntawv rau Ubidots

Cov cai hauv qab no xa lus nrog Hologram huab ntawm Hologram Python SDK, siv tus qauv los tsim kev sib txuas ntawm tes, thiab xa cov lus mus rau Hologram Cloud uas tau xa rov qab mus rau Ubidots. Thaum cov lus tau txais hauv Hologram huab cov lus yuav raug xa mus rau Ubidots yog tias txoj kev raug teeb tsa kom raug los ntawm Kauj Ruam 2 hauv phau ntawv qhia no.

1. Tsim thiab khiav cov ntawv Python hauv koj Pi lub davhlau ya nyob twg:

nano nova_temperature.py

Tom qab ntawd, muab cov lej no tso rau hauv Pi lub davhlau ya nyob twg thiab hloov tus lej lej 28-00000830fa90 ntawm kab temp_sensor = '/sys/bus/w1/devices/28-0000056915de/w1_slave' nrog koj tus lej xov tooj.

Thaum hloov tus lej lej, khaws cov cai.

2. Ua cov ntawv sau saum toj no nrog cov lus txib hauv qab no: nab hab sej ubidots_nova_temp.py

Yog tias koj tau txais cov cai tshwj xeeb cov lus yuam kev, khiav cov lus txib hauv qab no siv sudo:

sudo python ubidots_nova_temp.py

3. Ntawm no koj yuav pib txais cov lus hais hauv qab no hauv Pi lub davhlau ya nyob twg txhua 10 vib nas this. Txhawm rau txheeb xyuas cov lus tau txais, saib Hologram's Dashboard, tshwj xeeb "Tshooj" ntu. Raws li koj tuaj yeem pom ntawm daim duab saum toj no cov lus uas tau tshwm sim tau hla mus rau txoj kev yav dhau los tsim hu ua "Ubidots Platform"

4. Mus rau koj tus lej Ubidots, thiab nkag mus rau ntu "Ntaus" kom pom lub cuab yeej tshiab tsim nrog Tus Ntaus ID los ntawm koj lub Hologram Device. Sab hauv lub cuab yeej koj yuav pom qhov ntsuas kub tau xa los ntawm lub ntsuas txuas nrog ntawm Hologram webhook tsim.

Kauj Ruam 7: Hloov Npe Cov Ntaus thiab Cov Hloov

Hloov lub Device thiab Variables
Hloov lub Device thiab Variables
Hloov lub Device thiab Variables
Hloov lub Device thiab Variables

Cov npe ntawm cov kev hloov pauv tau tsim yog zoo ib yam li cov ntawv API, uas yog IDs siv los ntawm API. Qhov no tsis txhais tau tias lawv cov npe tsis tuaj yeem hloov pauv, yog li nws tau pom zoo kom hloov cov npe ntawm koj li khoom siv thiab cov hloov pauv kom lawv ua phooj ywg rau koj li IoT kev daws teeb meem lub npe. Nyem rau qhov no kom paub yuav hloov koj lub cuab yeej thiab cov npe hloov pauv li cas.

Koj tseem tuaj yeem ntxiv thiab kho cov chav ntawm txhua qhov sib txawv los ntawm koj cov npe xaiv. Raws li koj tuaj yeem pom saum toj no, peb tau muab cov chav sib txawv rau txhua qhov sib txawv thiab tseem tau muab cov npe zoo dua kom haum rau peb cov phiaj xwm npe. Qhov no tau pom zoo rau cov neeg siv nrhiav kev xa tawm ntawm 10+ cov cuab yeej.

Kev teeb tsa txheej xwm Ib qho xwm txheej (lossis ceeb toom) yog ib qho kev ua uas tshwm sim thaum cov ntaub ntawv ua tiav lossis tshaj li txoj cai tsim. Piv txwv li, email lossis SMS tuaj yeem xa tau txhua lub sijhawm uas lub ntsuas hluav taws xob nres xa cov ntaub ntawv lossis qhov ntsuas kub siab tshaj qhov siab tshaj lossis qhov tsawg kawg nkaus.

Kawm tsim cov xwm txheej: SMS, Email, thiab Telegram

Kauj Ruam 8: Qhov tshwm sim

Hauv ob peb feeb koj tau tsim qhov yooj yim DIY cellular ntsuas qhov ntsuas kub siv Hologram Nova nrog Raspberry Pi. Tam sim no nws yog lub sijhawm los tsim Ubidots Dashboards kom pib taug qab qhov ntsuas kub los ntawm koj lub cuab yeej thiab xa koj cov xov tooj ntawm tes txuas nrog tshuaj xyuas yooj yim!

Zoo siab hacking:)

Pom zoo: