Page 1 of 1

Detecting boards

Posted: Tue Nov 18, 2008 6:08 am
by jleni
I have more than one interface in my computer and netburner's software seems to detect udp packets only on the first active interface it finds. Is there any way I can set which interface to use?
As most recent notebooks I have one ethernet, one 802.11 and one UMTS stick.

I find very important to have internet access while I work so I don't find funny to plug/unplug every time I switch from eclipse to a browser...!!

I can't imagine if I have to tell a customer about this issue...

Please I really need an answer... !

Re: Detecting boards

Posted: Tue Nov 18, 2008 7:28 am
by Chris Ruff
It is not clear what your problem is..

What is not working? What steps do you do that breaks something. Is the problem Auto Update? IP Setup? some custom use of UDP?

The NB module doesn't 'find' interfaces, it only responds to UDP packets that are addressed or broadcast to it. And then responds via UDP.

Chris

Re: Detecting boards

Posted: Tue Nov 18, 2008 8:50 am
by yevgenit
You need correctly set IP address and network mask for each network interface (connection).
The router of Windows will forward IP packets to the correct direction.
See the details at any introduction to networking.

You can use the untouched network settings of your computer, if all the devices are connected via either ethernet switch or hub.

> I have more than one interface in my computer
> and netburner's software seems to detect udp packets
> only on the first active interface it finds.
> Is there any way I can set which interface to use?
> As most recent notebooks I have one ethernet, one 802.11 and one UMTS stick.

Re: Detecting boards

Posted: Wed Nov 19, 2008 2:09 am
by jleni
Sorry if wasn't clear enough.
I am talking about netburner's pc tools (eclipse, ipsetup, etc). Those tools usually broadcast some UDP packets on the computer network interface to detect any board in the LAN. Later you can setup the board. I know I could set the address from a serial interface or use DHCP, and routing will find a way to get to the board..

Board detection is not working because it seems that the packets are sent on the wrong interface. In fact the first one the application finds. I'll be looking at those tools source code today to find a simple fix.

Re: Detecting boards

Posted: Wed Dec 10, 2008 1:33 am
by jleni
Ok, the easiest fix I found was to change routing and run the following command from command line

route change 255.255.255.255 mask 255.255.255.255 xxx.xxx.xxx.xxx

where x is the address of the interface your board is connected to..

It is a little difficult to explain that to a customer when the product is deployed and someone wants to update the firmware

Re: Detecting boards

Posted: Wed Dec 10, 2008 3:17 pm
by thomastaranowski
There is a limitation with the NBFind algorithm portion of the auto update tooling which prevents it from working on multihomed hosts (if you have more than one network card on your laptop, and the netburner isn't on the default one). I have a fix, but it's a c# app and it doesn't do autoupdate, so it's not much use. The trick is that you have to broadcast out to all interfaces, not just the default, and there is some weirdness in interacting with the windows stack that makes it non-trivial.

Basically, it works like this, and shows the general idea.

//Send the discovery request out all networks
List<IPAddress> laddr = GetAllAdapterIPAddrList();
IPEndPoint remoteEP = new IPEndPoint(IPAddress.Broadcast, 0x4e42);
IPEndPoint anyLocalEP = new IPEndPoint(IPAddress.Any, 0x4e42);
foreach (IPAddress addr in laddr)
{
IPEndPoint localEP = new IPEndPoint(addr, 0x4e42);
UdpClient udp = new UdpClient(localEP);
DiscoveryStruct discovery = new DiscoveryStruct();
discovery.init();
byte[] tmp = Serialize(discovery);
int bytesSent = udp.Send(tmp, Marshal.SizeOf(discovery), remoteEP);
udp.Receive(ref anyLocalEP);
udp.Close();

}

Re: Detecting boards

Posted: Thu Dec 11, 2008 11:39 am
by jleni
I know that I could fix it that way.. however, the problem is that I would need to update all netburner's applications. In fact, I did that with "IP Setup Tool" but using eclipse was not working, etc.. So I decided that the best option was changing the route.
By now the best way to support a client with this problem is that... so we don't have to rewrite NB tools. I hope that in the near future they add at least a registry key to set which interface we want to use.. or broadcast to all of them..