Author Topic: [FIXED!] Weird Serial/WiFi issues  (Read 47756 times)

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #45 on: January 28, 2014, 02:50:55 am »
@gogol
   i tried x64 Ubuntu but the compiler seems broken there because of some missing 32bit librarys, gonna try x86 Ubuntu later.

@digistump
   is there anything I can do to help fixing this problem?

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #46 on: February 08, 2014, 08:48:46 am »
Still nothing new? :(
Can barely use it without Serial debugging.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Weird Serial/WiFi issues
« Reply #47 on: February 08, 2014, 12:06:35 pm »
just to reiterate:

you are able to upload code. That means, that at least in SAM-BA mode the COM-port seems to work.
Which board are you selecting: The DigiX or the native Arduino DUE?
I would recommend for testing purposes to stay with the Arduino DUE variant, as that should be 100% compatible, and we make sure, that the problem has nothing to do with the digistump extensions.
When a sketch is running, and the board is in Arduino mode, is it possible to reset the board, by opening a 1200 8N1 serial connection?

Next try: Is it possible to emulate a keyboard with a simple sketch? Will your host recognize the DigiX as working keyboard?

To the problems with  listComPorts.exe:  Is that failing when the DigiX is in DigiX/Arduino mode AND/OR when it is in SAM-BA mode?

Do you have another DigiX/Arduino Due you can borrow for a test?


Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #48 on: February 08, 2014, 03:54:24 pm »
I always used the DigiX Setting before, for further testing i'll be using "Arduino Due (Native USB Port)".
Btw. I'm using the MicroUSB cable of my Kindle Touch which is working perfectly with the Kindle and also worked with the DigiX on a MacBook.

Yes, the board resets by opening a 1200 8N1 serial connection.

Using this sketch my mouse pointer jumps up and down just fine (sending keyboard key presses to the computer also works):
Code: [Select]
void setup() {
   Mouse.begin();
}

void loop() {
  Mouse.move(0, -40);
  delay(1000);
  Mouse.move(0, 40);
  delay(1000);
}

listComPorts.exe fails, even if not a single USB device is plugged in.

I don't know anyone with a DigiX/Due  :-\

Thank you so much for still trying to help me :) i hope we can find the problem  ;D

One more thing i noticed, with this sketch
Code: [Select]
int led = 13;

void setup() {
  pinMode(led, OUTPUT);
  SerialUSB.begin(9600);
}

void loop() {
  digitalWrite(led, HIGH);
  SerialUSB.println("1");
  delay(1000);
  digitalWrite(led, LOW);
  SerialUSB.println("0");
  delay(1000);
}

The onboard LED blinks, but as soon as i open the serial monitor the LED keeps its current state and stops blinking, even if i close the monitor again, so the DigiX seems "locked up" in it's current state.
Connecting with a Terminal program (HTerm) doesn't cause this (but with the terminal program i can reset the board with 1200 8N1, so i suppose the program is working).

Without the SerialUSB parts, opening the serial monitor also doesn't cause the "lock up"
« Last Edit: February 08, 2014, 04:21:17 pm by Kaeltis »

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Weird Serial/WiFi issues
« Reply #49 on: February 09, 2014, 11:26:36 pm »
That's very interesting!
I assume, that the program is not longer running, but being stuck somewhere in the serial CDC stack.
The erase/flash however still works, because that is triggered via interrupt in ./hardware/arduino/sam/cores/arduino/USB/CDC.cpp.

The curious thing is here, that only parts of the USB-stack (I assume something like flow-control) is broken, as the the CORE USB functionality is given (SAM-BA upload works).
As parts of the Arduino stack are also working (HID mouse, erase/reset event), the problem seems to be deeper.

Its almost for sure no general Arduino<->Windows 8 problem, as I assume, that others might report that as well.  However, as most Arduino DUE users are using the programming port, there is no such big pressure, to track the errors down. (Assuming, that this problem only occurs between the SAM-USB-stack and Windows, as the programming port of the DUE uses the AVR-USB-stack)

As you had the DigiX running  on a MacBook, I assume, that it worked there ?

Which would be another valuable piece of the puzzle!

I recapitulate (correct me, when some assumptions are wrong)

  • DigiX connected to PC with Windows 8.1 x64
  • DigiX can be programmed via USB
  • ERASE/RESET works, when COM is connected with 1200 8N1
  • HID mouse examples are running, mouse is detected
  • extended blink-sketch, which is outputting the LED state between blinking via SerialUSB.println() is stuck, as soon, as terminal program connects
  • sketch is still stuck, when terminal-program is detached
  • sketch is running again, after reset
  • ERASE/RESET via 1200 8N1 connection is recognized even in stuck state!

Some more observations?  Something wrong?


Where are the USB gurus?


Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #50 on: February 10, 2014, 03:52:51 am »
Yes, on the MacBook everything worked perfectly

Some additions:
  • I'm not sure if the DigiX is shows up as a Mouse in Device Manager (didn't find anything obvious, only DigiX/Due in COM-Ports), but the mouse example was working.
  • The DigiX only gets stuck with the Arduino Built-in Serial Monitor, HTerm doesn't get it stuck but gets no Data output from the DigiX as well
  • When pressing the onboard RESET button, the sketch works fine again after being stuck
  • Interestingly, when pressing the RESET button (DigiX is on COM5), windows makes the "device disconnected" sound and the DigiX stops being shown in the Arduino software unter "Ports", but it's still shown in the Device Manager as COM5. After reseting I also can't reprogram it without reconnecting it physically, arduino always shows the Error "Board at COM5 is not available" (altough its still shown in device manager as COM5).

Everything else is correct.


« Last Edit: February 10, 2014, 03:59:18 am by Kaeltis »

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Weird Serial/WiFi issues
« Reply #51 on: February 10, 2014, 04:27:13 am »
Having the DigiX<->MacBook combination running, we can almost exclude hardware issues.  One try could be external power to the DigiX before USB connection, to make sure, that its not a voltage/power issue.
Its strange, that the COM-Port is not disappearing; that may be related to the listComPorts.exe problem.

What happens, if you connect the DigiX in Arduino-state with running sketch, than you press ERASE and RESET?  Is than the SAM-BA comport appearing and the Arduino COM-port disapperaring?

The SerialUSB library seems to have at least optimization potential: http://forum.arduino.cc/index.php?PHPSESSID=a7oct56k8taij56pn0717u7184&topic=143871.msg1533427#msg1533427
You might want to try the discussed alternative files (even when the initial problem there was RX).

Edit:
You should see in in the device manager an USB-Input Device ("USB-Eingabeger├Ąt") with the Arduino VID_2341 PID_003E.  That should disappear in SAM-BA mode and while RESET is pressed!


« Last Edit: February 10, 2014, 04:37:43 am by gogol »

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #52 on: February 10, 2014, 04:43:26 am »
Yes, ERASE and then RESET removed the Due (COM5) and shows Bossa Program Port (COM4)

I'll try with external power later, as soon as i find my power supply

Edit: yes, the mouse shows up with that hardware ID, while i press RESET it's removed

Edit2: Can't find a suitable power supply atm :\
« Last Edit: February 12, 2014, 04:31:21 pm by Kaeltis »

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #53 on: February 13, 2014, 08:02:18 am »
I just noticed more weirdness.

I programmed the DigiX as "Due (Native USB Port)" on COM6 with this Sketch:

Code: [Select]
void setup() {
  SerialUSB.begin(9600);
}

void loop() {
  int sensorValue = analogRead(A0);
  SerialUSB.println(sensorValue);
  delay(1);
}

and got, as i expected, no output in the Serial Monitor.

I then changed all "SerialUSB." to "Serial." and switched the Board Setting to "Digistump DigiX (standard)".
After flashing the program, clicking on the Serial Monitor gave me the error "Board at COM6 is not available".

The COM Port changed from COM6 to COM8, which should be normal as the boards USB-ID thing changed by switching to "DigiX-Mode".

I then selected COM8 in the Arduino IDE and clicked Serial Monitor again (without unplugging the board or anything else) and voila, i got Serial output from the DigiX.

After physically reconnecting the DigiX i'm again getting no output, nothing else changed.

Edit: this is not repeatable, i think this just happened because Windows detected the DigiX as a new device when changing from Due-Mode to DigiX-Mode.

My conclusion: It works every time Windows detects it as a new Device (either by changing the USB-ID or deleting it from device manager) but only until it resets or gets reconnected. But why?
Both the Arduino serial monitor and an external serial programm are working with this method.
The Arduino serial monitor in particular is NOT the cause of this issue, it seems to be a general problem with the Serial connection.

Maybe it's because of the way Windows handles unsigned drivers? When installing the DigiX driver i had to enable unsigned driver mode in the Win8.1 boot menu.
« Last Edit: February 13, 2014, 08:27:06 am by Kaeltis »

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Weird Serial/WiFi issues
« Reply #54 on: February 13, 2014, 11:59:11 pm »
I can't believe, that this is an general Windows 8.x problem. Otherwise I expect more reports, as well in the Arduino-forum.
There are changes in the Windows USB stack, but not related to those modules/functions the DigiX/Due uses.
http://msdn.microsoft.com/en-us/library/windows/hardware/ff538820%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/hardware/hh406292%28v=vs.85%29.aspx

However I would check with external power provided to the DigiX before making USB connection. At least disabling WiFi.
I have one computer, where the DigiX is unstable while plugged only to USB with Wifi up.

@All readers: If you are using the DigiX with Windows 8 / 8.1  can you try the second sketch from this post: https://digistump.com/board/index.php/topic,1277.msg5939.html#msg5939
Can you report back, if it is working for you, and which version of Windows 8.x (x32/x64) you are using.

dfarrell

  • Newbie
  • *
  • Posts: 30
Re: Weird Serial/WiFi issues
« Reply #55 on: February 14, 2014, 04:12:46 pm »
I have seen a couple of similar issues on Win7 64. Some I attribute to the multiple USB serial devices I plug in and out. Several Leonardos, DigiX's, Dues etc.  Most issues seem to relate to the two phase enumeration.  One device enumeration when the board is programmed (Atmels ID?) and the other when the serial monitor port enumerates.  I am up to COM44.  You should check the registry HKLM\HARDWARE\DEVICEMAP\SERIALCOM to see how you device enumerates.  You may want to re-install USB drivers for the ports seen in the registry.  I have also had issues with USB hubs, are you using a hub?  Lastly, be sure to always plug in to the same USB connector on your computer/hub.  It makes COM port numbers consistent when you plug in multiple devices.  I also have SAM-BA 2.12 and Atmel studio installed.  They may have updated the USB drivers, I can't tell you for sure. 
« Last Edit: February 17, 2014, 11:04:24 am by dfarrell »

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #56 on: March 02, 2014, 03:56:43 am »
I'm using always the same usb port directly on my motherboard and only got the DigiX in "SERIALCOMM"



Just installed the new Arduino 1.5.6-r2 BETA but it didn't fix the problem.

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #57 on: March 09, 2014, 07:33:17 am »
O M G i can't believe it, i FINALLY found the cause of my problem!

I tried to use my TI MSP430 Launchpad with Energia, but got an error when trying to upload code: No unused FET found.
I searched for a possible fix and found this thread: http://e2e.ti.com/support/microcontrollers/msp430/f/166/p/290981/1015186.aspx

I disabled the "Logitech Gaming Software" i'm using for my G19s and my G700 and the error was gone.
Being curious, I plugged in my DigiX and finally everything worked, including the Serial Monitor.
(listComPorts.exe still crashes, but doesn't matter as it's not used by the Arduino Software)

Serial output stops in the second i'm enabling the LGS, so it's definitely the cause.

Thank you so much everyone for helping me :)

I'm adding the LGS as a potential cause of problems to a troubleshooting section in the wiki, hope thats ok.
« Last Edit: March 09, 2014, 08:07:27 am by Kaeltis »

pitchakorn

  • Newbie
  • *
  • Posts: 7
Re: [FIXED!] Weird Serial/WiFi issues
« Reply #58 on: May 16, 2019, 02:22:33 am »
O M G  :(
ufabet