Edge Computer EC950 Series
User's Manual
(Compatible with Debian 11, IEOS V2.0.0 and above versions)
Version 2.0, January 2024
The software described in this manual is according to the license agreement, can only be used in accordance with the terms of the agreement.
Copyright Notice
© 2024 InHand Networks All rights reserved.
Trademarks
The InHand logo is a registered trademark of InHand Networks.
All other trademarks or registered trademarks in this manual belong to their respective manufacturers.
Disclaimer
The company reserves the right to change this manual, and the products are subject to subsequent changes without prior notice.We shall not be responsible for any direct, indirect, intentional or unintentional damage or hidden trouble caused by improper installation or use.
This user manual is applicable to the Edge Computer EC954 series based on Arm architecture, and covers a complete set of instructions applicable to all supported models. Before referring to these chapters, please confirm if the hardware specifications of your computer model support the features/settings covered.
In this chapter, we will introduce the hardware installation instructions of the edge computer EC954 series based on Arm structure.
The following chapter takes the EC954 series as an example to describe the application of external connectors and pin assignments in the EC954 series.
Top panel
Front panel
These are four RJ45 connectors for Ethernet connection
EC954 has four RJ45 Ethernet ports and supports 10M/100M/1000M adaptive rates.
Green light: The LINK indicator light is on for a long time when the peer device has a 1000M interface, and off for a long time when the peer device has a 10/100M interface.
Yellow light: ACT light, flashing when there is data
EC954 supports 8 serial ports, with the first 4 channels supporting RS-232, RS-485, or RS-422 communication. The software is configurable, and the last 4 channels are fixed to RS-485
|
|
|||
|
|
EC954 has a 2-way CAN bus interface and supports the CAN 2.0A/B standard, and can reach a maximum speed of 5Mbps.
|
|
|||
|
|
EC954 provides two USB 2.0 Host interfaces.
EC954 has 12 LED lights that respectively indicate the power supply and system operation status.
|
When selecting SIM card 1 for dialing, it always lights up. When selecting SIM card 2 for dialing or turning off dialing, it stays off. |
||
|
See instructions for cellular network signal strength indicator lights |
||
Cellular network signal strength indicator light
In addition to the combination of L1, L2, and L3 signal lights to indicate cellular signal strength, there is also a set of LED combinations to indicate the process of factory restoration.
After restoring the factory settings, the system will undergo a restart. After the restart is completed, the factory reset is not complete. At this time, the WARN light and ERROR flash, and the STATUS goes out. In this state, the device cannot be powered off, otherwise it may cause some files to be lost and affect system functions. This state will last for 30 seconds. After the factory is restored, WARN and ERROR will turn off, and STATUS will flash.
EC954 provides an API interface, which users can call to detect the status of programmable buttons and then implement their own button logic.
EC954 supports 12-48V DC input
EC954 supports 2 SIM card slots. SIM cards need to be installed in a power-off state. Simply press and insert the SIM card into the slot.
EC954 has a MircoSD card slot, and SD does not support hot swapping. It needs to be plugged and unplugged in the event of a power outage. After inserting the SD card and powering on the device, the system will automatically mount all partitions.
There is a reset button for restoring the system to factory settings. Refer to "Restore Factory Settings" for operation.
EC954 is equipped with an on/off button for power on/off.
EC954 has a total of 7 antenna interfaces, and the number of antennas standard for different models varies. The antennas are screwed into the corresponding antenna interfaces to complete antenna installation.
EC954 supports mSata hard drives, which are not included by default at the factory. If users have high-capacity storage needs and need to purchase their own mSata hard drives, they can also consult InHand to purchase mSATA.
In this chapter, we will introduce the basic configuration of the Edge Computer EC900 based on the Arm structure.
You need a computer to connect to EC900 and log in to the command line interface. It can be connected through an Ethernet cable.
Factory default username and password:
Username: edge
Password: security@edge
EC900 devices default to creating root at the factory, but login is disabled. If you need to use the root user, please manually modify the system configuration and enter sudo - s to switch to the root user. The user edge is in the sudo group, so you can use sudo to execute system level commands under the edge user. For other details, please refer to the sudo mechanism section in Chapter 5.
Prompt
When the command not found appears, enter sudo - s to switch to the root user or use the sudo command to operate.
Take care
For security reasons, we recommend that you disable the default user account and create your own user account.
EC900 supports SSH connection through Ethernet. Connect to EC900 using the following default IP address.
Prompt
These steps apply to connecting to EC900 on a Linux PC. Please do not apply these steps to the EC900 device itself. Before running the ssh command, make sure to configure the Ethernet port IP address of the PC within a specific range. ETH1: 192.168.1.0/24, ETH2: 192.168.4.0/24, ETH3: 192.168.5.0/24, ETH4: 192.168.6.0/24.
Use the ssh command on a Linux PC to access the ETH1 port of EC900.
Enter yes to continue connecting.
When the interface displays the terminal prompt `edge@edge-computer:~$`, indicating that shell commands can be entered, the connection is successful.
Prompt
These steps apply to connecting EC900 on a Windows PC. Please do not apply these steps to the EC900 device itself.
Please take the following steps on your Windows PC
Click on the link http://www.chiark.greenend.org.uk/ ~Sgtatham/putty/download.html, download PuTTY (free software), and establish the connection with the edge computer EC900 in the way of SSH command in the Windows environment. The following figure is an example of using SSH connection:
You can use the command sudo - s to switch to the root user. For security reasons, do not operate all commands under root privileges.
Prompt
Click on the link to get more information about the sudo command.
Take care
You may receive a permission denied prompt when using certain pipes or redirection behaviors without root privileges. In this case, you must use 'sudo su - c' instead of commands such as'>','<','>>','<<',' etc ', and include single quotes for the complete command.
You can use the useradd and userdel commands to create and delete user accounts. Please make sure to use these commands on the main interface to set the relevant access permissions for this account. Here is an example of how to create test1 in the sudo group (the default login environment for test1 users is bash, and their home directory is/home/test1)
Change the password for test1, use the passwd command, enter the new password, and then repeat the process to confirm the change
If you want to delete user test1, use the command userdel
Take care
Before disabling the default account, you should first create a user account
Use the passwd command to lock the default user account and prevent edge users from logging in
Unlocking edge users
EC954 is based on the Debian 11 system, so it can use native Linux commands for network and system management; In order to facilitate user configuration, InHand has developed an IEOS system program that provides a web interface, allowing users to easily manage networks and systems through the web. However, it should be noted that when the IEOS function is enabled, IEOS will take over network and system management. At this time, using Linux native commands for network and system management may become ineffective; IEOS is enabled by default at the factory of the device. If users need to perform network and system management based on Linux native command lines, they need to first disable IEOS.
IEOS is a network management and system management program developed by InHand that runs on Linux systems. IEOS provides a web interface, allowing users to configure Ethernet IP addresses, cellular dialing, Wi Fi Station, DHCP Client/Server, static routing, firewalls, and other network configurations through the web; You can also perform operations on system time, time zone, firmware upgrades, and system restarts; In addition, IEOS also supports integration with InHand's device management platform DeviceLive, allowing users to remotely monitor and manage EC954 devices through the DeviceLive platform.
IEOS adopts a design scheme that separates state and configuration, divided into three functional modules: network management, system management, and state. Only network and system related configurations can be performed under the network management menu and system management menu, and status information needs to be viewed uniformly on the status page.
Important note: When using the IEOS program to manage network and system configurations, if Linux native commands are used at the same time, the two may affect each other, leading to abnormal running states. It is recommended that the configurations supported by IEOS be managed through the IEOS web. For configurations not supported by IEOS, such as VPN, the configuration goals can be achieved by combining native Linux commands.
Considering that the user's program may require the use of HTTP/HTTPS standard port number 80/443, IEOS uses port number 9100 as the port for HTTPS connection and does not support access through HTTP; When users access the web using HTTP, they will automatically redirect to using HTTPS. This document takes the default address 192.168.4100 through eth2 as an example for explanation. After entering 192.168.4100:9100 in the browser, the user will be redirected to the login page
Important note: When the IEOS program is enabled, some port numbers will be reserved for internal communication, with a reserved port number range of 9100 to 9200. After enabling IEOS, customer programs should avoid using these port numbers, otherwise conflicts may occur and functional abnormalities may occur.
Configure static IP addresses for the eth1 interface
Configure DHCP Client for eth1 interface
Start the dhcp server function on the eth1 interface and assign addresses to the underlying devices of eth1
DHCP Server configuration parameter description:
Enable DHCP Server: Switch for DHCP Server functionality
Starting Address: The starting base address of the DHCP Server address pool, where network segment+starting address=the starting IP address of the address pool. In the screenshot, the network segment of eth1 is 192.168.1.0/24, and the base address is 1, so the starting address of the address pool is 192.168.1.1/24
Max Address Number: The maximum number of
addresses in the address pool
Cellular network parameter description:
Enable: switch for cellular function; The default is the enabled state.
APN Profiles: A set of dialing parameters used to configure APN, username, password, and authentication method information when dialing with a dedicated network card. If it is not a dedicated network card, there is usually no need to modify the configuration here. The dialing parameter set can add up to 10 records.
Network Mode: The cellular network format, which can choose from 3G, 4G and other related network formats, such as LTE, WCDMA, etc. If it is unclear which network standard to choose, choose automatic; The program will automatically select the most suitable network format. The default value is automatic.
Enable Default Route: Enable the add default route function. When enabled, a default route for the cellular port will be added after successful dialing. It is enabled by default.
Metric: The metric value of the default routing for cellular ports. When default routing is configured for cellular, Wi Fi, and Ethernet ports, the metric with the smallest value takes effect.
Dual SIM enabled: enables the dual SIM feature. EC954 supports dual card single dial to improve network reliability. Two SIM cards need to be inserted into the device. After enabling this function, if the SIM card 1 fails to dial due to arrears, it will automatically switch to the SIM card 2 for dialing. The default is off.
Main SIM: The main SIM card will prioritize the selected SIM card for dialing. When dialing fails a certain number of times, it will switch to another SIM card for dialing. By default, sim1 will be used for dialing first.
Max Number of Dials: After enabling the dual SIM single dial function, if the current SIM card reaches the specified number of dials, switch to another SIM card for dialing.
APN Profile: The dialing parameter set selected by the SIM card, with the default value being automatic. Usually, a dedicated network card needs to configure a dial-up parameter set and select the Index of the dial-up parameter set here.
PIN Code: The PIN code of the SIM card.
Wireless cellular networks are quite complex, and sometimes there may be false dial-up connections, where the dial-up status is successful but the target address cannot be pinged; When these situations occur, dialing again can restore normal operation. IEOS cellular dialing supports ICMP detection to detect fake connections. It is recommended that customers using cellular networking enable ICMP detection, so that when false connections occur, they can quickly recover.
ICMP detection parameters:
ICMP Detection Server Probes: ICMP detection address; Two detection addresses can be configured, and as long as one address is successfully detected, it indicates that there is no false connection in the cell. When both addresses are not configured, the ICMP detection function is turned off.
Detection Interval: How often should ICMP detection be conducted.
Detection Timeout: The ICMP detection timeout period. If no detection response message is received after waiting for a long time, it is considered that the detection has failed
Detection Max Retries: Maximum number of detections; When the detection fails and reaches this value, trigger a redial. Value range [1,5]
Detection Strict: Whether strict detection is enabled. When strict detection is turned off, the detection program will detect whether the messages received by the cellular interface have changed during each detection cycle. If there are changes, it indicates that the cellular network is connected, and ICMP messages will not be sent for detection, which can save some traffic; If detection is enabled, ICMP detection messages will be periodically sent regardless of whether the number of messages received by the cellular interface has changed. The default is off.
In advanced configuration, there are some uncommon setting options.
Debug Mode enabled: Whether to enable the debug function. After enabling it, some dial-up related debugging information will be added to the log, which is disabled by default.
Enable Infinitely Redial: Enable infinite redial. In some cases, dialing may be in an abnormal state and can be restored to normal by restarting the system; The default infinite redial is turned off. After a certain number of failed dials, the system will restart to try to recover. Due to dialing being enabled by default, some customers may fail to dial without inserting a SIM card, and the system may restart. In this case, unlimited redial can be enabled; This way, no matter how many times the dialing fails, the system will not restart.
Dial Interval: Dialing interval; But the time to wait before proceeding to the next dial when a dial fails.
Signal Query Interval: Signal query interval. When the signal is poor, false connections may occur; At this point, there is a certain probability that redialing can solve the problem of fake connections. The dial-up program will regularly check the signal strength, and the signal detection cycle is configured here.
Enable Wi Fi: enable switch; Default Off
Client SSID: The ssid that needs to be connected, which can be manually entered; You can also obtain nearby accessible ssids by scanning the button
Enable Default Route: Whether to enable the add default route function. When enabled, a default route for the WLAN port will be added after a successful WiFi connection. It is enabled by default.
Metric: The metric value of the default routing for WiFi ports. When default routing is configured for cellular, Wi Fi, and Ethernet ports, the metric with the smallest value takes effect.
Auth Method: Authentication method, supports no authentication, WPA-PSK, WPA2-PSK, WPA-PSK/WPA2-PSK Mixed
Encrypt Mode: encryption method; Supports CCMP, TKIP, TKIP, and CCMP
WPA/WPA2 PSK Key: Key information
The configuration here is for static routing of Ethernet. When default routing of Ethernet, cellular, and WiFi is configured simultaneously, the default routing with the lowest metric value takes effect. It is necessary to ensure that the metric value of the default route is different.
Static routing configuration parameters:
Interface: The outbound interface for static routing
Target: Target network
Netmask: Target Netmask
Gateway: Next hop address
Metric: The metric value of static routing
Currently, only the iptables command is supported for configuration.
DNS servers: DNS server addresses, supporting up to 4 configurations
Domain name hijacking: Domain name hijacking function, which can achieve binding between IP addresses and domain names.
Network diagnosis supports ping, traceroute, and nslookup functions.
Cloud management
Enabled: an enable switch for docking with the DeviceLive platform; DeviceLive is a remote monitoring and management platform for InHand devices;
Cloud Server: DeviceLive platform has 2 addresses; One is the address of the domestic platform, and the other is the address of the overseas platform; Choose which platform to connect to here.
Time zone and NTP client
Up to 10 NTP server addresses can be configured, and the program periodically sends synchronization requests to each server address in sequence. After successful synchronization, the system time is written to the RTC and synchronization requests are no longer sent to subsequent NTP servers.
In addition to using NTP to synchronize time, there is a synchronization button on the Device Info status page that allows for manual synchronization of time. However, this synchronization button is only displayed when the device time and local time (the time of accessing the computer used by the device) differ by more than 3 seconds.
Here, configuration import, export, and factory recovery are supported.
The automatic restart option is disabled by default. After upgrading the firmware, the system needs to be manually restarted to take effect; After enabling the automatic restart option, the system will automatically restart after a successful firmware upgrade.
This page has two functions: system restart and system reset. Resetting the system requires careful use. Resetting the system function will restore the configuration and file system status of the system to be consistent with the factory settings, which means that the software installed by the user will also be cleared.
The device information status page displays the host name, device model, serial number, firmware version, kernel version, file system version, as well as an overview of CPU, memory, and disk space usage.
The cellular dialing status page displays the SIM card, IMEI, IMSI, ICCID, signal strength, as well as the IP address, DNS, and other information obtained during dialing.
The Wi-Fi status page displays the IP address, gateway, and DNS information obtained after a successful Wi Fi connection.
The DHCP Server status page displays the IP address, client host name, client host MAC, and expiration time assigned to the device as a DHCP Server.
The routing status page displays information such as IPv4 direct routing, static routing, and routing neighbors.
The firewall status information displays filtering rules, IP address mapping rules, and other information.
The log page can view system logs, user logs, and set the level of logs to be viewed, including Error, Info, Debug, and other levels. Logs can also be downloaded locally.
When using the Linux command line for network and system configuration, the first step is to close the IEOS program. IEOS is managed through system ctl,
The way to close IEOS is as follows:
Systemctl stop ieos_daemon
This shutdown only takes effect for this startup. Even after the system restarts, the IEOS program will still start. The way to prevent the IEOS program from starting up is as follows:
Systemctl disable ieos_daemon
Important note: After disabling IEOS, wireless networking functions such as dial-up and Wi Fi require users to implement them based on native Linux commands, and it is also impossible to remotely manage devices through the DeviceLive platform.
If you want to set a static IP address for EC954, modify the corresponding network configuration file by using the commands vim/etc/network/interfaces. d/eth1 or vim/etc/network/interfaces. d/eth2 to set the default gateway, address, network, and subnet mask for the Ethernet interface. Here is an example of setting a static IP for the eth2 port:
After modifying the interface IP configuration, execute/etc/init.d/networking restart to restart the network service and make the configuration effective.
If you want to set a dynamic IP address for EC954, modify the corresponding network configuration file by using the command vim/etc/network/interfaces. d/eth1 or vim/etc/network/interfaces. d/eth2, and set it to DHCP after inet to automatically obtain the IP address.
Here is an example of setting a dynamic IP for the eth1 port.
After modifying the interface IP configuration, execute/etc/init.d/networking restart to restart the network service and make the configuration effective.
To check the computer firmware version of EC954, please type:
By adding the - a option, you can see the complete version information:
To determine the amount of available drive space, use the df command with the - h option. The system will return the amount of drive space decomposed by the file system. The available disk partition for users in EC954 product is/dev/mmcblk0p8. Here is an example:
The devinfo tool can view product model information
EC954 has two time settings. One is the system time, and the other is the RTC (Real Time Clock) time maintained by the hardware of EC954. Use the date command to query the current system time or set a new system time. Use the hwclock command to query the current RTC time or set a new RTC time.
Use the command date MMDDhhmmYYYY to set the system time:
MM: Month
DD: Day
Hh: hour
Mm: minutes
YYYY: Year
The following command can be used to set the RTC time to system time
Click on the following link to obtain more detailed information about dates and times:
https://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html
https://wiki.debian.org/DateTime
There are two methods to configure the time zone of EC954. One is to use the command tzselect. Another option is to use the/etc/localtime file.
After typing the tzselect command, you will enter the region selection interface. First, select the approximate region (divided by continent or ocean) and enter the number in front of the continent or ocean
Choose another country under that continent or ocean
Follow the above steps to obtain the Chinese time zone keyword Asia/Shanghai, and execute the following command to set the time zone
The local time zone is stored in/etc/localtime, and if no value is set for the TZ environment variable, it is used by the GNU library for C (glibc). This file is either a copy of/usr/share/zoneinfo/file, or a symbolic link pointing to it. If EC954 cannot find the/usr/share/zoneinfo/file, please download the time zone information file you need from the website( https://www.iana.org/time-zones )And re link to the local time file in EC900.
Take care
After successfully downloading the required time zone information file, decompress it, and then use the zic command to compile and generate the corresponding binary file. The generated time zone file is "/usr/share/zoneinfo/custom time zone file name".
In this chapter, we will introduce the advanced configuration of the peripheral interface of the edge computer EC900 based on the Arm structure.
EC954 has 8 serial ports, and the first 4 ports support multiple serial port modes including RS-232, RS-422, and RS-485. The default mode is RS-485, and the ih_uard_ctl command can be used to switch the serial port mode. The last four serial ports are fixed in RS-485 mode.
The device node corresponding to P1 is/dev/ttyCOM1
The device node corresponding to P2 is/dev/ttyCOM2
The device node corresponding to P3 is/dev/ttyCOM3
The device node corresponding to P4 is/dev/ttyCOM4
Viewing and Setting Serial Ports with the STTY Command
View detailed command content by typing sudo stty -- help:
Sudo stty - F /dev/ttyCOM1 ispeed 9600 ospeed 9600 cs8
Sudo stty - F /dev/ttyCOM1 ispeed 9600 ospeed 9600 cs8
Sudo stty - F /dev/ttyCOM3 ispeed 9600 ospeed 9600 cs8
Sudo stty - F /dev/ttyCOM4 ispeed 9600 ospeed 9600 cs8
Take care
Detailed information about the stty command can be found at the following link
http://www.gnu.org/software/coreutils/manual/coreutils.html
EC954 provides two USB 2.0 Host interfaces, mainly used for expanding storage devices, connecting mice and keyboards
EC954 supports hot swapping of USB storage devices. It will automatically mount all partitions. EC954 will partition all USB storage devices and mount them to the/mnt/path. The naming format for the mounting folder is usb1<node>_<num>. Among them,<node>is the device node name of the partition, and<num>can be a number from 0 to 9.
Take care
Before disconnecting a USB mass storage device, remember to enter the sync synchronization command to prevent data loss. When you disconnect the storage device, please exit from the/media/* directory. If you stay in/media/USB *, the automatic uninstallation process will fail. If this situation occurs, please type umount/media/USB * to manually uninstall the device
EC954 supports micro SD storage cards but does not support hot swapping. It will automatically mount all partitions. EC954 will partition all micro SD storage cards and mount them to the/mnt/path. The naming format for the mounting folder is sd_<node>_<num>. Among them,<node>is the device node name of the partition, and<num>is a number from 0 to 9.
(1) Log in to the system, execute sudo fdisk - l, and locate your hard disk partition, as shown in the following image:/dev/sda1
(2) Format the partition to the desired file system, such as ext4
(3) Create a mount point, such as/mnt/sda1
(4) Edit the vi/etc/fstab file,
Add/dev/sda1/mnt/sda1 ext4 defaults, nofail, x-system. device timeout=1s 0 0 at the end of the line, as shown in the following figure:
/Dev/sda1: Device partition, user needs to configure according to actual situation
/Mnt/sda1: Mount point, user needs to configure according to actual situation
The file system format of the etx4 hard disk partition needs to be configured by the user according to the actual situation
Default, nofail, x-system. device timeout=1s 0 0 fixed configuration. It is recommended to use this configuration, and users can also modify it according to their needs.
The CAN port of EC954 supports two CAN buses, with CAN1 corresponding to device can0 and CAN2 corresponding to device can1
By default, the CAN port will be initialized. If any other configuration is required, please use the IP link command to check the CAN device. To check the status of the CAN device, use the IP link command:
To configure CAN devices, please use IP link set can0 down to first shut down the device
Sudo IP link set can0 down
Then configure the bit rate (the following is an example of a 125k bit rate):
Sudo IP link set can0 type can bitrate 125000
Finally, restart the device
Sudo IP link set can0 up
By default, the CAN port will be initialized. If any other configuration is required, please use the IP link command to check the CAN device. To check the status of the CAN device, use the IP link command:
To configure CAN devices, please use IP link set can1 down to first shut down the device
Sudo IP link set can1 down
Then configure the bit rate (the following is an example of a 125k bit rate):
IP link set can1 type can bitrate 125000 dbitrate 1250000 fd on
Finally, restart the device
Sudo IP link set can1 up
EC954 supports 4-way DI and 4-way DO. When you want to use the IO port, please type the dio_mgmt command to control the input and output of IO. Usage of dio_mgmt:
When you need to set a certain IO port to high or low, you can type the command dio_mgmt set D<I/O><number><HIGH/LOW>
Print the level information of the corresponding IO port by typing dio_mgmt show D<I/O><number>.
Some EC900 models integrate GPS modules internally, and the data serial port nodes are/dev/ttyS9.
If you want to view detailed GPS information, there are two ways to view it:
1. Set up serial port nodes using STTY, type CAT to directly output source data
2. Type the gnss command to directly output parsed information such as time, longitude, and latitude
1. Press and hold the power button for 8 seconds to turn off the device
2. You can use Linux commands to shut down all software running on the device and stop the system. However, after running this command, major components such as CPU, RAM, and storage devices will power down.
Short press the power on button, and the system will perform the power on operation.
In this chapter, we will introduce the security mechanism of the edge computer EC900 based on ARM architecture.
In EC900, for better security, root users are prohibited from using it. Sudo is a program that allows system administrators to allow approved users to execute commands as root or other users. The most basic principle is to give as little privilege as possible to complete the work. Using sudo is safer than opening a session with root identity for many reasons, including:
Netfileter/iptables (hereinafter referred to as iptables) is an excellent and completely free packet filtering firewall tool that comes with the Nuix/Linux system. Its functions are very powerful, and it is very flexible to use. It can finely control the inflow, outflow, and flow of data packets through the server.
TPM stands for Trusted Platform Module, which is a hardware security module designed to provide security and encryption capabilities for computer systems. It is a security microcontroller that can be embedded in computer systems or sold as a standalone hardware device. It includes an encryption coprocessor for storing encryption keys, digital certificates, and other secure data, as well as supporting multiple encryption algorithms and security protocols. On EC954, the standard TPM2.0 protocol stack and TPM2.0 tools have been integrated for users to use.
In this chapter, we will introduce how to restore the factory settings and update the edge computer EC900 based on the Arm structure.
There are two methods to restore factory settings:
Prepare a USB flash drive (micro SD card). If the USB drive (SD card) has multiple partitions, please use the first partition. It is recommended not to create multiple partitions. The partition of the USB drive (SD card) needs to be in FAT32 format. This document takes upgrading EC954-V2.0.0.img as an example for explanation.
EC900 provides a JSON format device information description file. Customers who need to operate peripherals such as IO, LED, serial port, etc. can obtain the device node information of these peripherals by querying the device description information file.
Device description information file path:/tmp/ieos/etc/systeminfo.json, the content is as follows:
At present, there are a total of 8 IO interfaces on the device: for example, DI0~DI3 on the device panel have 4 input pins; DO0~DO3 have 4 output pins.
According to the device description information file/tmp/ieos/etc/systeminfo.json, the IO device nodes can be obtained as follows:
DI0~DI3-- sys/class/gpio/gpio487~sys/class/gpio/gpio490
DO0~DO3-- sys/class/gpio/gpio491~sys/class/gpio/gpio494
When you need to program IO interfaces, simply operate on the value value value under the backend device node (sys/class/gpio/gpioxxx/value)
Case:
When DO0 needs to output high voltage, it can directly write 1 to sys/class/gpio/gpio491/value
Echo 1>/sys/class/gpio/gpio491/value
When you need to check the level of DI0, you can also directly check the value of sys/class/gpio/gpio487/value
Cat/sys/class/gpio/gpio487/value
Complete shell script:
On the device, users can use two lights, USER1 and USER2, for status prompts. Please check the light label to confirm the positions of USER1 and USER2 lights.
According to the device description information file/tmp/ieos/etc/systeminfo.json, it can be obtained that the USER1 and USER2 device nodes are:
User1:/sys/class/LEDs/user1
User2:/sys/class/LEDs/user2
There are some control files in the sys/class/leds/user1 directory used to control the properties and status of LEDs:
/Sys/class/leds/user1/brightness: This file is used to control whether the USER1 light is on or off. Writing 1 means it is always on, and writing 0 means it is always off.
/Sys/class/leds/user1/trigger: The trigger for the LED light, which can be written as timer to indicate the timer is triggered, and written as none to indicate the cancellation of the trigger.
/Sys/class/leds/user1/delay_on: This file represents the time when the LED light is on, in milliseconds.
/Sys/class/leds/user1/delayed off: This file represents the time when the LED light went out, in milliseconds.
If the trigger is configured for timed triggering, the value in brightness will no longer take effect and will automatically become 0.
Replacing user1 with user2 in the file path controls the operation of the USER2 light.
case:
When the USER1 light needs to stay on, write 1 to the brightness file
Echo 1>/sys/class/LEDs/user1/brightness
When the USER1 light needs to flash, write the timer to the trigger file and control the on and off times through delay_on and delay_off
Complete shell script:
#!/bin/bash
USER1_BRIGTHNESS="/sys/class/leds/user1/brightness"
USER1_TRIGGER="/sys/class/leds/user1/trigger"
USER1_DELAY_ON="/sys/class/leds/user1/delay_on"
USER1_DELAY_OFF="/sys/class/leds/user1/delay_off"
USER2_BRIGTHNESS="/sys/class/leds/user2/brightness"
USER2_TRIGGER="/sys/class/leds/user2/trigger"
USER2_DELAY_ON="/sys/class/leds/user2/delay_on"
USER2_DELAY_OFF="/sys/class/leds/user2/delay_off"
# Light Up USER1 LED
if [ -f "$USER1_BRIGTHNESS" ]; then
echo 1 > $USER1_BRIGTHNESS
else
echo "no file exit
"$USER1_BRIGTHNESS
fi
# Light Up USER2 LED
if [ -f "$USER2_BRIGTHNESS" ]; then
echo 1 > $USER2_BRIGTHNESS
else
echo "no file exit
"$USER2_BRIGTHNESS
fi
# Set USER1 LED to Blink
if [ -f "$USER1_TRIGGER" ]; then
echo timer > $USER1_TRIGGER
else
echo "no file exit
"$USER1_TRIGGER
fi
# Set USER2 LED to Blink
if [ -f "$USER2_TRIGGER" ]; then
echo timer > $USER2_TRIGGER
else
echo "no file exit
"$USER2_TRIGGER
fi
# Set USER1 LED to Illuminate for 1000ms
if [ -f "$USER1_DELAY_ON" ]; then
echo 1000 > $USER1_DELAY_ON
else
echo "no file exit
"$USER1_DELAY_ON
fi
# Set USER1 LED to Turn Off for 1000ms
if [ -f "$USER1_DELAY_OFF" ]; then
echo 1000 > $USER1_DELAY_OFF
else
echo "no file exit
"$USER1_DELAY_OFF
fi
# Set USER2 LED to Illuminate for 1000ms
if [ -f "$USER2_DELAY_ON" ]; then
echo 1000 > $USER2_DELAY_ON
else
echo "no file exit
"$USER2_DELAY_ON
fi
# Set USER2 LED to Turn Off for 1000ms
if [ -f "$USER2_DELAY_OFF" ]; then
echo 1000 > $USER2_DELAY_OFF
else
echo "no file exit "$USER2_DELAY_OFF
fi
# Disable USER1 LED Blinking
if [ -f "$USER1_TRIGGER" ]; then
echo none > $USER1_TRIGGER
else
echo "no file exit
"$USER1_TRIGGER
fi
# 关Disable USER2 LED Blinking
if [ -f "$USER2_TRIGGER" ]; then
echo none > $USER2_TRIGGER
else
echo "no file exit
"$USER2_TRIGGER
fi
The user's own C/C++program can be cross compiled using a cross compilation toolchain on the development machine, and then the target file can be uploaded to the EC954 device for execution.
Cross compilation tool compressed package: gcc-linaro-6.3.1-2017.05-x86_64-arch64 Linux gnu.tar.gz
Method for configuring environment variables for cross compilation toolchain:
Using the classic Hello World program as an example, create the following directory and files
~/The content of the example/hello. c file is as follows:
Execute make in the~/example directory to generate the target file helloworld