IOT-MCU / ESP-12S-A9-A9G-GPRS-Node-v1.0

63 stars 27 forks source link

Example connecting via TCP, query URL etc #8

Closed eried closed 4 years ago

eried commented 4 years ago

Hi!

I was wondering if you have a more detailed guide how I can set my apn, connect and such?

I am using AT command testes, but the commands are not exactly compatible and the AT manual is all in chinese.

AT+CGDCONT?

OK
AT+CGDCONT=1,"IP","hologram","",,

OK
PDP Context list updated sucessfully

AT+CGDCONT?

+CGDCONT:1,"IP","hologram","0.0.0.0",0,0

OK
Following connection profiles are available,

CID->1
PDP Type->IP
APN->hologram
PDP Address->0.0.0.0
Data Compression->0
Header Compression->0
Checking registration status...

AT+CREG?

+CREG: 1,5

OK
Device is registered and is roaming.

Checking if device is already connected...

AT+CGACT?

+CGACT: 0,0

OK
AT+CMEE=1

OK
Attaching to network...
AT+CGATT=1

+CGATT:1

OK

Unable to attach to the network...
kamane commented 4 years ago

use : AT+CSTT="APN","USERNAM","PSW"

then : AT+CGACT=1,1 to get attached to the network predifined

with this : AT+CGPADDR=1 your IP adress should display

eried commented 4 years ago

Cool! it works, and with AT+HTTPGET it is so nice! I Thanks

kamane commented 4 years ago

is it possible to share your code for making HTTP connection mine can only ping AT+PING="23.235.209.134",120,200,1 --> works AT+CIPSTART="TCP","23.235.209.134",80 --> failed

eried commented 4 years ago

oh I am not doing that, I am just doing

AT+HTTPGET="http://64.xxxxxx5:5055/?id=dev1&lat=69.6492&lon=18.95...

HTTP/1.1  200  OK
content-length: 0
kamane commented 4 years ago

Thanks its works AT+HTTPGET , happy coding !!! :+1: