Cov txheej txheem:

Ledboard Pi: 5 Kauj Ruam (nrog Duab)
Ledboard Pi: 5 Kauj Ruam (nrog Duab)

Video: Ledboard Pi: 5 Kauj Ruam (nrog Duab)

Video: Ledboard Pi: 5 Kauj Ruam (nrog Duab)
Video: yawm txiv kav ntxhais part 2 HD end 2024, Kaum ib hlis
Anonim
Ledboard Pib
Ledboard Pib
Ledboard Pib
Ledboard Pib
Ledboard Pib
Ledboard Pib

Ledboard Pi screen yog qhov tshwm sim ntawm xyoo ntawm kev paub dhau los, kev kawm, thiab kev txhim kho; tab sis kuj, qhov tshwm sim ntawm muaj cov cuab yeej raug (kho vajtse, software, firmware) nyob rau lub sijhawm no: Raspberry Pi 4 (nrog Raspberry Pi 3 ua haujlwm ib yam nkaus) nrog nws qhov nrawm, nco thiab tsis muaj peev xwm ua haujlwm, qhov haujlwm zoo kawg Raspberry Pi LED Matrix Display raws li rpi-rgb-coj-matrix thiab rpi-fb-matrix cov tsev qiv ntawv (rau kev tsav ntau lub lag luam RGB LED Panels los ntawm GPIO) los qhia Raspberry Pi cov vis dis aus tso tawm ntawm qhov loj RGB LED matrix zaub (rau qhov qhia no, kev daws teeb meem yog 96x64 siv 6 sparkfun 32x32 panels). Txhua yam no tau tswj hwm nrog GUI daim ntawv thov ua haujlwm siv lazarus lub tswv yim ntawm lub teeb pom kev zoo qhib lub khoos phis tawj teeb tsa Raspbian Buster Lite duab thiab thaum kawg, qhia txhua yam uas koj xav tau tuaj yeem ua haujlwm: Multi-Sport Scoreboard, Digital Signage, lossis Video Player; tsis muaj kev txwv. Txoj haujlwm no, tswj hwm los ntawm ib lub computer, muaj peev xwm ua haujlwm VNC Viewer, vim tias VNC Server tseem tau teeb tsa ntawm Raspberry Pi 4's Rasbian Buster Lite.

Txij tag kis no, kuv yuav sim piav qhia ntxaws txhua kauj ruam kom ua tiav txoj haujlwm no.

Khoom siv

Peb xav tau rau txoj haujlwm no:

Kho vajtse

  1. Ib Raspberry Pi 3 lossis zoo dua, Raspberry Pi 4 nrog nws 5V 2.5 A fais fab mov
  2. Ib qho Electrodragon RGB LED Matrix Vaj Huam Sib Luag Tsav Tsheb Rau Raspberry Pi
  3. Rau rau 32x32 RGB LED Vaj Huam Sib Luag los ntawm Sparkfun
  4. Ib qho 40A 5v Fais Fab Khoom
  5. Ib qho 3 meters Aluminium duab plaub ncej 82.5 mm x 38 mm
  6. Ib qho kev txiav ntawm acrylic loj W 576 mm x H 384 mm
  7. Ib qho kev txiav ntawm zaj duab xis polarized

Software

  1. hezeller rpi-rgb-led-matrix tsev qiv ntawv
  2. Adafruit rpi-fb-matrix tsev qiv ntawv
  3. Raspbian buster lite lossis cov duab realtimepi-buster-lite
  4. Openbox
  5. Rau kev tswj hwm pc/laptop/Raspberry Pi 3 lossis 4, Tiag VNC Viewer rau Windows lossis Linux lossis Raspbian
  6. Lazarus IDE rau raspbian buster lite
  7. Leboard Pi daim ntawv thov

yuav tsum txuas ntxiv mus…

Kauj Ruam 1: Teeb Raspberry Pi 3/4 OS Khoom

Teeb Raspberry Pi 3/4 OS Khoom
Teeb Raspberry Pi 3/4 OS Khoom
Teeb Raspberry Pi 3/4 OS Khoom
Teeb Raspberry Pi 3/4 OS Khoom
Teeb Raspberry Pi 3/4 OS Khoom
Teeb Raspberry Pi 3/4 OS Khoom

Thaum peb muaj Cov Khoom Kho Vajtse, peb yuav tsum tau txais cov khoom OS:

Ua ntej, peb yuav tsum tau txais OS rau Raspbian 3/4. hauv kuv qhov xwm txheej, Kuv txiav txim siab siv lub sijhawm tiag tiag buster lite; tab sis koj tuaj yeem siv kuj Raspbian Buster Lite version. Tom qab ntawd koj yuav tsum hloov daim duab no mus rau hauv daim npav micro SD siv balenaEtcher.

Tom qab ntawd, peb yuav tsum txuas lub HDMI zaub thiab usb keyboard thiab cat5 network cable txuas nrog

Raspberry Pi 3/4 RJ45; yog li, peb tuaj yeem tshawb nrhiav Raspberry Pi 3/4 IP rau ua thawj zaug teeb tsa: network IP, txuas thiab wireless. Kuv siv tus ip scanner siab heev. Tam sim no, los ntawm raspi-teeb tsa, qhib SSH Server rau kev txuas sib nrug siv Putty kom ua tiav tas ntawm Ledboard Pi teeb tsa.

Tam sim no, hla cov ntawv lite, peb tab tom yuav teeb lub teeb pom kev ib puag ncig nrog qhib lub thawv

sudo apt-tau nruab-tsis-nruab-pom zoo xserver-xorg x11-xserver-utils xinit openbox

Tom qab ntawd, teeb tsa lightdm (Tus thawj tswj ID nkag mus)

sudo apt-tau nruab lightdm

Qhib realvncserver los ntawm raspi-config

sudo raspi-config> Kev xaiv cuam tshuam> vncserver> qhib vncserver

Ntawm no, thaum lub vnceserver tau qhib, peb yuav siv VNC Viewer. Hauv qhov no, lub desktop txhawm rau teeb tsa hauv kev sib txuas yog 0, ex. Yog IP yog 192.168.100.61, qhov txuas yog "192.168.100.61:0"

Peb xav tau kev sib txuas ntawm kev tswj hwm lub khoos phis tawj/lub khoos phis tawj thiab lub Ledboard Pi, yog li samba yuav tsum tau teeb tsa rau kev hloov pauv ntawm qhov chaws, cov ntaub ntawv, duab, yeeb yaj kiab, thiab lwm yam

sudo apt-tau nruab samba samba-common-bin -y

Nco ntsoov tias koj tus neeg siv yog tus tswv ntawm txoj kev koj tab tom sim qhia tawm ntawm Samba

sudo chown -R pi: pi/home/pi/share

Nqa ib daim qauv ntawm cov ntaub ntawv qub samba qhia tawm

sudo cp /etc/samba/smb.conf /etc/samba/smb.bak

Kho cov ntaub ntawv teeb tsa samba

sudo nano /etc/samba/smb.conf

Tawm ntawm pawg ua haujlwm li WORKGROUP (lossis npe nws raws li koj xav tau)

#yeej txhawb = tsis muaj

kom yeej kev txhawb nqa = yog

Tom qab ntawd….

#Qhov no yog lub npe ntawm cov ntawv sib faib nws yuav tshwm li thaum koj tshawb

[ledboardpi] tawm tswv yim = ledboardPi qhia txoj hauv kev =/tsev/pi/Qhia tsim daim npog ntsej muag = 0775 daim npog ntsej muag = 0775 nyeem nkaus xwb = tsis tuaj yeem tshawb pom = muaj pej xeem = muaj quab yuam neeg siv = pi tsuas yog qhua = tsis

Tam sim no, peb tuaj yeem nkag mus rau "home/pi/share" folder hauv/home/pi path los ntawm lwm lub computer.

Txog kev tswj hwm cov ntaub ntawv siv cov gui app, peb yuav nruab pcmanfm

sudo apt-tau nruab pcmanfm

Kauj Ruam 2: Rub tawm, teeb tsa, thiab Ua Haujlwm ntawm RGB LED Vaj Huam Sib Luag Xav Tau Lub Tsev Qhua

Image
Image
Rub tawm, teeb tsa, thiab Ua Haujlwm ntawm RGB LED Vaj Huam Sib Luag Xav Tau Lub Tsev Qhua
Rub tawm, teeb tsa, thiab Ua Haujlwm ntawm RGB LED Vaj Huam Sib Luag Xav Tau Lub Tsev Qhua
Rub tawm, teeb tsa, thiab Ua Haujlwm ntawm RGB LED Vaj Huam Sib Luag Xav Tau Lub Tsev Qhua
Rub tawm, teeb tsa, thiab Ua Haujlwm ntawm RGB LED Vaj Huam Sib Luag Xav Tau Lub Tsev Qhua

Ua ntej, teeb tsa ua ntej qhov xav tau

sudo apt-tau hloov tshiab

sudo apt-tau nruab -y tsim-qhov tseem ceeb git libconfig ++-dev sudo apt-tau nruab libgraphicsmagick ++-dev libwebp-dev -y sudo apt-tau nruab python2.7-dev nab nab-hauv ncoo -y

Tom qab ntawd, rub tawm thiab suav sau hzeller rpi-rgb-led-matrix

wget

unzip master.zip cd rpi-rgb-led-matrix-master/ && ua

Tsis tas li, rub tawm thiab Nruab rpi-fb-matrix

Koj yuav tsum clone qhov chaw cia no nrog cov kev xaiv rov ua dua kom cov submodules tsim nyog kuj tseem raug cloned. Khiav cov lus txib no:

git clone-ua tau zoo

ua

Nco tseg: hloov lub rpi-rgb-led-matrix tsev qiv ntawv rub tawm thaum ntxov rau hauv rpi-fb-matrix nplaub tshev

Tam sim no, peb yuav sim cov tsev qiv ntawv no, nco ntsoov, rpi-fb-matrix nyob ntawm rpi-rgb-led-matrix

cd rpi-fb-matrix

cd rpi-rgb-led-matrix sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua" --led- no-hardware-pulse --led-pwm-lsb-nanoseconds = 180-led-show-refresh --led-brightness = 80 -D 0 sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "regular" --led-no-hardware-pulse-led-pwm-lsb-nanoseconds = 180-led-show-refresh- coj-ci ntsa iab = 80 -D 1 runtext.ppm sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua"- -led-no-hardware-pulse --led-pwm-lsb-nanoseconds = 180-led-show-refresh --led-brightness = 80 -D 2 runtext.ppm sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "regular" --led-no-hardware-pulse-led-pwm-lsb-nanoseconds = 180 --led -show-refresh --led-brightness = 80 -D 3 sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = " tsis tu ncua "-coj-tsis-kho vajtse-mem tes-coj-pwm-lsb-nanoseconds = 180-coj-qhia-ua tshiab-coj-ci = 80 -D 4 sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua" --led-no-hardware-pulse --led-pwm-lsb-nanoseconds = 180-led-show-refresh --led-brightness = 80 -D 5 sudo./demo --led-chain = 3 --led-parallel = 2 --led- slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua"-coj-tsis-kho vajtse-mem tes-coj-pwm-lsb-nanoseconds = 180-coj-qhia-ua kom tshiab-coj-ci = 80 -D 6 sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua" --led-no-hardware-pulse --led-pwm-lsb-nanoseconds = 180-led-show-refresh --led-brightness = 80 -D 7 sudo./demo --led-chain = 3 --led-parallel = 2 --led- slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua"-coj-tsis-kho vajtse-mem tes-coj-pwm-lsb-nanoseconds = 180-coj-qhia-ua kom tshiab-coj-ci = 80 -D 8 sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua" --led-no-hardware-pulse --led-pwm-lsb-nanoseconds = 180-led-show-refresh --led-brightness = 80 -D 9 sudo./demo --led-chain = 3 --led-pa rallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "regular" --led-no-hardware-pulse-led-pwm-lsb-nanoseconds = 180-led-show-refresh --led-brightness = 80 -D 10 sudo./demo --led-chain = 3 --led-parallel = 2 --led-slowdown-gpio = 4 --led-gpio-mapping = "tsis tu ncua"- led-no-hardware-pulse-led-pwm-lsb-nanoseconds = 180-led-show-refresh-led-brightness = 80 -D 11

Txhua tus khiav zoo.

Tam sim no, rpi-fb-matrix tsev qiv ntawv. Qhov no yuav qhia ib feem (96x64) ntawm lub vijtsam rau hauv RGB LED Panels raws li Ledboard Pi

cd/tsev/pi/rpi-fb-matrix

Nco ntsoov, luam qhov kawg ntawm rpi-rgb-led-matrix tsev qiv ntawv rau hauv rpi-fb-matrix nplaub tshev. Tseem ceeb heev

ua kom huv

ua txhua yam

Cov lus txib kawg, rau ob qho tib si rpi-fb-matrix thiab rpi-rgb-led-matrix libraries ….

Rau rpi-fb-matrix xav tau kev teeb tsa raug ntawm matrix.cfg (Kuv hloov npe davenew.cfg rau qhov kev qhia no), nyeem, txheeb xyuas rau cov phiaj xwm kev cai nrog ntau tus lej ntawm RGB LED Panels …

LED Matrix Display Configuration // Txheeb xyuas tag nrho qhov dav thiab qhov siab ntawm cov zaub hauv pixels. // Qhov no yog _total_ dav thiab qhov siab ntawm lub duab plaub txhais los ntawm txhua tus // cov hlua khi. Qhov dav yuav tsum yog ntau yam ntawm lub vaj huam sib luag pixel dav (32), // thiab qhov siab yuav tsum yog ntau yam ntawm lub vaj huam sib luag pixel qhov siab (8, 16, lossis 32). display_width = 96; display_height = 64; // Txhais qhov dav ntawm txhua lub vaj huam sib luag hauv pixels. Qhov no yuav tsum yog 32 (tab sis tuaj yeem // hauv kev xav hloov pauv). panel_width = 32; // Txheeb xyuas qhov siab ntawm txhua lub vaj huam sib luag hauv pixels. Qhov no feem ntau yog 8, 16, lossis 32. // NCO TSEG: Txhua lub vaj huam sib luag hauv cov zaub _must_ yuav tsum yog qhov siab tib yam! Koj tsis tuaj yeem sib xyaw // 16 thiab 32 pixel siab vaj huam sib luag piv txwv. vaj huam sib luag_height = 32; // Txheeb tag nrho cov naj npawb ntawm cov vaj huam sib luag hauv txhua txoj saw. Suav suav tab sis ntau // vaj huam sib luag tau txuas ua ke thiab muab tus nqi ntawm no. Yog tias koj siv // ntau txoj kab sib txuas sib suav suav txhua tus sib cais thiab xaiv qhov loj tshaj // tus nqi rau qhov teeb tsa no. chain_length = 3; // Txhais tag nrho cov naj npawb ntawm cov saw sib luag. Yog tias siv Adafruit HAT koj // tsuas muaj ib txoj saw thiaj lo nrog tus nqi 1. Tus Pi 2 tuaj yeem txhawb nqa // txog 3 txoj hlua sib txuas, saib rpi-rgb-led-matrix library kom paub ntau ntxiv: // https://github.com/hzeller/rpi-rgb-led-matrix#chaining-parallel-chains-and-coordinate-system parallel_count = 2; // Kho txhua lub vaj huam sib luag LED matrix. // Nov yog kab lus ob-seem nrog kev nkag mus rau txhua lub vaj huam sib luag. Cov kab // txhais cov kab sib chaws uas yuav faib cov zaub, yog li piv txwv li 64x64 loj // zaub nrog 32x32 pixel vaj huam sib luag yuav yog 2x2 array ntawm vaj huam sib luag teeb tsa. // // Rau txhua lub vaj huam sib luag koj yuav tsum teeb tsa qhov kev txiav txim uas nws nyob hauv nws cov saw, piv txwv li // thawj lub vaj huam sib luag hauv cov saw yog xaj = 0, qhov txuas ntxiv yog xaj = 1, thiab lwm yam. Koj tuaj yeem // kuj teeb tsa kev sib hloov rau txhua lub vaj huam sib luag rau tus as khauj rau kev hloov pauv hauv vaj huam sib luag kev taw qhia // (zoo li thaum 'snaking' ua ntu ntu ntawm qhov kawg kom xaus rau cov xov hlau luv sau). // // Piv txwv li kev teeb tsa hauv qab no piav qhia cov kab sib chaws ntawm cov vaj huam sib luag thiab // lawv cov thaiv (pib los ntawm sab saud sab xis thiab nqes sab laug, nqes, thiab // sab xis mus rau hauv qab vaj huam sib luag sab xis): // _ _ _ / / | Vaj Huam Sib Luag | | Vaj Huam Sib Luag | | Vaj Huam Sib Luag | // | ib order = 2 | <= | order = 1 | <= | order = 0 | <= Chain 1 (los ntawm Pi) // | tig = 0 | | tig = 0 | | tig = 0 | // | _ | | _ | | _ | // _ _ _ // | Vaj Huam Sib Luag | | Vaj Huam Sib Luag | | Vaj Huam Sib Luag | // | ib order = 2 | <= | order = 1 | <= | order = 0 | <= Chain 2 (los ntawm Pi) // | tig = 0 | | tig = 0 | | tig = 0 | // | _ | | _ | | _ | // // Daim ntawv ceeb toom cov saw pib nyob rau sab xis thiab nab nyob ib puag ncig mus rau hauv qab // txoj cai. Qhov kev txiav txim ntawm txhua lub vaj huam sib luag tau teeb tsa raws li nws txoj haujlwm raws txoj saw, // thiab kev sib hloov yog siv rau cov vaj huam sib luag qis uas tau ntxeev ib puag ncig txheeb ze // rau cov vaj huam sib luag saum toj no. // // Tsis pom tab sis yog tias koj tab tom siv cov saw sib txuas koj tuaj yeem qhia meej rau txhua qhov nkag // hauv cov ntawv teev npe 'sib luag = x;' xaiv qhov twg x yog tus lej ID ntawm qhov sib npaug // saw (0, 1, lossis 2). panels = (({order = 2; tig = 0; parallel = 0;}, {order = 1; tig = 0; parallel = 0;}, {order = 0; tig = 0; parallel = 0;}, { order = 2; tig = 0; parallel = 1;}, {order = 1; tig = 0; parallel = 1;}, {order = 0; tig = 0; parallel = 1;})) // Los ntawm qhov pib rpi-fb-matrix cov cuab yeej yuav hloov pauv thiab txo qis ntawm lub vijtsam // kom haum rau kev daws teeb meem ntawm cov vaj huam sib luag zaub. Txawm li cas los xij koj tuaj yeem hloov pauv // ib qho tshwj xeeb pixel-zoo theej ntawm ib cheeb tsam ntawm lub vijtsam los ntawm kev teeb tsa x, y // npo pixel ua haujlwm hauv qab no. Ib lub duab plaub ntawm qhov loj me me ntawm cov zaub // (piv txwv li display_width x display_height pixels) yuav tau theej los ntawm lub vijtsam // pib ntawm qhov muab x, y ua haujlwm. Tawm tswv yim tawm qhov no kom tsis ua haujlwm // qhov kev coj ua qoob loo no thiab hloov qhov loj me ntawm lub vijtsam mus rau cov zaub matrix. cog_origin = (0, 0)

Kauj Ruam 3: Sib Sau Ua Ke, Teeb thiab Ntsuas Ledboard Pi GUI Daim Ntawv Thov

Image
Image
Sau ua ke, Teeb tsa thiab Xeem Ledboard Pi GUI Daim Ntawv Thov
Sau ua ke, Teeb tsa thiab Xeem Ledboard Pi GUI Daim Ntawv Thov
Sau ua ke, Teeb tsa thiab Xeem Ledboard Pi GUI Daim Ntawv Thov
Sau ua ke, Teeb tsa thiab Xeem Ledboard Pi GUI Daim Ntawv Thov

Peb xav tau lub program IDE los tsim daim ntawv thov GUI (Ledboard Pi). Tom qab ntawd, kuv xaiv "Lazarus IDE" zoo ib yam li Delphi/C ++ Builder Kuv siv hauv Windows OS

sudo apt-tau nruab lazarus-ide

Thaum ntsia, cia li ua:

lazarus-xav

Qhib Ledboard Pi txoj haujlwm, tom qab ntawv suav sau kom tau txais Daim Ntawv Thov Ledboard Pi. Ua ntej qhib daim ntawv thov no, ua cov npe hu ua LEDBOARD_APP hauv txoj kev /tsev /pi, tom qab ntawv luam daim ntawv thov Ledboard Pi rau qhov no

Tam sim no, peb yuav ntxiv qhov txuas mus rau txoj cai-nias cov ntawv qhia zaub mov ntawm lub thawv qhib. Yuav ua li cas, peb xav tau obmenu, tseem xterm siv Putty txuas, yog li:

sudo apt-tau nruab obmenu xterm

Tam sim no, peb tuaj yeem siv lub davhlau ya nyob twg thiab obmenu hauv vncviewer window:

  1. Hu rau xterm los ntawm txoj cai-nias cov ntawv qhia zaub mov
  2. Qhib obmenu los ntawm xterm

Ntxiv cov khoom tshiab: Ledboard Pi

  1. Xaiv yam khoom tshiab
  2. npe nws Ledboard Pi
  3. ua raws sudo zoo -n -15/tsev/pi/LEDBOARD_APP/LEDBOARD
  • Rub tawm "horn. WAV", tom qab ntawd, siv lub network txuas samba qhov chaw "\ ledboardpi / ledboardpi \" luam qhov no thiab hloov nws mus rau hauv realtimePi ib puag ncig li "horn.wav". Cov ntaub ntawv no, thaum hloov npe, yuav tsum tau theej rau /home /pi folder.
  • Ua tiav, koj yuav tsum muaj peev xwm khiav Ledboard Pi zoo li Koj pom hauv cov vis dis aus thiab duab.

Kauj ruam 4: Nruab thiab teeb tsa WiFi Hotspot

Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot
Nruab thiab teeb tsa WiFi Hotspot

Txoj haujlwm no tau tsim los ua haujlwm siv tus saib tiag tiag los ntawm lub khoos phis tawj txuas nrog wirelessly rau Raspberry Pi 3/4. Yog li, qhov no yog cov kauj ruam kawg kom nws khiav, thiab hais tias "hasta la vista tus menyuam" rau qhov npau suav phem.

Teeb Software

sudo apt-tau hloov tshiab

sudo apt-tau nruab hostapd isc-dhcp-server

DHCP neeg rau zaub mov

Ua neeg ntse thiab ib txwm ua thaub qab ntawm lub neej ntawd teeb tsa

sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.default

Kho qhov defult config file

sudo nano /etc/dhcp/dhcpd.conf

Saib cov kab hauv qab no…

xaiv sau npe-npe "example.org";

xaiv sau npe-npe-servers ns1.example.org, ns2.example.org;

nyeem:

#option domain-name "example.org";

#option domain-name-servers ns1.example.org, ns2.example.org;

… thiab tsis tawm lus kab lus no

#tso cai;

… Nyeem:

muaj cai;

… Nqes mus rau hauv qab ntawm cov ntawv thiab sau cov kab hauv qab no:

subnet 192.168.42.0 netmask 255.255.255.0 {

khwv 192.168.42.10 192.168.42.50; xaiv qhov chaw tshaj tawm-chaw nyob 192.168.42.255; xaiv routers 192.168.42.1; default-xauj-sijhawm 600; xaum xaum xaum 7200; xaiv sau npe-npe "hauv zos"; xaiv sau npe-npe-servers 8.8.8.8, 8.8.4.4; }

Cia teeb wlan0 rau IP zoo li qub

Ua ntej, kaw nws…

sudo ifdown wlan0

… khaws nws kom nyab xeeb thiab ua cov ntaub ntawv thaub qab:

sudo cp/etc/network/interfaces /etc/network/interfaces.backup

… Kho cov ntaub ntawv cuam tshuam rau lub network:

sudo nano/etc/network/interfaces

… Kho kom haum nyeem:

source-directory /etc/network/interfaces.d

pib lo iface lo inet loopback iface eth0 inet dhcp pub-hotplug wlan0 iface wlan0 inet zoo li qub chaw nyob 192.168.42.1 netmask 255.255.255.0 post-up iw dev $ IFACE teeb tsa power_save tawm

… Kaw cov ntaub ntawv thiab muab tus IP zoo li qub tam sim no

sudo ifconfig wlan0 192.168.42.1

Ua tiav …

Hostapd

Tsim ib daim ntawv thiab kho nws:

sudo nano /etc/hostapd/hostapd.conf

Hloov kho ssid nrog lub npe uas koj xaiv thiab wpa_passphrase mus rau WiFi ua ntej

interface = wlan0

ssid = LedboardPi hw_mode = g channel = 6 macaddr_acl = 0 auth_algs = 1 ignore_broadcast_ssid = 0 wpa = 2 wpa_passphrase = davewarePi wpa_key_mgmt = WPA-PSK wpa_pairwise = TKIP rsn_pairwise = CCMP

Cia teeb tsa lub network chaw nyob txhais lus

Tsim cov ntaub ntawv thaub qab

sudo cp /etc/sysctl.conf /etc/sysctl.conf.backup

kho cov ntaub ntawv config

sudo nano /etc/sysctl.conf

… Un-comment lossis ntxiv rau hauv qab:

net.ipv4.ip_forward = 1

#… Thiab qhib nws tam sim:

sudo sh -c "ncha 1>/proc/sys/net/ipv4/ip_forward"

… Hloov kho iptables los tsim kev txhais lus sib txuas ntawm eth0 thiab wifi chaw nres nkoj wlan0

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sudo iptables -A FORWARD -i eth0 -o wlan0 -m lub xeev -xeev RELATED, ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

… ua qhov no tshwm sim ntawm reboot los ntawm runnig

sudo sh -c "iptables -save> /etc/iptables.ipv4.nat"

… thiab kho dua

sudo nano/etc/network/interfaces

… Txuas ntxiv thaum kawg:

nce iptables-restore </etc/iptables.ipv4.nat

Peb cov ntaub ntawv/etc/network/interfaces yuav zoo li no:

source-directory /etc/network/interfaces.d

auto hlo

iface lo inet loopback pub-hotplug eth0 iface eth0 inet zoo li qub chaw nyob 192.168.100.61 netmask 255.255.255.0 rooj vag 192.168.100.1 tso cai-hotplug wlan0 iface wlan0 inet zoo li qub chaw 192.168.42.1 netmask 255.255.255.0 network 192.168.42.0 tshaj tawm 192.168.42.255 cov npe /etc/network/interfaces.d

Cia peb sim peb qhov chaw nkag los ntawm kev khiav:

sudo/usr/sbin/hostapd /etc/hostapd/hostapd.conf

Koj lub hotspot tau nce thiab khiav: sim txuas nws los ntawm lub khoos phis tawj lossis lub xov tooj ntawm tes. Thaum koj ua li ntawd, koj yuav tsum pom qee qhov kev ua haujlwm ntawm koj lub davhlau ya nyob twg. Yog tias koj txaus siab, nres nws nrog CTRL+C

Cia peb ntxuav txhua yam: sudo kev pabcuam hostapd pib sudo kev pabcuam isc-dhcp-server pib

… thiab paub tseeb tias peb tab tom ua haujlwm:

sudo kev pabcuam hostapd xwm txheej

sudo kev pabcuam isc-dhcp-server xwm txheej

… Cia teeb tsa peb daemons kom pib ntawm lub sijhawm khau raj:

sudo hloov tshiab-rc.d hostapd pab

sudo hloov tshiab-rc.d isc-dhcp-server pab kom sudo systemctl unmask hostapd sudo systemctl unmask isc-dhcp-server

… reboot tus pi

sudo rov pib dua

Tam sim no koj yuav tsum muaj peev xwm pom koj li Wi WiFi, txuas rau nws thiab nkag tau internet rau nws. Raws li kev sib piv nrawm, rub tawm 4k cov vis dis aus yuav siv li 10% ntawm pi CPU yog li … siv nws raws li.

Raws li qhov tau txais txiaj ntsig, yog tias koj xav tshuaj xyuas dab tsi tshwm sim ntawm koj li WiFi hotspot, txheeb xyuas cov ntaub ntawv teev cia:

tw -f/var/log/syslog

Kauj ruam 5:

Duab
Duab
Duab
Duab
Duab
Duab

Rooj plaub.

Tsim

Rau ntu no, Kuv siv sketchup 3D tsim qauv tsim. Ledboard Pi Aluminium Case 3D Tsim

Txog qhov no, Kuv siv cov duab ib txwm 82.5 mm x 38 mm aluminium profiles, qee lub kaum ntse ntse thiab qee qhov ntsia hlau. Kev txhawb nqa tau tsim los ntawm Kuv Niam ntawm txoj kev, pov tseg. Nws muaj lub log raws li qhia hauv duab.

Pom zoo: