AT Command to connect to remote machine using IP


#1

Hello,
I am working on a project where I am using normal phone line modem or ethernet module to communicate between two machines.
I would like to use GSM modems as well, M1306B-1 or M1306B-2 and I use the following AT command ATDT123.134.135.123:8023 123.134.135.123 is the remote machine IP and 8023 is the port number when I use the ethernet module.
I don’t know if it’s something similar I can use it with GSM modem since the ISP provide a dynamic/static IP address to the device.

Thanks


#2

Don’t just start a new thread - be sure to provide a link to your previous post so that people can easily find it:
viewtopic.php?f=30&t=3657&p=15562#p15562

Did you read the AT Commands Guide?

Did that suggest that this is a valid usage of the ATD command…?


#3

as I mentioned I used ATDT ( and it’s a valid AT command ) so my question is there another way to start a session and communicate with the remote machine.

Rabie K


#4

i’m interested in where you found this command in the documentation, because i can’t find it.

the only way i’m aware of is using the wip-at commands through wip-soft


#5

Likewise!

The ATD command exists - but not for use with an IP address and port (not with Wavecom devices, at least);

The ‘T’ in ATDT indicates Tone (ie, DTMF) dialling - and so is irrelevant to GSM.

Agreed - unless you do the whole thing from scratch in an external device.


#6

Madouc,

Somewhere I had the documentation where I saw the ATDT:
the Link below show how to Telnet to modem emulator for Windows
boycot.no-ip.com/InternetModem/

And I am using the same command to connect Phone line Modem and a Ethernet Module to connect to a telnet server running in the remote machine.

I was asking for an alternative Command that does connect to a Telnet/SSH Server, because in the other end I have a software that does hand shake first and then start sending commands and talk to the modbus to retrieve the data.

Thanks


#7

so, where in this picture is the wavecom module running?
because if you’ve got a wavecom module running in there,
it must be driven by an external application
or
it has a custom application running.

or maybe my problem is that i don’t really understand what you are trying to achieve here?


#8

Madouc,
The website was under maintenance I could not response right away.
the example that I posted above is showing the use of ATDT.

  1. what I have achieved until now is two software communicate with each other using customized phone line Modem (tinymodem) or Ethernet Module ( Xport from Lantronix ) ( Machine A is Client ) connected to Modem ( phone line / Ethernet ) via RS232 and connects to Machine B ( Telnet Server running on a Unix Box ) to make this connection I send ATDT123.456.789.129:23 After the connection is established Software in Machine B ask for login and password so the Machine A send login & password and begin data transfer from A to B on demand.

  2. I have now a wavecom Modem and I would like to achieve the same concept, of course not with ATDT but maybe something else that wavecom support.

Thanks again


#9

sorry, i still am not sure i understand what the ultimate goal is:
you want to connect with a client to a server and the client can only communicate trough a telnet session?


#10

Neither do I! :confused:

I think a diagram is required.

Or, why not go and discuss it face-to-face with your local Distributor…?


#11

What I have now :

With Phone Line :
Step1 Client connected to phone Line modem dials the number ATDT2345678 without the “;” because its not a voice call the modem connected to the Server answers the call
Step2 mgetty answers requesting Login + Password
Step3 if login successful /usr/local/software kicks and start communicating with the client firmware. ( requesting data from Server and sending it from Client )
Step4 Data transfer completed send ATH to end the call

With Ethernet Module
Step1 Client connected to ethernet module ( xport )send the command ATDT123.123.234.222:8789 ( 123.123.234.222 is IP and 8789 is Port ) A telnet session using port 8789 starts on the Server
Step2 telnet server answers requesting Login + Password
Step3 if login successful /usr/local/software kicks and start communicating with the client firmware. (Server requests data from the client, client grabs data from the modbus and send it to the server )
Step4 Data transfer completed quit and end the session

/usr/local/software is the shell path for the user in /etc/passwd instead of /bin/bash or /bin/sh etc…

So since the wavecome module can get IP address from the provider and support TCP/IP I thought I can do similar concept, if not my question will be is there another way to establish the connection between two machines and I am not talking about sending files, but requesting and sending data from the modbus in the client level.


#12

Hiya,

Now things become a little clearer. The XPort (a serial-ethernet device server from Lantronix) firmware has enhanced (or extended) the functionality of the ATD command. Being able to use an IP address as the destination of an ATD dial command is non-standard, and is NOT supported by the Wavecom modem.

However, I can see at least two ways around it.

  1. Download the Wavecom supplied WIP AT application, and get your client to use the AT+WIPxxx commands to connect to the internet and transfer data . This will almost be a direct replacement for what it appears that you are already doing (expect that htere will eb a few more command steps in the sequence.
  2. Write your own application for the Wavecom modem, using the OpenAT development environment and the WIP library to emulate the one-line command that the XPort does.

Before you go down this path, check that your modem has the ‘Internet Commercial Feature’ enabled. See viewtopic.php?f=9&t=3980 as a starting point for this discussion.

ciao, Dave


#13

David,

Thanks for your response, I was able to setup a client-server tcp connection by using AT+WIPCREATE=2,1,“123.123.234.222”,8789 and I was able to see it the server side.

I am a newbie in the wireless m2m applications, maybe you or somebody else can give me a hint how to initiate a telnet session between the client and the server. In some wavecom applications I saw for example providing login and password in the AT command to establish a ftp connection by sending this command AT+WIPCREATE=4,1,”ftp.wavecom.com”,”admin”,”123456”

I appreciate it.


#14

Hiya,

Telnet (as I understand it) is an (almost) raw, byte oriented socket transfer.

You should be able to create your socket connection using AT+WIPCREATE=2,1,“123.123.234.222”,23 as you have been doing, and get a logon prompt from your telnet server - and then your slave device can do the login etc as normal. Note that you will have to use port number 23 as your destination port in the +WIPCREATE command to access your Telnet server (unless you have changed the default telnet port number).

I believe that you close the socket connection by sending a CTRL-Z (Ascii 26 decimal) character - so be careful if oyu are transferring binary data across the socket link.

Also, remember that the M1306 is now obsolete, so if you are intending on rolling this application out to a number of devices I would look into using the new Fastrack Supreme modem.

ciao, Dave


#15

David,

Thank you for your response. I have now telnet server running on port 23, so I initiate the call with AT+WIPCREATE=2,1,“123.123.234.222”,23 but I don’t see any return from the server to enter login and password, we I can see that a TCP connection is established I had to close the socket connection from the server, I haven’t tried Ctrl-z.
regarding your comment on the data format yes I am going to transfer binary data and I know it’s a problem with the format all the machines are not the same, like a 16 bit integer the value 1 as 00 01 in hex is different in other machine, it will be translated as 01 00, but we can do a workaround.

For the next comment, I am going to implement this in a big number of machines, right now I got Fastrack 1306B-2 Model Q24 Plus Q24PL001 for testing,

Thanks again


#16

Hiya,

I’ve just had another re-read of the WIP AT doco. The AT+WIPCREATE command creates the socket (as you are seeing), then you have to use the AT+WIPDATA command to send/receive data. Have another look at section 6.2 of the WIPAT Commands User Guide for further info. There’s also some examples at the end of the doco - in particular, you may be interested in looking at section 9.1 - TCP Socket example.

I’m using the Q2686 modules and associated WIP library. Your version may not have the same functionality as you are using an obsolete product…

ciao, Dave


#17

Hello David,

Thank you for your help, it’s working now but I had to run a TCP listener on the server side, and use AT+WIPCRATE and AT+WIPDATA and it connect without any issues.
my question is for example after AT+CREATE I receive
+WIPREADY: 2,1
+WIPDATA: 2,1,9

and than I type AT+WIPDATA= 2,1,1 to Connect. So will the modem echo me WIPREADY:2,1 and WIPDATA: 2,1,9 each time I try to connect if yes is it going to have same values ?

Thanks again for your help.


#18

Hiya,

My copy of the WIP AT Commands Guide indicates that AT+WIPCREATE=2,… will always respond (sometime after the command) with the unsolicited response +WIPREADY:2,…; and that AT+WIPDATA=2,… returns an unsolicited response of +WIPDATA: 2,…, when new data is received on your socket ( is the number of bytes available to read).

You probably need to have another read of the doco - sometimes it takes a number of reads to really understand the way these modems operate :smiley:

ciao, Dave


#19

Thanks David for your response,

I was able to connect to the remote machine using a telnet session.
my server side app. is sending commands to communicate with the firmware but in Binary, some how the firmware doesn’t understand so it ignores those commands. but using the same send & request over the Ethernet it works just fine.
is there a way to force the connection to use 8 bit transmission and not 7 bit. I saw in the manual 11.2 IP Protocol Services talking about options numbers on TCP client and TCP server sockets and Option number 40 shows boolean “TYPE” Data representation type. This can be Binary (value is “1”) or ASCII(value is “0”). Default type is ASCII.

is it something I could use for this type of connection ?

Thanks

Rabie


#20

Hiya,

I’m not sure how the telnet protocol handles binary characters. There may be an escaping mechanism, but I’ve never had to use it.

When I have to shift binary data over an unknown channel, I simply UUEncode or BINHEX the data. This turns everything into 7 bit printable characters - but the downside is that the amount of data being transferred will gow in size.

ciao, Dave