84 lines
1.6 KiB
Markdown
84 lines
1.6 KiB
Markdown
# HL854x AT Commands
|
|
|
|
# Serial tty to tcp socket
|
|
|
|
~~~
|
|
socat tcp-l:2020,reuseaddr,fork file:/dev/ttyAMA0,echo=0,b115200,raw,crnl,icanon=1
|
|
~~~
|
|
|
|
# Proxy two tcp connections
|
|
|
|
~~~
|
|
socat TCP4-LISTEN:10667,fork TCP:127.0.0.1:4000
|
|
~~~
|
|
|
|
# Full example
|
|
|
|
~~~
|
|
AT+KCNXCFG=1,"GPRS","office.vodafone.com","vodafone","vodafone"
|
|
AT+KTCPCFG=1,0,"beta.dualinventive.com",10667
|
|
AT+KTCPCNX=1
|
|
AT+KTCPSND=1,12
|
|
\x44\x4A\x52\x01\x00\x0cAAPAAP--EOF--Pattern--
|
|
~~~
|
|
|
|
# Simcard & carrier
|
|
|
|
~~~
|
|
# Check pin
|
|
AT+CPIN?
|
|
# Register network
|
|
AT+COPS=0
|
|
# Get cell registration info
|
|
AT+CREG?
|
|
# Get carrier name
|
|
AT+COPS?
|
|
~~~
|
|
|
|
# APNs
|
|
|
|
~~~
|
|
# vodafone
|
|
#APN: office.vodafone.com
|
|
#User: vodafone
|
|
#Pass: vodafone
|
|
echo -e "AT+KCNXCFG=1,\"GPRS\",\"office.vodafone.com\",\"vodafone\",\"vodafone\"\r\n" | nc 192.168.23.141 2020
|
|
~~~
|
|
|
|
# TCP client
|
|
|
|
~~~
|
|
# URC info
|
|
AT+KURCCFG?
|
|
# Config session 1 to tcp://beta.dualinventive.com:3003
|
|
echo -e "AT+KTCPCFG=1,0,\"beta.dualinventive.com\",3003\r\n" | nc 192.168.23.141 2020
|
|
# Connect
|
|
echo -e "AT+KTCPCNX=1\r\n" | nc 192.168.23.141 2020
|
|
# Close
|
|
AT+KTCPCLOSE=1
|
|
~~~
|
|
|
|
## SMS commands
|
|
|
|
~~~
|
|
# set to text mode
|
|
echo -e "AT+CMGF=1\r\n" | nc 192.168.23.141 2020
|
|
|
|
# send message
|
|
# -- Start message
|
|
echo -e "AT+CMGS=\"+31639428774\"\r\n" | nc 192.168.23.141 2020
|
|
# -- Data
|
|
echo -e "test\r\n" | nc 192.168.23.141 2020
|
|
# -- end of message
|
|
echo -e "\x1A\r\n" | nc 192.168.23.141 2020
|
|
|
|
# Set new message indicator (copied from SMS-server)
|
|
echo -e "AT+CNMI=2,3,0,0,0\r\n" | nc 192.168.23.141 2020
|
|
|
|
# Read SMS message (from index 1)
|
|
echo -e "AT+CMGR=1\r\n" | nc 192.168.23.141 2020
|
|
|
|
# Read SMS message (from index 1)
|
|
echo -e "AT+CMGD=1\r\n" | nc 192.168.23.141 2020
|
|
~~~
|