Cov txheej txheem:
- Kauj ruam 1: Kho vajtse
- Kauj ruam 2: Uber API
- Kauj Ruam 3: Tso rau Heroku
- Kauj Ruam 4: [Tsis teb los tau] Kev ceeb toom SMS dawb Nrog Tus Kws Ua Haujlwm Txawb Tebchaws Fab Kis (npe dawb)
- Kauj Ruam 5: Kho Sigfox Backend Callback
- Kauj Ruam 6: Khiav Mus Xeem
- Kauj Ruam 7: Hais kom Caij Tsheb Uber Tiag
Video: Khawm Uber: 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Tau txais Uber caij tsuas yog nias lub pob!
Taw qhia
Hauv qhov kev qhia no, peb yuav siv Sigfox network kev pabcuam hauv ib cheeb tsam (uas tuaj yeem, tam sim no, muab ntau tshaj 1km txoj haujlwm vojvoog qhov tseeb) txhawm rau kom tau txais txoj haujlwm ze tshaj plaws rau qhov chaw nyob tshwj xeeb thiab thov Uber caij raws li. Yog li ntawd, peb tsis xav tau lub cuab yeej nrog GPS.
Peb yuav siv Sens'it tab sis txhua lub cuab yeej muaj peev xwm xa xov dhau Sigfox tuaj yeem siv los ua kom qhov kev qhia no ua tiav.
Ua tibzoo saib ntawm no yog tias koj xav tau cov ncauj lus kom ntxaws ntsig txog Sigfox tus tsim khoom.
Kauj ruam 1: Kho vajtse
Sens'it (lossis lwm yam cuab yeej muaj peev xwm xa Sigfox lus)
Kauj ruam 2: Uber API
Peb yuav ua qhov txheej txheem xaj ntawm kev thov caij tsheb los ntawm kev hu rau Uber API qhov kawg.
Txhawm rau nkag siab tias qhov no ua tau li cas, thov nco ntsoov txheeb xyuas qhov node module Kuv tsim los rau kev siv yooj yim thiab meej meej lub hom phiaj. Koj yuav xav tau tus lej nkag mus rau Uber API kom nws ua haujlwm. Cov txheej txheem yuav ua li cas kom tau txais cov cim no tuaj yeem pom ntawm nplooj ntawv GitHub no.
Yam yuavtsum tau kawm uantej
- Uber tus lej siv tau
- Koj tus lej Uber API nkag mus (kos rau sab saud seb yuav ua li cas thiaj tau nws)
- Ib qho cuab yeej ua haujlwm ntawm Sigfox Backend (ua raws qhov txuas no rau Sens'it ua kom ua haujlwm). Koj yuav xav tau tus lej ID thiab PAC.
Kev teeb tsa
Hauv app.js, ob qhov chaw nyob yuav raug tsim raws li hauv qab no (nrog cov txiaj ntsig tau piav qhia hauv qhov hloov pauv ib puag ncig):
qhov chaw nyob_1 = {
'npe': process.env. ADDRESS_1_NAME, 'lat': process.env. ADDRESS_1_LAT, 'lng': process.env. ADDRESS_1_LNG}; const address_2 = {'npe': process.env. ADDRESS_2_NAME, 'lat': process.env. ADDRESS_2_LAT, 'lng': process.env. ADDRESS_2_LNG};
Cov chaw nyob no yuav raug siv los txheeb xyuas qhov chaw tuaj tos thiab tso chaw. Peb yuav teeb lawv tom qab.
Yog tias Sens'it ntaus ntawv xa nws qhov chaw geo-localized nyob ze rau qhov chaw nyob #1, tom qab ntawd chaw nyob #1 tau teeb tsa raws li tuaj tos thiab chaw nyob #2 tau teeb tsa raws li kev tso tawm rau kev thov caij tsheb. Thiab ntxiv rau qhov rov qab …
Yog tias Sigfox Backend qhov chaw pabcuam hauv thaj chaw xa rov qab qhov tseeb loj dua qhov nrug ntawm ob qhov chaw nyob, Uber qhov kev thov yuav tsis ua tiav (vim qhov chaw tuaj txog tsis tuaj yeem txiav txim siab tau).
Kauj Ruam 3: Tso rau Heroku
Kuv tau sau ib daim ntawv thov siv NodeJS kom siv qhov txheej txheem xaj khoom. Nyem rau lub pob hauv qab no kom siv tau nws ntawm Heroku.
NYEM QHOV NO NTAUB NTAWV
Lwm txoj hauv kev kom nws ua haujlwm ntawm Heroku yog txhawm rau txhim kho Heroku Cli thiab ua raws cov theem no:
$ git clone
$ cd sigfox_uber $ heroku apps: tsim $ git thawb heroku master
Tam sim no, lub taub hau mus rau qhov chaw teeb tsa ntawm koj li Heroku app (https://dashboard.heroku.com/apps//settings) txhawm rau teeb tsa ib puag ncig hloov pauv. Teem cov kev hloov hauv qab no (nco ntsoov teeb tsa cov chaw nyob uas koj xav tau):
- ACCESS_TOKEN | YOUR_ACCESS_TOKEN
- ADDRESS_1_LAT | 49.009698
- ADDRESS_1_LNG | 2.547882
- ADDRESS_1_NAME | tshav dav hlau
- ADDRESS_2_LAT | 48.876579
- ADDRESS_2_LNG | 2.330618
- ADDRESS_2_NAME | chaw ua haujlwm
Qhov kawg "…/thov/: ntaus ntawv/: lat/: lng/: radius" yuav raug hu txhua zaus cov lus xa mus rau Sigfox Backend (saib hauv qab no yuav teeb tsa nws li cas). Los ntawm kev siv Sigfox geolocalization cov kev pabcuam, tus neeg rau zaub mov yuav tau txais Sens'it kwv yees txoj haujlwm. Qhov no yuav txiav txim siab UberX nrog kev txiav txim siab tuaj tos thiab tso chaw nyob.
Txhawm rau txheeb xyuas yog tias lub app ua haujlwm, mus rau nws qhov URL. Koj yuav tsum pom "App tau khiav …" ntawm koj tus browser. Koj tseem tuaj yeem tshawb xyuas cov cav kom paub meej ntxiv.
Kauj Ruam 4: [Tsis teb los tau] Kev ceeb toom SMS dawb Nrog Tus Kws Ua Haujlwm Txawb Tebchaws Fab Kis (npe dawb)
Yog tias koj muaj Fab Kis Free mobile operator subscription, koj tuaj yeem siv lawv li SMS pub dawb API txhawm rau kom tau txais kev ceeb toom ntawm koj lub xov tooj. Txhawm rau ua txoj haujlwm no, tsuas yog qhib qhov kev pabcuam hauv koj cheeb tsam cov neeg siv khoom thiab xa cov kev hloov pauv ib puag ncig hauv qab no hauv cov chaw teeb tsa ntawm koj Heroku app:
- FREE_USER | YOUR_FREE_USER
- FREE_PASS | YOUR_FREE_PASS
Tam sim no koj tuaj yeem tau txais SMS ceeb toom txog koj li kev thov UberX.
Kauj Ruam 5: Kho Sigfox Backend Callback
- Nkag mus rau ntawm no
- Mus rau https://backend.sigfox.com/devicetype/list, nyem sab laug ntawm koj lub cuab yeej kab thiab xaiv "Kho kom raug"
- Tam sim no mus rau "CALLBACKS" ntu ntawm sab laug, xaiv "tshiab" nyob rau sab saum toj sab xis, xaiv "Custom Callback"
- Hom: KEV PAB | GEOLOC
- Channel URL
- Tus qauv URL: https://.herokuapp.com/request/ {device}/{lat}/{lng}/{radius}
- Siv Txoj Cai HTTP: Tau Txais
- Xaiv "OK" kom paub tseeb
Kauj Ruam 6: Khiav Mus Xeem
Los ntawm lub neej ntawd, qhov sib txawv sandbox tau teeb tsa kom raug. Qhov no yuav cuav Uber caij thov kom koj tus as -qhauj hauv txhab nyiaj tsis raug cuam tshuam los ntawm kev ua tsis ncaj ncees.
Nias lub Sens'it khawm ob zaug kom xa xov hla Sigfox. Nco ntsoov tias cov lus tau txais zoo ntawm Sigfox Backend. Nkag mus, mus rau ntu DEVICE thiab nyem sab laug ntawm koj lub cuab yeej ID. Koj tuaj yeem dhau mus rau MESSAGES ntu kom pom cov nyiaj them poob haujlwm.
Kauj Ruam 7: Hais kom Caij Tsheb Uber Tiag
Tam sim no teeb tsa sandbox ib puag ncig sib txawv rau qhov tsis raug yog tias koj xav thov tus tsav tsheb Uber tiag.
SANDBOX | cuav
Lub pob Sens'it yuav hu rau txoj hauv kev …/thov/: ntaus ntawv:: lat/: lng/: lub vojvoog thiab ua rau thov thov caij Uber!
Koj tseem tuaj yeem pom qhov xwm txheej thov tam sim no ntawm…/thov/tam sim no.
Txhawm rau thim qhov kev txiav txim, txoj hauv kev no tuaj yeem siv tau:…/thov/tso tseg.
Cia peb tsav
Muaj kev lom zem xaj koj Ubers!
Antoine tsib Chassey
Pom zoo:
$ 5 Tsev Automation Khawm: 4 Kauj Ruam
$ 5 Tsev Automation Khawm: A $ 5 Tsev Automation Khawm Qee lub sij hawm qhov kev daws teeb meem yooj yim tshaj plaws yog khawm nkaus xwb. Peb xav tau txoj hauv kev yooj yim los ua kom "pw tsaug zog" niaj hnub ua haujlwm ntawm peb lub tsev siv tshuab hauv tsev (Hubitat Elevation), uas tua hluav taws feem ntau, teeb lwm tus rau qib tshwj xeeb, thiab
Ib Khawm Servo Suspension Lockout: 3 Cov Kauj Ruam
Ib Khawm Servo Suspension Lockout: Cov tsheb kauj vab roob tag nrho muab kev caij tsheb kom du, tab sis feem ntau yuav tsum tau xauv tawm qhov kev ncua thaum taug kev nce toj. Txwv tsis pub, qhov kev tshem tawm nrawm thaum koj sawv ntawm lub pedals, nkim lub zog ntawd. Cov tuam txhab tsim tsheb kauj vab paub qhov no, thiab muab
Lub Hwj Huam-Tawm Khawm rau Raspberry Pi: 3 Kauj Ruam
Lub Hwj Huam-Tawm khawm rau Raspberry Pi: Raspberry Pi yog lub tswv yim siv tau zoo uas tso cai tsim ntau yam IoT/neeg hlau/ntse-tsev/… phiaj xwm kev thov. Ib yam uas nws tsis muaj txawm tias, piv rau lub khoos phis tawj ib txwm, yog kaw lub zog-tua khawm. Yog li peb tuaj yeem tsim
Rooj Bluetooth Hais Lus Nrog Pom Pom Lub Suab, Khawm Khawm thiab NFC.: 24 Kauj Ruam (nrog Duab)
Rooj Bluetooth Hais Lus Nrog Pom Pom Suab, Khawm Khawm thiab NFC.: Nyob zoo! Hauv Cov Lus Qhia no Kuv yuav qhia yuav ua li cas kuv thiaj ua Lub Rooj Sib Tham Bluetooth hais lus no uas muaj Lub Suab Pom Zoo Zoo nrog kov cov nyees khawm thiab NFC. Ua tau yooj yim ua ke nrog NFC Enabled cov cuab yeej nrog tsuas yog kov. Tsis muaj lub cev khawm
Micro: ntsis Cov Hauv Paus Kawm: Khawm Khawm: 11 Kauj Ruam
Micro: ntsis Cov Hauv Paus Kawm: Kov Khawm: Ntawm BBC Micro: ntsis, muaj 3 kov footers: pin0, pin1, pin2. Yog tias koj tuav tus GND tus pin nrog ib txhais tes thiab kov tus lej 0, 1, lossis 2 nrog rau lwm qhov, qhov hluav taws xob me me (nyab xeeb) yuav ntws los ntawm koj lub cev thiab rov qab mus rau hauv micro: me ntsis. Qhov no yog