Esato

Forum > Sony Ericsson / Sony > Technical > sending AT-Commands via usb port (problem with USB)

Author sending AT-Commands via usb port (problem with USB)
George_f
K750
Joined: Mar 15, 2006
Posts: 9
From: Paradise, Fallen on the Earth!
PM
Posted: 2006-03-15 21:56
Reply with quoteEdit/Delete This PostPrint this post
Hi,
I would like to write an application that sends AT-Commands to my Sony Erricsson phone(K750i). my phone connects to PC via usb port.
I don't know how can I send commands to usb port. in fact I have problem with communicating to usb port.
It would be greatly appreciated if you help me out.

-Thanks in advance
surapat
T68 gold
Joined: Mar 17, 2006
Posts: 1
From: bangkok
PM
Posted: 2006-03-17 01:27
Reply with quoteEdit/Delete This PostPrint this post
first of all, you must look for COMXX port from device manager. All K750i series phone will emulate COM port from internal h/w of each phone after plug in USB.
George_f
K750
Joined: Mar 15, 2006
Posts: 9
From: Paradise, Fallen on the Earth!
PM
Posted: 2006-03-17 14:06
Reply with quoteEdit/Delete This PostPrint this post
Firstly thank you for your response. As you said, I looked in device manager & found that my phone uses com7(WMC Device management) & com6(WMC OBEX interface).do you mean that for sending commands to my phone, I should suppose that I am just writing an application for serial port?
I use Delphi for writing codes. in delphi there is a comport component for
communicating with serial port, I used this componenent & wrote a small
application for sending AT commands. I sent 'AT', but instead of getting 'OK' from phone, I got 'AT'!!!!. I tested both com6 & com7.
I tested with 'ATI0' command but it didn't respond
please let me know what I should do now?

-thanks again for your attention
George_f
K750
Joined: Mar 15, 2006
Posts: 9
From: Paradise, Fallen on the Earth!
PM
Posted: 2006-03-19 14:09
Reply with quoteEdit/Delete This PostPrint this post
no idea?
max_wedge
Xperia Neo Black
Joined: Aug 29, 2004
Posts: > 500
From: Australia
PM, WWW
Posted: 2006-03-19 23:10
Reply with quoteEdit/Delete This PostPrint this post
try testing first by using a terminal application like hyperterm. once you get the commands working and the right response you can put it in your app. I've used the usb cable comport to send AT commands to my phone and AT gets the "OK" response.
George_f
K750
Joined: Mar 15, 2006
Posts: 9
From: Paradise, Fallen on the Earth!
PM
Posted: 2006-03-20 09:06
Reply with quoteEdit/Delete This PostPrint this post
In HyperTerminal, every thing is ok. when I send 'AT' I receive 'OK' & when I send 'ATI' I receive my phone

model(K750i), but in my application, when I send these commands, I just receive my own sent command, for

example in the response of 'AT', I get 'AT', & when I send 'ATI', I get 'ATI'. this is my code in delphi

(ComPort is the name of the serial port component, which I use) :

procedure TForm1.SendButtonClick(Sender: TObject);
begin
if ComPort.Connected <> true then
ComPort.Open;
ComPort.WriteStr('AT');
end;

procedure TForm1.ComPortRxChar(Sender: TObject; Count: Integer); //triggered when any thing received from port
var
Str: String;
begin
ComPort.ReadStr(Str, Count);
ReceiveMemo.Text := ReceiveMemo.Text + Str;

end;

I should mention that I use COM6 or COM7 for sending commands, and these ports has been specified in Device

manager with the 'Sony Ericsson 750 USB WMC device management' & 'Sony Ericsson 750 USB WMC OBEX interface'

comments.
please let me know what language you use for writing the same applications? do you use components for communicating with serial
port or you use API?
-Thanks again
George_f
K750
Joined: Mar 15, 2006
Posts: 9
From: Paradise, Fallen on the Earth!
PM
Posted: 2006-03-20 21:28
Reply with quoteEdit/Delete This PostPrint this post
I found where was my mistake
I had forgotten to add CR at the end of my command. by adding the #13#10 code at the end of my command(AT), it worked well.
thanks again for your attention

[ This Message was edited by: George_f on 2006-03-20 20:28 ]
max_wedge
Xperia Neo Black
Joined: Aug 29, 2004
Posts: > 500
From: Australia
PM, WWW
Posted: 2006-03-21 00:47
Reply with quoteEdit/Delete This PostPrint this post
yep, carriage return is rather necessary
Access the forum with a mobile phone via esato.mobi