Placa WRTnode vine cu un cablu special cu micro USB, USB A si USB A mama.
*conectam cablul micro USB la placa, apoi conectam USB A la un alimentator USB (5Vcc) (poate fi un port USB de computer)
*dupa pornire (5-10 secunde), un LED albastru de pe placa se aprinde si in lista de retele WiFi vom vedea un AP cu numele "WRTnodeXYZW"
*ne conectam la acesta, parola este 12345678
*Ctrl + Alt + T -> deschidem un terminal
*lansam una din comenzile: ping i.wrtno.de / ping wrtnode.lan / ping openwrt.lan (apasa simultan
*daca functioneaza conexiunea, avem un raspuns de genul (Ipul din fabrica pt WRTnode este 192.168.8.1):
ping openwrt.lan
PING openwrt.lan (192.168.8.1) 56(84) bytes of data.
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=1 ttl=64 time=101 ms
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=2 ttl=64 time=20.5 ms
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=3 ttl=64 time=43.9 ms
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=4 ttl=64 time=66.4 ms
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=5 ttl=64 time=88.9 ms
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=6 ttl=64 time=111 ms
64 bytes from OpenWrt.lan (192.168.8.1): icmp_seq=7 ttl=64 time=30.7 ms
^C
--- openwrt.lan ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6009ms
rtt min/avg/max/mdev = 20.596/66.280/111.760/33.106 ms
*lansam: telnet i.wrtno.de (prima conectare se face obligatoriu in acest mod, nu este setata inca o parola de root)
*daca functioneaza, avem acces la un prompt ca mai jos:
Trying 192.168.8.1...
Connected to i.wrtno.de.
Escape character is '^]'.
=== IMPORTANT ============================
Use 'passwd' to set your login password
this will disable telnet and enable SSH
------------------------------------------
BusyBox v1.22.1 (2014-08-13 19:31:12 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r41508)
-----------------------------------------------------
* 1/2 oz Galliano Pour all ingredients into
* 4 oz cold Coffee an irish coffee mug filled
* 1 1/2 oz Dark Rum with crushed ice. Stir.
* 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:/#
*urmeaza sa stabilim o parola de root pt WRTnode-ul nostru (acest lucru este explicit cerut si mai sus, dupa conectarea prin telnet):
root@OpenWrt:/# passwd
Changing password for root
New password:
Retype password:
Password for root changed by root
(*notati undeva pe o hartie parola, sa nu o uitati si sa ramineti incuiati pe dinafara)
*din acest moment avem acces la conexiune SSH, lansam comanda exit si ne reconectam (prima data trebuie sa confirmam in Ubuntu faptul ca acceptam o conexiune fara cheie de securitate, doar prin parola):
root@OpenWrt:/# exit
Connection closed by foreign host.
catalins@catalin-N5110:~$ ssh root@i.wrtno.de
The authenticity of host 'i.wrtno.de (192.168.8.1)' can't be established.
RSA key fingerprint is bc:00:71:ac:b1:12:23:34:c7:7a:9b:6a:59:8e:da:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'i.wrtno.de,192.168.8.1' (RSA) to the list of known hosts.
root@i.wrtno.de's password:
BusyBox v1.22.1 (2014-08-13 19:31:12 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r41508)
-----------------------------------------------------
* 1/2 oz Galliano Pour all ingredients into
* 4 oz cold Coffee an irish coffee mug filled
* 1 1/2 oz Dark Rum with crushed ice. Stir.
* 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:~#
*lansam comanda aps pt a vedea toate punctele de acces WiFi (WiFi AP), rezultatul ca mai jos:
*alegem reteaua noastra (APul nostru, retinem canalul, numele si modul de securizare, trebuie sa stim parola) din cele enumerate de comanda aps si pregatim WRTnode-ul pt conexiunea la Internet prin intermediul APului nostru - comanda vw ne ajuta sa editam exact fisierul de configurare pt retea (aici am luat in considerare doar securizarea WPA2 (AES sau TKIP)) (practic editam fisierul /etc/config/wireless):
root@OpenWrt:~# vw
*editarea este relativ greoaie deoarece se foloseste editorul de Unix (Linux) vi (navigare cu sagetile, nu cu mousul), dar din fericire avem de editat doar cateva lucruri (vezi "#aici editam...") (http://www.cs.colostate.edu/helpdocs/vi.html):
config wifi-device 'ra0'
option type 'ralink'
option mode '9'
option channel '3' #aici editam canalul APului la care dorim sa ne conectam
option txpower '100'
option ht '20+40'
option country 'US'
option disabled '0'
config wifi-iface
option device 'ra0'
option network 'lan'
option mode 'ap'
option encryption 'psk2'
option key '12345678'
option ApCliEnable '1'
option ApCliSsid 'RETEAUA_MEA' #aici editam numele APului prin care ne vom conectam la Internet
option ApCliAuthMode 'WPA2PSK/AES' #aici editam securizarea APului prin care ne vom conectam la Internet
option ApCliEncrypType 'AES' #aici editam securizarea APului prin care ne vom conectam la Internet (doar TKIP sau AES)
option ApCliPassWord 'parola_retelei_mele' #aici editam parola APului prin care ne vom conectam la Internet
option ssid 'WRTnode99D2'
*comenzi pt editorul de fisiere vi (comanda este intre ""):
-cursorul il plasam in fisier cu tastele cu sageti
-":x" +
-":q" +
-":w" +
-plasam cursorul sub caracterul pe care dorim sa il stergem, apoi apasam "x", caracterul respectiv va fi sters
-plasam cursorul sub caracterul dupa care dorim sa inseram alte caractere, apasam "i" si introducem caractere; dupa ce terminam de introdus caracterele, apasam
*dupa ce am editat fisierul de configurare a retelei, resetam partea de retea cu comanda nr
*am dat si un reset hardware la WRTnode
*dupa ce am pornit, am incercat sa conectez laptopul din noul la WRTnode prin WiFi, am avut cateva incercari nereusite, dar in final a mers
*apoi am conectat prin SSH la WRTnode:
*comanda ia ne arata cum este conectat WRTnode la reteaua WiFi:
root@OpenWrt:~# ia
apcli0 Link encap:Ethernet HWaddr 66:5F:GE:32:00:T2
inet addr:192.168.1.256 Bcast:192.168.1.256 Mask:255.255.255.0
inet6 addr: fe80::6423:7eGT:fe32:99d2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
*se pare ca ruterul WiFi si WRTnode sunt conectate, urmeaza sa vedem daca WRTnode are acces la Internet (apasa simultan
root@OpenWrt:~# ping google.com
PING google.com (173.194.116.231): 56 data bytes
64 bytes from 173.194.116.231: seq=0 ttl=54 time=18.675 ms
64 bytes from 173.194.116.231: seq=1 ttl=54 time=16.275 ms
64 bytes from 173.194.116.231: seq=2 ttl=54 time=16.520 ms
64 bytes from 173.194.116.231: seq=3 ttl=54 time=19.485 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 16.275/17.738/19.485 ms
*din acest moment WRTnode poate fi utilizat pt proiectele lumii IoT :)
-nu uita ce parola ai stabilit pt root! (cea notata pe hartie)
-nu uita numele WRTnode-ului tau! (WRTnodeXXXX)
-nu uita IP-ul WRTnode-ului tau! (192.168.8.1 - din fabrica il are asa)
In acest moment placa WRTnode este conectata la Internet, putem incepe sa instalam diverse pachete, aplicatii. Prin intermediul WRTnode ne putem conecta si noi la Internet prin WiFi (APul WRTnodeXXXX).
Deci sa inceapa distractia!
Niciun comentariu:
Trimiteți un comentariu