RocNet Protocol documentation ... netnode-en

RocNet Protocol documentation

Postby Dagnall » 20.09.2016, 14:05

Can I suggest an update for the ?
Code: Select all
18   set channel   channel#   valueH   valueL   

When I use the (excellent) "Fine Tune" tab, I am seeing a 4th data byte, with the value (0: Set offPos , 1: Set onPos)..
I'm not sure if there other settings for offsteps, on steps or options elsewhere.

Also, a note here for anyone else doing their own RocNet:
Where the documentation says (as an example..
Code: Select all
(write port event)   port#    idH   idL   port

This means in effect that you can have many more than just the 4 data bytes shown.. as you will actually get multiple ports data sent in a single message : port1, idH(port1) , idl(port1) port(port1), port2, idH(port2) , idl(port2) port(port2),
Its really obvious when you see it ! :wink:

All the best

Re: RocNet Protocol documentation

Postby Dagnall » 18.02.2017, 17:36

An question about the protocol..And specifically the rocnet response to Identify.

Is there somewhere where "class" ( data1 of the "group 3, code 8" byte in the identify response) is documented. ?
I think "bit 0= accessory"" bit 1= dcc" "Bit 3=RFID", but what do the other bits represent??

I would also like to better understand the group 7 code 5 data format,
I cannot find any precise documentation for "iotype; flags; cstype; or csdevice" and It also seems to need a 5th data byte that is not shown in the documentation...?

At the moment i have built up my response message with the following code, which shows what these variables mean, based on the github info... But I am afraid I am still confused :oops: .. ..
Can you give a simple explanation of what each bit of the variables means... :)

Code: Select all
          sendMessage[8] = RN[15]; //    iotype      0=GPIO, 1=I2c-0, 2=I2C-1not pi
          sendMessage[9] = RN[16]; //    flags bit    0 = ack (data->sack ? 0x01:0x00) | (data->rfid ? 0x02:0x00) | (data->usepb ? 0x04:0x00) | (data->adcsensor ? 0x08:0x00);
          sendMessage[10] = RN[17]; //   cstype     :0=none, 1=dcc232, 2=sprog //(  for [9]>tl_info ? 0x10:0x00) | (data->tl_monitor ? 0x20:0x00) | (data->ismobile ? 0x40:0x00);
          sendMessage[11] = RN[18]; //  csdevice usb 0/1
          sendMessage[12] = RN[19];

is there somewhere where these variables are clearly defined??

Many thanks

Re: RocNet Protocol documentation

Postby rjversluis » 18.02.2017, 17:47

Hi Dagnall,

Code: Select all
#define RN_CLASS_IO      0x01
#define RN_CLASS_DCC     0x02
#define RN_CLASS_RFID    0x04

Those bits are saved in the class member variable:
Code: Select all
    TraceOp.trc( name, TRCLEVEL_INFO, __LINE__, 9999, "queryids request from %d to %d", sndr, rcpt );
    msg = allocMem(128);
    msg[RN_PACKET_NETID] = data->location;
    rnReceipientAddresToPacket( sndr, msg, 0 );
    rnSenderAddresToPacket( data->id, msg, 0 );
    msg[RN_PACKET_LEN] = 7 + StrOp.len(data->nickname);
    msg[RN_PACKET_DATA+0] = data->class;
    msg[RN_PACKET_DATA+1] = 70;
    msg[RN_PACKET_DATA+2] = revisionnr/256;
    msg[RN_PACKET_DATA+3] = revisionnr%256;
    msg[RN_PACKET_DATA+4] = 128;
    msg[RN_PACKET_DATA+5] = data->ip[data->ipsize-2];
    msg[RN_PACKET_DATA+6] = data->ip[data->ipsize-1];
    StrOp.copy((char*)&msg[RN_PACKET_DATA+7], data->nickname);

Best Regards, Rob.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
Site Admin

Re: RocNet Protocol documentation

Postby Dagnall » 29.07.2017, 18:23

Rob, sorry, some more questions.
Group 5, Message 7 is defined as 'read option' with data "iotype flags cstype csdevice".
I think I have these being sent correctly.

However.. the "OPTIONS " TAB also shows 'I2C Detect' with some addresses for 'GCA-Pi-02' ..03 ..04 ..07 and "rocdisplay"..
Where and how are these address variables sent to rocview??

I would like to set these correctly in my ESPWIFIRocnet code... which currently reports a
GGCA-Pi02 addresses of 0x22 0x24 .. (but these address change for unknown reasons with multiple 'get' )
"GCA-Pi07 address of "0x48 0x49 "

Many thanks

Re: RocNet Protocol documentation

Postby rjversluis » 30.07.2017, 07:03

Hi Dagnall,

a snippet:
Code: Select all
    iONode node = NodeOp.inst(, NULL, ELEMENT_NODE );
    wProgram.setmodid(node, sndr);
    wProgram.setcmd( node, wProgram.getoptions );
    wProgram.setval1( node, rn[RN_PACKET_DATA+0] );
    wProgram.setval2( node, rn[RN_PACKET_DATA+1] );
    wProgram.setval3( node, rn[RN_PACKET_DATA+2] );
    wProgram.setval4( node, rn[RN_PACKET_DATA+3] );
    /* I2C scan of 0x20, 0x30 and 0x40 */
    wProgram.setval5( node, rn[RN_PACKET_DATA+4]*256 + rn[RN_PACKET_DATA+5] );
    wProgram.setval6( node, rn[RN_PACKET_DATA+6]*256 + rn[RN_PACKET_DATA+7] );
    wProgram.setval7( node, rn[RN_PACKET_DATA+8]*256 + rn[RN_PACKET_DATA+9] );
    wProgram.setval8( node, rn[RN_PACKET_DATA+10] );
    if( rn[RN_PACKET_LEN] >= 13 )
      wProgram.setval9( node, rn[RN_PACKET_DATA+11]*256 + rn[RN_PACKET_DATA+12] );
    wProgram.setiid( node, data->iid );
    wProgram.setlntype(node, wProgram.lntype_rocnet);
    data->listenerFun( data->listenerObj, node, TRCLEVEL_INFO );

I now documented it in the Wiki.
The 16 bit I2C scan values are bitmaps.

BTW: I added the C-Headerfile: ... t-en#files
Best Regards, Rob.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
Site Admin

Return to RocNetNode