4G

This article guides readers on configuring 4G modules on the Edge101 mainboard, explaining the PCIe pinout and providing example code for network time synchronization using an ESP32 controller.

8.8 4G

The Edge101 mainboard does not come with a 4G module pre - installed, but it supports the installation of wireless modules such as 4G modules.

The PCIe pinout for wireless modules is as follows:

1 WAKEUP_OUT 2 VCC_3.3
3 U_BOOT 4 GND
5 NC 6 NC
7 NC 8 USIM_VCC
9 GND 10 USIM_DATA
11 VDD_EXT 12 USIM_CLK
13 NC 14 USIM_RST
15 GND 16 NC
17 NC 18 GND
19 WAKEUP_IN 20 NC
21 GND 22 RESET_IN
23 UART_RXD 24 VCC_3.3
25 UART_RTS 26 GND
27 GND 28 UART_CTS
29 GND 30 NC
31 UART_TXD 32 WAKEUP_OUT
33 RESET_IN 34 GND
35 GND 36 USB_DN
37 GND 38 USB_DP
39 VCC_3.3 40 GND
41 VCC_3.3 42 LED_WWAN
43 GND 44 NC
45 NC 46 NC
47 NC 48 NC
49 NC 50 GND
51 NC 52 VCC_3.3

Please refer to this PCIe pinout when configuring other wireless modules.

Example: Fetching Network Time

Hardware Requirements:

Example Code:

/*! 
 * @file setNTP.ino
 * @brief : Network time synchronization example
 * @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
 * @licence The MIT License (MIT)
 * @author [yangfeng]<[email protected]>
 * @version V1.0
 * @date 2021-08-18
 */
#include <DFRobot_AIR720UH.h>
DFRobot_AIR720UH      AIR720UH;

void setup(){
    int signalStrength,dataNum;
    Serial.begin(115200);
    Serial1.begin(115200);
    while(!Serial);
    AIR720UH.begin(Serial1);
    
    // SIM card status check
    Serial.println("Check SIM card......");
    if(AIR720UH.checkSIMStatus()){                               // Check SIM card status
        Serial.println("SIM card READY");
    }else{
        Serial.println("SIM card ERROR, Check if you have inserted SIM card and restart AIR720UH");
        while(1);
    }

    // Signal quality check
    Serial.println("Get signal quality......");
    delay(500);
    signalStrength = AIR720UH.checkSignalQuality();                // Get signal strength
    Serial.print("signalStrength =");
    Serial.println(signalStrength);

    // NTP network time synchronization configuration
    delay(500);
    Serial.println("set NTP ...");
    while(1){
      int data = AIR720UH.setNTP();
      if(data == 1){
        Serial.println("The network time is synchronized successfully!");  // Time synchronization successful
        break;
      }else if(data == 61){
        Serial.println("Network error");                         // Network error
        break;
      }else if(data == 62){
        Serial.println("DNS resolution error");                  // DNS resolution error
        break;
      }else if(data == 63){
        Serial.println("Connection error");                      // Connection error
        break;
      }else if(data == 64){
        Serial.println("Service response error");                // Service response error
        break;
      }else if(data == 65){
        Serial.println("Service response timeout");             // Service response timeout
        break;
      }else{
        Serial.println("set error");                             // Unknown error
      }
    }
}

void loop(){
  // Continuously fetch and display the network time
  char *buff = AIR720UH.getCLK();
  if(buff != NULL){
    Serial.println(buff);  // Output format example: 2021/08/18 14:30:45
  }
}

Was this article helpful?

TOP