TCP connection over GPRS with SM5100B module

After having no success sending GET requests to HTTP servers I finally decided to set up my own tcp server by directing a port on my router to my PC and setting up a simple tcpserver listener in cygwin like this:

~ > tcpserver -t1000 -v -Bare_we_receiving 0 9876 bash -c "sleep 1000"
tcpserver: status: 0/40

Then I sent the following commands to the modem


For some reason the MY_ROUTER_ADDRESS had to be the text host name instead of the IP address, which was something like for me as per my router.

Immediately I saw a connection appear in the tcpserver log:

tcpserver: status: 1/40
tcpserver: pid 5232 from
tcpserver: ok 5232 :::ffff: :::ffff:
tcpserver: end 5232 status 256
tcpserver: status: 0/40

And then some data was received on the GPRS modem side:

> +STCPD:1

Which I read back promptly:

> +SOCKSTATUS: 1,1,0102,54,0,16
> OK
> +SSTR:1,are_we_receiving
> OK

And it exactly matched the banner text. So atleast I can establish TCP connections. The AT command interface though is a real pain.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s