Wiki source code of Notes for cellular network connection
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | **Table of Contents:** | ||
2 | |||
3 | {{toc/}} | ||
4 | |||
5 | |||
6 | |||
7 | = **1. Enable Cellular Connection** = | ||
8 | |||
9 | |||
10 | //If your device has a Cellular module, you can see the below screenshot. enable the cellular connection here.// | ||
11 | |||
12 | [[image:image-20220601110850-2.png]] | ||
13 | |||
14 | **//Enable Cellular Connection//** | ||
15 | |||
16 | ((( | ||
17 | //If your device doesn't have a cellular module, you will see a cellular module not detected.// | ||
18 | ))) | ||
19 | |||
20 | [[image:image-20220527153544-2.png]] | ||
21 | |||
22 | |||
23 | = **2. How to Debug if Cellular connection fails** = | ||
24 | |||
25 | |||
26 | //If there is a problem with the cellular connection. Please check the below points~:// | ||
27 | |||
28 | |||
29 | == **2.1 Do you order the model with a cellular option** == | ||
30 | |||
31 | |||
32 | //Make sure you order the model with the cellular option. Can check by command or via the Web UI.// | ||
33 | |||
34 | (% class="box" %) | ||
35 | ((( | ||
36 | //root@dragino-1bbd90:~~# lsusb | ||
37 | Bus 001 Device 004: ID 2c7c:0125 ~-~-> This is the Cellular module | ||
38 | Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub | ||
39 | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub// | ||
40 | ))) | ||
41 | |||
42 | [[image:image-20220601110748-1.png]] | ||
43 | |||
44 | |||
45 | == **2.2 Do you input the SIM card correctly** == | ||
46 | |||
47 | |||
48 | **//Below command can check if you have a SIM card inserted, or via Web UI//** | ||
49 | |||
50 | * //Make sure to Power Off when you insert the SIM card and power on the device. The device doesn't support auto-detect SIM card on power on// | ||
51 | * //Make sure you have the correct direction to insert the SIM card. Every device has an example photo in the manual for the direction.// | ||
52 | |||
53 | (% class="box" %) | ||
54 | ((( | ||
55 | //root@dragino-1dadd8:~~# **comgt -d /dev/ttyUSB3** | ||
56 | SIM ready | ||
57 | Waiting for Registration..(120 sec max) | ||
58 | Registered on Home network: "CHN-UNICOM",7 | ||
59 | Signal Quality: 10,99// | ||
60 | ))) | ||
61 | |||
62 | |||
63 | (% class="wikigeneratedid" %) | ||
64 | [[image:image-20220527153804-4.png]] | ||
65 | |||
66 | |||
67 | (% class="wikigeneratedid" %) | ||
68 | //**Note:** If the icon is missing some information, like SIM, Network, or Signal, which may be due to the display bug.// | ||
69 | |||
70 | (% class="wikigeneratedid" %) | ||
71 | //Please check the IP address is displayed and the Internet displays "OK", it works properly.// | ||
72 | |||
73 | (% class="wikigeneratedid" %) | ||
74 | [[image:image-20220527153827-5.png]] | ||
75 | |||
76 | |||
77 | == **2.3 Check dialing info** == | ||
78 | |||
79 | //run "**logread -f**" in gateway CLI。// | ||
80 | |||
81 | (% class="box" %) | ||
82 | ((( | ||
83 | Fri Feb 7 01:20:28 2020 daemon.notice pppd[29452]: pppd 2.4.7 started by root, uid 0 | ||
84 | Fri Feb 7 01:20:29 2020 user.notice iot_keep_alive: Ping WAN | ||
85 | Fri Feb 7 01:20:29 2020 user.notice iot_keep_alive: Default interface is | ||
86 | Fri Feb 7 01:20:29 2020 user.notice iot_keep_alive: No internet at any interface | ||
87 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: abort on (BUSY) | ||
88 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: abort on (NO CARRIER) | ||
89 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: abort on (ERROR) | ||
90 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: report (CONNECT) | ||
91 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: timeout set to 10 seconds | ||
92 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: send (AT&F^M) | ||
93 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: expect (OK) | ||
94 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: AT&F^M^M | ||
95 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: OK | ||
96 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: ~-~- got it | ||
97 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: send (ATE1^M) | ||
98 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: expect (OK) | ||
99 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: ^M | ||
100 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: ATE1^M^M | ||
101 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: OK | ||
102 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: ~-~- got it | ||
103 | Fri Feb 7 01:20:29 2020 local2.info chat[29485]: send (AT+CGDCONT=1,"IP",""^M) | ||
104 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: timeout set to 30 seconds | ||
105 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: expect (OK) | ||
106 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: ^M | ||
107 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: AT+CGDCONT=1,"IP",""^M^M | ||
108 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: OK | ||
109 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: ~-~- got it | ||
110 | (% style="color:#037691" %)**Fri Feb 7 01:20:30 2020 local2.info chat[29485]: send (ATD*99#^M) ~-~-~-~--> In case the dialling process already reach here. | ||
111 | Normally the problem is with a provider, need to check if the SIM card has balance or other requirement from the cellular operator**(%%) | ||
112 | (% style="color:black" %)Fri Feb 7 01:20:30 2020 local2.info chat[29485]: expect (CONNECT) | ||
113 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: ^M | ||
114 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: ATD*99#^M^M | ||
115 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: CONNECT | ||
116 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: ~-~- got it | ||
117 | Fri Feb 7 01:20:30 2020 local2.info chat[29485]: send ( ^M) | ||
118 | Fri Feb 7 01:20:30 2020 daemon.info pppd[29452]: Serial connection established. | ||
119 | ))) | ||
120 | |||
121 | |||
122 | = **3. Share Cellular Network for WiFi & LAN clients** = | ||
123 | |||
124 | |||
125 | ((( | ||
126 | //By default, the Cellular Network won't be shared with the WiFi or LAN clients. If users need to share with them, the user can modify the file.// | ||
127 | ))) | ||
128 | |||
129 | (% class="box" %) | ||
130 | ((( | ||
131 | ((( | ||
132 | root@dragino-1d25dc:~~# cat /etc/config/firewall | ||
133 | |||
134 | config defaults | ||
135 | option syn_flood '1' | ||
136 | option input 'ACCEPT' | ||
137 | option output 'ACCEPT' | ||
138 | option forward 'REJECT' | ||
139 | config zone | ||
140 | option name 'lan' | ||
141 | list network 'lan' | ||
142 | option input 'ACCEPT' | ||
143 | option output 'ACCEPT' | ||
144 | option forward 'REJECT' | ||
145 | config zone | ||
146 | option name 'wan' | ||
147 | list network 'wan' | ||
148 | list network 'wwan' | ||
149 | list network 'wan6' | ||
150 | list network 'cellular' ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--> Add this line and reboot | ||
151 | option input 'REJECT' | ||
152 | option output 'ACCEPT' | ||
153 | option forward 'ACCEPT' | ||
154 | option masq '1' | ||
155 | option mtu_fix '1' | ||
156 | config forwarding | ||
157 | option src 'lan' | ||
158 | option dest 'wan' | ||
159 | ))) | ||
160 | ))) | ||
161 | |||
162 | ((( | ||
163 | //and run **/etc/init.d/firewall reload** or reboot the device.// | ||
164 | |||
165 | |||
166 | ))) | ||
167 | |||
168 | = **4. How does the gateway view the International Mobile Equipment Identity (IMEI)** = | ||
169 | |||
170 | |||
171 | //Users can access the gateway CLI and run the minicom command to get the configuration interface.// | ||
172 | |||
173 | ((( | ||
174 | |||
175 | |||
176 | **//Enter the minicom command, then select the option ''serial port setup".//** | ||
177 | ))) | ||
178 | |||
179 | (% class="box infomessage" %) | ||
180 | ((( | ||
181 | root@dragino-1ef9ac:~~# minicom -s | ||
182 | ))) | ||
183 | |||
184 | [[image:image-20220527154132-6.png]] | ||
185 | |||
186 | |||
187 | And then, change the setting: | ||
188 | |||
189 | (% class="box infomessage" %) | ||
190 | ((( | ||
191 | (% style="color:black" %)**Serial Device :** (% style="color:#037691" %)**/dev/ttyModemAT** | ||
192 | |||
193 | (% style="color:black" %)**Bps/Par/Bits :**(% style="color:#037691" %)** 9600 8N1** | ||
194 | ))) | ||
195 | |||
196 | |||
197 | //**Note: Enter the corresponding letter to change the configuration, like A,B,C**// | ||
198 | |||
199 | [[image:image-20220527154154-7.png]] | ||
200 | |||
201 | |||
202 | //Enter **AT+GSN **in the interface to get the IMEI,// | ||
203 | |||
204 | // **For example (% style="color:#037691" %)860548042566627(%%)**// | ||
205 | |||
206 | (% class="box infomessage" %) | ||
207 | ((( | ||
208 | ((( | ||
209 | **AT+GSN** | ||
210 | ))) | ||
211 | ))) | ||
212 | |||
213 | [[image:image-20220527154231-8.png]] | ||
214 | |||
215 | |||
216 | = **5. How does the gateway connect to the network via a USB 4G Dongle** = | ||
217 | |||
218 | |||
219 | == **5.1 Introduction** == | ||
220 | |||
221 | |||
222 | (% style="color:red" %)**//Prerequisite: Requires a USB 4G Dongle and a supported gateway firmware//** | ||
223 | |||
224 | ((( | ||
225 | //This introduces a setup and configured gateway for using a USB 3g/UMTS-modem for WAN connection.// | ||
226 | |||
227 | |||
228 | ))) | ||
229 | |||
230 | ((( | ||
231 | //Many modes (and most **LTE**) USB modems provide **qmi**, **mbim**, **ncm**, **rndis** protocol for connection instead of legacy **ppp** protocol, they are faster and better, overall recommended.// | ||
232 | ))) | ||
233 | |||
234 | ((( | ||
235 | //This is not beginner-friendly due to too many protocols.// | ||
236 | |||
237 | //For more information: [[https:~~/~~/openwrt.org/docs/guide-user/network/wan/wwan/3gdongle>>url:https://openwrt.org/docs/guide-user/network/wan/wwan/3gdongle]]// | ||
238 | |||
239 | |||
240 | ))) | ||
241 | |||
242 | == **5.2 How to use the USB Dongle at the gateway** == | ||
243 | |||
244 | |||
245 | //Most of the products can be used on the gateway, but because their protocols are different, they are not used in the same way.// | ||
246 | |||
247 | ((( | ||
248 | //For example, the Huawei-E3372/E8372 is using **Hilink mode** or **NCM mode**.// | ||
249 | ))) | ||
250 | |||
251 | (% class="box" %) | ||
252 | ((( | ||
253 | Huawei-E3372/E8372 | ||
254 | Check the (% style="color:#037691" %)**E3372**(% style="color:black" %) version to determine the mode. | ||
255 | The version numbers starting with 21 is NCM mode | ||
256 | The version numbers starting with 22 is Hilink mode | ||
257 | The E8372 only has Hilink mode | ||
258 | **~ **(% style="color:red" %)**Note: The e3372 in the vast majority of cases is Hilink mode** | ||
259 | ))) | ||
260 | |||
261 | |||
262 | == **5.3 Hilink mode** == | ||
263 | |||
264 | |||
265 | //Gateway upgrade to the specified firmware:[[Hilink.mode~~-~~-build-v5.4.1625627505>>url:https://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/LG308-LG301/Firmware/USB-Dongle_firmware/Hilink.mode--build-v5.4.1625627505-20210707-1113/]]// | ||
266 | |||
267 | |||
268 | === **5.3.1 Plugs into the device** === | ||
269 | |||
270 | |||
271 | ((( | ||
272 | //USB-Dongle plugs into the gateway USB port// | ||
273 | ))) | ||
274 | |||
275 | ((( | ||
276 | //Check the USB module via command (% style="color:#037691" %)**lsusb**// | ||
277 | ))) | ||
278 | |||
279 | ((( | ||
280 | (% style="color:red" %)//**Note: Users need to that connect to the gateway command line via ssh.**// | ||
281 | ))) | ||
282 | |||
283 | [[image:image-20220527154739-9.png]] | ||
284 | |||
285 | |||
286 | === **5.3.2 Detection of new network interfaces added** === | ||
287 | |||
288 | |||
289 | //Check network configuration command line input: // | ||
290 | |||
291 | (% class="box infomessage" %) | ||
292 | ((( | ||
293 | ((( | ||
294 | root@dragino-1ef9ac:~~# ifconfig -a | ||
295 | ))) | ||
296 | ))) | ||
297 | |||
298 | [[image:image-20220527154822-10.png]] | ||
299 | |||
300 | //In the command, the output user can see that the new interface added is (% style="color:#037691" %)**eth2**// | ||
301 | |||
302 | //Usually, the user can see that the new interface added is (% style="color:#037691" %)**eth2** (% style="color:black" %)or (% style="color:#037691" %)**wwan0**// | ||
303 | |||
304 | |||
305 | === **5.3.3 Add the new interface to the network configuration.** === | ||
306 | |||
307 | |||
308 | //Enter the configuration from the command line~:// | ||
309 | |||
310 | (% class="box" %) | ||
311 | ((( | ||
312 | uci set network.lte=interface | ||
313 | uci set network.lte.proto=dhcp | ||
314 | uci set network.lte.ifname=eth2 ~-~-~-~-~-~-~-~-->#This depend on the name of the new interface gateway add | ||
315 | uci commit network | ||
316 | uci set firewall.@zone[1].network="wan wwan wan6 lte" | ||
317 | uci commit firewall | ||
318 | /etc/init.d/network restart | ||
319 | ))) | ||
320 | |||
321 | [[image:image-20220527154937-11.png]] | ||
322 | |||
323 | |||
324 | //**Checking Network Configurations**// | ||
325 | |||
326 | //Command-line input: (% style="color:#037691" %)**ifconfig**// | ||
327 | |||
328 | [[image:image-20220527155013-12.png]] | ||
329 | |||
330 | //Now, Gateway is configured to access the internet on the LTE network.// | ||
331 | |||
332 | |||
333 | == **5.4 NCM mode** == | ||
334 | |||
335 | |||
336 | == **5.5 Troubleshooting** == | ||
337 | |||
338 | |||
339 | === **5.5.1 The USB-Dongle interface cannot obtain the IP address.** === | ||
340 | |||
341 | |||
342 | //Please try this USB dongle to access the internet on your PC, to make sure this USB dongle can normally access the internet.// | ||
343 | |||
344 | |||
345 | = **6. How to reduce data traffic** = | ||
346 | |||
347 | |||
348 | == **6.1 Introduce** == | ||
349 | |||
350 | |||
351 | **//The gateways will use the data traffic below two places.//** | ||
352 | |||
353 | |||
354 | //1. There is the data traffic from LoRa package Forward which were the gateway status package and sensor end node uplink/downlink.// | ||
355 | |||
356 | //For this case, by default, the gateway will uplink self-status to the LoRaWAN server per the 30s. the users can adjust the interval time.// | ||
357 | |||
358 | [[image:image-20220527155108-13.png]] | ||
359 | |||
360 | |||
361 | //2. There is the data traffic from the gateway check self-network status. by default, the gateway will check the network per 15s.// | ||
362 | |||
363 | //For this case, We have monitored the loss of data traffic, which is the loss of 2M data traffic per day. the users can adjust the interval time following screenshots.// | ||
364 | |||
365 | [[image:image-20220527155358-16.png]] | ||
366 | |||
367 | //System General interface// | ||
368 | |||
369 | |||
370 | [[image:image-20220527155229-15.png]] | ||
371 | |||
372 | //Keepalive script interval time settings// | ||
373 | |||
374 |