Hi,
I'm looking for a way to automatically detect my boards plugged into a network without knowing their ip address (no fixed IP). I would like to see all my boards (with their mac address) on my computer and then give them an IP address set by me.
someone has an idea?
thank you in advance.
Have your boards run a UDP server which recognises a 'magic packet' and replies with a 'magic response'. Then write an app to broadcast a UDP 'magic packet' on the subnet, accumulate the 'magic packet' responses. Once you know what is there and what the IP addresses are, you can communicate to set other parameters.
The "magic packet" is not reserved for the Wake-On-Lan? The "magic packet" supports multiple answers at the same time?
Is the TCP stack of Keil supports the "magic packet"? I have not seen anything on this site on keil.
Can you give me some more information? I do not understand how to do exactly.
Thanks.
This would be a packet that you (and your equipment) would recognise and not other equipment - Nothing to do with Wake-On-Lan.
It is data that you choose, along with a port number. No reason for Keil to mention it, since it is just data.
For example, you could broadcast from your PC "JB PACKET FOR JB EQUIPMENT" on port 9900.
Your board(s) might be listening on port 9900 and if they receive a packet, check it for that unique data and, if found, return a packet "JB PACKET FROM JB EQUIPMENT" to port 9900.
Your PC application could accumulate all received packets, check them for acceptability and then process them accordingly.
Of course, you may well want to put in more stringent checks to stop false detections.
BTW This is actually a fairly standard method of checking for devices on a network, and the Keil TCPnet stack can be used to achieve it.
Hello JB, if you have a DHCP service on your network you might want to just use the NetBIOS name service which is supported by the MDK-Professional middleware. Then you can discover your boards by name and change the IP address to whatever you like.
Regards, Matthias
Hi matthias,
I had thought of this solution, except that the cards are identical (with the same code). So the same NetBIOS name. I'm not sure it works in this case.
Regards.
OK,
I understand better. It's clear. I need either a DHCP server on the network or a static ip in my boards.
thank you for your help.