Difference between revisions of "WRTnode2R开箱指南/en"

From WRTnode Wiki
Jump to: navigation, search
(创建页面,内容为“==Login to WRTnode2R using telnet or ssh== Use any PC with Windows, Linux or MacOS operating system, install PuTTY on Windows PC, use any Linux / MacOS terminal soft...”)
(创建页面,内容为“==No internet no happiness== Now we will connect WRTnode2R to the internet. of course, you must have a 2.4G Wi-Fi ap or router with has connected on the internet.<br...”)
Line 38: Line 38:
 
[[File:Busybox.jpg|700px]]<br /><br />
 
[[File:Busybox.jpg|700px]]<br /><br />
  
==不联网不幸糊==
+
==No internet no happiness==
接下来的事情就是要把你的WRTnode2R连上互联网。首先,你得有个已经连上网的无线路由器。<br />
+
Now we will connect WRTnode2R to the internet. of course, you must have a 2.4G Wi-Fi ap or router with has connected on the internet.<br />
 
  root@OpenWrt:~# aps
 
  root@OpenWrt:~# aps
'aps'是WRTnode的自定义命令,扫描当前的Wi-Fi,结果是类似这样的:<br />
+
'aps' is the command of WRTnode2R to scan the Wi-Fi available, the output of 'aps' looks like this:<br />
 
<pre>
 
<pre>
 
WRTnode AP scaner.
 
WRTnode AP scaner.
Line 56: Line 56:
 
11  CU_wpFS                          xx:xx:xx:xx:xx:xx  WPAPSK/TKIPAES        70      11b/g/n NONE  In YES
 
11  CU_wpFS                          xx:xx:xx:xx:xx:xx  WPAPSK/TKIPAES        70      11b/g/n NONE  In YES
 
</pre>
 
</pre>
然后,我们来将WRTnode2R连上您现有的路由器:
+
ok,we will connect one:
  root@OpenWrt:~# setwifi 您要连接的路由器SSID 对应的密码
+
  root@OpenWrt:~# setwifi SSID_you_connetctin the_password
注意哦,SSID和密码中间有个空格。<br />例如:
+
be careful, there's a space between the SSID and the password <br />Such as:
  root@OpenWrt:~# setwifi TP_linkAB33CD password
+
  root@OpenWrt:~# setwifi TP_linkAB33CD my_password
回车以后等5秒,有时需要我们的电脑重新连接WRTnode2R的Wi-Fi,然后看看WRTnode2R有没有从上级路由DHCP获取IP地址:
+
Press Enter and wait 5 seconds, or sometimes we need to reconnect our computer to the WRTnode2R's SSID, so let's see if we have got the IP address from uppter router:
 
  root@OpenWrt:~# ia
 
  root@OpenWrt:~# ia
我们得到:<br />
+
we'll see<br />
 
<pre>
 
<pre>
 
root@OpenWrt:~# ia
 
root@OpenWrt:~# ia
Line 74: Line 74:
 
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
</pre>
 
</pre>
有时候,获取IP地址有可能要搞十几秒甚至几十秒,稍安勿躁。搞到IP后,我们看看是不是已经连上互联网了:<br />
+
sometimes getting the IP address will lasts more than 5 seconds, so be patient. Once we got the IP address, let's see if the board have access the internet:<br />
 
<pre>
 
<pre>
 
root@OpenWrt:~# ping baidu.com
 
root@OpenWrt:~# ping baidu.com
Line 80: Line 80:
 
64 bytes from 220.181.111.85: seq=0 ttl=54 time=6.071 ms
 
64 bytes from 220.181.111.85: seq=0 ttl=54 time=6.071 ms
 
</pre>
 
</pre>
搞定,我们用电脑连上了WRTnode2R,还把WRTnode2R连上了互联网。<br /><br />
+
See, thus we connected our computer to the WRTnode2R, and we connected the WRTnode2R to the internet.<br /><br />
  
 
=WRTnode2R软件仓=
 
=WRTnode2R软件仓=

Revision as of 17:32, 15 March 2016

Other languages:

The most first tip:
WRTnode2R default WiFi ssid: WRTnode2R_xxxx
Defual password for the Wi-Fi ssid: 12345678

What's in the WRTnode2R retail package

WRTnode2R retail package including the WRTnode2R and it's standerd shield
2R.png
This is how they are togother ready to work.
2RSHLD-0.jpg
2RSHLD-3.jpg

How WRTnode2R inserted into the shield

Plug the golden core module WRTnode2R into the miniPCI socket as the angle like the figure:
2Rsetup1.jpg
And push the outside of the golden module lightly, as the figure:
2Rsetup2.jpg
After a "carrrrrh" sound, the core module and the base board fitted each other perfectly, as the figure:
2Rsetup3.jpg
Isn't the inserting of WRTnode2R looks like the inserting of the RAM stick to the laptop? Yep, it's just how we want to design.

Light up WRTnode2R

2Rlightup.jpg

  • The board is powered by micro-USB connector, find an ordinary micro-USB power cable( which is not included in the retail package)
  • Plug into the baseboard's micro-USB connector, and the other side you could use any USB port which could offer more than 500mA and 5V power, such as a computer or a laptop's USB interface or a mobile phone charger or something like this.
  • The blue LED lights on and the OpenWrt starts to run in the board.
  • 20 seconds later, you will find a Wi-Fi with the SSID like WRTnode2P_xxxx( xxxx means the last four byte of the MAC address of your WRTnode2P), you could connecting the Wi-Fi with computer or phone with the password 12345678.

Login to WRTnode2R using telnet or ssh

Use any PC with Windows, Linux or MacOS operating system, install PuTTY on Windows PC, use any Linux / MacOS terminal software on Linux / MacOS.

  • First ping the WRTnode to see if connection is available. The default IP of WRTnode2R is set to 192.168.8.1, but WRTnode2R is able to resolve openwrt.lan to 192.168.8.1 as well:
ping openwrt.lan
  • Connect to WRTnode2R using telnet or ssh

If you connect first time to WRTnode2R or you didn't set password for root user of OpenWrt, use telnet to connect:

telnet 192.168.8.1 

or

telnet openwrt.lan

If you a password for root user was set, use SSH to connect:

ssh root@192.168.8.1

or

ssh root@openwrt.lan

Input your root password and a screen should appear like, ok, that's it. you could play your Linux CLI interacting here now:
Busybox.jpg

No internet no happiness

Now we will connect WRTnode2R to the internet. of course, you must have a 2.4G Wi-Fi ap or router with has connected on the internet.

root@OpenWrt:~# aps

'aps' is the command of WRTnode2R to scan the Wi-Fi available, the output of 'aps' looks like this:

WRTnode AP scaner.
Begin scaning APs, pls wait...
Finished.
APs available are...
ra0       get_site_survey:
Ch  SSID                             BSSID               Security               Siganl(%)W-Mode  ExtCH  NT WPS DPID
1   Tenda                            xx:xx:xx:xx:xx:xx   NONE                   70       11b/g/n ABOVE  In YES
1   hshn                             xx:xx:xx:xx:xx:xx   WPA2PSK/AES            96       11b/g/n NONE   In YES
6   TP-LINK                          xx:xx:xx:xx:xx:xx   NONE                   55       11b/g   NONE   In  NO
6   BY01                             xx:xx:xx:xx:xx:xx   NONE                   100      11b/g/n NONE   In YES
6   Tenda_xxxxxx                     xx:xx:xx:xx:xx:xx   WPAPSK/AES             50       11b/g/n ABOVE  In  NO
11  CU_wpFS                          xx:xx:xx:xx:xx:xx   WPAPSK/TKIPAES         70       11b/g/n NONE   In YES

ok,we will connect one:

root@OpenWrt:~# setwifi SSID_you_connetctin the_password

be careful, there's a space between the SSID and the password
Such as:

root@OpenWrt:~# setwifi TP_linkAB33CD my_password

Press Enter and wait 5 seconds, or sometimes we need to reconnect our computer to the WRTnode2R's SSID, so let's see if we have got the IP address from uppter router:

root@OpenWrt:~# ia

we'll see

root@OpenWrt:~# ia
apcli0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/xx 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)

sometimes getting the IP address will lasts more than 5 seconds, so be patient. Once we got the IP address, let's see if the board have access the internet:

root@OpenWrt:~# ping baidu.com
PING baidu.com (220.181.111.85): 56 data bytes
64 bytes from 220.181.111.85: seq=0 ttl=54 time=6.071 ms

See, thus we connected our computer to the WRTnode2R, and we connected the WRTnode2R to the internet.

WRTnode2R软件仓

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/base/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_base.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/telephony/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_telephony.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_packages.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/routing/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_routing.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/luci/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_luci.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/management/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_management.

root@OpenWrt:~# opkg install xxxx

把玩stm32

固件更新

WRTnode2R的stm32上,为了实现在7688上更新stm32的固件,我们在stm32的前4k地址烧写了一个bootloader程序,同时在7688上也提供了刷写固件的程序flash-stm32。
如果使用flash-stm32,用户仅需要执行

root@OpenWrt:~# flash-stm32 URL

URL这个命令行参数可以是stm32固件的链接,也可以是指定的本地stm32系统;就可以将存在服务器上的固件或者本地的固件烧写到stm32中。
建议大家升级stm32的固件,新的固件会有更好的体验:

root@OpenWrt:~# flash-stm32 http://d.wrtnode.com/2R-stm32/WRTnode2r_stm32_V1.bin

Flash-stm32-step.png
如上图stm32已经升级完成,升级完以后stm32会自动重启。
如果用户希望进行stm32的开发,我们建议用户使用stlink等在线调试工具来开发、调试和烧写代码。在开发前只需要注意点三:

  • 用户开发的代码中要将中断向量表重定向到0x08001000位置。
  • 用户代码下载时,要下载到0x08001000位置。
  • 如果用户完全抛弃我们提供的代码进行开发,但是又希望能够支持在线更新固件的功能,需要在用户开发的代码中实现7688控制stm32复位的功能。(在我们提供的代码中,已经实现了reset这个cmd,所以基于我们提供的代码进行开发,不需要完成这一步)

体验stm32的msh

WRTnode2R的STM32上运行着RT-Thread实时操作系统,受益于RTT中友好的msh命令行调试组件,我们在出厂固件中实现了RTT的spi slave设备驱动,并且将msh的输入输出端口都映射到了spi总线上。同时我们提供了在7688上与STM32通过SPI总线通信的软件(包括spiS0设备驱动、spi-bridge通信软件和flash-stm32固件升级程序)。
体验stm32上的msh:

  • 登录到WRTnode2R上。(登录的方式有串口、telnet、ssh)
  • 输入spi-bridge即可打开和stm32的msh命令行终端,可以按下tab键再按下enter键列出msh支持的所有命令。
spi-bridge
  • 若要执行某一条命令,输入命令后按下enter即可执行。如图:

Stm32-ps-cmd.png

  • exit退出msh。

如需了解WRTnode2R stm32的详情,请参考:WRTnode2R的STM32开发指南
如果你手上拿到的是WRTnode2R的内测版,第一次升级固件请参考stm32的升级:WRTnode2R内测版Stm32升级;升级stm32固件之后再升级WRTnode的固件。提供WRTnode升级固件的方法新固件下载链接

恢复出厂设置

root@OpenWrt:~# firstboot
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock5 is mounted as /overlay, only erasing files
root@OpenWrt:~# reboot

静态OpenWrt SDK

请到https://github.com/WRTnode/openwrt克隆或下载
ps: 本sdk是WRTnode各款硬件产品的OpenWrt通用的SDK,如果是要用于WRTnode2R,请在make menuconfig的时候 [ Subtarget ] 选择 [MT7628 base boards]

更多资源

WRTnode2R详细参数
WRTnode2R针脚定义
WRTnode2R标准底板
WRTnode2R硬件扩展开发及量产指南
WRTnode2R的STM32开发指南

走起来吧,骚年!