• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiple netrepns
#10
(July-21st-2021, 06:48 AM)Armin@netPI Wrote: In the morning I tried to setup also two netPIs in the office ... and guess what ... I was having the same problem as you have.

Ethernet network scan tool just shows only one device. So I was really astonished. Each of the devices connected alone to the scan tools worked ... but the remarkable thing was both devices showed me the very same MAC address even if the device label was indicating me a different one.

So I went to the source code and found the following sequence in "PacketHandlerPNS.c"

Code:
uint32_t Protocol_SendFirstPacket(APP_DATA_T *ptAppData){

  uint32_t lRet=RCX_S_OK;
  uint8_t abMacAddr[6] = { 0x00, 0x02, 0xA2, 0x2F, 0x90, 0x58 };
  lRet=Sys_SetMacAddressReq(ptAppData->hChannel[0], &ptAppData->tPkt, ptAppData->ulSendPktCnt++, &abMacAddr[0]);

  return lRet;
}

So the example code configures always a MAC address (the same for all) for each of the netPIs and overwrites the one installed during production and this is why it does not work to run two or more netPIs the same time on the network.

Since I didn't want to change the calling process in "PNS_simpleConfig.c" source code

Code:
lRet = Protocol_SendFirstPacket(&tAppData);

instead I did some code modifications in "PacketHandlerPNS.c" to get rid of the SetMacAddress feature

Code:
uint32_t Protocol_SendFirstPacket(APP_DATA_T *ptAppData){

  uint32_t lRet=RCX_S_OK;
  //uint8_t abMacAddr[6] = { 0x00, 0x02, 0xA2, 0x2F, 0x90, 0x58 };
  //lRet=Sys_SetMacAddressReq(ptAppData->hChannel[0], &ptAppData->tPkt, ptAppData->ulSendPktCnt++, &abMacAddr[0]);

  lRet=Pns_SetConfigReq(ptAppData->hChannel[0], &ptAppData->tPkt, ptAppData->ulSendPktCnt++);
 
  return lRet;
}

So instead of configuring the MAC address, I directly start with the configuration as "first packet".

BUT ONE MORE THING ... since my two netPIs already got a MAC address before due to the previous "wrong" code ... a reset of the netPIs Industrial Ethernet Controller was necessary to get it removed. The trick is to call one of the other examples that are included in the programming example container like ./ECS_simpleConfig ... this causes a firmware reload into the controller and hence a reset. Afterwards calling my recompiled example ./PNS_simpleConfig succeeded.

Now I am able to see both of my netPI working with the labeled MAC addresses as expected.

Thx
Armin

thank you for the support. I will try it next week
  Reply


Messages In This Thread
multiple netrepns - by royazriel - July-18th-2021, 01:03 PM
RE: multiple netrepns - by Armin@netPI - July-18th-2021, 02:54 PM
RE: multiple netrepns - by royazriel - July-20th-2021, 01:00 PM
RE: multiple netrepns - by Armin@netPI - July-20th-2021, 01:14 PM
RE: multiple netrepns - by royazriel - July-20th-2021, 01:19 PM
RE: multiple netrepns - by Armin@netPI - July-20th-2021, 02:34 PM
RE: multiple netrepns - by Armin@netPI - July-20th-2021, 03:00 PM
RE: multiple netrepns - by royazriel - July-20th-2021, 03:21 PM
RE: multiple netrepns - by Armin@netPI - July-21st-2021, 06:48 AM
RE: multiple netrepns - by royazriel - July-21st-2021, 07:47 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)