Page 1
USR-EG828 Technical Manual Open Source Controller Technical Manual USR-EG828 V2.0 Be Honest & Do Best Your Trustworthy Smart Industrial IoT Partner .pusr.com...
1. Introduction This document primarily provides an explanation of the hardware and software interfaces used in the USR- EG828 product, facilitating users to quickly adapt the product after acquisition. The USR-EG828 comes with a standard Linux Ubuntu 20.04 system. 2. Hardware Interface Description 2.1.
Page 4
USR-EG828 Technical Manual #include <termios.h> #include <stdbool.h> int UART_INIT(char uart_num) serial_port =0; (uart_num 0)//rs485 初始化 serial_port open("/dev/ttyS1", O_RDWR O_NOCTTY O_NDELAY); else serial_port open("/dev/ttyS3", O_RDWR O_NOCTTY O_NDELAY); (serial_port < 0) { printf("Error from open: %s\n", errno, strerror(errno)); return // Create new termios struct, we call it 'tty' for convention struct termios tty;...
Page 5
USR-EG828 Technical Manual tty.c_iflag &= ~(IXON IXOFF IXANY); // Turn off s/w flow ctrl tty.c_iflag &= ~(IGNBRK BRKINT PARMRK ISTRIP INLCR IGNCR ICRNL); //IGNBRK | PARMRK // Disable any special handling of received bytes tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) tty.c_oflag...
USR-EG828 Technical Manual usleep(10); // Delay for 1 second // Close the serial port close(port485_fd); close(port232_fd); return 2.2. CAN interface The interface pin spacing of CAN interface is 3.81MM, interface identification is can0. Definition Attribute Description CAN_L Output CAN_H Output...
USR-EG828 Technical Manual 2.4. WiFi interface The EG828 has a built-in WiFi module for direct WiFi connection. WiFi connection operations can be performed directly after powering on and logging into the desktop, or connected using Linux commands. Command Description Search for WiFi hotspots...
-ne "at+qgps=1\r\n" > /dev/ttyUSB2 Enable GPS function cgps -s Check positioning information Note: The GPS function is supported by USR-EG828-GL only. The specific steps: 1. Install GPSD Client:apt-get install gpsd gpsd-clients 2. Modify GPS interface information: enter gpsd file using vim /etc/default/gpsd 3.
Page 9
USR-EG828 Technical Manual 4. Before enabling GPS, first confirm that the command channel is clear by executing the cat /dev/ttyUSB2 command to check if the channel is open. If you receive an echo of the command, it indicates that it is functioning properly. At this point, exit to the command mode.
USR-EG828 Technical Manual 2.6. IO interface The EG828 has built-in IO interfaces, supporting DI, DO, and AI interfaces. The default configuration is 2 DO, 4 DI, and 4 AI, with each AI supporting voltage and current detection. The IO interface is controlled through the serial port, identified as ttyS8.
Page 11
USR-EG828 Technical Manual (Hex) 0000 ~ 0003 ON:0xFF00 0000 ~ 0001 01/05/0F OFF:0x0000 32 Bit Unsigned 0000 ~ 0006 (AB CD) 32 Bit Unsigned 0010 ~ 0016 (AB CD) The test demo code is as the follows, mainly implementing the 1-second toggling function of the DO (Digital Output) interface.
Page 12
USR-EG828 Technical Manual ((crc & 0x0001) // If the LSB is set >>= // Shift right and XOR 0xA001 0xA001; else // Else LSB is not set >>= // Just shift right return crc; // Note, this CRC calculation is reversed endian to some implementations...
Page 13
USR-EG828 Technical Manual tty.c_iflag &= ~(IXON IXOFF IXANY); // Turn off s/w flow ctrl tty.c_iflag &= ~(IGNBRK BRKINT PARMRK ISTRIP INLCR IGNCR ICRNL); // Disable any special handling of received bytes tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) tty.c_oflag...
USR-EG828 Technical Manual 3.2. Upgrading Ubantu version The product comes with Ubuntu 20.04. To upgrade to the latest version of Ubuntu, use the following commands: Command Function apt-get update Update sources apt-get upgrade Update installed packages apt-get dist-upgrade Handle dependency relationships...
USR-EG828 Technical Manual repository "deb [arch=arm64] https://mirrors.aliyun.com/docker- APT sources ce/linux/ubuntu $(lsb_release -cs) stable" apt-get update Update apt package index again apt-get install docker-ce docker-ce-cli containerd.io Install the latest version of Docker CE (Community Edition) mkdir -p /etc/docker Configure Docker to use tee /etc/docker/daemon.json <<-'EOF'...
USR-EG828 Technical Manual 6. Disclaimer The information in this document provided in connection with Jinan USR IoT technology ltd. and/or its affiliates’ products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of USR IoT products. EXCEPT AS SET FORTH IN THE TERMS...
Need help?
Do you have a question about the USR-EG828 and is the answer not in the manual?
Questions and answers