USR IOT USR-G809 User Manual

USR IOT USR-G809 User Manual

Opencpu
Hide thumbs Also See for USR-G809:

Advertisement

Quick Links

User Manual of OpenCPU
USR-G809 OpenCPU User Manual
Build a Smarter IoT world, Your Trustworthy Partner
www.pusr.com
1
Your Trustworthy Industrial IoT Partner

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the USR-G809 and is the answer not in the manual?

Questions and answers

Summary of Contents for USR IOT USR-G809

  • Page 1 User Manual of OpenCPU USR-G809 OpenCPU User Manual Build a Smarter IoT world, Your Trustworthy Partner www.pusr.com Your Trustworthy Industrial IoT Partner...
  • Page 2: Table Of Contents

    User Manual of OpenCPU Content 1. Brief introduction of USR-G809 ........................- 2 - 1.1. Hardware specification ........................- 2 - 1.2. Interface ............................- 4 - 1.3. Hardware resources ........................... - 4 - 1.3.1. The description of indicator lights ....................- 4 - 1.3.2.
  • Page 3: Brief Introduction Of Usr-G809

    1. Brief introduction of USR-G809 USR-G809 is an industrial 4G router gateway that integrates 4G LTE, DIDO, serial, Ethernet ports (4LAN and 1WAN), and other interfaces. It combines 4G router, serial server, and IO control, making it a fully featured LTE router designed specifically for mission-critical IIoT applications.
  • Page 4 User Manual of OpenCPU Working power Average 522mA/12V, Maximum 811mA/12V industrial terminal block. RS485/RS232(alternative) Note:RS232 default. Baud rate(bps) 1200,2400,4800,9600,19200,38400,57600,115200,230400 Serial Interface Data bits Stop bits Parity NONE,ODD,EVEN Housing Metal shell,IP30 125.0*103.0*45.0mm (L*W*H, antenna pedestal, terminal block and DIN Dimensions Rail are not included) Installation method Ear mounting, DIN-Rail mounting Physical...
  • Page 5: Interface

    User Manual of OpenCPU 1.3. Interface 1.4. Hardware resources 1>The main control chip is MT7620A, with 128M memory and 32M storage. 2>It has 1*100M WAN port, 4*100M LAN ports, and supports 5G WIFI (reserved) compatible with MT7612E and mainstream 4G modules. 1.4.1.
  • Page 6: Led Pin Definitions

    User Manual of OpenCPU Always on after connecting to the network. Two colors indicate 4G network, green indicates 3G and red indicates 2G. SIG(1-3) Signal strength indicator, the more lights on, the stronger the signal. 1.4.2. LED pin definitions 1.4.3. Terminal definitions Terminal interface Description V+,V-...
  • Page 7: Lte Module Pin Definitions

    User Manual of OpenCPU 1.4.4. definitions Digital_IO 1.4.5. LTE module pin definitions 1.4.6. UART Level 3.3V Band rate 57600 Data bits Parity None Stop bit Flow control None 2. Environment preparation 1>Install a Linux environment, such as the Ubuntu system, switch to the root user, and install software package dependencies.
  • Page 8: Sdk Configuration

    3. SDK Configuration 3.1. Configuration file 3.1.1. Use the configuration file provided by USR Copy package/USR/configs/USR-G809.config into the root directory of the SDK, and rename it as .config. Alternatively, you can load the package package/USR/configs/USR-G809.config by selecting Load in make menuconfig.
  • Page 9: Firmware Compilation

    User Manual of OpenCPU 4. Firmware compilation Run make V=s to compile. Note: After the first successful compilation, you can add "-jxx" after "make" to specify xx threads for simultan eous compilation, such as "make -j32 V=s". The compiled bin file is located in the directory: bin/targets/ramips/mt7620/. The complete firmware file is: openwrt-ramips-mt7620-usr_usr-g809-squashfs-sysupgrade.bin.
  • Page 10 2>To use tftpd32 to open the TFTP service and access the firmware directory. 3> Connect the USR-G809 to the computer via an Ethernet cable, either directly or through the same LAN. 4>Use a USB-TTL serial cable (supporting 3v3) to connect to the debug serial port of the device. Power on the device and quickly enter the number "2"...
  • Page 11 User Manual of OpenCPU www.pusr.com - 10 - Your Trustworthy Industrial IoT Partner...
  • Page 12: Sdk Introduction

    Feeds—-This directory contains the package feeds for OpenWrt. Bin--After compilation, the firmware and “ipk” files will be placed in this directory. 6.2. SDK Introduction of USR-G809 This SDK is based on the official OpenWrt v22.03.03 and adds the USR's programs in the package/USR www.pusr.com...
  • Page 13 Quectel, please refer to the Quectel official documen quectel-CM tation for more details. The following are the source code directories for reference: package/USR/ ├── configs │ ├── USR-G809.config │ └── USR-G809.config.old ├── kernel │ ├── GobiNet │...
  • Page 14: Introduction Of Usr Demo Program

    User Manual of OpenCPU ├── files │ └── usr_digital_io.sh └── Makefile 6.3. Introduction of USR demo program: 6.3.1. DTU demo program 6.3.1.1. Function The DTU connects an external MCU through an internal extended serial port (ttyS0), and the MCU provides a external serial port for serial data exchange.
  • Page 15 User Manual of OpenCPU Enable or forbidden sa_enable ON: enable OFF: forbidden Source code directory libusrdtu/ including configuration file and startup scripts ├── files configuration file │ ├── usr_dtu startup scripts │ └── usr_dtu_service for OpenWrt compilation ├── Makefile source file and └──...
  • Page 16 User Manual of OpenCPU * @modification: none *********/ int usrdtu_destroy(int fd_serial); /********* receive data, non-blocking * @brief: descriptor of serial file, * @param: fd: created by usrdtu_create() * @param: data: buffer for storing data length of * @param: len: buffer for storing data reading data length if failed, return * @return:...
  • Page 17 User Manual of OpenCPU www.pusr.com - 16 - Your Trustworthy Industrial IoT Partner...
  • Page 18: Dialnet Dialing Demo Program

    2>Modify the DTU‘s parameter configuration file, turn on TCP, and configure the address and port to the server 's address and port. 3>Computer and USR-G809 are connected via USB to 232 serial cable,and open the “UartAssist”. 4>Restart the DTU_demo program: /etc/init.d/usr_dtu_service restart 5>Check whether the device is connected.
  • Page 19 User Manual of OpenCPU ├── Makefile └── src //gpio control ├── gpio_opt.c ├── gpio_opt.h ├── Makefile //dial-up program └── usr_dialnet.c cellular_config This includes the configuration of the APN parameters. The built-in webpage can write the configuration to the file, and the program reads the configuration file parameters when it starts.
  • Page 20 User Manual of OpenCPU char tmp_buf[128]; memset(tmp_buf, 0, strlen(tmp_buf)); shell_get_for_single("uci get cbi_file.APN.name", tmp_buf, sizeof(tmp_buf)); if (0 == strlen(tmp_buf)) return 0; else memcpy(modem.apn.name, tmp_buf, strlen(tmp_buf)); memset(tmp_buf, 0, strlen(tmp_buf)); shell_get_for_single("uci get cbi_file.APN.usr", tmp_buf, sizeof(tmp_buf)); if (0 == strlen(tmp_buf)) return 0; memcpy(modem.apn.user, tmp_buf, strlen(tmp_buf)); memset(tmp_buf, 0, strlen(tmp_buf));...
  • Page 21 User Manual of OpenCPU dialnet_setval(LED_MODE1, LED_OFF); break; case LTE_MODE_3G: // 3G dialnet_setval(LED_MODE0, LED_OFF); dialnet_setval(LED_MODE1, LED_ON); break; case LTE_MODE_4G: // 4G dialnet_setval(LED_MODE0, LED_ON); dialnet_setval(LED_MODE1, LED_ON); break; default: // others dialnet_setval(LED_MODE0, LED_OFF); dialnet_setval(LED_MODE1, LED_OFF); break; LED of gpio void module_signal_led_control(int signal) ..The G809 currently supports two cellular modules, and the dialing process for these two modules differs slig htly.
  • Page 22 User Manual of OpenCPU shell_get_for_single("lsusb | grep 19d2:0579", s_usb_list_buf, sizeof(s_usb_list_buf)); (strlen(s_usb_list_buf) > 0) return G405TF; return -1; After getting the module type, execute the corresponding resident network code according to the type. Dial-up and network link maintenance are implemented using state machines, and the state definitions are as follows: typedef enum EFINDUSBSTA = 0,...
  • Page 23 User Manual of OpenCPU Introduction to the Successful Network Residency Process 1. Enter the EFINDUSBSTA state, waiting for the recognition of the AT port ttyUSB. 2. Enter the EINITMODEL state, mainly initializing the serial port read-write file descriptor and turning on the RF switch.
  • Page 24 User Manual of OpenCPU 9. Enter the EGETNETSTA state. This step will cyclically detect network attachment status, IP status, DNS status, network mode, and signal value. When the network link status is abnormal, the module will be reset, and then dial-up will be performed again. 10.
  • Page 25: Usb Mounting

    User Manual of OpenCPU 6.3.3. USB mounting 6.3.3.1. Configuration of make menuconfig Add USB support Kernel modules —> USB Support —> <*> kmod-usb-core. ## the default <*> kmod-usb-ohci. ## the default is old usb1.0 <*> kmod-usb-uhci. ## usb1.1 <*> kmod-usb-storage. <*>...
  • Page 26 Save and exit. Make V=99 6.3.3.2. Add automatically mount scripts of U drive. Create a file named 11-external_storage_mount under target/linux/ramips/mt7620/base- files/etc/hotplug.d/block/ and write the following content: #!/bin/ash board=$(board_name) case "$board" usr,usr-g809) case "$ACTION" add) $(ls /dev/ | grep 'sd[a-z][1-9]') mkdir -p...
  • Page 27: Instruction Of Digital_Io Program(Package/Usr/Utils/Usr_Digital_Io)

    User Manual of OpenCPU List the content of /mnt/sda1 dictionary. 6.3.4. Instruction of digital_io program(package/USR/utils/usr_digital_io) 1.The digital_io demo program is used to demonstrate the usage of the DI/DO interface. The DI interface is us ed to receive external high/low level signals, while the DO interface is used to connect/disconnect the COM interface.
  • Page 28 User Manual of OpenCPU 3.The pins used for DO have been defined in the dts file. Specifically, dout0-ctl corresponds to D01 and dout1-ctl corresponds to DO2. The connection to COM for DI1 and DI2 can be configured by writing to th e files /sys/class/gpio/dout0-ctl/value and /sys/class/gpio/dout1-ctl/value.
  • Page 29 User Manual of OpenCPU It is controlled by two GPIO pins which have been configured as an LED indicator in the dts file. Specifically, red:usr0 corresponds to LED_USR1, green:usr1 corresponds to LED_USR2. The status of the LED indicator can be obtained and controlled by reading/writing to the files /sys/class/leds/red:usr0/brightness and /sys/class/leds/green:usr1/brightness.
  • Page 30: Explanation Of Modifications Based On Openwrt

    SOC := mt7620a #Name of DTS file Size of firmware IMAGE_SIZE := 32448k Provider DEVICE_VENDOR := USR Device’s model DEVICE_MODEL := USR-G809 DEVICE_VARIANT := 32M #Size of flash needed DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci packages of the device SUPPORTED_DEVICES += usr-g809...
  • Page 31: How To Add A Package (Using Libusrdtu As An Example)

    User Manual of OpenCPU Add rtc clock. &i2c { gpios <&gpio0 1 GPIO_ACTIVE_LOW &gpio0 2 GPIO_ACTIVE_LOW>; status = "okay"; pcf8563@51 compatible = "nxp,pcf8563"; = <0x51>; Enable extended serial port. /* Configure the control serial port as ttyS1 */ chosen { bootargs = "console=ttyS1,57600";...
  • Page 32: Analysis Of File Structure

    User Manual of OpenCPU 7.1. Analysis of file structure The configuration file is copied to the /etc/config/ directory on the device from the top- level Makefile, and is available for application programs to call. config uart2 'uart2' option parity 'NONE' option data option stop...
  • Page 33 User Manual of OpenCPU usleep 100000 let cnt=cnt+1 if [ $cnt -ge 15 ]; then ps | grep dtu_demo | grep -v grep | awk 'NR==1{print $1}' | xargs kill -s 9 break done Src directory: The files in this directory mainly consist of source code for the application program. The Makefil e in this directory is responsible for compiling the source code into an executable file.
  • Page 34 User Manual of OpenCPU endef #Copy the source code files that are not in this directory to the corresponding directory. such as ../../xucommon/xucommon.c, copy xucommon.c to the source code ../../ in this directory define Build/Prepare mkdir -p $(PKG_BUILD_DIR) $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Build/Configure endef...
  • Page 35 User Manual of OpenCPU Package/$(PKG_NAME)/prerm [Script to be executed before deletion. Remember to include #!/bin/sh. If not, leave it blank] endef Package/$(PKG_NAME)/postrm [Script to be executed after deletion. Remember to include #!/bin/sh. If not, leave it blank] endef $(eval $(call BuildPackage,$(PKG_NAME))) After the package is prepared, you can execute "make menuconfig"...

Table of Contents