Cov txheej txheem:

Kev Nkag Mus Los ntawm GPS Ublox Neo 6M Nrog Raspberry Pi B+: 3 Cov Kauj Ruam
Kev Nkag Mus Los ntawm GPS Ublox Neo 6M Nrog Raspberry Pi B+: 3 Cov Kauj Ruam

Video: Kev Nkag Mus Los ntawm GPS Ublox Neo 6M Nrog Raspberry Pi B+: 3 Cov Kauj Ruam

Video: Kev Nkag Mus Los ntawm GPS Ublox Neo 6M Nrog Raspberry Pi B+: 3 Cov Kauj Ruam
Video: nyiag nkag koj tus hluas nkauj tus messenger ua koj twb g paub password 2024, Hlis ntuj nqeg
Anonim
Kev Nkag Mus Los ntawm GPS Ublox Neo 6M Nrog Raspberry Pi B+
Kev Nkag Mus Los ntawm GPS Ublox Neo 6M Nrog Raspberry Pi B+

Raspberry Pi yog lub khoos phis tawj me me sib xws rau ntau yam qauv uas yooj yim siv. Yeej nws yuav luag zoo ib yam li PC tab sis tuaj yeem tswj hwm nrog GPIO los ntawm Raspberry Pi. Raspberry Pi kuj tseem txhawb nqa nrog ntau kab kev sib txuas lus, ib qho yog kab ntawm kev sib txuas lus Serial / UART.

Nov yog qhia txog yuav siv Ublox Neo 6M GPS Module nrog Raspberry Pi nrog Serial / UART Kev Sib Txuas Lus.

Kauj Ruam 1: Cov Khoom Uas Koj Xav Tau

Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau
Cov Khoom Koj Xav Tau

Koj yuav xav tau:

  • Raspberry Pi Module B+512MB RAM
  • Ublox Neo 6M rau Arduino Raspberry
  • PL2303 USB to TTL
  • Poj Niam Rau Poj Niam Jumper Cable

Kauj Ruam 2: Siv PL2303 (tsis yog GPIO)

Siv PL2303 (tsis yog GPIO)
Siv PL2303 (tsis yog GPIO)
  • Txuas txhua lub Cheebtsam raws li cov txheej txheem saum toj no.
  • Txheeb xyuas kev sib txuas lus ntawm PL2303 seb nws puas tau kuaj pom los ntawm Raspberry Pi lossis tsis yog los ntawm kev hais kom ua ntawm lub davhlau ya nyob twg raws li hauv qab no:

ls /dev /ttyUSB*

qhov kev tso tawm ntawm cov lus txib yuav muab cov ntaub ntawv uas USB uas PL2303 raug kuaj pom

  • Nruab GPS Daemon tus thov kev pabcuam nrog cov lus txib hauv qab no:
  • Txheeb xyuas kev sib txuas lus ntawm PL2303 seb nws puas tau kuaj pom los ntawm Raspberry Pi lossis tsis yog los ntawm kev hais kom ua ntawm lub davhlau ya nyob twg raws li hauv qab no:

sudo apt-tau nruab gpsd gpsd-cov neeg siv sej-gps

Ua ib phau ntawv hais kom ua los khiav GPSD Daemon Socket nrog hais kom ua raws li hauv qab no:

sudo gpsd/dev/ttyUSB0 -F /var/run/gpsd.sock

ttyUSB0 tuaj yeem hloov pauv raws li qhov chaw nres nkoj pom los ntawm Raspberry Pi

Kev hais kom saib cov ntaub ntawv los ntawm GPS, ua cov lus txib hauv qab no:

cgps ua

Nws yuav qhia cov txiaj ntsig los ntawm qhov ntev, latitude, cheeb tsam, sijhawm thiab lwm yam Txhawm rau tawm qhov pom, nyem CTRL + Z / C.

Kauj Ruam 3: Siv GPIO Raspberry Pi

Siv GPIO Raspberry Pi
Siv GPIO Raspberry Pi
  • Txuas txhua lub Cheebtsam raws li schematic saum toj no.
  • Pab kom tus lej Pin ntawm Pib -> Nyiam -> Raspi Configuration -> Enable Serial Port
  • Kho kom raug cmdline.txt kom pab tau chaw nres nkoj txuas nrog hais kom ua raws li hauv qab no:

$ sudo nano /boot /cmdline.txt

  • Tshem tawm "console = ttyAMA0, 115200" ces txuag (CTRL + X) thiab Y ces ENTER.
  • Ua phau ntawv pib ntawm GPS Daemon nrog hais kom ua raws li hauv qab no:

$ sudo killall gpsd

$ sudo gpsd/dev/ttyAMA0 -F /var/run/gpsd.sock

Txhawm rau pom cov ntaub ntawv gps ua cov lus txib hauv qab no:

cgps ua

Pom zoo: