Readme.md

May 28, 2021 · View on GitHub

Since the microcontroller only recognizes the string type in the JSON format, the following parameters, even if the parameter type is INT, will be converted to a string and sent

Parameter nameTypeNecessityDefaultDescriptionPossible value
ssidstringyes" "2G WiFi SSIDA string of up to 32 characters
upstringyes"0"Indicates whether 2G WIFI is enabled. If it is not enabled, the LCD will not display the 2G WIFI page.0 or 1
keystringno" "2G WiFi password, if it is empty, it means no encryption, LCD shows OPENA string of up to 64 characters
ssid_5gstringyes" "5G WiFi SSIDA string of up to 32 characters
up_5gstringyes"0"Indicates whether 5G WIFI is enabled. If it is not enabled, the LCD will not display the 5G WIFI page.0 or 1
key_5gstringno" "5G WiFi password, if it is empty, it means no encryption, LCD shows OPENA string of up to 64 characters
hide_pskstringno"0"Whether to hide the wifi password on the LCD0 or 1
Parameter nameTypeNecessityDefaultDescriptionPossible value
SIMstringno"NO_SIM"SIM card status, there is no SIM parameter normally, if there is SIM parameter, other parameters will not be transferredNO_SIM (No SIM card detected), PIN_SIM (PIN code required), NO_REG (No service)
carrierstringno"0"Carrier nameA string of up to 16 characters
smsstringno"0"/Number of text messages. If this parameter is greater than 0, the LCD displays the text message icon.Numbers greater than 0
signalstringno"0"Signal strength0~4
modem_modestringno" "Network mode2G,3G, 4G, 4G+
modem_upstringno"0"Whether the modem data is enabled0 or 1
Parameter nameTypeNecessityDefaultDescriptionPossible value
work_modestringyes" "Router network modeRouter,AP,WDS,Extender
lan_ipstringyes" "Router gateway address, or the IP address of the router under bridge modeLegal IP address
method_nwstringyes" "Router's current Internet accesscable,repeater,modem,tethering, if there is extra information, use "|" to separate them. For example, repeater|GL-AR750S-081
Parameter nameTypeNecessityDefaultDescriptionPossible value
vpn_typestringyes" "VPN protocolopenvpn,wireguard
vpn_statusstringyes" "VPN connection statusconnected,connecting,off
vpn_serverstringyes" "VPN configuration nameA string of up to 128 characters
Parameter nameTypeNecessityDefaultDescriptionPossible value
clientsstringyes"0"Number of clientsNumbers greater than or equal to 0
Parameter nameTypeNecessityDefaultDescriptionPossible value
display_maskstringno"1f"This value indicates whether the 1-5 screen is displayed. You need to convert this value to the corresponding binary when setting. For example, 0x03 converted to binary is 00011, which means that only the first screen and the second screen are displayed; the default 1f, that is, 11111, displays 5 screen contents0x0-0x1f
custom_enstringno"0"This value indicates whether the user is using a custom page, 0 means not use, 1 means use0 or 1
contentstringno" "Display contentA string of up to 64 characters
msgstringno" "Display content on the screen for 20 secondsA string of up to 64 characters
Parameter nameTypeNecessityDefaultDescriptionPossible value
buttonstringno"0"The time the reset button was pressedNumbers greater than or equal to 0
systemstringno"boot"Show system status on screenreboot (reboot), reft (restore factory settings), adding (system upgrade), gouboot (enter uboot mode), boot (boot), Calibrate stage (calibration stage), Flash stage (waiting to upgrade standard firmware stage), Test stage 1 (Test Phase 1), Test stage 2 (Test Phase 2)
diskstringno"0"Is there a disk0 or 1
torstringno"0"Is it the Tor firmware0 or 1
debugstringno"0"Whether to print debug information in logread0 or 1
Parameter nameTypeNecessityDefaultDescriptionPossible value
mcu_statusstringnoNOGet the status of the microcomputer, send the command within 1 second, the microcomputer will return the relevant data through the serial port, which are the percentage of power, the temperature of the coulometer, the state of charge, the number of battery charging cycles, and the battery voltage

screen test

Parameter nameTypeNecessityDefaultDescriptionPossible value
lcd_teststringnoNOTest the screen for bad pixels1 (light up all pixels) or 0 (off screen)

coulometer parameter query

Parameter nameTypeNecessityDefaultDescriptionPossible value
QENstringnoNOCheck if the coulometer algorithm is enabled
chemidstringnoNOCheck coulometer file version
high_tempstringno72Set high temperature shutdown value, don't set too low

MCU firmware version query

Parameter nameTypeNecessityDefaultDescriptionPossible value
versionstringnoNOCheck MCU firmware version

example1: How to control the OLED display

Use the echo command directly to send data in json format to the system serial port. This example contains basic WIFI information, SIM card information, VPN status, client status, time, etc. The MCU_status parameter is included in the example, which indicates that the microcontroller is required to return status

echo '{ "ssid_5g": "GL-E750-719", "up_5g": "1", "key_5g": "goodlife", "ssid": "GL-E750-719", "up": "1", "key": "goodlife", "SIM": "NO_SIM", "work_mode": "Router", "lan_ip": "192.168.82.1",  "vpn_status": "off", "clients": "1", "clock": "02:30", "mcu_status": "1" }' >/dev/ttyS0

After the command is executed, the serial port will return the status within 1 second. The return value is as follows. Each parameter is separated by a comma, where {OK} indicates successful execution, 99 indicates that 99% of the current power is left, and 42.4 indicates that the current coulometer Temperature, 1 means charging, 2 means the battery has two charge and discharge cycles**

{OK},99,42.4,1,2

example2: How to check the information

If you want to check the MCU firmware version, please following these steps.

  1. Open the first terminal useing SSH protocol

  2. In the terminal, execute the uci set mcu.global.debug=1 && uci commit command to open the debug mode

  3. Execute the /etc/init.d/e750_mcu restart command to restart the mcu process

  4. Execute the logread -f command to monitor the system log

  5. Open the second terminal useing SSH protocol, and then execute the echo {\"version\": \"1\"} > /tmp/mcu_message && killall -17 e750-mcu command

  6. In the first terminal, you will see the e750-mcu recived:xxx message

Compile .ipk

1. Compile on the glinet openwrt source

$cd openwrt_root          #go to your openwrt source root
$./scripts/feeds update -f -a
$./scripts/feeds install -f -a
$make menuconfig
  GL.iNet packages choice shortcut  ---> 
    Select MCU  --->
      <*> Support GL_E750_MCU
$make package/feeds/gli_pub/gl-e750-mcu/{clean,compile} V=s
$ls bin/packages/mips_24kc/gli_pub/gl-e750-mcu_2020-06-08-f8c77bdb-1_mips_24kc.ipk

2. Compile on the other openwrt source

$cd openwrt_root          #go to your openwrt source root
$cd package
$git clone https://github.com/gl-inet/GL-E750-MCU-instruction.git
$cd ..
$make menuconfig
  gl-inet  ---> 
    <*> gl-e750-mcu........................................ GL iNet mcu interface
$make package/GL-E750-MCU-instruction/{clean,compile} V=s
$ls bin/packages/mips_24kc/base/gl-e750-mcu_2020-06-08-f8c77bdb-1_mips_24kc.ipk

How to upgrade the mcu firmware

  1. Get the mcu firmware from GL sales or compile the firmware by youself use the source code

  2. Use the TFTP or SCP protocol to upload the MCU firmware to a directory on E750 file system. For example, my firmware name is e750-mcu-V1.0.5.bin and I chose the directory is /tmp, so the firmware path is /tmp/e750-mcu-V1.0.5.bin

  3. Open the first terminal useing SSH protocol, execute the ubus call service delete '{"name":"e750_mcu"}' command to stop the mcu process, don't care the rerurn message

  4. Execute the mcu_update /tmp/e750-mcu-V1.0.5.bin command to upgrade the MCU firmware