跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
Mcuzone Wiki
搜索
搜索
登录
个人工具
登录
查看“4001 R3S 4G EN”的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
←
4001 R3S 4G EN
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[4001 R3S 4G|切换语言为中文]] == '''Keywords''' == FriendlyElec NanoPi R3S、RK3566、4G LTE、FriendlyWrt、OpenWrt、Ubuntu == '''I. Introduction''' == The 4G module for the R3S is a 4G LTE kit designed specifically for the FriendlyElec NanoPi R3S development board. It is based on our CM4 4G mini (Qualcomm 4G LTE) module, around which we have designed a 4G carrier board for the R3S along with a matching 3D-printed base to compose the set. The 3D printed base is designed to replace the R3S enclosure base and incorporates an integrated 4G antenna. The 4G module is supported out-of-the-box by the official Friendly firmware, with automatic detection and no need for additional driver installation. The 4G module is a USB device that connects to the USB port of the R3S. For customers who have purchased an integrated kit that includes both a 4G module and an R3S from our company, we can assist with modifications if required. The modification involves transforming the USB cable of the 4G module to be fully internal, eliminating the need for a USB adapter board. However, after this modification, the USB port on the R3S will no longer be able to connect to any other USB devices. http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_47.jpg http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_48.jpg == '''II. Work with FriendlyWrt''' == The R3S development board comes in two versions: one without eMMC (which requires the system to be booted from a TF card), and another with eMMC (which allows the system to be booted either from the eMMC or from a TF card). All demonstrations in this document use the version that boots the system from a TF card. Different boot methods require corresponding different firmware packages. Please ensure that you match the correct firmware package to your boot method. The version of the FriendlyElec system we tested: rk3566-sd-ubuntu-noble-core-6.1-arm64-20241114.img.gz The 4G module is used as a WAN port in the FriendlyWrt system. Connect the R3S's LAN port to the PC's network port using an Ethernet cable. Open a web browser on the PC and navigate to 192.168.2.1 to log in to the FriendlyWrt system backend page (the default username is <code>root</code> and the password is <code>password</code>). === 2.1 Test 4G module === 进入“服务 - 终端”,登录终端,默认用户名<code>root</code>,密码<code>password</code>: Navigate to Services - Terminal", log in to the terminal with the default username: <code>root</code> and password: <code>password</code>: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_49.jpg http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_46.jpg Execute <code>ip addr</code>, and the result is as follows: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_36.jpg You can see `usb0`, which is our CM4 Qualcomm 4G LTE module. This indicates that the system has recognized the 4G module, but it has not yet obtained an IP address. To use the 4G module for internet access, you need to add a 4G interface. The steps are as follows: 进入“网络 - 接口”,点击“添加新接口”: Navigate to "Network - Interfaces," and click on "Add New Interface": http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_37.jpg 按下图进行配置(“名称”可以自定义),设备选择“usb0”,然后点击“创建接口”: Configure as shown in the figure below (the "Name" can be customized), select "usb0" for the device, and then click "Create Interface": http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_38.jpg 点击“防火墙设置”,在“创建/分配防火墙区域”中,选择wan,然后点击“保存”: Click on "Firewall Settings", in the "Create/Assign Firewall Zones" section, select "WAN", and then click "Save": http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_39.jpg 自动返回“接口”页面,点击“保存并应用”: It automatically returns to the "Interface" page, then click "Save and Apply": http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_40.jpg 稍等片刻,我们可以看到4G模块已经获得了IP地址: Wait for a moment, and we can see that the 4G module has obtained an IP address: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_41.jpg Back in the terminal, execute <code>ifconfig usb0</code> to check the network parameters of the 4G module: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_42.jpg A successful ping to the domain indicates that the 4G module is now able to browse the internet normally: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_43.jpg 4G Module internet speed test: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_02.jpg '''''Note: Network speed testing is affected by the network environment and the testing method. The speed provided here is for reference only, please refer to the actual speed for accurate information.''''' === 2.2 R3S外扩USB网卡 === R3S自带两路以太网,如需第三路以太网,可以通过USB3.0口来扩展,但是此时将无法使用4G。我司测试了R3S可以支持RTL8153的USB有线网卡,可以作为第二个LAN口使用。操作如下: 先不接USB有线网卡,系统正常启动,登录后台页面。 再插入USB有线网卡,稍等片刻,等在终端中执行<code>ifconfig -a</code>后出现eth2即可: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_44.jpg 然后进入”网络 - 接口 - 设备“,点击br-lan后面的”配置...“: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_19.jpg 点击”网桥接口“后面的下拉箭头,将eth1和eth2都选中,然后按”保存“: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_21.jpg 保存后返回上一层页面,按”保存并应用“: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_22.jpg 这样就设置了新增的USB有线网卡为LAN口,同时原来自带的LAN口也可以正常使用。 === 2.3 R3S外扩USB WiFi === R3S只有一路USB口,此USB口可以外扩USB WiFi,此时将无法使用4G。以外置MT7662 USB无线网卡为例: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_04.jpg http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_05.jpg http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_06.jpg 注:通过无线网卡上网不稳定,有可能会出现找不到AP的问题。 === 2.4 FriendlyWrt的其他操作 === ==== 2.4.1 Adblock ==== http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_11.jpg ==== 2.4.2 统计 ==== 如温控统计、处理器统计等: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_14.jpg http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_12.jpg == '''三、Ubuntu系统的测试''' == R3S开发板有不带eMMC版本(需要从TF卡启动系统),也有带eMMC版本(可以从eMMC启动系统,也可以从TF卡启动系统),此文的演示均用从TF卡启动系统;不同的启动方式,对应的烧写包文件不一样,注意匹配即可。 === 3.1 测试4G模块 === 将Ubuntu系统(命令行版本,无图形化桌面)烧写进TF卡。 我们测试的友善官方烧写包版本:rk3566-sd-ubuntu-noble-core-6.1-arm64-20241114.img.gz 用网线将R3S的LAN口接上级路由器,然后PC连接同一个上级路由器,插入已安装SIM卡4G模块和烧好系统的TF卡。系统启动后,通过路由器的后台,查看R3S的ip地址,本文档中系统所获得的地址为:192.168.8.35。 PC上下载安装终端软件MobaXterm,MobaXterm下载地址: https://mobaxterm.mobatek.net/download-home-edition.html 使用MobaXterm软件,通过SSH连接系统(用户名<code>root</code>,密码<code>fa</code>): http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_27.jpg http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_28.jpg 执行<code>ifconfig -a</code>,查看网络参数如下: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_29.jpg eth0是R3S的WAN口,没有接网线,所以没有IP地址; eth1是R3S的LAN口,接上游路由器,已经正确获得了ip地址; usb0是4G模块,已经正确获得了ip地址。 执行<code>route</code>,查看路由表,usb0排在第一位,因此此时是通过4G模块上网: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_30.jpg 此时我们ping IP和域名,均成功,说明4G模块工作正常: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_31.jpg === 3.2 网络优先级的修改 === R3S的Ubuntu系统,默认情况下,优先通过4G网络上网。 如果要优先使用有线网络上网的话,可以运行命令: <code>sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1</code> 这两条命令(以“&&”分隔)的解释: <code>sudo ip route del default</code>:删除路由表中的默认路由; <code>sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1</code>:添加有线网络的网关为新的默认路由(网关地址以实际为准)。 执行完毕后,再执行<code>route</code>,查看路由表,目前的默认路由为有线网络的网关(eth1排第一位): http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_32.jpg 这样网络就默认走有线网络了,如果需要改回默认走4G网络,请运行: <code>sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.225.1</code> 或者重启系统即可。 其中192.168.225.1为4G模组的默认网关,请以实际为准。 '''''注意,重启后路由表还是会恢复原状,所以如果重启后要网络继续默认走有线网络/无线网络,需要再执行一次<code>sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1</code>。''''' === 3.3 AT命令操作 === 先安装usbutils: <code>apt install usbutils</code> 使用<code>lsusb</code>查看USB设备,红框处即为4G模组: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_33.jpg 本模块的id为05c6 90b6,记录下这个值。 使用下列命令打开ttyUSB串口,其中echo后面的值就是之前记录的ID值: <code>modprobe option</code> <code>sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> 执行上述两条命令之后执行: <code>ls /dev</code> 此时应该能看到dev设备下有ttyUSB0-2三个设备: http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_34.jpg 安装串口软件minicom: <code>apt install minicom</code> 通过minicom打开AT命令串口: <code>minicom -D /dev/ttyUSB0</code> (注意,使用哪个串口,应以在进入此串口后,可输入运行AT命令,显示不乱码,不乱跳结果为准。) 如果需要查看回显,请键入命令:<code>ate1</code>,然后回车,继续键入其它命令,回车可以看到结果。 http://www.mcuzone.com/wiki/4001_Friendly_NanoPi_R3S/4001_Friendly_NanoPi_R3S_35.jpg 常用AT命令: 1. 检查SIM卡是否识别到: <code>at+cpin?</code> 返回ready表示卡已识别,返回error要检查硬件 2. 检查天线信号质量: <code>at+csq</code> 返回值在26-31表示信号OK,信号满格31;返回值在20-25表示信号勉勉强强;返回值在20以下表示信号比较糟糕或者天线没接 3. 检查注网情况: <code>at+cops?</code> 正常应该返回运营商代码和7,7代表4G。 注意,以上命令只有<code>at+csq</code>不要加问号,另外两条命令需要加问号。 4. 查看4G模块的IMEI码: <code>at+cgsn</code> 5. 重启4G模块(有时候如果重插SIM卡,热插拔不一定管用,可以用这个reset命令来复位模块): <code>at+reset</code> 6. 关闭射频: <code>at+cfun=0</code> 开启射频: <code>at+cfun=1</code> 上述两条命令成对使用,可以在不重启4G模组的情况下让模组重新注网。 === 3.4 修改4G模组的IP地址 === 如果出厂默认的4G IP地址和用户使用的IP地址有冲突,或有修改IP地址的需求,则将4G模块的IP改为直接获取公网IP即可,请执行AT命令: 设置IP为公网:<code>AT+GTIPPASS=1</code> 设置IP为内网:<code>AT+GTIPPASS=0</code> 查询当前IP为公网还是内网:<code>AT+GTIPPASS?</code> 修改IP完毕后需要断电重启才能生效。 == '''四、总结''' == 此处仅介绍4G模块基于NanoPi R3S的操作,不涉及到NanoPi R3S开发板自身的操作及软件系统,关于NanoPi R3S开发板资料,请前往友善官网查阅: https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R3S/zh {{联系我们_图标}}
本页使用的模板:
模板:Contact Us icon
(
查看源代码
)
返回
4001 R3S 4G EN
。
开关有限宽度模式