Skip to content

Instantly share code, notes, and snippets.

@Josverl
Forked from sago35/rtl8720dn_at_commands
Created November 21, 2022 08:33
Show Gist options
  • Save Josverl/5517628d078c3b750523f99dae715031 to your computer and use it in GitHub Desktop.
Save Josverl/5517628d078c3b750523f99dae715031 to your computer and use it in GitHub Desktop.
at_spi_write('AT+CWMODE=1\r\n', 13, 500)
at_spi_read ('OK\r\n', 4, 500)
at_spi_write('AT+CWMODE?\r\n', 12, 500)
at_spi_read ('+CWMODE:1\r\nOK\r\n', 15, 500)
at_spi_write('AT+CWQAP\r\n', 10, 500)
at_spi_read ('OK\r\n', 4, 500)
at_spi_write('AT+CWMODE?\r\n', 12, 500)
at_spi_read ('+CWMODE:1\r\nOK\r\n', 15, 500)
at_spi_write('AT+CWQAP\r\n', 10, 500)
at_spi_read ('OK\r\n', 4, 500)
at_spi_write('AT+CWDHCP=1,1\r\n', 15, 500)
at_spi_read ('OK\r\n', 4, 500)
at_spi_write('AT+CWDHCP?\r\n', 12, 500)
at_spi_read ('+CWDHCP:3\r\nOK\r\n', 15, 500)
at_spi_write('AT+CWJAP="abcdef-gw","0123456789abc"\r\n', 38, 500)
at_spi_read ('ERROR\r\n', 7, 500)
at_spi_read ('\r\nWIFI CONNECTED\r\n', 18, 500)
at_spi_write('AT+CWDHCP?\r\n', 12, 500)
at_spi_read ('+CWDHCP:3\r\nOK\r\n', 15, 500)
at_spi_write('AT+CIPSTA?\r\n', 12, 500)
at_spi_read ('+CIPSTA:ip:"0.0.0.0"\r\n+CIPSTA:gateway:"0.0.0.0"\r\n+CIPSTA:netmask:"0.0.0.0"\r\nOK\r\n', 80, 500)
at_spi_read ('\r\nWIFI GOT IP\r\n', 15, 500)
at_spi_write('AT+CWDHCP?\r\n', 12, 500)
at_spi_read ('+CWDHCP:3\r\nOK\r\n', 15, 500)
at_spi_write('AT+CIPSTA?\r\n', 12, 500)
at_spi_read ('+CIPSTA:ip:"192.168.1.116"\r\n+CIPSTA:gateway:"192.168.1.1"\r\n+CIPSTA:netmask:"255.255.255.0"\r\nOK\r\n', 96, 500)
at_spi_write('AT+CWDHCP?\r\n', 12, 500)
at_spi_read ('+CWDHCP:3\r\nOK\r\n', 15, 500)
at_spi_write('AT+CIPSTA?\r\n', 12, 500)
at_spi_read ('+CIPSTA:ip:"192.168.1.116"\r\n+CIPSTA:gateway:"192.168.1.1"\r\n+CIPSTA:netmask:"255.255.255.0"\r\nOK\r\n', 96, 500)
at_spi_write('+CWMODE?\r\n', 10, 500)
at_spi_read ('+CWMODE:1\r\nOK\r\n', 15, 500)
at_spi_write('AT+CWDHCP?\r\n', 12, 500)
at_spi_read ('+CWDHCP:3\r\nOK\r\n', 15, 500)
at_spi_write('AT+CIPSTA?\r\n', 12, 500)
at_spi_read ('+CIPSTA:ip:"192.168.1.116"\r\n+CIPSTA:gateway:"192.168.1.1"\r\n+CIPSTA:netmask:"255.255.255.0"\r\nOK\r\n', 96, 500)
at_spi_write('AT+CIPDOMAIN="192.168.1.110"\r\n', 30, 500)
at_spi_read ('+CIPDOMAIN:"192.168.1.110"\r\nOK\r\n', 32, 500)
at_spi_write('AT+CIPSTATUS\r\n', 14, 500)
at_spi_read ('STATUS:2\r\nOK\r\n', 14, 500)
at_spi_write('AT+CIPSTART=4,"TCP","192.168.1.110",80,0\r\n', 42, 500)
at_spi_read ('+LINK_CONN:0,4,"TCP",0,"192.168.1.110",80,0\r\nOK\r\n', 49, 500)
at_spi_write('AT+CIPSTATUS\r\n', 14, 500)
at_spi_read ('STATUS:3\r\n+CIPSTATUS:4,"TCP","192.168.1.110",80,0,0\r\nOK\r\n', 57, 500)
at_spi_write('AT+CIPSEND=4,26\r\n', 17, 500)
at_spi_read ('OK\r\n>', 5, 500)
at_spi_write('GET /index.html HTTP/1.1\n\n', 26, 500)
at_spi_read ('\r\nSEND OK\r\n', 11, 500)
at_spi_read ('\r\n+IPD,4,309,192.168.1.110,80:HTTP/1.1 400 Bad Request\r\nServer: nginx/1.17.6\r\nDate: Thu, 24 Sep 2020 23:25:18 GMT\r\nContent-Type: text/html\r\nContent-Length: 157\r\nConnection: close\r\n\r\n<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body#>\r\n<center><h1>400 Bad Request</h1></center>\r\n<hr><center>nginx/1.17.6</center>\r\n</body>\r\n</html>\r\n', 339, 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment