Barf,
Thank you for taking time to investigate this!
Barf wrote:I claim that, generally speaking, serial-over-USB is not a very good idea. Instead of making a proper USB device, a serial communication from the previous century is just squeezed into USB. To have a security critical component (like a UPS) depend on this does not appear to be a very good idea to me.
I don't share your disdain for and/or aversion to "serial over USB". It's a very handy way to leverage "mountains" of hardware and software from the past. Case in point: I simply refuse to stop using (let alone discard) my expensive, perfectly functional UPS, which has been in daily use for 23 years now, simply because it natively speaks RS-232. A simple, common, inexpensive RS-232-to-USB adapter was all that I needed to connect it to my latest motherboard.
Barf wrote:If you cannot accept "resets", you should not use serial-over-USB. IMHO.
Even after accounting for the "IMHO" part, I'm quite surprised (and disappointed) to hear you say that.
You're using the euphemism "reset" for what I would call "bad, entirely preventable behavior" (i.e. deliberately and automatically opening a serial port without knowing if it's in use or not).
Surely you would not consider it acceptable for a native USB device to be reset simply because some badly designed software decides that it's convenient to see what USB devices are connected by watching them enumerate on the bus. Right??? Because that's analogous to what's going on here.
I have more to say about the subject, but I think it's best to "agree to disagree".
Barf wrote:The "disruptive" serial port scan of nrjavaserial (which is nothing but a slightly developed version of RXTX) appear to sit deep in the library. I did some attempt to have it to work without the port scan, but it was not successful. If you want to try, the sources are available at Github.
Respectfully, I'll pass on that. You know Java far, far better than I do. Frankly, I despise it and hope to continue happily minimizing all encounters with it. So if you tried and failed, I have no chance whatsoever, being honest with myself.
I wrote a simple Linux command-line app a few years ago to read from my IR Widget. The most likely outcome of all this is that I'll put whatever effort I decide to apply into that program at some point instead, since I don't really need a GUI and, if I ever decide I do, can whip one up pretty easily.
Barf wrote:The fact that there does not exist an official, maintained library for serial communication in Java does not exactly make serial-over-USB more attractive. (However, there are several libraries of "hacker quality", nrjavaserial/RXTX,....)
Just another reason why I'll never embrace Java.
Barf wrote:I also should point out that programs like RMIR and IrScrutinizer are user programs, occasionally invoked willingly by the user, who can fix possible side effects. It is not used for "deployment" nor are they invoked as system programs.
Now that really seems like a rather odd position to take. It seems to me to be attempting to defend the bad behavior of that Java serial library.
IrScrutinizer (using the 3rd-party 'nrjavaserial' library) and RMIR (using the JP1 project's own 'jp12serial' library) are the only times I've encountered software that opens serial ports inappropriately, as far back as I can recall.
But we are clearly of different minds on this point. So, again here, I'll "agree to disagree".
Barf wrote:Your desire to use user-supplied device names, which are links and not read device nodes (like /dev/irwidget) is reasonable. It will not make it into 2.4.0 though. I will be happy for a patch...

But as useful as that capability might be, there is absolutely no point (for me) in adding that as long as IrScrutinizer continues to let 'nrjavaserial' abuse my open serial port(s) at startup, before any attempt to use an IR Widget is even begun! So, again here, no patch will be forthcoming.
Regardless of my disagreement with your point of view on "serial over USB" and on the acceptability of a program totally disrupting another program's communication, I still do appreciate your having taken the time to look into the whole issue. I know more now than I did a day ago and that's always a good thing.
