Socket listen

  • Q: Type of module? A:GM862-QUAD
    Q: Firmware version? A: 7.02.602
    Q: Type of starter kit you have? None
    (S1, S1B, S2, S3, S4, EVK1, EVK2, none, other)


    Hey everyone, i searched through the forum but didn't find something like this, so i need to have my GM862-QUAD listening for connections on port 7777 and i have java code that is a client socket example and i put in the ip address i get when my module connects to the internet and try to create a socket connection and send stuff but i always get a time out IOException when i do that, what am i doing wrong?? the module says it's listening on port 7777 but i don't get the CONNECT when i try to start client java program always get time out!!!! Please any help would be great. I'll add my AT command sequence below:


    AT#FRWL=1,"0.0.0.0","255.255.255.255"
    AT#SCFG=1,1,300,90,600,50
    AT#SGACT=1,1,"internet","internet"
    AT#SL=1,1,7777


    then my code waits for SRING if it gets it, it will send :-
    AT#SA=1



    but i never get the SRING i get OK after all commands and get ip address after SGACT which i copy and put in my java program...
    hope this is all info you need.
    thanks for your help

  • Do you mean a public ip on the module side or on the laptop side??


    i have public IP on the laptop that i can find out using whatismyipaddress.com but on the module side i'm not sure i'll have to check.


    #EDIT: i checked and vodafone say that the ip is public

  • If I understand right your module is listen for incoming data. For that you must know the ip.
    For further support please be so kind and support me with your RS customer number or tell when and where you purchase your module. Thank you.

  • I got this module about 27th of april 2011 from this website ... it's GM862-QUAD and using it with EASY GSM/GPRS board.
    Also i know i need the ip, but i get this ip when i issue the SGACT command to go online it replies with SGACT: 10.221.92.110 for instance, isn't this the public ip ?? or am i getting this all worng??


    Also i tried this module before to send data to server java program and it sort of worked, i go the CONNECT msg it only send the data when i restart the micro controller though. wasn't sure why so i though i'd try this...


    thanks alot for your support.

  • When you open a connection and send data from the module, you are the client. What ever IP you have is fine. However if you are the server, you will need a public IP so that people can see you (you are reachable). Your provider can set up your SIM and assign you a public IP every time your system is powered up and GPRS is activated.


    And also your fire wall command doesn't seem to be right. I would use AT#FRWL=1,"0.0.0.0","0.0.0.0" in order to accept all connection requests.


    Good luck.

  • Turns out you were right!! I used a java server program and had the module connect to it and got the IP of module from java and was something like 41.206.xxx.xxx and the port of communication. so would this be my public IP address that i can use?? i am thinking of getting the ip address this way and using it to communicate afterwards to the socket i'm listening at!!!


    And the ..... at vodafone didn't even know what is a private ip or public ip, so they were no help at all!!!


    Thanks alot for your help :):):)

  • No i even explained it to him what is private and public ip. Anyway it doesn't matter i discovered it's private ip probably inside the GPRS network and it is the routed to a public ip which is what i get when i read the ip address...


    I have another question though if you could be so kind to help, if i listen on port 7777 for instance on my GM862 module, do you think if i send a connection the the IP address i got from java and on port 7777 it will be connected?? i mean if i'm listening on privateIP:7777 will that mean that i'm also listening on publicIP:7777 ???