# Issues using serial debugging (Mouse moving)

**URL:** <https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200>\
**Category:** Troubleshooting\
**Created:** [January 3, 2014, 4:04am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200 "2014-01-03T04:04:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![harrisonhjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/harrisonhjones/32/4132_2.png) [@harrisonhjones](https://community.particle.io/u/harrisonhjones)\
**Post date:** [January 3, 2014, 4:04am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/1 "2014-01-03T04:04:00Z")

</div>

OS: Windows 7 x64  
Serial Console Used: the one that comes w/ the Arduino software

What Happens:  
As soon as the Core boots up the below code my computer recognizes a "new" device.  
Every few seconds my mouse is moved down and to he right about 100 ish pixels  
All buttons are now the the "Middle Click" or at least act like it (clicking on a tab in chrome closes it which happens when you middle click"  
This can only be fixed by unplugging the core and randomly plugging and unplugging my mouse connected to my computer.  
It appears the issue is a result of the SparkCore installing itself as a mouse and serial port "combo" of sorts.

Any idea why this is happening?

> byte mac[6]; // the MAC address of your Wifi shield  
> int LED = D7;

> void setup()  
> {  
> pinMode(LED, OUTPUT);

> ```
> Serial.begin(9600);
> Network.macAddress(mac);
> 
> ```
> 
> }

> void loop() {

> ```
> Serial.print("MAC: ");
> Serial.print(mac[5],HEX);
> Serial.print(":");
> Serial.print(mac[4],HEX);
> Serial.print(":");
> Serial.print(mac[3],HEX);
> Serial.print(":");
> Serial.print(mac[2],HEX);
> Serial.print(":");
> Serial.print(mac[1],HEX);
> Serial.print(":");
> Serial.println(mac[0],HEX);
> 
> ```

> ```
> digitalWrite(LED, HIGH);
> delay(5000);
> digitalWrite(LED, LOW);
> delay(5000);
> 
> ```
> 
> }

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [January 3, 2014, 9:10pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/2 "2014-01-03T21:10:04Z")

</div>

Hi @harrisonhjones,

The Core should definitely not be acting as a mouse! Unless you have some custom driver software with misconfigured vendor / product IDs or some rogue driver or software interfering with hardware on your machine. If you wanted to double check, you could open up your device manager and look under “Mice and other pointing devices.” Or if you could provide text output of how your computer recognizes the core – that would be interesting.

I’m guessing there might be some low-power interaction between your mouse and the core trying to draw sufficient power. Sounds like maybe you could try powering your mouse / core over a powered USB hub. I would also be curious to know what brand mouse / drivers, control mechanism, etc.

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![harrisonhjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/harrisonhjones/32/4132_2.png) [@harrisonhjones](https://community.particle.io/u/harrisonhjones)\
**Post date:** [January 4, 2014, 3:06pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/3 "2014-01-04T15:06:23Z")

</div>

I ended up never getting this problem again. I frankly don’t know what I did. I used the drives supplied by Spark and the movement happened every 10 seconds so it wasn’t just random; the core was doing it!

This makes me wonder: do y’all have plans to release drivers so the core can behave as a HID compliant mouse/keyboard? It appears the core is able to, even if by accident.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [January 5, 2014, 12:17am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/4 "2014-01-05T00:17:05Z")

</div>

That’s so weird! Please let me know if this crops up again, or other people please chime in if you see this.

I’m sure a bunch of community members know more about building HID devices than I do, so this might be a great opportunity for a pull request? 🙂 Or is anybody out there working on this already?

---

<div class="post-metadata">

**Author:** ![DanC](https://avatars.discourse-cdn.com/v4/letter/d/77aa72/32.png) [@DanC](https://community.particle.io/u/DanC)\
**Post date:** [February 28, 2014, 3:08am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/5 "2014-02-28T03:08:57Z")

</div>

I have the same issue. I have used arduino serial out code and spark driver.

Every second the mouse is moved to bottom right hand corner of screen. This is the same timing as my serial out information

---

<div class="post-metadata">

**Author:** ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)\
**Post date:** [February 28, 2014, 3:13am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/6 "2014-02-28T03:13:09Z")

</div>

@Dave Same exact thing happened to me when I was working setting up my IN219 current sensor.

Soon as the core was plugged into my laptop it took the mouse down to the start button every 3 seconds basically making the computer unusable.

After numerous times of re flashing the sketch to the Core over the Spark IDE the core froze up and would only show the solid blue pin 7 LED light. I had to Factory Reset the core and then reload the sketch and it never happened again.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [February 28, 2014, 3:39am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/7 "2014-02-28T03:39:56Z")

</div>

I had the same problem also! As soon as my program ran on the core, the mouse started doing its own thing. I had to reboot my PC for the mouse to work properly. Only when I did a factory reset did it stop. I have not tried a new sketch yet.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [February 28, 2014, 1:07pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/8 "2014-02-28T13:07:40Z")

</div>

@Dave @zachary @zach I'm not sure which is causing the bug but it's indeed happening

> **[Vine](https://vine.co/v/MKX1qD1lnFp)**
>
> The entertainment network where videos and personalities get really big, really fast. Download Vine to watch videos, remixes and trends before they blow up.

EDIT: Sending hex over serial was causing the issue. The HEX values probably got recognized as HID commands

> Serial.print(a[j], HEX);

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [February 28, 2014, 3:28pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/9 "2014-02-28T15:28:12Z")

</div>

In terms of weird interactions / bugs, that’s pretty wild! 🙂 This name “Microsoft Serial Ballpoint” is magic, because searching for that shows a lot of people having this same problem with USB serial devices:

The fix for this appears to be to disable Window’s support for crazy Serial mice entirely

##Warning! This fix involves editing your registry, make a restore point first!

###_I have wrecked machines by goofing up a registry edit, you should really make a restore point first._

in regedit:  
HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\SerMouse  
and change the value “Start” from 3 (load on demand) to 4 (disabled)

more info here:  
[http://www.curioustech.net/xport.html](http://www.curioustech.net/xport.html)  
[http://support.microsoft.com/kb/103000](http://support.microsoft.com/kb/103000)

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [February 28, 2014, 4:03pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/10 "2014-02-28T16:03:32Z")

</div>

@Dave Tested and working!

Luckily you had a fix real fast or i can’t continue to get the Camera code running! Hoping to get it working to the core ASAP for more users to try it out 🙂

---

<div class="post-metadata">

**Author:** ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)\
**Post date:** [February 28, 2014, 4:10pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/11 "2014-02-28T16:10:11Z")

</div>

I’m glad we know what was causing this without much trouble. Nice to know we know how prevent this from happening again also. Good work guys!

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 26, 2014, 7:04am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/12 "2014-03-26T07:04:48Z")

</div>

Just thinking if anyone met this issue recently…

I was trying to output the response from the GET request from google and print via Serial.

Didn’t get the terminal opened before the core starts to spill out all the data and my mouse ran all over the place.

My device manager had like 2 to 3 more mouse (ps/2 and usb virtual) appearing

---

<div class="post-metadata">

**Author:** ![coolnewt](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@coolnewt](https://community.particle.io/u/coolnewt)\
**Post date:** [August 4, 2014, 4:07am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/13 "2014-08-04T04:07:32Z")

</div>

Just encountered this for the first time. The registry hack fixed it for me. Thanks guys!

---

<div class="post-metadata">

**Author:** ![dougleppard](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dougleppard](https://community.particle.io/u/dougleppard)\
**Post date:** [September 29, 2014, 5:03pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/14 "2014-09-29T17:03:36Z")

</div>

I have been having this problem sending hex over USB serial.

All I did was these lines and my mouse went crazy:

```auto
void setup() {
        Serial.begin(9600); //used with monitor
}

void loop() {
// Serial.println("408b42A6"); //this line works

    Serial.println("408B42A6"); //this lines blows it up.

    delay(1000);
}

```

I will try the fix above.

---

<div class="post-metadata">

**Author:** ![dougleppard](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dougleppard](https://community.particle.io/u/dougleppard)\
**Post date:** [September 29, 2014, 5:32pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/15 "2014-09-29T17:32:07Z")

</div>

I just did this fix for my windows 8.1 computer and it solved the problem. How weird printing hex makes the computer to go bonkers.

---

<div class="post-metadata">

**Author:** ![v8dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/v8dave/32/2616_2.png) [@v8dave](https://community.particle.io/u/v8dave)\
**Post date:** [September 30, 2014, 3:02am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/16 "2014-09-30T03:02:29Z")

</div>

Still can’t believe that this issue still plagues Windows. 😄

We used to have the exact same issue with Windows 2000 many many years ago with a serial device that used to send data on power up. Windows would randomly detect this as a mouse on startup. It gave us such IT headaches.

---

<div class="post-metadata">

**Author:** ![modbargeek](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@modbargeek](https://community.particle.io/u/modbargeek)\
**Post date:** [November 28, 2014, 1:59pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/17 "2014-11-28T13:59:37Z")

</div>

Dave, thanks so much for that! That was driving me nuts, and I was having a hell of a time figuring it out!

Best,  
Aric

---

<div class="post-metadata">

**Author:** ![HH1](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@HH1](https://community.particle.io/u/HH1)\
**Post date:** [May 4, 2015, 6:47pm UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/18 "2015-05-04T18:47:43Z")

</div>

Wow, I can’t say how much time I wasted with this bug. It was crazy because the serial monitor worked but instead of my time (reading an external RTC over I2C) I got only shit, and I thought I have wrong variable types. But only after few days I make an fully restart (my notebook usually go to standby) there was suddenly a spark core arduino mouse which jumped funny around and now I find your bug fix. 😃  
This given me a lot of gray hairs, I promise. 👴

greetings from Austria!

---

<div class="post-metadata">

**Author:** ![csjall](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@csjall](https://community.particle.io/u/csjall)\
**Post date:** [September 30, 2015, 3:25am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/19 "2015-09-30T03:25:09Z")

</div>

Ran into the (Photon) serial mouse problem too. So weird. Registry key worked like a charm.

![](https://sea2.discourse-cdn.com/flex026/uploads/particle/original/a/e/aec5eaad862854fdbd4ec2432a76f4e4c0fa6d9f.png)

---

<div class="post-metadata">

**Author:** ![Phoenix](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/phoenix/32/6948_2.png) [@Phoenix](https://community.particle.io/u/Phoenix)\
**Post date:** [October 20, 2015, 12:08am UTC](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200/20 "2015-10-20T00:08:05Z")

</div>

Is there any course for Particle to address this? (Change in the drivers?)

This bug turned into a huge issue with a lab of students, where 20% of students experienced this (on both lab computers and entirely different student computers). It really is a pain to have students making registry changes as part of a lab.

[Next page](https://community.particle.io/t/issues-using-serial-debugging-mouse-moving/1200.md?page=2)
