BiDi addressing problem

Moderator: Moderators

BiDi addressing problem

Postby Buddace » 29.05.2018, 23:39

I have problem with addressing DIY BiDi detector in rocrail using OPC_MULTI_SENSE.
Detection in rocrail sensor work fine with sensor address 1 to 4...but don't work with address 263 (I don't tested other value a this time). Address 263 in rocrail is located like address 1. To debug I sniffed with Lonotet Sniffer and it look right address 263.
I attached plan with rocrail.ini and trace.
You do not have the required permissions to view the files attached to this post.
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 30.05.2018, 06:47

only provide the trace file with the multi sense packet.
Better: Show your program snippet how you set the address in the packet.
Code: Select all
20180530.001407.763 r9999c lnreader OLocoNet 0719 BDL[1] RX[7] zone [D] reports [present] of decoder address [652] direction [-]
20180530.001407.764 r9999a lnreader OModel   4950 trying to match sensor event: [LNPC] 0:7 uidname=[] state=1 code=652

Not 263 but 652...

The OPC_MULTI_SENSE is a classic LocoNet packet and is used for many decoders like BDL, Lissy, DR5088RC, ...
The addressing in Rocrail is correct.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby Buddace » 30.05.2018, 07:24

652 is detected Locomotive Address
You do not have the required permissions to view the files attached to this post.
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 30.05.2018, 07:32

OK, the BDL section number is 7:
Code: Select all
20180530.081802.480 r9999c lnreader OLocoNet 0719 BDL[1] RX[7] zone [D] reports [present] of decoder address [652] direction [-]
20180530.081802.481 r9999a lnreader OModel   4950 trying to match sensor event: [LNPC] 0:7 uidname=[] state=1 code=652
20180530.081802.482 r9999a lnreader OFBack   0725 fb[S1N_1] state=ON code=652 dir=fwd val=0 count=1 regval=0
20180530.081802.483 r9999a lnreader OFBack   0774 fb [S1N_1](ON) code=652 val=0 count=1 absent=0 call listener 0x01000DEC...


The monitor log does not show the binary packet.
You did not answer all my questions.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby Buddace » 30.05.2018, 08:22

I'm sorry but in Loconet log:
08:18:02.486: [D0 22 06 05 0C 02] Transponder address 652 present at LR263 () (BDL16x Board ID 17 RX4 zone D).


and rocrail trace:
20180530.081802.480 r9999c lnreader OLocoNet 0719 BDL[1] RX[7] zone [D] reports [present] of decoder address [652] direction [-]


For same packet rocrail tell BDL1 and Loconet sniffer 263 (right). Rocrail switch on feedback with address 1

The monitor log does not show the binary packet.

Do you talk about loconet data : [D0 22 06 05 0C 02] ? :beer: :beer: :beer: :beer:
Thanks
Nuccio
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 30.05.2018, 08:54

Zone and section is in your packet 0x06: BDL 1 sensor address = 6+1(Rocrail + 1 offset) = 7.
7 is also used for looking up a fitting sensor.

http://wiki.rocrail.net/doku.php?id=loc ... e_opcodes2

OPC_MULTI_SENSE is not documented in the LNPE...

Code: Select all
static void __handleTransponding(iOLocoNet loconet, byte* msg) {
  iOLocoNetData data = Data(loconet);

  int type         = msg[1] & OPC_MULTI_SENSE_MSG;
  int dyntype      = msg[1] & MULTI_SENSE_DYN_ITEMMASK;
  int addr         = msg[2] + ((msg[1] & 0x01) ? 0x80:0x00);
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby Buddace » 30.05.2018, 09:51

rjversluis wrote:
http://wiki.rocrail.net/doku.php?id=loc ... e_opcodes2

OPC_MULTI_SENSE is not documented in the LNPE..]

I used JMRI and LoconetOverTcp to decode (both software show expected address)
Code: Select all
//;<OxD0>,<ARG1>,<ARG2>,<ARG3>,<ARG4>,<CKSUM>
//;<OPC>=0xD0
//;<ARG1>=0x20 // MSG field: transponder seen
//;<ARG1>=0x00 // MSG field: transponder lost
//;<ARG1>=0x60 // MSG field: Power message
//;<ARG1>=<0,T1,T0,0- A10,A9,A8,A7>
//;<ARG2>=<0,A6,A5,A4- A3,A2,A1,A0>
//;<ARG3>=ADR
//;<ARG4>=ADR2

[D0 22 06 05 0C 02]

<ARG0>=D0
<ARG1>=22 Transponder seen (0x20), Detector AddressHi =2 (0x02)
<ARG2>=06 Detector AddressLow =6 (0x06)
Detector address (2^8)+(2^2)+(2^1)=262 +1 (offeset)= 263
You don't use low nibble of ARG1, right ? May be useful to use :D
My code:
Code: Select all
//*****************************************************************************
//*send_multisense_data                                                                 *
//*****************************************************************************
BYTE send_multisense_data(BYTE railcom_adrh,BYTE railcom_adrl,BYTE track_sts,BYTE zone){
BYTE multisense_buffer[6],adrl,adrh,i;

adrl=DEVICE_ADDRESS_LOW+zone;
adrh=DEVICE_ADDRESS_HIGH;
if(adrl&0x80){
   adrl=adrl&0x7F;
   adrh=(adrh+1)&0x0F;
}
multisense_buffer[0]=OPC_MULTI_SENSE;
multisense_buffer[1]=adrh|((track_sts<<5)&0x60);
multisense_buffer[2]=adrl;
multisense_buffer[3]=((railcom_adrh<<1)|(railcom_adrl>>7)&0x01)&0x7F;
multisense_buffer[4]=railcom_adrl&0x7F;
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 30.05.2018, 11:39

just ask Digitrax for an official documentation of its multi sense, it has been extended by Digikeijs for RailCom DR5088rc:

Code: Select all
#define OPC_MULTI_SENSE_MSG     0x60 // byte 1
#define OPC_MULTI_SENSE_PRESENT 0x20 // MSG field: transponder seen
#define OPC_MULTI_SENSE_ABSENT  0x00 // MSG field: transponder lost
#define OPC_MULTI_SENSE_POWER   0x60 // MSG field: Power message
#define OPC_MULTI_SENSE_DYN     0x40 // MSG field: RailCom dyn
#define MULTI_SENSE_RAILCOM_DYN 0x40

#define MULTI_SENSE_DYN_ITEMMASK 0x1E
#define MULTI_SENSE_DYN_SPEED    0x00
#define MULTI_SENSE_DYN_FLAGS    0x0A
#define MULTI_SENSE_DYN_INPUT    0x0C
#define MULTI_SENSE_DYN_QOS      0x0E
#define MULTI_SENSE_DYN_QTY_BASE 0x10


As far as I am correctly informed only bit zero of byte 1 is used for address high.
MULTI_SENSE_DYN_QOS uses all other bits.
IMHO LocoNet is not RailCom ready. (sucks)
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby rjversluis » 30.05.2018, 11:55

OK, I found the problem; git pull and test.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby Buddace » 30.05.2018, 12:35

rjversluis wrote:OK, I found the problem; git pull and test.
Can you explain please
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 30.05.2018, 14:58

check revision 13.999+ if its OK.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby Buddace » 31.05.2018, 14:07

rjversluis wrote:check revision 13.999+ if its OK.

I will test tonight.
But question, may be another topic, never consider a method to fill locomotive list in rocrail via railcom (like ecos)?
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 31.05.2018, 16:15

Buddace wrote:But question, may be another topic, never consider a method to fill locomotive list in rocrail via railcom (like ecos)?

Another topic, a new thread with LocoNet and RailCom Plus.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: BiDi addressing problem

Postby Buddace » 01.06.2018, 10:15

rjversluis wrote:check revision 13.999+ if its OK.

Tested work fine with address 263. Are you using all 4 last significant bits ?
www.dccworld.com First and Only Italian DCC Website.

TMWDCC/TBX , zDCC, Lokmaus 2, Arnold DCC, Intellibox, Hornby Select, A lot of Loconet DIY (Loconet SwitcBoard, Loconet P50, etc..)
Buddace
 

Re: BiDi addressing problem

Postby rjversluis » 02.06.2018, 06:51

Buddace wrote:
rjversluis wrote:check revision 13.999+ if its OK.

Tested work fine with address 263. Are you using all 4 last significant bits ?

Yes, all 4.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 


Return to Loconet

cron