Cov txheej txheem:

Nintendo Wifi Router: 17 Cov Kauj Ruam (nrog Duab)
Nintendo Wifi Router: 17 Cov Kauj Ruam (nrog Duab)

Video: Nintendo Wifi Router: 17 Cov Kauj Ruam (nrog Duab)

Video: Nintendo Wifi Router: 17 Cov Kauj Ruam (nrog Duab)
Video: ЗАПРЕЩЁННЫЕ ТОВАРЫ с ALIEXPRESS 2023 ШТРАФ и ТЮРЬМА ЛЕГКО! 2024, Kaum ib hlis
Anonim
Nintendo Wifi Router
Nintendo Wifi Router

Siv qhov qub Nintendo Kev Lom Zem cov ntaub ntawv txheej txheem, tsim ua haujlwm tau zoo hauv tsev siv lub RaspberryPI 3!

Kauj Ruam 1: Nruab Qhov Yuav Tsum Tau RaspberryPi Software

Flashing RaspberriPi Hard Disk / Install Yuav Tsum Software (Siv Ubuntu Linux)

Download "RASPBIAN JESSIE LITE"

Tsim koj lub hard disk tshiab rau DashboardPI

Ntxig lub microSD rau koj lub khoos phis tawj ntawm USB adapter thiab tsim cov duab disk siv cov lus txib dd

Nrhiav koj daim npav microSD tso ntawm df -h hais kom ua, unmount nws thiab tsim cov duab disk nrog daim disk theej daim ntawv dd

$ df -h/dev/sdb1 7.4G 32K 7.4G 1%/media/XXX/1234-5678

$ umount /dev /sdb1

Ceev faj: nco ntsoov tias cov lus txib yog qhov tseeb, koj tuaj yeem ua rau lwm lub disks puas tsuaj nrog cov lus txib no

yog = qhov chaw ntawm RASPBIAN JESSIE LITE duab cov ntaub ntawv ntawm = qhov chaw ntawm koj daim npav microSD

$ sudo dd bs = 4M yog =/path/to/raspbian-jessie-lite.img ntawm =/dev/sdb (ceeb toom: qhov no, nws yog/dev/sdb,/dev/sdb1 yog lub koomhaum uas twb muaj lawm muab faib rau ntawm microSD) Teeb koj li RaspberriPi

Ntxig koj daim npav microSD tshiab rau raspberrypi thiab siv nws nrog lub ntsuas saib txuas nrog rau HDMI chaw nres nkoj

ID nkag mus

neeg siv: pi pass: raspberry Hloov koj tus lej password kom ruaj ntseg

sudo passwd pi Pab kom RaspberriPi Advanced Options

sudo raspi-config Xaiv: 1 Nthuav Cov Ntaub Ntawv System

9 Advanced Options

A2 Hostname hloov nws mus rau "NESRouter"

A4 SSH Pab kom SSH Server

A7 I2C Pab kom i2c interface Pab kom Askiv/Asmeskas Keyboard

sudo nano/etc/default/keyboard Hloov cov kab hauv qab no: XKBLAYOUT = "peb" Teeb cov npe yooj yim l hais kom ua [xaiv tau]

vi ~/.bashrc

ntxiv cov kab hauv qab no:

alias l = 'ls -lh'

qhov ~/.bashrc Kho VIM default syntax highlighting [yeem]

sudo vi/etc/vim/vimrc

tsis pom zoo cov kab hauv qab no:

syntax ntawm Reboot koj li PI kom tau txais qhov hloov pauv kawg

rebootUpdate lub sijhawm cheeb tsam chaw teeb tsa

sudo dpkg-reconfigure tzdata xaiv koj lub sijhawm siv lub interface

Kauj ruam 2: Tsim WiFi Access Point

Thov nco ntsoov, ua ntej qhov no dhau los ua router uas peb tab tom ntsaws rau hauv RaspberryPi rau lub network uas twb muaj lawm los ntawm nws qhov chaw nres nkoj ethernet txhawm rau teeb tsa cov pob hauv qab no.

sudo apt-tau hloov tshiab && sudo apt-tau -y txhim kho

sudo apt-tau nruab dnsmasq hostapd vim

sudo apt-tau nruab vim git python-smbus i2c-tools python-imaging python-smbus build-essential python-dev rpi.gpio python3 python3-pip libi2c-dev

sudo vi /etc/dhcpcd.conf

Ntxiv cov kab hauv qab no:

rejectinterfaces wlan0 sudo vi/etc/network/interfaces

Kho cov ntu wlan0 kom nws zoo li qhov no:

auto lo iface lo inet loopback

iface eth0 inet phau ntawv qhia

pib wlan0 iface wlan0 inet zoo li qub chaw nyob 10.0.10.1 netmask 255.255.255.0 network 10.0.10.0 tshaj tawm 10.0.10.255

auto eth1 iface eth1 inet zoo li qub chaw nyob 10.0.20.1 netmask 255.255.255.0 network 10.0.20.0 tshaj tawm 10.0.20.255 Reload DHCP Server thiab thaws teeb tsa rau eth0 thiab wlan0 txuas

sudo kev pabcuam dhcpcd rov pib dua

sudo ifdown eth0; sudo ifup wlan0

Kho HOSTAPD (Hloov ssid thiab wpa_passphrase rau qhov tseem ceeb ntawm koj tus kheej xaiv)

sudo vi /etc/hostapd/hostapd.conf

# Nov yog lub npe ntawm WiFi interface peb teeb tsa saum toj no interface = wlan0

# Siv tus nl80211 tus neeg tsav tsheb nrog brcmfmac tus tsav tsheb tsav = nl80211

# Nov yog lub npe network ssid = NintendoWiFi

# Siv 2.4GHz band hw_mode = g

# Siv channel 6 channel = 6

# Pab kom 802.11n ieee80211n = 1

# Pab kom WMM wmm_enabled = 1

# Pab kom 40MHz raws nrog 20ns tus neeg zov lub sijhawm ht_capab = [HT40] [SHORT-GI-20] [DSSS_CCK-40]

# Txais tag nrho MAC chaw nyob macaddr_acl = 0

# Siv WPA kev lees paub authent_algs = 1

# Xav kom cov neeg siv khoom paub lub npe network tsis quav ntsej_broadcast_ssid = 0

# Siv WPA2 wpa = 2

# Siv tus lej ua ntej sib qhia wpa_key_mgmt = WPA-PSK

# Lub network passphrase wpa_passphrase = password

# Siv AES, hloov TKIP rsn_pairwise = CCMP Peb tuaj yeem tshawb xyuas yog tias nws ua haujlwm nyob rau theem no los ntawm kev khiav (tab sis tseem tsis tau muaj kev sib txuas hauv is taws nem tsis tau):

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

sudo vi/etc/default/hostapd

Nrhiav kab

#DAEMON_CONF = "" thiab hloov nws nrog

DAEMON_CONF = "/etc/hostapd/hostapd.conf" Kho DNSMASQ

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

sudo vi /etc/dnsmasq.conf

khi-cuam tshuam # Txheeb rau lub interface kom paub tseeb tias peb tsis xa cov khoom mus rau lwm qhov server = 8.8.8.8 # Forward DNS thov rau Google DNS sau-xav tau # Tsis txhob xa cov npe luv bogus-priv # Tsis txhob xa cov chaw nyob hauv -routed chaw nyob.

# Muab tus IP chaw nyob w/sijhawm tsis muaj sijhawm xauj (rau cov cuab yeej siv stats) dhcp-range = wlan0, 10.0.10.100, 10.0.10.200, 255.255.255.0, 10.0.10.255, infinite dhcp-range = eth1, 10.0.20.100, 10.0. 20.200, 255.255.255.0, 10.0.20.255, teeb tsa tsis kawg IPV4 mus tom ntej

sudo vi /etc/sysctl.conf

[tsis pom zoo] net.ipv4.ip_forward = 1

Qhib nws tam sim ntawd nrog sudo sh -c "ncha 1>/proc/sys/net/ipv4/ip_forward"

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

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

sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

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

sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

Txuag iptables nqis rau rov pib dua tom ntej

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

Tsim cov ntaub ntawv ipv4 cov cai (nrog cov ntsiab lus tshiab)

sudo vi/lib/dhcpcd/dhcpcd-hooks/70-ipv4-nat

iptables-restore </etc/iptables.ipv4.nat Restart Services

sudo kev pabcuam hostapd pib sudo kev pabcuam dnsmasq pib

sudo rov pib dua

Muab Cov IPs Zoo Li Qub [Xaiv tau]

Yog tias koj xav tau cov tswv ntawm koj lub network kom muaj ips zoo li qub thov siv cov hauv qab no

Tau txais cov tswv tam sim no txuas ntawm DHCP vi /var/lib/misc/dnsmasq.leases

Ntxiv MAC Chaw Nyob (los ntawm cov zis saum toj no) thiab tus IP chaw koj xav muab lawv rau sudo vi /etc/dnsmasq.conf

# lub ntsiab desktop dhcp-host = 12: 34: 56: 78: 9a: bc, 10.0.20.20 Nco tseg: Qhov no yuav muab lub network sib txuas nrog MAC Chaw Nyob: 12: 34: 56: 78: 9a: bc rau IP chaw nyob 10.0.20.20. IP chaw nyob uas teev tseg tsis tas yuav nyob hauv DHCP qhov muab, tsuas yog nyob hauv tib lub subnet. Kuv lub desktop tseem ceeb saum toj no yog nyob ntawm subnet eth1: 10.0.20.0, yog li kuv muab IP Chaw Nyob ntawm 10.0.20.20.

Ntxiv UFW Firewall

sudo apt-tau nruab ufw

Tso chaw nres nkoj 22 rau kev siv rau pej xeem (rau kev nkag mus rau tej thaj chaw deb network)

sudo ufw tso cai 22

Tso cai txhua qhov chaw nres nkoj ntawm kuv lub network hauv zos

sudo ufw tso cai los ntawm 10.0.10.0/24 sudo ufw tso cai los ntawm 10.0.20.0/24

Tso cai rau web chaw nres nkoj rau txhua tus

sudo ufw tso cai 80

Tso cai web chaw nres nkoj ruaj ntseg rau txhua tus

sudo ufw tso cai 443

Pab kom UFW thiab tshawb xyuas qhov xwm txheej

sudo ufw -yuam kom qhib

sudo ufw xwm txheej

Txhim kho BUG nrog UFW tsis pib thaum pib

sudo su crontab -e

Ntxiv cov kab hauv qab no: @reboot /bin /pw 60; ufw -ua kom muaj zog

Kauj Ruam 3: Cov Khoom Siv Xav Tau: Qub Nintendo tawg

Cov Khoom Siv Xav Tau: Qub Nintendo tawg
Cov Khoom Siv Xav Tau: Qub Nintendo tawg

Qub Nintendo Case los ntawm NES tawg (tshem tag nrho cov ntsiab lus qub hauv rooj plaub, tawm tsuas yog sab nrauv, lub zog / rov pib dua cov nyees khawm thiab cov tswj kev sib txuas)

Kauj Ruam 4: Cov Khoom Siv Xav Tau: Raspberry Pi 3 Qauv B

Cov Khoom Siv Xav Tau: Raspberry Pi 3 Qauv B
Cov Khoom Siv Xav Tau: Raspberry Pi 3 Qauv B

Kauj Ruam 5: Cov Khoom Siv Xav Tau: 1.44 "Serial: UART/I2C/SPI TFT LCD 128x128 Display Module

Cov Khoom Siv Xav Tau: 1.44
Cov Khoom Siv Xav Tau: 1.44
Cov Khoom Siv Xav Tau: 1.44
Cov Khoom Siv Xav Tau: 1.44

Kauj Ruam 6: Cov Khoom Siv Xav Tau: 5V 0.1A Mini Fan Raspberry Pi

Cov Khoom Siv Xav Tau: 5V 0.1A Mini Fan Raspberry Pi
Cov Khoom Siv Xav Tau: 5V 0.1A Mini Fan Raspberry Pi

Kauj Ruam 7: Cov Khoom Siv Xav Tau: Ugreen USB 2.0 rau 10/100 Fast Ethernet Lan Wired Network Adapter

Cov Khoom Siv Xav Tau: Ugreen USB 2.0 rau 10/100 Fast Ethernet Lan Wired Network Adapter
Cov Khoom Siv Xav Tau: Ugreen USB 2.0 rau 10/100 Fast Ethernet Lan Wired Network Adapter

Kauj Ruam 8: Kev tsim kho

Kev tsim kho
Kev tsim kho

Nruab sab hauv NES

Siv lub tshuab luam ntawv 3D luam tawm Digole Display thav duab "NESPanel" hauv/tsim/tso tawm-thav duab/nplaub tshev. [yog tias koj tsis muaj lub tshuab luam ntawv 3D koj tuaj yeem txiav lub qhov square rau Digole Display nrog Dremel cov cuab yeej] Txiav cov qhov hauv qab no qhib rau sab nraub qaum thiab sab ntawm rooj plaub kom tso cai rau lub kiv cua me kom nrawm rau ntawm sab thiab lub zog/ethernet thiab USB ethernet cables kom tau txais los ntawm sab nraub qaum.

Kauj Ruam 9: Kev Tsim Kho Ntxiv

Kev Tsim Kho
Kev Tsim Kho

Ntsia qhov sab saum toj txoj cai dub los ntawm NES thiab ntxuav kom huv ib lub qhov loj txaus los txhawm rau txhim kho koj lub digole zaub. Kub Nplaum cov zaub tso rau hauv qhov chaw nrog "NESPanel" 3D luam ntawv thav duab saum nws.

Kauj Ruam 10: Kev Tsim Kho Ntxiv

Kev Tsim Kho
Kev Tsim Kho

Mount RaspberryPi nyob nruab nrab ntawm hauv qab ntawm qhov tsis muaj NES rooj plaub, txuas los ntawm kua nplaum lossis ntsia hlau me me hauv qab. Siv 270 ohm resister, txuas "lub zog ntawm LED" ntawm NES mus rau 5V thiab GND pins hauv Raspberry Pi (luv luv LED yog hauv av). Txuas tus kiv cua me me mus rau 5V thiab GND pins ib yam kom nws ua haujlwm thaum chav pib, kaw cov kiv cua tawm tsam lub qhov nyob rau sab rau nws.

Kauj Ruam 11: Txuas Digole Display

Txuas cov pins hauv qab no rau cov pins ntawm RaspberryPi

VCC txuas nrog 3v GND yog hauv av DATA yog SDA CLOCK yog SCL Tam sim no koj yuav tsum pom lub cuab yeej hauv koj i2cdetect hais kom ua

i2cdetect -y 1 nws yuav tsum tshwm nyob rau hauv kab sib chaws ntawm cov ntawv li 27

Kauj Ruam 12: Txhim Kho Network Saib Xyuas Cov Cuab Yeej & DB Logging

sudo apt-tau nruab ifstat memcached sej-memcache postgresql postgresql-pab txhawb sej-psycopg2

sudo vi /etc/postgresql/9.4/main/pg_hba.conf

Ntxiv cov kab hauv qab no mus rau qhov kawg ntawm cov ntaub ntawv: hauv zos txhua tus pi lo lus zais sudo -i -u postgres

psql ua

tsim lub luag haujlwm pi lo lus zais 'tus lej zais ntawm no';

hloov lub luag haujlwm pi tus ID nkag mus;

hloov lub luag haujlwm pi superuser;

du ib

(koj yuav tsum pom koj tus neeg siv PI nrog kev tso cai tso cai) tsim cov database network_stats;

q ua

tawm

psql -d network_stats

Khiav cov lus nug hauv qab no:

CREATE TABLE traffic_per_minute (tus lej xov tooj, lub sijhawm timestamp tsis muaj thaj tsam lub sijhawm TSIS NULL, eth0_down tiag, eth0_up tiag, eth1_down tiag, eth1_up tiag, wan0_down tiag, wan0_up tiag);

CREATE UNIQUE INDEX time_idx ON traffic_per_minute (sijhawm); Luam theej tawm cov ntawv "txiav" ntawm txoj haujlwm no mus rau phau ntawv teev npe tsev ntawm koj li RPi

crontab -e

Ntxiv kab no

@reboot /bin /pw 60; nohup nab hab sej /home/pi/logging/networkUsage.py>/dev/null 2> & 1

Kauj Ruam 13: Txhim Kho Daim Ntawv Qhia Txog Kev Ruaj Ntseg (khiav Txhua 5 feeb los ntawm Cronjob)

crontab -e

ntxiv kab hauv qab no

*/5 * * * * nab hab sej /home/pi/logging/trafficSummary.py

Kauj Ruam 14: Nruab Dashboard Screen

Luam theej duab "zaub" cov cai ntawm qhov haujlwm no mus rau phau ntawv teev npe tsev ntawm koj li RPi

Khiav nws raws li hauv qab no

$ python /home/pi/display/NESRouter.py Teeb cov ntawv sau kom khiav thaum pib

crontab -e

Ntxiv kab no

@reboot nohup nab hab sej /home/pi/display/NESRouter.py>/dev/null 2> & 1

Txheeb xyuas cov zaub pib ua haujlwm ntawm reboot

sudo rov pib dua

Kauj Ruam 15: Txhim Kho Lub Zej Zog Siv/txheeb cais Lub Vev Xaib [https://10.0.10.1]

Txhim kho cov kev siv hauv zos/txheeb cais lub vev xaib [https://10.0.10.1]

sudo apt-tau hloov tshiab && sudo apt-tau upgrade -y

sudo apt-tau nruab apache2

sudo kev pabcuam apache2 rov pib dua

Tshem cov nplooj ntawv tsis raug

cd /ua /www

sudo rm -rf html

Luam 'webportal' nplaub tshev los ntawm qhov haujlwm no rau koj lub tsev ntawv ntawm koj RPi thiab tsim cov cim txuas rau apache los siv

cd /ua /www

sudo ln -s/tsev/pi/webportal html

cd/var/www/html

chmod +x *.py

sudo a2enmod cgi cov

sudo vi /etc/apache2/sites-enabled/000-default.conf

Pab kom Python CGI Scripting

Ntxiv rau sab hauv

Xaiv +ExecCGI AddHandler cgi-script.py sudo service apache2 rov pib dua

Tam sim no koj tuaj yeem mus ntsib HTTP lub vev xaib [https://10.0.10.1]

Teeb tsa kev saib xyuas network siab dua (ntawm IPFM)

sudo apt-tau hloov tshiab

sudo apt-tau nruab ipfm

sudo mv /etc/ipfm.conf /etc/ipfm.conf-bak

sudo vi /etc/ipfm.conf

Tsim nrog cov hauv qab no:

# Ntiaj teb hloov pauv

# IPFM tuaj yeem saib xyuas ib lub cuab yeej nkaus xwb. KHOOM eth0

# Ntiaj teb LOGGING teeb tsa LOG

FILENAME "/var/log/ipfm/%Y_%d_%m/%H_%M"

# cav txhua feeb DUMP EVERY 1 feeb

# txheeb cais tseeb txhua hnub CLEAR txhua 24 teev teev nyob rau hauv RESOLVE sudo kev pabcuam ipfm pib

YOOJ YIM: Tsim koj tus kheej cov duab Nintendo los ua ntawm cov zaub

Upload koj tus kheej 128x128 cov ntaub ntawv rau hauv qab no URL:

www.digole.com/tools/PicturetoC_Hex_convert…

Xaiv koj cov ntaub ntawv duab rau upload, ntxiv qhov loj me koj xav kom nws nyob ntawm qhov screen (Dav/Qhov siab)

Xaiv "256 Xim rau Xim OLED/LCD (1 byte/pixel)" hauv "Siv rau" qhov poob qis

Tau txais cov txiaj ntsig hex.

Ntxiv cov hex cov zis rau cov zaub/ tsim/ header (.h) cov ntaub ntawv, siv lwm tus los ua cov lus qhia rau cov lus sib xyaw.

Suav nrog cov ntawv tshiab hauv cov ntawv digole.c #include myimage.h

Suav nrog kab lus hais kom ua tshiab txuas rau koj cov ntaub ntawv duab hauv. Nco tseg: cov lus txib hauv qab no yog hais kos koj cov duab ntawm txoj haujlwm 10 pixels tshaj 10 pixels nqis. Koj tuaj yeem hloov nws mus rau X sib txawv, Y tswj hwm, koj tseem tuaj yeem hloov qhov muaj nuj nqis 128, 128 rau qhov loj me me uas koj cov duab tshiab yog.

} lwm yog (strcmp (digoleCommand, "myimage") == 0) {drawBitmap256 (10, 10, 128, 128, & myimageVariableHere, 0); // myimageVariableQhov no yog txhais hauv koj (.h) cov ntaub ntawv}

Tam sim no rov tsim dua (tsis quav ntsej qhov ua tsis raug) hauv qab no kom muaj koj cov duab tshiab ua nrog cov lus txib hauv qab no.

$./digole myimage Re-Building [Muaj] Digole Display Driver rau koj qhov kev hloov pauv tau

$ cd zaub/tsim $ gcc digole.c $ mv a.out../../digole $ chmod +x../../digole

Pom zoo: