Huawei E3371 – Part 2 – AT commands

In my previous post you can read a little introduction about this device.
The one I got runs a HiLink firmware and those below is just the log of what I tried in the python CLI
just for testing.
The most important commands may are:
1. AT^CARDLOCK which unlock the device from operators.
2. AT^U2DIAG which allow you to switch the device mode permanently and that didn’t work for me
3. AT+CGDCONT that allows you to run a ppp connection. That looks to work from here, but that
didn’t really work in practice. At least wvdial was not able to get it working.
BTW just remember that run an LTE connection over PPP would not perform well, as I mentioned in the previos post.

import serial
p=’/dev/ttyUSB0′
ser = serial.Serial(port=p, timeout=15)
ser.write(‘AT\r\n’)
ser.read(5)
# check if it’s SIM locked
ser.flushInput()
ser.write(‘AT^CARDLOCK?\r\n’)
response = ser.read(50) # ^CARDLOCK: 2,10,0 print response
# get IMEI
ser.flushInput()
ser.write(‘AT+CGSN\r\n’)
response = ser.read(50)
print response
# port mode 1
ser.flushInput()
ser.write(‘AT^U2DIAG?\r\n’)
response = ser.read(50)
print response # ERROR!
# port mode 2
ser.flushInput()
ser.write(‘AT^GETPORTMODE\r\n’)
response = ser.read(150)
print response # ^GETPORTMODE: TYPE: WCDMA: huawei,ecm:1,pcui:2,c_shell:3,a_shell:4,3g_diag:5,gps:6,4g_diag:7,mass:8,
# Device info
ser.flushInput()
ser.write(‘ATI\r\n’)
response = ser.read(50)
print response
#TEST
ser.flushInput()
ser.write(‘ATH”\r\n’)
response = ser.read(50)
print response
ser.flushInput()
ser.write(‘ATZ”\r\n’)
response = ser.read(50)
print response
ser.flushInput()
ser.write(‘ATQ0″\r\n’)
response = ser.read(50)
print response
ser.flushInput()
ser.write(‘AT+CGDCONT=1,”IP”,”internet”\r\n’)
response = ser.read(50)
print response
ser.flushInput()
ser.write(‘ATDT*99#\r\n’)
response = ser.read(50)
print response

One comment on “Huawei E3371 – Part 2 – AT commands

Leave a Reply

Your email address will not be published. Required fields are marked *