PDA

View Full Version : fbus/infrared version 2 protocol problem



leg0man
04-01-2003, 01:47 AM
Hi,

I'd like to develop a Java program to view phone details from my 6210.
I have read the gnokii documents and lots of web pages of the fbus/infrared/mbus protocol but i can't manage it, to send i.e. a reset command to my phone via IR. With logomanager it works.

Here is my fbus command line (reset) for an infrared connection.

1C 00 0C 40 00 06 00 01 64 03 01 41 05 75

When I send this to my phone, i saw on my phone display that a connection is established, but nothing happens......no reset.The line above is the only command I send to the phone....ACK I don't need, I think.

Has anyone some sources or code examples for me?
Can anyone help me?

Greetings

leg0man

slikmik
04-01-2003, 02:09 AM
not too sure but when u send reset command as above in your thred the fone sends one back and u need to acknowledge it

so try a simple acknwledge after a set time and it should work dude :)


Mike

leg0man
04-01-2003, 11:35 AM
Hi,

first I'd like to thank you slikmik for your help.
But I can't get it to work.

I think anything is wrong with my command.

this is my pseudocode I send via IR to my phone.
I also send my commands with RTS ANS DTR enabled...because of FBUS/IR protocol.

sendCommand("1C000C4000060001640301410575");
sleep(100);
sendCommand("1C000C7F016E");
sleep(100);
sendCommand("1C000C4000060001640301420675");
sleep(100);
sendCommand("1C000C7F026D");

I think, the first part (1C000C40000600016403) is without errors.
1C= IR/FBUS
00=mobile phone
0C=PC
40=security commands
00=have to be set
06=Frame length (without padding byte because of "even")
0001=Header for "Reset"
6403= RESET

I think, the error must be here (01410575)
01=last frame (Frames to go)
4= First Block (0=continuing block)
1=Sequence Number
05= ODD XOR
75= EVEN XOR

I'm wondering, because the sequence number is only a "half byte"...but it is described as a half byte in gnokii documents.

When you look above, you see I've also tested acknowledge...hope my command is right. But when I look at the gnokii documents....I think no Acknowledge is necessary in FBUS/IR protocol.

I don't know where my error is.
Hope slikmik or someone else can help me.

cu

leg0man

slikmik
04-01-2003, 06:55 PM
post your "sendcommand" sub routine please

maybe sendcommand"xx xx xx xx xx" will work

Mike

p.s. happy to help (well TRYING to! :))

leg0man
04-01-2003, 08:46 PM
Hi,

my "sendcommand" only executes

printStream.write(command.getBytes());

command is a String.

Mhhh I thougt, FBUS has DTR AND RTS enabled...but in fbus.c in the gnokii project they disable RTS like in M2BUS.

Does anyone know whats right?

I also saw, that in fbus.c a special init string was send to the phone ( 32times "0x55" and 1time "0xC1") and an init string with messagetyp "0x02" !!! that confused me....because messagetype 0x02 means SMS !!!

I had also an error in my reset command I have posted.
You must switch the 2 checksums at the end.....first checksum of frame 0,2,4,etc.....then checksum of 1,3,5,etc......

But I can't get it to work.
I have tried the init with 0x55 and 0xC1.....
I dont't know whether the init with 0x02 will work.....

I've tried to log logomanager commands via IR with portmon....but it doesn't work......Has someone else a solution for this?

I think, there has to be a special init string before I can send my reset or other commands......Is there nobody who has developed a FBUS program and can help me?

Hope slikmik can help me..:)

leg0man
04-01-2003, 11:59 PM
Hi all,

I can't get it to work. Now I have studied the complete frame transfer from gnokii but it doesn't work. I made the initialisation
like gnokii. For you guys, that want to help me, I post the main method of my Java program.

public static void main(String args[]) {
String command="";
SendAT sendAT = new SendAT();
sendAT.init();

try {
//***************************************
//***************************************

//SAME INITIALISATION AS GNOKII
// INIT infrared via FBUS
for (int j=0;j<32;j++){
sendAT.sendCommand("55");
}
sendAT.sendCommand("C1");

Thread.sleep(100);

command="1C000C02000A0001000d000002014000";
command=command+sendAT.make_XOR("1C0C000000000240");
command=command+sendAT.make_XOR("00020A010d000100");
sendAT.sendCommand(command);

Thread.sleep(1000);

//***************************************
//***************************************


command="1C000C400006000164030141"; //reset
command=command+sendAT.make_XOR("1C0C00006401");
command=command+sendAT.make_XOR("004006010341");
sendAT.sendCommand(command);

Thread.sleep(100);

command="1C000C7F01"; // Acknowledge
command=command+sendAT.make_XOR(command);
sendAT.sendCommand(command);
Thread.sleep(100);

command="1C000C400006000164030142"; // reset
command=command+sendAT.make_XOR("1C0C00006401");
command=command+sendAT.make_XOR("004006010342");
sendAT.sendCommand(command);

Thread.sleep(100);

command="1C000C7F02"; //Acknowledge
command=command+sendAT.make_XOR(command);
sendAT.sendCommand(command);

} catch (InterruptedException e) {
}

sendAT.close();
}

I think, I don't need acknowledge...but it should not to be an error.

I set portspeed to 9600 and RTS=false and DTR=true.

The inititalisation is like gnokii does it.

Please help me....

Greets

leg0man

slikmik
05-01-2003, 02:51 AM
erm well i'd love to help really i would but im confused by java only use vb6 really, but am interested of anybody can help

sinse as u have initialisation, wait time and acknowledgement i have no other ideas :( sorry

good luck though!!!

Mike

p.s. maybe its the length of the sleep times (?????)

leg0man
05-01-2003, 11:10 AM
mhhhh does anyone know if it's possible to sniff infrared?
if i can sniff the logomanager connection to my phone....that would be great....

thanks again for your will to help me, slikmik.

greets

leg0man

leg0man
07-01-2003, 09:57 AM
hi all,

the complete last week I tried to implement
FBUS via infrared....now I think I know why it doesn't work.
I think Nokia 6210 doesnt't support infrared connection via ircomm2k in windows2000.....Only
irda connection via Microsoft irda stack works.
But I have no solution to communicate with my mobile phone via Java. With JAVACOMM only COM ports are supported...no Microsoft irda stack...
I think with Nokia 61XX it should work with Java and infrared.....So the only way is to implement it with visual basic or visual c++ I think.

But I will thank all members here who tried to help me.

This was just for information if someone else has the same problem as I.

Greets

leg0man

iamqq
10-02-2003, 03:21 AM
hi leg0man:
i check your reset command "1C000C4000060001640301410575"
,then i think the ckeckSun1 and checkSum2 should be change the position==>"1C000C4000060001640301417505"

try it...... i hope it can help u !!

nfrodo
07-03-2003, 04:36 PM
The message is OK, but you should "translate" it to byte format and then send to port. The telephone understands only byte format. So every two hex letters will be one byte. Try, I am using FBUS connection without problems.
If you have more questions post it.

baloo
18-03-2003, 05:35 PM
Did you try to post 'Enable extended command' first? It is very important to send it before you want to use other commands from 0x40 series.

Baloo...

Kim Mortensen
09-05-2003, 10:04 PM
Im New to this, but am an electronics ingeneer and are realy lookin for some sort of document to describe the bytes in the messages send back and forth from the phone and the PC.

I have used the logomanager and tried to sniff the messages, and do reverse ingeneering, but there are some bytes that I simply can not find any answers to - And I hope you gyus can help.

The thread was aktually great for getting started, and im looking forward for further help on this thread...

I sniffed the following message which is send when logomanager starts up, and I thought it would be great for a starter:

1E 00 0C D1 00 07 00 01 00 03 00 01 45 00 57 D5

I have no clue on whats goung on from byte 5 to 11, and also dont know where to find the information.

Please help...