Mixed Messages

« Return to Article
  • Grant P. 2007-08-27 15:33
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.
  • ParkinT 2007-08-27 15:37
    RS-232. Ah... the good old days.
  • Lysis 2007-08-27 15:41
    Techie cat is not amused.
  • KattMan 2007-08-27 15:45
    Let me guess, he went on to market this as the first mainframe mouse.

  • AdT 2007-08-27 15:48
    We all love Microsoft Windows.
  • MX5Ringer 2007-08-27 15:51
    HHHHHHMMMMMMM!!

    Not so much a WTF,

    If only he'd plugged in a UPS Serial uplink cable as well that would have been 2 wtf's in 1.

    Maybe!

    I'm a but drunk!

    But still.

    Captcha: sanitarium (and I'm a registered user, how terribly apt!!)
  • Macxdmg 2007-08-27 15:57
    i wish my validation pc had a mouse :(
  • dan krüsi 2007-08-27 16:07
    Good story. Thanks for the post.
  • Kemp 2007-08-27 16:20
    So I'm expected to believe that it worked fine sending data to his logging app over the serial port for a while and then suddenly Windows decided it was a serial mouse? Is this even possible? To my knowledge Windows doesn't try to interpret the data being sent back and forth in these scenarios purely because it could be absolutely anything, that's up to the app to know what to do with. Any supposed magic byte sequence would be sent eventually no matter what you hooked up (assuming you were sending purely binary data, text data could most likely hit it too if you used characters outside the A-Z, a-z and 0-9 range).
  • Steve 2007-08-27 16:23
    So what was causing the issue with the motor?
  • ebs2002 2007-08-27 16:24
    Kemp:
    So I'm expected to believe that it worked fine sending data to his logging app over the serial port for a while and then suddenly Windows decided it was a serial mouse? Is this even possible?


    Think about Plug-and-play. I plug in my mouse, and Windows knows it's a mouse! I unplug the mouse and plug in a hard drive, and Windows knows it's a hard drive! I have a 4-port USB hub, plug in a mouse and a hard drive, then unplug the hard drive and plug in an external sound card, and Windows recognizes it (even though it didn't know that something was unplugged or plugged back in).

    While I don't know this for sure, it logically seems that USB devices send a byte sequence that Windows is constantly sniffing for. I would imagine that any port that has plug-and-play support would do the same (like a serial port).
  • Karl von L. 2007-08-27 16:30
    I remember that Windows 2000 had a bug in which the mouse would suddenly start doing this anyway. That is, you'd move the mouse slightly, and the pointer would jump around randomly, occasionally clicking on whatever happened to be under it. But it would be fine after a reboot.
  • Anon 2007-08-27 16:46
    ebs2002:

    While I don't know this for sure, it logically seems that USB devices send a byte sequence that Windows is constantly sniffing for. I would imagine that any port that has plug-and-play support would do the same (like a serial port).


    That's nice, but when did a serial port become plug and play?
  • unklegwar 2007-08-27 16:46
    Interesting story, sure.

    But "Worse Than Failure"? Hardly.

  • FredSaw 2007-08-27 16:55
    MX5Ringer:
    I'm a but drunk!
    Most people are; but it's good that you recognize it. And by the way, it's spelled with two t's.
  • yaff 2007-08-27 16:56
    My guess is that something is lost in translation, here. I've seen this happen, but only if Windows is restarted. It performs a serial port scan at boot-up to find serial mice. It used to drive us crazy at my previous job. We developed a piece of equipment that continuously updated a VT-100 GUI via the serial port. Windows found a mouse on that serial port every time.

    Solution? We used VT terminals instead of laptops. Mmmm... green phosphor.
  • Lanth 2007-08-27 17:06
    I had this problem once. Glad I finally know why it actually happened.

    I develop routers at my job, which of course get plugged in to the serial port. One day I restarted my computer and the mouse went completely nuts like this - more reboots later and it persisted. Eventually I simply unplugged everything from the back and plugged it all back in - no problem.

    The curious thing is that I'd had that router plugged in to the serial port for weeks of restarts and never had the problem once, nor since.

    I doubt that anyone would interpret this kind of mouse behaviour as "someone remote desktopping in" - the thing was going crazy frantic, jumping all over the screen and clicking madly.
  • sxeraverx 2007-08-27 17:12
    I met someone today who told me she didn't like Vista because it was too user-friendly, too easy--she couldn't do what she wanted how she wanted to do it.
  • jtl 2007-08-27 17:14
    "That's nice, but when did a serial port become plug and play?"

    Win 95 could do it.
  • Rowboat Woodpecker 2007-08-27 17:21
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    As soon as you work with automating devices, you run into all sorts of sneaky stuff, that may *seem* obvious once it's already discovered. So let us all know when you find out what made you post such a turd-o-rific remark, and get back to the rest of us "idiot engineers" with the answer.

    Thanks.
  • Jason 2007-08-27 17:22
    I had a similar problem with a Pressure sensor. This was made a bit more interesting due to it being connected to the PC via an 8-port RS232 to Ethernet Adapter.

    The comments about "duh! why didn't he find it quicker" are pretty dumb, considering the scope of faults that are possible on kit like this.
    Next time around, it could be electrical noise caused by some guy welding in the next room, or a dry joint on a connection.
  • Tsuki 2007-08-27 17:25
    Ah, I just had one of those wonderful moments where something on the WTF matches up far too well with my own life.

    I've had this exact same issue on my current project, with an RS232 GPS receiver...
  • whicker 2007-08-27 17:25
    Steve:
    So what was causing the issue with the motor?


    Yes, I was wondering that too.

    also, is "/noserialmouse" in boot.ini an XP-only thing?
    hmm... it's "/noserialmice" to add more confusion for NT4 and below.
  • Jim 2007-08-27 17:32
    It definitely happens. I've seen it with plain serial ports and with USB serial adapters. You can add /noserialmouse to the boot.ini to stop detection of serial mice at boot up time, but they will still plug&play later on. The only thing to do is wait for them (the serial (ballpoint) mouse) to appear in the device manager and then disable (not delete!) them. Total PITA.
    Jim
  • Anon 2007-08-27 17:32
    jtl:
    "That's nice, but when did a serial port become plug and play?"

    Win 95 could do it.


    But I don't think the serial port has ever been hot swappable, i.e. the OS isn't going to look for serial devices except on boot up.
  • Broz 2007-08-27 17:51
    I'm just glad to see that someone else uses the phrase "remote desktopping" as un-hesitantly as I do...

    Also, as I'm typing this, the CAPTCHA word is "riaa". That depresses me.
  • AdT 2007-08-27 17:56
    Anon:
    But I don't think the serial port has ever been hot swappable, i.e. the OS isn't going to look for serial devices except on boot up.


    Are you perhaps confusing the serial (RS232) port with PS/2?
  • mexi-fry 2007-08-27 18:08
    1. (not really a WTF) I agree. As a programmer, I often find myself looking at the wrong places for similar reasons... and to those who say it is obvious... I bet you never thought your pc was broken for about an hour until you remembered to take the floppy out. Oversights happen.
    2. Yes, plug and play actually initiates with a device and manufacturer ID. The sequence (even through serial) would be recognized should the device mimic the boot up and classification sequence (I am sure that is not the best way to phrase it).
    3. (as long as it is sending binary data and not strings...) all control devices are sending binary data which can be interpreted numerically or as strings. Everything is (by definition) typeless until an application construct gives it context.
  • Lingerance 2007-08-27 18:10
    Reminds me of when I was playing starcraft over a serial cable, my buddy's cursor just started moving and clicking at random making it unplayable for him. Totally not fun.
  • Twon 2007-08-27 18:11
    Tsuki:
    Ah, I just had one of those wonderful moments where something on the WTF matches up far too well with my own life.

    I've had this exact same issue on my current project, with an RS232 GPS receiver...


    We have this problem as well; we use multiple types of RS-232 GPS receivers as well as some of our own custom RS-232 hardware. This is the most irritating Windows-ism ever; there's not even a way to globally specify "LEAVE MY COM PORTS ALONE." You have to hand-hack HKCR for every device you want Plug and Play to ignore (and even this only sort-of works) -- so good luck plugging in a new USB-to-serial adapter with a live device on the end of it.
  • AdT 2007-08-27 18:38
    Kemp:
    To my knowledge Windows doesn't try to interpret the data being sent back and forth in these scenarios purely because it could be absolutely anything,


    followed by not one, not two, but three accounts of people who suffered the same problem...

    So it seems Windows does try to interpret the data even though it could be absolutely anything.
  • Carnildo 2007-08-27 18:45
    Anon:
    ebs2002:

    While I don't know this for sure, it logically seems that USB devices send a byte sequence that Windows is constantly sniffing for. I would imagine that any port that has plug-and-play support would do the same (like a serial port).


    That's nice, but when did a serial port become plug and play?


    When Microsoft decided it was.
  • IV 2007-08-27 19:39
    Who leaves a floppy in for an hour before figuring it out? Did your screen not say "Invalid System Disk error" or "Non system boot disk"? Everything I have ever dealt with has some sort of message of that nature.

    Captcha: paint. I like putting all my captchas so someone can program them into a bot. Sure, the odds of guessing right are slim, but they do exist. Help someone make his/her bot dictionary complete!
  • swordfishBob 2007-08-27 19:41
    and then suddenly Windows decided it was a serial mouse? Is this even possible?


    Happens to us regularly with weighbridge scales on a serial interface. Usually it gets triggered while Windows is starting up. Easily fixed by disabling the serial mouse service (which used to be simpler when the Devices control panel functioned like the Services one, back in NT4). Easy to forget to do when replacing a PC though.
  • Kemp 2007-08-27 19:48
    AdT:
    Kemp:
    To my knowledge Windows doesn't try to interpret the data being sent back and forth in these scenarios purely because it could be absolutely anything,


    followed by not one, not two, but three accounts of people who suffered the same problem...

    So it seems Windows does try to interpret the data even though it could be absolutely anything.


    But seriously, there is no device detection and suchlike on the serial port. Example: Start a serial console session, you'll be typing to (and receiving data from) anything that is connected, the OS has no idea. Pull the device out and plug it back in, the session continues as if nothing happened. Hell, random partial connections while plugging the device in will cause odd characters to appear if you do it right (or wrong depending on your point of view). Applications that talk over the serial port have to be started manually, there is no "device driver" for a mobile phone connected via serial for instance, instead you start your phone management program and it sends some data back and forth to figure out if it's really a phone that is connected.

    Executive summary:
    How did you guys ever manage to bork windows to the point that it spontaneously decided you had a mouse connected? At bootup I can imagine, while running I can't see a way.
  • Matti Bäckman 2007-08-27 20:02
    Kemp:
    AdT:
    Kemp:
    To my knowledge Windows doesn't try to interpret the data being sent back and forth in these scenarios purely because it could be absolutely anything,


    followed by not one, not two, but three accounts of people who suffered the same problem...

    So it seems Windows does try to interpret the data even though it could be absolutely anything.


    But seriously, there is no device detection and suchlike on the serial port. Example: Start a serial console session, you'll be typing to (and receiving data from) anything that is connected, the OS has no idea. Pull the device out and plug it back in, the session continues as if nothing happened. Hell, random partial connections while plugging the device in will cause odd characters to appear if you do it right (or wrong depending on your point of view). Applications that talk over the serial port have to be started manually, there is no "device driver" for a mobile phone connected via serial for instance, instead you start your phone management program and it sends some data back and forth to figure out if it's really a phone that is connected.

    Executive summary:
    How did you guys ever manage to bork windows to the point that it spontaneously decided you had a mouse connected? At bootup I can imagine, while running I can't see a way.


    Maybe there isn't, but Microsoft certainly seems to think there is.

    "Plug and Play External COM Device Specification"
    http://www.microsoft.com/whdc/resources/respec/specs/pnpcom.mspx
  • Kemp 2007-08-27 20:09
    Matti Bäckman:
    Maybe there isn't, but Microsoft certainly seems to think there is.

    "Plug and Play External COM Device Specification"
    http://www.microsoft.com/whdc/resources/respec/specs/pnpcom.mspx


    I stand corrected in a subset of cases. I'll rephrase. Device detection is a breaking change from traditional (and still majority) usage, and according to that spec is useful for a tiny number of devices.

    Summary:
    Damn you Microsoft =P
  • Kemp 2007-08-27 20:12
    Of course, that spec also means nothing if their enumerator only runs on startup =P Plus, the spec implies that unless the current device is physically disconnected another one won't be detected, so other behaviour is a broken implementation.

    Disclaimer:
    I'd need a bit more time with the spec to properly confirm, but this is what it seems to say.
  • Kuba 2007-08-27 23:31
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    I would like you being in the OPs pants and actually recognizing the problem any faster. It's not as trivial as it sounds.
  • Kuba 2007-08-27 23:33
    ebs2002:
    Think about Plug-and-play. I plug in my mouse, and Windows knows it's a mouse! I unplug the mouse and plug in a hard drive, and Windows knows it's a hard drive! I have a 4-port USB hub, plug in a mouse and a hard drive, then unplug the hard drive and plug in an external sound card, and Windows recognizes it (even though it didn't know that something was unplugged or plugged back in).

    While I don't know this for sure, it logically seems that USB devices send a byte sequence that Windows is constantly sniffing for. I would imagine that any port that has plug-and-play support would do the same (like a serial port).


    Wrong on all counts. Don't say something if you're beyond clueless. Warning for ya: "don't know for sure", in your case, should mean: "let's do the homework first".

    Duh.
  • Kuba 2007-08-27 23:35
    Anon:
    ebs2002:

    While I don't know this for sure, it logically seems that USB devices send a byte sequence that Windows is constantly sniffing for. I would imagine that any port that has plug-and-play support would do the same (like a serial port).


    That's nice, but when did a serial port become plug and play?


    Since, umm, Windows 95? Google for it. It could automatically detect certain serial printers and modems, for example. The framework was there; even to a point where FTDI's serial-to-usb converter has an option bit in the eeprom, which tells the driver to invoke Windows's plug-and-play mechanism on the serial data stream. I.e. the USB device is plug-and-play, a driver exposing the serial port is loaded, and then another plug-and-play is done on the virtual serial device. Wicked :)
  • Daniel Beardsmore 2007-08-28 00:08
    Kuba:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    I would like you being in the OPs pants and actually recognizing the problem any faster. It's not as trivial as it sounds.


    I doubt very much that the OP would like Grant P in his pants.
  • amandahugginkiss 2007-08-28 00:25
    ParkinT:
    RS-232. Ah... the good old days.


    Work with electrical engineers and you'll find out that RS-232 is a long way from being 'old'.
  • Cpt 2007-08-28 00:44
    Kemp:
    So I'm expected to believe that it worked fine sending data to his logging app over the serial port for a while and then suddenly Windows decided it was a serial mouse? Is this even possible? To my knowledge Windows doesn't try to interpret the data being sent back and forth in these scenarios purely because it could be absolutely anything, that's up to the app to know what to do with. Any supposed magic byte sequence would be sent eventually no matter what you hooked up (assuming you were sending purely binary data, text data could most likely hit it too if you used characters outside the A-Z, a-z and 0-9 range).


    If only this were true.... Sadly Mr. Gates and his colleagues have decided that we as consumers are stupid morons who have no idea about the actual configuration of our PCs and they will decide what is good for us. So if data comes in the rs323 port sending data which vaguely resembles a mouse datastream... well... if it walks like a duck, quacks like a duck, so suffer and die! No matter that you already have a mouse installed and we'll perhaps present you with a window asking if it is ok, but just to be sure, we'll assume that you are stupid and default to "yes" in 30 seconds.

    Windows is no operating system, it is a game of chance, otherwise why would Microsoft help desk personnel ask you to reinstall your Windows operating system if you report some small problem? Even if you tell them that this will not change the causes of the problem, they are in battling symptoms, not the causes...

    well... that's me off my soapbox :)
  • Doug Burbidge 2007-08-28 02:29
    Add me to the list of people that have had Windows detect their serial device as a mouse. For us, it's only ever happened at startup.

    We use the same workaround as the OP: go into device manager and disable the serial mouse. Note: do not delete it, because Windows will just "find" the serial mouse all over again next time -- disabling it, on the other hand, prevents the problem recurring.
  • theatrus 2007-08-28 02:57
    As a developer of various devices that talk over a USB->serial link (virtual com ports), this is a hugely annoying problem. But, it only occurs if no application has the COM port open (though windows will try to read some bytes on connection to find the device, so if it chatters by its self, you're doomed ;))

    And you can't turn it off system wide! MS expects you to run hunt the VID/PID entry in the registry and add a magic key for every device plugged in.

    Captcha: burned (appropiate)
  • bif 2007-08-28 04:20
    This story reminds me of the hours of toil I put in adding devices in the days of DOS! Manually working the BIOS and the CONFIG.SYS to squeeze all my devices on to the precious few IRQs available to me, what fun!

    My worst conflict was when I somehow got my printer and SCSI hard drive sharing an IRQ and I had garbage start printing on my Panasonic 1124i dot matrix printer. The print head was jittering and jostling for a minute before I cut the power. Fascinating experience. Always had a boot disk handy back in those days.

    As for the various debates on RS232:

    RS232 will never die! It is still used all over the place in industry. All you have to do is walk into any manufacturing plant of reasonable size and look at the machines they use that are connected to computers. Serial ports, serial ports, everywhere! Ah!

    And programming RS232? Yike. Serious black magic. I programmed a very small machine control application once, and immediately decided to try to stay away from serial ports for the rest of my career. I mean, when I tell a device to rotate 45 degrees, using the exact command specified in the device's "manual", over a completely pristine, three-foot serial cable, I expect it rotate 45 degrees. I don't expect it to do nothing, or to wait ten seconds and then rotate, or to rotate -45 degrees, or rotate 22.5 degrees, and any other number of wacky things. The guys who program this stuff every day must nerves of steel. It would send me over the edge. But guys, can you stop using VB? Just kidding! I'm a kidder.
  • Hatshepsut 2007-08-28 04:33
    Wouldn't opening the serial port lock out anything else (including the serial mouse driver) from using the port? Or... does the serial mouse driver have a cosy relationship with the serial port driver that ignores whether an app already has the port open?

    Or if the driver grabs the port at boot time, wouldn't the test app be unable to open the port? Or... does the test app not check the return value from the open request?

  • Hognoxious 2007-08-28 04:45
    mexi-fry:
    As a programmer, I often find myself looking at the wrong places for similar reasons...
    Me too. The usual reason is that I assume (despite years of experience to the contrary) that the person who reported the bug actually knows what he's talking about.
  • Sid2K7 2007-08-28 04:58
    Well, Windows does lock out other applications from using the serial port if it is already in use (to some extent). Windows, however, is running the driver, and thus has access to the data streaming in from the serial port, even if it is in use (i think). That way, Windows might suddenly decide that the connected device is talking to it, and start interpreting it as a mouse.

    I've also seen it happen.
  • iMalc 2007-08-28 05:20
    Hatshepsut:
    Wouldn't opening the serial port lock out anything else (including the serial mouse driver) from using the port? Or... does the serial mouse driver have a cosy relationship with the serial port driver that ignores whether an app already has the port open?

    Or if the driver grabs the port at boot time, wouldn't the test app be unable to open the port? Or... does the test app not check the return value from the open request?
    Exactly!
    Obviously it can happen when nobody has requested the port.

    But surely an application that has asked the OS to open the port for its own explicit use is not going to have the OS interpreting the incomming data as that is none of its business.

    Perhaps the app in this case regularly opened and then closed the port, instead of keeping it open, giving the OS a window of opportunity to do its plug and pray stuff?
  • iMalc 2007-08-28 05:21
    Hatshepsut:
    Wouldn't opening the serial port lock out anything else (including the serial mouse driver) from using the port? Or... does the serial mouse driver have a cosy relationship with the serial port driver that ignores whether an app already has the port open?

    Or if the driver grabs the port at boot time, wouldn't the test app be unable to open the port? Or... does the test app not check the return value from the open request?
    Exactly!
    Obviously it can happen when nobody has requested the port.

    But surely an application that has asked the OS to open the port for its own explicit use is not going to have the OS interpreting the incomming data as that is none of its business.

    Perhaps the app in this case regularly opened and then closed the port, instead of keeping it open, giving the OS a window of opportunity to do its plug and pray stuff?
  • charon 2007-08-28 08:02
    I'm surprised that nobody checked the microsoft knowledge base for this yet. Here it is: http://support.microsoft.com/kb/283063
  • TeeBee 2007-08-28 08:03
    Yup, at one of my old jobs a similar thing. We were writing a serial interface to an EPoS (Electronic Point of Sale or 'shop till/register' to the un-acronym-friendly) and every time Windows was rebooted whilst the EPoS was connected it would cause the EPoS printer to spew out communication failure printouts.

    Never did figure out why though, so I guess I guess I'll know what to try and disable next time :)

    capthca: waffles ... yum
  • Ancient_Hacker 2007-08-28 08:43
    Uh, I don't think the problem was due to Windows recognizing the data link as a mouse. If it did, then the cursor would be going all over the place all the time, not just when you move the mouse.

    There *is* a bug in the PC that can cause the mouse to go all funny-- somewhere in the depths of the interrupt handler there's a small window of opportunity where the interrupt controller 8259A-work-alike chip can get confused about what interrupts are pending and which are idle. You see the PC design starting with the AT, mistakenly overlaid some of the hardware interrupts with some of the CPU memory management error interrupts. So sometimes a page fault gets misinterpreted as a serial port interrupt and vice-versa, and things go really haywire.

    We first saw this in the good old days of 16-bit DPMI applications. An app would be running just fine, then the mouse would go all wobbly. I still see it on Windows XP every month or so.





  • Mr. Big 2007-08-28 08:45
    No that's been around forever. Anyone who has tried a Windows upgrade with an UPS connected to the serial port and did not have /noserialmice in boot.ini probably learned the hard way. It can cause an APC UPS to go on-battery.
  • KenW 2007-08-28 08:48
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    Are you always this big a jerk?

    Doesn't seem that long to me for him to figure it out. Let's see. A mouse replacement, a network cable disconnect, a reboot, a virus scan, another mouse replacement, a cup of coffee, a solution. That's not very long, especially when you're diagnosing a problem in non-standard hardware to begin with (the test rig he assembled). Not quite the same low level of complexity as, say, your monitor not working.
  • poochner 2007-08-28 08:49
    Mr. Big:
    No that's been around forever. Anyone who has tried a Windows upgrade with an UPS connected to the serial port and did not have /noserialmice in boot.ini probably learned the hard way. It can cause an APC UPS to go on-battery.

    That would explain some oddness I had a couple of years ago. And here I thought it was just because the UPS was crap. Maybe not after all.
  • KenW 2007-08-28 08:51
    Anon:
    That's nice, but when did a serial port become plug and play?


    Well, I have no serial port on my laptop, but have a serial device I need to use occasionally. I bought a USB to serial adapter; when I plug the cable for it into a USB port, Windows detects that I've installed a serial port. I guess that makes it plug and play, right?
  • Kevlar 2007-08-28 09:32
    Microsoft not only has the KB article linked earlier, they have a tool you can install that will allow you to set which serial ports you want to have off limits for serial mouse detection.

    http://support.microsoft.com/kb/819036

    I use this all the time as my company has a program which reads a serial data stream and occasionally (not too often), Windows will detect the incoming serial stream as a mouse. Then the cursor will randomly jump around the screen and click on things until you unplug from the serial port. At that point you can use the utility I linked from Microsoft to disable the detection on that mouse port, you can manually edit the registry to make the same changes or you can do the device manager workaround (disable, but don't delete the mouse). I have found the above utility to prevent the problem every time.
  • aaaaaaaaaaaaaaaaaaa 2007-08-28 10:05
    Anon:

    That's nice, but when did a serial port become plug and play?


    2000, apparently:
    Serial Device May Be Detected as a Serial Mouse in Windows 2000
  • Khanmots 2007-08-28 10:10
    bif, serial isn't all that bad. Just make sure you read the documentation for the device you're talking to and make sure to set the right number of stop bits and set your parity bit correctly. Also make sure you're leaving the right amount of dead time between messages if your device requires it. (some use dead time to detect the end of a msg)

    If you were simply seeing rotation in the wrong direction, or off by some factor it sounds more like you were dealing with a misdocumented API and not serial issues.
  • Grant P. 2007-08-28 10:33
    C'mon, I really don't think i'm being that unfair...

    Seems painfully clear that if things start behaving strangely with one device, perhaps it's got something to do with that new piece of hardware you just connected. maybe - just maybe - that's a lick more likely than "oh noes, we're being haxed".
  • Alex 2007-08-28 10:39
    GPS devices cause this problem all the time...
  • Grant P. 2007-08-28 10:47
    Kuba:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    I would like you being in the OPs pants and actually recognizing the problem any faster. It's not as trivial as it sounds.


    Are you sure? This is a pretty small intuitive leap we're talking about here. More like an intuitive hop.

    "Hmm, I plugged in this [presumably] uncommon device into my serial port, and now my mouse is acting up."

    Sure, a weekend elapsed in between plugging in the hardware and discovering the problem, but it sure sounds like he couldn't have forgotten that he had this odd piece of gear plugged into his machine since that was the reason "he eagerly went over to the testing PC".

  • SWM 2007-08-28 10:49
    bif:
    As for the various debates on RS232:

    RS232 will never die! It is still used all over the place in industry. All you have to do is walk into any manufacturing plant of reasonable size and look at the machines they use that are connected to computers. Serial ports, serial ports, everywhere! Ah!


    Things are changing, but slowly. By popular demand, newer gear tends to have USB ports, since the average PC these days comes with 8 USB ports and only one or sometimes zero RS232 ports. Admittedly, the USB port is really just a USB-to-RS232 dongle built inside the case of the device, but between USB and Ethernet interfaces, the writing is on the wall for RS232.

    If you have a soldering iron and don't mind voiding the warranty, you just have to remove the USB chip and solder in a voltage converter and a DB9 or DB25 connector.

    The Windows drivers for these devices are basically USB serial drivers that use vendor-specific USB device identification instead of the standard device/interface classes for serial ports. Obviously the USB device can't reveal to Windows that it's really an RS232 port, since Windows cannot be trusted to leave those alone. Users of other operating systems are simply told (or left to discover by themselves) that patching their kernel's existing USB-serial driver so it recognizes the device ID's as standard serial ports will more or less work.
  • Tei 2007-08-28 10:54
    Hognoxious:
    mexi-fry:
    As a programmer, I often find myself looking at the wrong places for similar reasons...
    Me too. The usual reason is that I assume (despite years of experience to the contrary) that the person who reported the bug actually knows what he's talking about.


    Me too.
    But I am going better on the task ;D

    The machine often generate simptons, so the real cause is elsewhere. So you learn to link what simpton mean what problem.

    Theres also humans. Humans generate horrible poor bug reports. Change words, so left can be right, up down, conected mean unconnected. Don't work mean it work, but not on the expected way, etc.

    Thats our job, and is cool. :DDD
  • mike 2007-08-28 11:14
    The moment i saw rs232 and mouse it was immediately obvious what was happening. Come on, you don't have to be a frickin genius to figure that one out... and I'm not even a hardware engineer.
  • Michael R. 2007-08-28 11:25
    Grant P.:
    C'mon, I really don't think i'm being that unfair...

    Seems painfully clear that if things start behaving strangely with one device, perhaps it's got something to do with that new piece of hardware you just connected. maybe - just maybe - that's a lick more likely than "oh noes, we're being haxed".


    I'd think the entire testing PC -- not just the hardware being debugged -- would qualify as "the new piece of hardware you just requestioned for the test rig". I somehow doubt each engineer has their own personal horde of testing hardware without any sort of common pool.

    With that in mind, accidentally remoting into the wrong box for debugging being a not-to-uncommon occurrence doesn't seem all that far fetched, when boxes are getting swapped around all the time.

    With that in mind, neither is the possibility that the last person to have had their hands on a newly requestioned box be one of the walking talking WTF generators that this site oh so loves to discuss, and are responsible for oh so many breaches of PC security.

    So, no, you're not being unfair if the guy is an RS-232 expert surrounded by coworkers who are all completely competent with computers, each with their own horde of testing machines, all toiling in perfect harmony in candyland. But you'll forgive me for not seeing the slightest shred of evidence that we can assume any of those things are the case here. Being a pessimist (an outlook further reinforced just by being on this site), I would in fact assume the very opposite for all of the above.

    Aside from the clicking bit, my mouse also regularly spazzes out as described originally. The culprit is invariably a loose piece of hair confusing the optical sensors.

    My experience with RS-232 has thankfully been limited to updating a couple shell scripts that talked directly to a couple of label printers. No concurrency management -- queue two large print jobs and the printer would completely spaz out, ruining the contents of both. I wonder if I have a copy of the source of that laying around my hard drive...
  • Grant D. Noir 2007-08-28 11:26
    Back in uni, I had a course on industrial automation -
    At one lecture, the teacher proclaimed that RS-232 was going away rapidly and soon to be replaced by USB. I recall being somewhat sceptical about point of view, as I knew (from my part-time job as an embedded software-engineer-wanna-be) that RS-232 still was a pretty big deal.

    Fast forward 5-7 years. I know (from my full-time job as an embedded software-engineer) that RS-232 still is a pretty big deal.

    I do agree with ParkinT that RS-232 is old, but I am pretty sure it isn't going away anytime soon. Hey, every half-decent PC-motherboard/cpu-board still has RS-232.

  • Michael R. 2007-08-28 11:30
    *too
    *Yes, you are being fair if...

    As I've just wonderfully demonstrated, some people have trouble with even basic English before their coffee as well.
  • PPP 2007-08-28 11:35
    It's not DAQ, but DAC. (Digital to Analogue Converter).
  • SWM 2007-08-28 12:24
    bif:
    And programming RS232? Yike. Serious black magic. I programmed a very small machine control application once, and immediately decided to try to stay away from serial ports for the rest of my career. I mean, when I tell a device to rotate 45 degrees, using the exact command specified in the device's "manual", over a completely pristine, three-foot serial cable, I expect it rotate 45 degrees. I don't expect it to do nothing, or to wait ten seconds and then rotate, or to rotate -45 degrees, or rotate 22.5 degrees, and any other number of wacky things. The guys who program this stuff every day must nerves of steel. It would send me over the edge.


    Most of that problem is that people can't seem to build RS232-compliant serial ports to save their lives. The problem is even worse on modern PC's, where 99% of serial ports are used to talk to mice and modems, which are (by evolutionary necessity) extremely tolerant of all kinds of crap from their DTE peers.

    I did a survey of ~30 computers at my workplace a few years back. There was one (1) compliant serial port out of 30 machines I tested (several whiteboxes, several Dells, the occasional HP desktop or IBM laptop). The others had too little voltage or too much slew. This is a problem when you're talking to 1980's hardware, or even 2000's equipment with ultra-precise input discrimination ("-2.996 volts on your RS-232 data pin? Too close to zero to be valid, no bits for you.")

    Ironically, the one compliant serial port was actually a USB-to-RS232 dongle that I only tested because I'd just finished testing two and a half dozen machines without success, and I thought "what the hell?". No wonder the thing cost almost $70, its outputs were just beautiful on an oscilloscope...

    Since RS-232 does not specify a packet format or (much) error detection, the occasional lost bit just corrupts data, and usually gets ignored. Thus, "rotate 45 degrees"--which is usually written as something like "rotate 12500 encoder units"--often gets corrupted as "rotate 1250 encoder units" or "rotate 52500 encoder units". It gets even worse when the command protocols aren't ASCII strings--most equipment will raise an error when it sees "rotate !2500 encoder units", but not when it sees "0x52 0xB0 0xD4" instead of "0x52 0x30 0xD4".

    bif:
    But guys, can you stop using VB? Just kidding! I'm a kidder.


    I've noticed that too. Things like "VB API" modules that actually implement "write line" and "read line" in a C++ DLL. This isn't too much of a WTF except that "read line" blocks, it's mutually exclusive with "write line" (so don't bother trying to work around this by creating two threads) there is no "data is ready" API nor any timeout facility. This means that if you want to read a response to a command, you had better be sure there will be data coming back from the device or your application will hang. Of course, several of the commands may or may not return responses depending on the state of the physical hardware. It's the kind of useless "API" that you read, say "WTF?", and throw away in under five minutes.
  • KenW 2007-08-28 12:29
    Grant P.:
    C'mon, I really don't think i'm being that unfair...

    Seems painfully clear that if things start behaving strangely with one device, perhaps it's got something to do with that new piece of hardware you just connected. maybe - just maybe - that's a lick more likely than "oh noes, we're being haxed".


    Nope. Still no go.

    "Gee, I just installed a piece of hardware on the COM port, and my USB mouse started misbehaving *three days later*. Do I automatically make the jump that it's a Plug and Play issue with a serial mouse?" No. I eventually (and probably fairly soon) make the jump, but not immediately.
  • Grant P. 2007-08-28 12:49
    KenW:
    Grant P.:
    C'mon, I really don't think i'm being that unfair...

    Seems painfully clear that if things start behaving strangely with one device, perhaps it's got something to do with that new piece of hardware you just connected. maybe - just maybe - that's a lick more likely than "oh noes, we're being haxed".


    Nope. Still no go.

    "Gee, I just installed a piece of hardware on the COM port, and my USB mouse started misbehaving *three days later*.


    Two of those days being Saturday and Sunday.

    KenW:
    Do I automatically make the jump that it's a Plug and Play issue with a serial mouse?" No. I eventually (and probably fairly soon) make the jump, but not immediately.


    After trying three different mice. And rebooting several times.

    Was it Einstein, or Franklin, that said insanity is trying the same thing several times and expecting different results? Probably neither. Still an interesting thought...
  • Steve H. 2007-08-28 13:13
    Grant P.:
    Was it Einstein, or Franklin, that said insanity is trying the same thing several times and expecting different results? Probably neither. Still an interesting thought...

    If that's insanity, what is it called when you try the same thing several times and actually get different results?
  • Grant P. 2007-08-28 13:23
    Steve H.:
    Grant P.:
    Was it Einstein, or Franklin, that said insanity is trying the same thing several times and expecting different results? Probably neither. Still an interesting thought...

    If that's insanity, what is it called when you try the same thing several times and actually get different results?


    quantum physics?

    </ignorance>
  • dubbreak 2007-08-28 13:28
    Steve:
    So what was causing the issue with the motor?

    It thinks it's a mouse.
  • nobot 2007-08-28 13:35
    These kinds of problems are always <sarcasm> FUN </sarcasm> to troubleshoot.

    Imagine an off-brand UPS being detected as a serial mouse. ;)

    Hmmm, I wonder if disabling Universal Plug-and-Pray would help a situation like this?
  • nobot 2007-08-28 13:36
    Re: Mixed Messages
    2007-08-28 13:23 • by Grant P.
    Steve H.:
    Grant P.:
    Was it Einstein, or Franklin, that said insanity is trying the same thing several times and expecting different results? Probably neither. Still an interesting thought...

    If that's insanity, what is it called when you try the same thing several times and actually get different results?


    quantum physics?

    Actually, since the environment you are doing the "same thing" in is different, you can count on occasionally getting different results.
  • nobot 2007-08-28 13:51
    mike:
    The moment i saw rs232 and mouse it was immediately obvious what was happening. Come on, you don't have to be a frickin genius to figure that one out... and I'm not even a hardware engineer.


    Must be nice when you're not aware of other possibilities...</sarcasm>
  • bif 2007-08-28 13:51
    Khanmots:
    bif, serial isn't all that bad. Just make sure you read the documentation for the device you're talking to and make sure to set the right number of stop bits and set your parity bit correctly. Also make sure you're leaving the right amount of dead time between messages if your device requires it. (some use dead time to detect the end of a msg)

    If you were simply seeing rotation in the wrong direction, or off by some factor it sounds more like you were dealing with a misdocumented API and not serial issues.


    I'm sure it was a combination of me doing everything you mentioned wrong at least once, and my total inexperience. It was enough to scare me away for good, though! We also had this remote relay board that worked a frustrating 80% of the time exactly as it should, and did absolutely nothing the other 20% of the time. The time and cost effective solution was to poll the device on the other side of the relay to see if it was on/off as necessary, rather than getting a more reliable board. Like I mentioned earlier, my hat is off to you guys who do this stuff day-to-day, I'm sticking with Java, HTML, and SQL!
  • savar 2007-08-28 14:15
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    If you post "fist" then your comment gets deleted, but if you post something as stupid as this your comment gets to stay?
  • Seth 2007-08-28 14:18
    First off, this is quite possible. I develop FPGA hardware, and often the simplest way to get data out of an embedded soft processor is a serial port. I ran into a very similar problem a while back after rebooting the development PC I was using. I discovered, after a couple of hours, that if I left the FPGA board running, and rebooted the PC, Windows would think that the board was a mouse.

    It's not something you run across every day, and Windows will do this with a USB->RS232 converter as well as a real COM port. I'm ashamed to admit, it took me a couple of hours to realize that was what was going on the first time it happened to me.

    Apparently, the mouse auto detection system in Windows isn't too hot.
  • Ken 2007-08-28 14:22
    Anon:
    ebs2002:

    While I don't know this for sure, it logically seems that USB devices send a byte sequence that Windows is constantly sniffing for. I would imagine that any port that has plug-and-play support would do the same (like a serial port).

    That's nice, but when did a serial port become plug and play?

    Since at least 1995:
    http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf
    How do you think Windows (and Linux, et al) "know" that there is a mouse attached to your serial port, even if you plug it in after booting?
  • Grant P. 2007-08-28 14:29
    savar:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    If you post "fist" then your comment gets deleted, but if you post something as stupid as this your comment gets to stay?


    you're just jealous.
  • mexi-fry 2007-08-28 14:30
    Hognoxious:
    mexi-fry:
    As a programmer, I often find myself looking at the wrong places for similar reasons...
    Me too. The usual reason is that I assume (despite years of experience to the contrary) that the person who reported the bug actually knows what he's talking about.


    I usually know where to look for other people's problems... comes from realizing they are using something for a purpose for which it was not intended.

    Captcha: dubya ... WHAT?
  • Ken 2007-08-28 14:31
    Rowboat Woodpecker:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.

    As soon as you work with automating devices, you run into all sorts of sneaky stuff, that may *seem* obvious once it's already discovered. So let us all know when you find out what made you post such a turd-o-rific remark, and get back to the rest of us "idiot engineers" with the answer.

    And when was the last time you saw, let alone used, a serial mouse?

    I know that "gee, maybe Windows thinks my hardware diagnostics machine is really a mouse" wouldn't be very high up on my radar.
  • misha 2007-08-28 14:35
    Rowboat Woodpecker:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    As soon as you work with automating devices, you run into all sorts of sneaky stuff, that may *seem* obvious once it's already discovered. So let us all know when you find out what made you post such a turd-o-rific remark, and get back to the rest of us "idiot engineers" with the answer.

    Thanks.


    Personally, I guessed this one straight away. But that was probably cause I'm reading it on DailyWTF and was expecting something funny... not sure I'd have caught it in real life.
  • Grant P. 2007-08-28 14:47
    Ken:
    Rowboat Woodpecker:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.

    As soon as you work with automating devices, you run into all sorts of sneaky stuff, that may *seem* obvious once it's already discovered. So let us all know when you find out what made you post such a turd-o-rific remark, and get back to the rest of us "idiot engineers" with the answer.

    And when was the last time you saw, let alone used, a serial mouse?


    That's almost irrelevant. What's important is knowing that serial mice were common enough at one time to be supported by Windows "out of the box".
  • Ken 2007-08-28 14:59
    Steve H.:
    Grant P.:
    Was it Einstein, or Franklin, that said insanity is trying the same thing several times and expecting different results? Probably neither. Still an interesting thought...

    If that's insanity, what is it called when you try the same thing several times and actually get different results?

    "Tech support".
  • FredSaw 2007-08-28 17:51
    nobot:
    Was it Einstein, or Franklin, that said insanity is trying the same thing several times and expecting different results?
    Aerosmith - Get A Grip

    "Cuz if you do what you've always done You've always get what you've always got.
    Uh, could that be nuthin'?"

    I doubt they coined the phrase, but people in AA use it, too, in reference to an alcoholic trying over and over to just drink a little bit without keeping on going til he's baked.
  • BobLoblaw 2007-08-28 22:19
    So did Nick ever figure out what was wrong with the automated sorting machine after debugging his test rig? There was an awful lot of setup in that story to leave us hanging like that.
  • Wildpeaks 2007-08-29 06:29
    Cpt:
    Sadly Mr. Gates and his colleagues have decided that we as consumers are stupid morons

    "realized", not "decided".
  • KenW 2007-08-29 08:44
    Ken:
    And when was the last time you saw, let alone used, a serial mouse?


    Ummm... Today? :-) Seriously - we have an old machine that runs interactive voice software for a phone system; it's still running Windows 95 and has both a serial mouse and a PS/2 keyboard attached.

    Ken:

    I know that "gee, maybe Windows thinks my hardware diagnostics machine is really a mouse" wouldn't be very high up on my radar.


    Agreed. Completely. That was my initial point to Grant P., who seems to be clairvoyant about these things (and oblivious to any other kind of logical thinking). Maybe the clairvoyance is related to the original article giving away the solution, so Grant P. could figure it out.

    You know, kinda like when you point out something to a child that they should have known already, and they don't want to admit they didn't know? "Duh! I knew that!" I guess Grant P. hasn't outgrown that yet.
  • JoLeQ 2007-08-29 08:58
    Yes this does happen with Windoze. I work in the instrumentation field. I had a project once in which one of the data streams was from an RS-232 port. I couldn't use the mouse until I went to the device manager and disabled that "mouse" that windows had detected. Crazy!
  • MET 2007-08-29 11:39
    SWM:
    bif:
    As for the various debates on RS232:

    RS232 will never die! It is still used all over the place in industry. All you have to do is walk into any manufacturing plant of reasonable size and look at the machines they use that are connected to computers. Serial ports, serial ports, everywhere! Ah!


    Things are changing, but slowly. By popular demand, newer gear tends to have USB ports, since the average PC these days comes with 8 USB ports and only one or sometimes zero RS232 ports. Admittedly, the USB port is really just a USB-to-RS232 dongle built inside the case of the device, but between USB and Ethernet interfaces, the writing is on the wall for RS232.

    The problem with USB is of course the extremely short maximum cable length (3m ?) unless you want a chain of hubs. Whereas RS232 with a good cable will go through 30m of noisy machine environment without a hitch.
  • Thijs 2007-08-29 14:16
    Rowboat Woodpecker:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.


    As soon as you work with automating devices, you run into all sorts of sneaky stuff, that may *seem* obvious once it's already discovered. So let us all know when you find out what made you post such a turd-o-rific remark, and get back to the rest of us "idiot engineers" with the answer.

    Thanks.


    Hear, hear!
  • Simmo 2007-08-29 23:33
    Grant P.:
    Ken:
    Rowboat Woodpecker:
    Grant P.:
    seems kinda obvious, no? maybe this guy's job shouldn't be diagnosing problems if it took him so long to figure that one out. duh.

    As soon as you work with automating devices, you run into all sorts of sneaky stuff, that may *seem* obvious once it's already discovered. So let us all know when you find out what made you post such a turd-o-rific remark, and get back to the rest of us "idiot engineers" with the answer.

    And when was the last time you saw, let alone used, a serial mouse?


    That's almost irrelevant. What's important is knowing that serial mice were common enough at one time to be supported by Windows "out of the box".


    That's important is it? I must remember to add that to my list of 'important information'.
  • Simmo 2007-08-29 23:50
    FredSaw:
    MX5Ringer:
    I'm a but drunk!
    Most people are; but it's good that you recognize it. And by the way, it's spelled with two t's.


    Nope, only one. MX5Ringer is from New Zulland.
  • s 2007-08-30 04:21
    Installing Linux...
    Answering questions...
    Suddenly, power goes down. The UPS has switched off. Seemingly, unrelated.
    Trying again... the UPS switches off again. Same point of installation. This time, a bit of thought, I unplug the UPS serial cable from the PC, try installing Linux again.
    We reach the point. "Detecting mice. Serial mouse: none."
  • YdK 2007-08-30 04:25
    This story reminds me a little of a problem we had with our home PC about 10 years ago.

    At some point the pc would refuse to load internet sites, unless you wacked the mouse around like crazy.
    Turns out that somehow the internal modem (14k4 ofcourse...) had somehow went from com4 to com3 (or the other way around, can't remember) which put it on the same IRQ as the serial mouse (the real WTF etc... I know).

    Eventually we just disabled com3 in the BIOS, which solved the problem.
  • RogerWilco 2007-08-31 06:06
    Kemp:
    So I'm expected to believe that it worked fine sending data to his logging app over the serial port for a while and then suddenly Windows decided it was a serial mouse? Is this even possible? To my knowledge Windows doesn't try to interpret the data being sent back and forth in these scenarios purely because it could be absolutely anything, that's up to the app to know what to do with. Any supposed magic byte sequence would be sent eventually no matter what you hooked up (assuming you were sending purely binary data, text data could most likely hit it too if you used characters outside the A-Z, a-z and 0-9 range).


    I think it's the rebooting that added the serial mouse, as it tries to do autodetect then. I think whatever his problem was before the reboot is still an unknown.
  • RogerWilco 2007-08-31 06:15
    PPP:
    It's not DAQ, but DAC. (Digital to Analogue Converter).

    Except that National Instruments calls their DAC stuff NI-DAQ, so the article is quite right as it mentions this hardware ;-)

    http://sine.ni.com/nips/cds/view/p/lang/en/nid/1037
  • Err... 2007-09-03 09:11
    PPP:
    It's not DAQ, but DAC. (Digital to Analogue Converter).


    No it's not. National Intstruments call their DAC boards Data AcQuisition cards (NIDAQ). Trust me, I've used them.
  • Err... 2007-09-03 09:15
    Err...:
    PPP:
    It's not DAQ, but DAC. (Digital to Analogue Converter).


    No it's not. National Intstruments call their DAC boards Data AcQuisition cards (NIDAQ). Trust me, I've used them.


    Oh, and they're primarily ADCs, not DACs anyway (though I think some of them have outputs as well).
  • MC 2007-09-04 23:27
    Bingo! And actually LOOKING at that standard, I see exactly what's wrong.

    Windows tries to support pre-1995 mice that do not have a distinctive ID string. Note that the standard says that the ID of a serial mouse could be almost anything.

    Please, Microsoft, stop supporting pre-1995 serial mice!

    The other thing that comes out is that our hapless victim's PC must have rebooted over the weekend. All indications are that serial port enumeration takes place only at bootup.
  • MC 2007-09-04 23:28
    MC:
    Bingo! And actually LOOKING at that standard, I see exactly what's wrong.

    Windows tries to support pre-1995 mice that do not have a distinctive ID string. Note that the standard says that the ID of a serial mouse could be almost anything.

    Please, Microsoft, stop supporting pre-1995 serial mice!

    The other thing that comes out is that our hapless victim's PC must have rebooted over the weekend. All indications are that serial port enumeration takes place only at bootup.


    Sorry, lost some context. I was referring to the Plug and Play standard which someone pointed us to:
    http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf

  • Snow_Cat 2009-02-22 01:16
    Think that having Windows mistake some random input for a mouse is fun?

    Windows' PNP periodically interrogates all of the legacy ports. This can be quite a learning experience if for example you are reverse engineering some very expensive hardware using, a parallel port that has carefully configured set to TTL mode (at 0-2.5v) to drive the target hardware. And Windows interrupts a few open driver handles to say "Hay Guys, Has printer? No?" And failing a reply switches to VDiff mode to shout "Wake up Mr. Printer!" (at ±13 V!)

    Certainly taught me to build a PCI interface rather than improvising one, and that a five-figure damage-guarantee on third-party device-drivers in writing was not only hilarious, but a very good thing to have had.