4006 NEO CAT1 EN

来自Mcuzone Wiki
Mcuadm留言 | 贡献2024年12月9日 (一) 16:15的版本

切换语言为中文

Keywords

FriendlyElec NanoPi, NEO, NEO Air, NEO Core, Allwinner H3, Cortex-A7, NEO CAT1, 4G LTE, Ubuntu, Debian, IoT

I. Introduction

NEO CAT1 is a 4G LTE product which we designed based on the FriendlyElec NanoPi series featuring the H3 CPU motherboard (including models such as NEO, NEO CORE, and NEO AIR). The 4G module is a USB device that utilizes the USB IO pins on the NEO development board for communication and power supply, thereby providing 4G network connectivity to the NEO series boards.

4G Cat1 is a high-cost-performance module aimed at low-speed IoT applications with speeds around 10Mbps. The rates of 10Mbps downlink and 5Mbps uplink can meet the majority of connectivity and transmission requirements.

NEO CAT1, in conjunction with NEO series, enables the creation of a low-cost IoT device. The 4G module is driver-free, on FriendlyElec's official Ubuntu and Debian systems, the device is automatically recognized, requiring no additional driver installation.

II. Hardware Spec

1. One USB 2.0 port, used for powering and communication with the 4G module. The module comes in two packaging options: one is a female header connector, designed for connecting to the NEO development board. The other is a 1.25mm-4P interface, intended for connecting to other development boards that are not NEO Core, NEO, or NEO Air. You may choose to use one of the two packaging interfaces.

2. One 4G CAT1 LTE.

3. One IPEX Gen 1 antenna port.

4. Dual SIM Paths: One path is a Nano SIM card slot, the other path is an eSIM chip with a 5x6mm package (which needs to be procured and soldered by the user). The two SIM paths are used alternatively, with the Nano SIM being the default option.

5. Three LEDs: STS, MODE, and NET.

6. Two M2.5 mounting holes.

7. Size: The maximum size is 40x30mm.

8. PCB board: Two-layer board, with gold plating process, lead-free production; the material is UL and RoHS certified, with a fire rating of 94V-0.

III. Operations for NEO with CAT1

3.1 Based on Debian system

Flash the Debian system (command-line version, without a GUI) to the TF card.

The version of the official FriendlyElec system we tested: h3-sd-debian-bookworm-core-4.14-armhf-20240818.img.gz

NEO has an Ethernet port, so there are two methods for operation: one is to connect to a computer via a USB-to-TTL serial module, and the other is to connect to a router using the Ethernet port and access it through SSH.

3.1.1 Operate through TTL serial connection to PC

Insert the SIM card and the TF card with the system. The Debug interface of NEO, located next to the USB-A port, is a TTL serial port. The pinout from top to bottom is as follows: GND, 5V, TXD, RXD. Connect the USB-to-TTL serial module to it (connect TXD to RXD, RXD to TXD, and GND to GND; the 5V pin is not used), and connect the USB port of the USB-to-TTL serial module to the PC, as shown in the figure below:

4006_FriendlyElec_NanoPi_NEO_CAT1_28.jpg

Then download and install the terminal software MobaXterm on your PC. The download link for MobaXterm is:

https://mobaxterm.mobatek.net/download-home-edition.html

Open MobaXterm and configure the TTL serial port as shown in the figure below:

Note: Use a baud rate of 115200.

4003_FriendlyElec_NanoPi_NEO3_74.jpg

Then open this serial port and log in to the Debian system (username: root, password: fa):

4006_FriendlyElec_NanoPi_NEO_CAT1_29.jpg

Excecute ifconfig -a to view the following network parameters:

4006_FriendlyElec_NanoPi_NEO_CAT1_37.jpg

eth0 is the NEO's own Ethernet port, which does not have an IP address since it is not connected to a network cable. eth1 is the 4G CAT1 module, which has correctly obtained an IP address. We performed a ping test, and the results are as follows:

4006_FriendlyElec_NanoPi_NEO_CAT1_38.jpg

Pinging the IP address succeeds, but pinging a domain name results in an error, indicating that the system needs to have its DNS addresses configured. The setup method is as follows:

Edit the resolv.conf file:

sudo nano /etc/resolv.conf

Change the address in the red box in the image below to a general DNS server address (such as 114.114.114.114, or any other general DNS address):

4006_FriendlyElec_NanoPi_NEO_CAT1_26.jpg

If the DNS addresses are not set in the file, please enter:

nameserver 114.114.114.114

Save and exit.

At this point, pinging the domain name and pinging the IP address both succeed:

4006_FriendlyElec_NanoPi_NEO_CAT1_39.jpg

However, after making these changes, if the system restarts, the DNS entries in the resolv.conf file will be reset to their default addresses. Therefore, if you need the 4G internet connection to start automatically upon boot, you will also need to modify the permissions of the resolv.conf file. Since /etc/resolv.conf is actually a symbolic link, you need to regenerate the resolv.conf file in order to modify its permissions. The method to do so is as follows:

sudo mv /etc/resolv.conf /etc/resolv.conf.link

sudo nano /etc/resolv.conf

This recreates the resolv.conf file. In this newly created file, enter the following:

nameserver 114.114.114.114

Save and exit, then execute:

sudo chattr +i /etc/resolv.conf

After completing the above steps, restart the system, and the contents of the resolv.conf file will remain unchanged.

3.1.2 Operate through SSH over Ethernet

Connect NEO's Ethernet port to the upstream router using an Ethernet cable, then connect the PC to the same upstream router. Insert the SIM card and the TF card with the system. After the system starts, check NEO's IP address through the router's backend. In this document, the address obtained by the system is: 192.168.8.110.

Then use MobaXterm to connect to the system via SSH (username: root, password: fa):

4006_FriendlyElec_NanoPi_NEO_CAT1_35.jpg

4006_FriendlyElec_NanoPi_NEO_CAT1_02.jpg

Excecute ifconfig -a to view the following network parameters:

4006_FriendlyElec_NanoPi_NEO_CAT1_03.jpg

eth0 is the NEO's own Ethernet port, and eth1 is the 4G CAT1 module; both have correctly obtained IP addresses.

In the previous section, we have already set up a general DNS address. Now, we will perform ping tests separately through eth0 and eth1:

ping www.mcuzone.com -I eth0

ping www.mcuzone.com -I eth1

4006_FriendlyElec_NanoPi_NEO_CAT1_05.jpg

Confirms successful internet access via both wired and 4G networks.

3.2 基于Ubuntu系统

将Ubuntu系统(命令行版本,无图形化桌面)烧写进TF卡。

我们测试的友善官方烧写包版本:h3-sd-ubuntu-noble-core-20240823.img.gz

NEO有网口,所以操作方式有两种,一种是用TTL转串口接电脑,一种是用网口接路由器SSH。

3.2.1 通过TTL串口连接电脑操作

通过TTL串口连接电脑与在Debian下的操作相同,请参阅3.1.1节

连接成功后打开这个串口,登录Ubuntu系统(用户名root,密码fa):

4006_FriendlyElec_NanoPi_NEO_CAT1_30.jpg

执行ifconfig -a,查看网络参数如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_40.jpg

eth0是NEO自身的网口,没有接网线,故没有IP地址;eth1是4G CAT1模块,已经正确获得了ip地址,我们可以进行ping包操作,如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_41.jpg

ping IP能通,但ping域名报错,说明此系统没有开启4G,需要设置系统的DNS地址,设置方法如下:

修改resolv.conf文件:

sudo vi /etc/resolv.conf

将下图红框中的地址改为通用的DNS服务器地址(如所示的114.114.114.114,或者其它的通用DNS地址):

4006_FriendlyElec_NanoPi_NEO_CAT1_42.jpg

如果文件中未设置DNS地址,请输入:

nameserver 114.114.114.114

保存并退出。

此时再ping域名和ping IP,都正常:

4006_FriendlyElec_NanoPi_NEO_CAT1_43.jpg

不过,这种修改方式在系统重启后,resolv.conf文件内的DNS会被修改到默认地址;如果需要开机自动启动4G上网,则需要修改resolv.conf文件的权限,因为/etc/resolv.conf实际上是个软链接,所以需要重新生成resolv.conf文件才能修改权限,方法如下:

sudo mv /etc/resolv.conf /etc/resolv.conf.link

sudo vi /etc/resolv.conf

这样就重新建立了resolv.conf文件,在这个新建的文件中输入:

nameserver 114.114.114.114

保存退出,然后执行:

sudo chattr +i /etc/resolv.conf

做完上述步骤后,重启系统,resolv.conf文件的内容也不会变化了。

3.2.2 通过网线SSH连接电脑操作

用网线将NEO的网口接上级路由器,然后PC通过连接同一个上级路由器,插入SIM卡和烧好系统的TF卡。系统启动后,通过路由器的后台,查看NEO的ip地址,本文档中系统所获得的地址为:192.168.8.77。

然后使用MobaXterm软件,通过SSH连接系统(用户名root,密码fa):

4006_FriendlyElec_NanoPi_NEO_CAT1_34.jpg

4006_FriendlyElec_NanoPi_NEO_CAT1_36.jpg

执行ifconfig -a,查看网络参数如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_31.jpg

eth0为NEO自带的有线网卡,eth1为4G CAT1模块,都已经正确获得了ip地址。

上一节我们已经设置了通用的DNS地址,现在分别通过eth0和eth1进行ping包:

ping www.mcuzone.com -I eth0

ping www.mcuzone.com -I eth1

4006_FriendlyElec_NanoPi_NEO_CAT1_33.jpg

说明通过有线网络和4G网络都能成功上网。

四、NEO Core配CAT1的操作

4.1 基于Debian系统

NEO Core的系统是烧写在eMMC中的,本节所用系统为友善官方系统:h3-eflasher-debian-bookworm-core-4.14-armhf-20240818.img.gz

连接方式:用USB转TTL串口模块将core核心板连到电脑上,如下图所示:


打开串口软件MobaXterm,按下图设置好TTL串口:

注意:波特率使用115200

4003_FriendlyElec_NanoPi_NEO3_74.jpg

然后打开这个串口,登录Debian系统(用户名root,密码fa)。

执行ifconfig -a,查看网络参数如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_56.jpg

可见eth1(4G CAT1模块)已经正确获得了ip地址。如果没有获取IP地址,请运行dhclient eth1

ping IP和ping域名都能通,说明4G模块工作正常:

4006_FriendlyElec_NanoPi_NEO_CAT1_57.jpg

4.2 基于Ubuntu系统

NEO Core默认内置Ubuntu系统(位于eMMC上);

按与Debian系统同样的方法设置好TTL串口,然后打开这个串口,默认系统是登录pi这个账号,输入:

sudo su

切换到sudo账号。

执行ifconfig -a,查看网络参数如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_53.jpg

可见eth0(4G CAT1模块)已经正确获得了ip地址。如果没有获取IP地址,请运行dhclient eth1

ping IP和ping域名都能通,说明4G模块工作正常:

4006_FriendlyElec_NanoPi_NEO_CAT1_54.jpg

五、 NEO Air配CAT1的操作

5.1 基于Debian系统

NEO Air的系统是烧写在eMMC中的,本节所用系统为友善官方系统:h3-eflasher-debian-bookworm-core-4.14-armhf-20240818.img.gz

硬件连接是用USB转TTL串口模块将NEO Air与PC相连,如下图所示:


打开MobaXterm,按下图设置好TTL串口:

注意:波特率使用115200

4003_FriendlyElec_NanoPi_NEO3_74.jpg

然后打开这个串口,登录Debian系统(用户名root,密码fa)。

执行ifconfig -a,查看网络参数如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_49.jpg

可见eth0(4G CAT1模块)已经正确获得了ip地址。如果没有获取IP地址,请运行dhclient eth0

ping IP能通,但ping域名报错,说明此时DNS地址有问题,需要设置正确的DNS地址:

4006_FriendlyElec_NanoPi_NEO_CAT1_50.jpg

设置方法如下:

修改resolv.conf文件:

sudo nano /etc/resolv.conf

添加下图红框中的通用DNS地址(如所示的114.114.114.114,或者其它的通用DNS地址):

nameserver 114.114.114.114

4006_FriendlyElec_NanoPi_NEO_CAT1_51.jpg

保存并退出。此时再ping域名和ping IP,都正常:

4006_FriendlyElec_NanoPi_NEO_CAT1_52.jpg

不过,这种修改方式在系统重启后,resolv.conf文件内的DNS会被修改到默认地址,所以如果需要开机自动启动4G上网,还需要修改resolv.conf文件的权限,因为/etc/resolv.conf实际上是个软链接,所以需要重新生成resolv.conf文件才能修改权限,方法如下:

sudo mv /etc/resolv.conf /etc/resolv.conf.link

sudo nano /etc/resolv.conf

这样就重新建立了resolv.conf文件,在这个新建的文件中输入:

nameserver 114.114.114.114

保存退出,然后执行:

sudo chattr +i /etc/resolv.conf

做完上述步骤后,重启系统,resolv.conf文件的内容也不会变化了。

5.2 基于Ubuntu系统

NEO Air默认内置Ubuntu系统(位于eMMC上)

按与Debian系统同样的方法设置好TTL串口,然后打开这个串口,登录Ubuntu系统,默认系统是登录pi这个账号,输入:

sudo su

切换到sudo账号(密码输入pi)。

执行ifconfig -a,查看网络参数如下:

4006_FriendlyElec_NanoPi_NEO_CAT1_55.jpg

可见enx2089846a96ab(4G CAT1模块)已经正确获得了ip地址(注:enx后面的数字是4G模组的mac地址,每个模组都不一样,请以实际为准)。如果没有获取IP地址,请运行dhclient enx2089846a96ab

ping IP和ping域名都能通,说明4G模块工作正常:

4006_FriendlyElec_NanoPi_NEO_CAT1_48.jpg

六、4G模组相关操作

6.1 网络优先级的修改

NEO的Debian系统和Ubuntu系统在4G网络和有线网络共存的情况下,默认优先通过4G网络上网;

NEO Air的Debian系统和Ubuntu系统在4G网络和无线网络共存的情况下,默认也是优先通过4G网络上网。

如果要优先使用有线网络/无线网络上网的话,可以运行命令:

sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1

这两条命令(以“&&”分隔)的解释:

sudo ip route del default:删除路由表中的默认路由;

sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1:添加有线网络/无线网络的网关为新的默认路由(网关地址以实际为准)。

执行完毕后,再执行route,查看路由表,目前的默认路由为有线网络/无线网络的网关:

4006_FriendlyElec_NanoPi_NEO_CAT1_27.jpg

这样网络就默认走有线网络/无线网络了,如果需要改回默认走4G网络,请运行:

sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.10.1

或者重启系统即可。

其中192.168.10.1为4G模组的默认网关,请以实际为准。

注意,重启后路由表还是会恢复原状,所以如果重启后要网络继续默认走有线网络/无线网络,需要再执行一次sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1

6.2 AT命令操作

适用于NEO/NEO Core/NEO Air

如果无法执行lsusb,请先安装usbutils:

sudo apt install usbutils

使用lsusb查看USB设备,红框处即为4G模组:

4006_FriendlyElec_NanoPi_NEO_CAT1_06.jpg

然后安装串口软件minicom:

apt install minicom

然后执行:

ls /dev

此时应该能看到dev设备下有ttyACM0-2三个设备:

4006_FriendlyElec_NanoPi_NEO_CAT1_07.jpg

通过minicom打开AT命令串口:

minicom -D /dev/ttyACM0

如果需要查看回显,请键入命令:ate1,然后回车,继续键入其它命令,回车可以看到结果。

4006_FriendlyElec_NanoPi_NEO_CAT1_08.jpg

常用AT命令:

1. 检查SIM卡是否识别到:

at+cpin?

返回ready表示卡已识别,返回error要检查硬件

2. 检查天线信号质量:

at+csq

返回值在26-31表示信号OK,信号满格31;返回值在20-25表示信号勉勉强强;返回值在20以下表示信号比较糟糕或者天线没接

3. 检查注网情况:

at+cops?

正常应该返回运营商代码和7,7代表4G。

注意,以上命令只有at+csq不要加问号,另外两条命令需要加问号。

4. 查看4G模块的IMEI码:

at+cgsn

5. 重启4G模块(有时候如果重插SIM卡,热插拔不一定管用,可以用这个reset命令来复位模块):

at+reset

6. 关闭射频:

at+cfun=0

开启射频:

at+cfun=1

上述两条命令成对使用,可以在不重启4G模组的情况下让模组重新注网。

6.3 修改4G模组的IP地址

适用于NEO/NEO Core/NEO Air

执行AT命令:

AT+ROUTEIP=<newip>

注意,只支持192.168.x.2这样格式的地址,设置完毕后需断电重启系统。

查询当前IP:AT+ROUTEIP?

测试IP是否生效:AT+ROUTEIP=?

七、总结

此处我们只是基于CAT1的使用操作,不涉及到NanoPi开发板自身的操作及软件系统,关于NanoPi NEO/NEO Core/NEO Air开发板资料,请前往友善官网查阅:

https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO/zh

https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO_Core/zh

https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO_Air/zh

联系我们

4f7e81daf8791971.jpg 79c020da7ad0af9b.jpg 2851e01a0549e6f7.gif 0003_bb.jpg 0005_qq.jpg QQ:8204136

邮件:mcuzone@vip.qq.com

电话:13957118045

如本页面有任何疏漏、错误或者侵权,请通过上述途径联系我们,谢谢!

Copyright 2004-2025 野芯科技