How to detect board disconnection?
-
This might be a long shot, but...
I'm controlling a Duet 3 from my own C# program. I would like to get a notification on board disconnection or reset. Windows sees that, there is disconnect and reconnect sounds. I have so far found out, that the solution is very much device dependent. Does anybody have deep enough knowledge of the Duet USB implementation behaviour to give me pointers on how to do that?
If no: I suspect that Duet3D people did not write that themselves, but use a driver from the chip manufacturer or some other third party. I could dig deeper on this, if I would know better where to dig... -
@JuKu you could either detect USB disconnection/reconnection in your C# program, or you could use M409 to retrieve parts of the object model at intervals and watch for changes that signal a reboot, such as the up-time decreasing.
-
@dc42 “you could either detect USB disconnection/reconnection in your C# program…” Yes, I was asking how to do that. It is possible but not trivial to get notification for this on a particular device. Further, it needs deeper knowledge of the actual driver providing the serial interface to the application, which I don’t have. So I asked if anyone might have this.
But my approach was wrong. I don’t have that info, but I don’t need it either: The right way to do it is to hook to the general device event and know that some device dis-/reconnected. That is enough, I can then look at the uptime or a variable to find out if it was the Duet.