Another help needed to get Socket kicked off


#1

Hello,

I’ve been playing around with Socket example that comes with the development for past couple days and I’ve come across some problems I could not find solutions from the forum nor documenations. Appreciate little help from the experts.

I am using OpenAT v3.01, Q2406B module, running MSVS .net 2003.

==============================================
Problem 1:

In this scenario, untouched Socket example is compiled in debug mode.

The following are the state I got upto.

  • have successfully received CGATT=1 response,
  • got IP address from the network(eg 10.224.65.115)
  • ed_SocketTCPStart() returned 0x00, which means OK.
  • Callback function of (ed_ResponseCbk_f)tcp_pfResponseCbk was executed, getting “Socket Started” string out in my Terminal Emulator

This all looks really good but the problem is when I use my browser to connect to the Wavecom IP address, ie 10.224.65.115, nothing happens. I have placed break points in ‘(ed_DataHandler_f)tcp_pfDataHnd’ to see if any attempt is made, but unfortunately nothing came through.

I would expect the browser to try to establish connection to port 80 of Wavecom device. How do I make my dear Wavecom to act as a web server, if it doesn’t want to respond?

===============================================
Problem 2:

I didn’t want to get stuck with the above problem, so I tweaked the code little bit so that Wavecom is now a client instead of server.

Inside, tcp_ConnectHandler’ function, ‘Listen’ variable was changed to 0 (instead of 1 to initiate socket) and Params.TcpServ parameter was changed to a known IP address, eg “64.223.187.99” for Google

  • have successfully received CGATT=1 response,
  • got IP address from the network(eg 10.224.65.115)
  • ed_SocketTCPStart() returned 0x00, which means OK.

Unlike the response in Problem 1, ‘tcp_pfResponseCbk’ was not even called. Of course tcp_pfDataRequest didn’t get called either.

From lots of other posts I have read from this forum, people have managed to retrieve data from websites. It looks pretty trivial but this makes me little frustrated to see how a simple thing like this is not kicking off. I would be delighted if anybody can help me with the two most basic functionalities of GPRS communication I have mentioned here.

Thanks for your help.

Yul

============================================


#2

Hi Yul,

I only know an answer to problem 1:

IP adresses starting with 10. are all on a private subnet. You can’t reach them from outside the network! (It might work if the computer with the web browser is on the same network…)

Best Regards,
Jan


#3

Hi Jan,

Thanks for fast reply. I would like to point out however, I’ve tried to connect to the wavecom device using another GSM, GPRS enabled phone to use its browser to talk to the Wavecom device. This phone used the same network provider (Vodafone NZ) and I would think Vodafone assigns a similar IP address to the phone as the Wavecom devicce.

Even after this attempt, no promising signs appeared.


#4

Hi Yul,

maybe the network provider blocks the communication between the GPRS devices. I have heard that vodafone DE tried to do that because they couldn’t ensure the billing within the network. (I don’t know if the information is accurate or outdated and I haven’t tried it myself yet.)

Best Regards,
Jan


#5

Hello Yul,

I have recently made socket to work.
Socket server didn’t worked for me also. It seems that the IP is private on the module. I have ADSL connection to internet with static IP and wavecom modem as client.

May be my project helps you:

  1. Configure your ADSL router NAPT address (TCP port translation)
    (e.g. external “62.103.215.241”(your static IP), port = 8000,
    internal “192.168.1.1” (your PC), port = 8000)

  2. Set Listen = 0
    Address = your static IP
    Port = your port (e.g. 8000) (after success do your test with port 80)

  3. Run a tcp socket server to your PC and listen to port 8000

  4. start your wavecom module

  5. If you see the client connecting to your PC you can start writing your data exchange code (I didn’t have any problems to connection, but a lot of hours of debugging my code).

You can do this test with a regular PSTN modem connection, but you
must find your IP (ipconfig from command promt) and then change and compile your code as you are still connected to internet.


#6

Hello People,

I just like to write an update with the above problems I had.

After all the headaches I have decided to upgrade my OpenAT from version 3.01 641OS to version 3.10 655 OS. And I am glad to tell you I am finally kicked off!!

Mind you, the new OpenAT includes this add-on library DTL and to compile the previous OpenAT v3 project I had to take out ipconnect.c and ipcmd.c. Then I added couple of lines to include the new library files in the code and I used Project Wizard, using “Existing Project” option with “-otherlib TCPIP -otherlib DTL” under script additional options.

Now I can connect to a webserver. The only problem is the server keeps disconnecting me because I think I’m not sending the correct GET string to the server. But my application really doesn’t involve talking to a server so I’m not so fussed. But it would be handy to know anyhow. The following is the string I use to send. Any comment would be helpful.

wm_strcpy(Buff,"GET /index.html\r\nHTTP/1.0\r\nHost:www.google.com\r\nContent-Type:text/html\r\n");

Well happy coding guys.

Yul


#7

Hi Yul,

I think the request should be terminated with an empty line, which would be \r\n\r\n then. I think

wm_strcpy(Buff,"GET /index.html\r\nHTTP/1.0\r\nHost:www.google.com\r\nContent-Type:text/html\r\n\r\n");

should work fine…

Best Regards,
Jan