-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic device name assignment in mtconnect #10
Comments
John, Thanks for posting the issue. I'll make the changes to the agent and add a
Command to the adapter interface as well as various tests. The search order will be UUID and then Name – not that it should be an issue. |
Name prefixing Name prefixing is only required if the default device given in the cfg file or dynamically assigned by the adapter changes. The prefix of the data item is usually used in sensors that get data from multiple machines like a XBee hub. For the name resolution issue, here are some thoughts... SMB allows for dynamic updating of local DNS with DHCP assigned IP addresses. There are other local BIND compatible solutions for other operating systems as well – samba on linux supports this... you can also do DHCP reservations with a known MAC address. But let's say you can't do any of that... A couple of solutions: If you know the IP address range, a port scan could be done periodically on all machine in that range. If an adapter is found (port 7878 or whatever is given), a connection can be attempted and dynamically assigned as above to the device. An additional port scanner thread would need to be created with a short timeout on connections. The address would need to be given as follows:
or we could net masks, but that will not allow for easy subsetting of the address ranges. More than one range can be specified as well. This would require a meta-adapter or an adapter factory that can create other adapters from the port scanner. Unlike a first class adapter that goes into a wait loop once it disconnects, this adapter will exit and allow the port scanner to reconnect next time. There is some additional house keeping required as well to make sure there are no duplicate connections, etc... |
I have added the
Support in 1.3.0.8 and changed the device name requirements for adapters to allow for a lazy match. I have not built binaries yet, so please download and test. |
* device: <name|uuid> command from the adapter to dynamically set the device for an adapter. Adapters can not be lazy about assigning a device – warning will be generated, but will not be fatal as it was before. Issue #10.
I should clarify my ignorance. I'm not a DHCP expert. Most IT DHCP look at your macid before they let you on the network, and assign you same IP. But I know my old wireless router and natbox randomly assigned IPs - so it can be done. However, I was informed that the MTConnect target application had 20 fixed ips, and the underlying devices on this network changed ips. Whether this is due to a firewall which remaps the ips to confuse hackers, or the mobility of (although macids should be the same), I am not sure. I did not need to know. I do know if you dynamically assign device identification - MTConnect can handle it. I tried it - it works. |
This would be easy to configure with a range or list of IPs. DHCP usually works with ranges of IP addresses, but putting 20 IPs as specific adapters into the cfg file may be tedious, though it will work with the current implementation. The new version will support what you're requiring, except not quite as elegantly as giving a simple IP address range. |
This fixes Issue #10 Removed dlib threads and replaced with std::thread
Question: I want to be able to support Devices that might be assigned to a different IP address at different times. This might happen during DHCP when a router assigns an IP address to the Device. Thus, an existing Device-Agent IP configuration would be invalid. Another possibility is that the devices “move” and then replug into a router (I call this a mobile assets case) while still talking to the same MTConnect Agent. Again, the IP might change, thus nullifying the Device/Agent IP assigned configuration.
Is there any way for MTConnect to do dynamic device assignment not based on IP but on the device name?
I am posting it to the issues web site, soweb crawlers will find my response!
The text was updated successfully, but these errors were encountered: