Go Down

Topic: NANO 33 SENSE: COM mismatch with Serial Monitor (Read 1 time) previous topic - next topic

RudolfAtRTC

Hello Community,
all new NANO versions have their own "special behavior", but alright, they are very new.
The NANO 33 SENSE is displayed as COM6 on my Windows 10 computer with IDE 1.8.9. Compiling and downloading works fine.

But when I start the serial monitor, the message: "Board at COM5 is not available" is displayed. In Windows Device Manager, no COM5 is visible.

A workaround is:
   - Close the Serial Monitor
   - Reset the NANO with its reset switch
   - Start Serial Monitor immediately (with sufficient delay at the beginning of the sketch)

That should be corrected.

RudolfAtRTC

... the perfect COM mismatch!

msdsmith

With these new nano boards they seem to change port numbers while the sketch is uploading. (This becomes obvious if you put the board into bootloader mode by doubleclicking the button on it.) Sometimes the IDE seems to handle the switches automatically. Other times I've had to manually change the selected port in order, for instance, for the serial monitor to work.

finalglide

I'm having this issue as well.

First, this board takes so much longer than other boards to compile, like 5 times as long.
Second, everytime it uploads the sketch, my com ports changes after it resets, so I have to manually change the port back in the Arduino IDE before I can use again.  Annoying but still works.  

X_rramirez5411

It happens very often, just go to the tools tab and change the port.

And if you can no longer with that option close the arduino program, open it again and repeat the operation of the first paragraph.

Florin_Andrei

Random port changes on Windows 10 after every upload. The Nano appears to be on either COM9 or COM11, seemingly at random.

The serial monitor gets stuck. Upload gets stuck.

Manually changing / re-setting the port in the IDE helps a few times. After a while, the IDE gets confused, and no ports work anymore - neither for serial monitor, nor for upload. The IDE needs a restart. That may happen once every 10 minutes if I recompile a lot.

None of this happens on macOS.

ballscrewbob

#6
Oct 23, 2019, 04:53 pm Last Edit: Oct 23, 2019, 04:57 pm by ballscrewbob
The BLE SENSE has TWO COM ports.
The second COM port also often referred to as "BOOTLOADER" can be invoked by quickly double tapping the reset button.
It can also be used to help clear out a sketch that does not behave. For that put it into BOOTLOADER then upload either BLINK or BARE MINIMUM from the EXAMPLES.

The IDE knows and expects this and can handle it.
Most often there is no need to chase the new COM port.

However there have been some scenarios with other boards of this nature where over aggressive antivirus, Cloud  / network or portable based IDE installs can cause delays which result in some problems.

If yours is one of those types of problem then unless you have some decent knowledge of networking etc. it is often best to uninstall the IDE and re-install to a local drive

If you think it is antivirus / security based then you need to add the install locations to your whitelist / exclusions.

Another is USB 3.x issues. There are well known not just for Arduino but other USB peripherals too.
It can be your computers CHIPSET that may not be fully compliant. The most common fix is to insert a USB 2.0 hub between the Arduino (or errant peripheral ). This acts as a buffer in most cases

Last but not least are USB driver issues under Windows. If your USB drivers were supplied by Microsoft you should consider going to the hardware manufacturer site and getting the proper drivers as microsoft has a habit of breaking some of the drivers. This extends beyond USB with the second largest problem being Graphics card drivers supplied by microsoft.

Please rule all those aspects out first.

Also including a pdf that may help with some of those aspects (but not all)

Bob.


It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

sganesh07

Have tried it all ... Cleaned up the registry, have a new IDE, finally got the code to upload but now the Serial monitor plays dumb. Absolutely no data. Copied this code from https://circuitdigest.com/microcontroller-projects/arduino-nano-33-ble-sense-board-review-and-getting-started-guide and i have a blank serial monitor right now. Have even restarted and made sure i dont have anymore COM devices other than just this one. Radio Silence! Any thoughts ?

pert

There is a problem with that code. Like all the native USB Arduino boards, the Nano 33 BLE doesn't reset when you open Serial Monitor. This means that any output printed to Serial between the time the program starts and you opening Serial Monitor is lost. This means that if one of the sensors failed to initialize, you would not get the warning message and the board will just be stuck in an infinite while loop, giving no output.

The solution is to add a line of code that will cause the Nano 33 BLE to wait until the Serial Monitor has been opened before starting the program. On the line following this line:
Code: [Select]
  Serial.begin(9600); //Serial monitor to display all sensor values
Add this:
Code: [Select]
  while(!Serial);

Upload the improved sketch and open Serial Monitor. Do you see output? If so, what is it?

ballscrewbob

@sganesh07

I just tried in the in the online editor from the sketch provided from your link and dont have any issues.

Also tried it in 1.8.11  and again no issues.

Using Win 7 x64 pro here with full administrator privs.


Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.

Posting tips.
  • Your OS and version can be valuable information, please include it along with extra security you are using.
  • Always list the version of the IDE you are using and the board version if applicable.
  • How to insert an image into your post. ( Thanks Robin2 )
  • Add your sketch where applicable but please use CODE TAGS ( </> )
  • Add a SCHEMATIC were needed even if it is hand drawn
  • Add working links to any specific hardware as needed (NOT links to similar items)
  • Remember that the people trying to help cannot see your problem so give as much information as you can

COMMON ISSUES
  • Check you have a COMMON GROUND where required.
  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.
  • Try other computers where possible.
  • Try other USB leads where possible.
  • You may not have the correct driver installed. CH340/341 or CP2102
  • There may be a problem with the board check your wiring first.
  • Remove any items connected to pins 0 and 1.
  • Boards using a MICRO usb connector need a cable that is both DATA and CHARGE. Many are CHARGE ONLY.

COMPUTER RELATED
  • close any other serial programs before opening the IDE.
  • Ensure you turn off any additional security / antivirus just to test.
  • There may be a problem with the PC try RESTARTING it.
  • You may be selecting the wrong COM port.
  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.
  • Clear your browsers CACHE.
  • Close the IDE before using any other serial programs.
  • Preferably install IDE's as ADMINISTRATOR or your OS equivalent

Arduino specific boards
  • CH340/341 based clones do not report useful information to the "get board info" button.
  • NANO (Old Types) some require you to use the OLD BOOTLOADER option.
  • NANO (New Types) See the specific sections lower in the forum.
  • NANO (New Types) Install your board CORE's.
  • Unless using EXTERNAL PROGRAMMERS please leave the IDE selection at default "AVRISP mkII".

CREATE editor install locations.
  • On macOs ~/Applications/ArduinoCreateAgent-1.1/ArduinoCreateAgent.app/Contents/MacOS/config.ini
  • On Linux ~/ArduinoCreateAgent-1.1/config.ini
  • On Windows C:\Users[your user]\AppData\Roaming\ArduinoCreateAgent-1.1

Performing the above actions may help resolve your problem without further help.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

sganesh07

Thanks both of you. That was the fastest response i've had in any forum for a while. Really appreciate it.

I've fizzled the Code to something much smaller and simpler -
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  while(!Serial); 
  //delay(5000);
  Serial.println("this better work!! ");
}

void loop() {
  // put your main code here, to run repeatedly:
}

I had a delay introduced before that made it work albeit inconsistently and even after introducing the command suggested above - i have the same inconsistency.

Am running IDE 1.8.5 on Windows 10 Home and as an Administrator only. I have changed 3 USB cables just to make sure. As mentioned above, i have no issues with the COM port or upload or the necessary headers required. I dont know if the Anti Virus does anything to the serial port connectivity but i did explicitly exclude my .ino file from the AV.

thanks.

pert

Please provide a detailed description of what you mean by "inconsistency".

sganesh07

Thanks for the immediate response once again. Let me detail the iterations here.

Iteration 1 - Serial monitor showed the print statement.
Iteration 2 - i clicked the reset button when the Serial monitor is open - no change
Iteration 3 - i compile and upload again - it works
Iteration 4 - i close the serial monitor and open again - nothing happens
Iteration 5 - i clicked the reset button and opened the serial monitor - it works
Iteration 6 - i repeat the same thing - and it works
Iteration 7 - i open the serial monitor again - and nothing happens

So am guessing the call to reset and opening the serial monitor on IDE 1.8.5 seems to work a little more predictable than the others.

And what works for me is actually the delay statement than the while alternative. Here is a snapshot when it works.

thank you.

pert

Iteration 4 - i close the serial monitor and open again - nothing happens
Iteration 7 - i open the serial monitor again - and nothing happens
This is the correct behavior, and exactly what we would expect. As I said before, the Nano 33 BLE Sense is not reset when you open Serial Monitor. Since your program only prints once after the program starts, it will only print again if you reset the board. The program already started and printed the output in Iterations 3 and 6, so in Iterations 4 and 7 it was just sitting in loop doing nothing, thus no output.

You might be used to the behavior of the non-native USB boards like the Uno, Nano, Mega, and Pro Mini, which do reset when the Serial Monitor is opened.

sganesh07

thanks @pert. Just so that am clear -
1. Even if the Serial monitor is open and i hit reset - nothing happens - is that also expected behavior ?
2. Between the (while!Serial) and delay(xx) - is there a recommendation ? coz on my actual program - i do initialize all of the sensors (am most keen on Gyroscope and Accelerometer only) up front and then on the loop i work with changing data (as i plan to use this to replace an old model of Quad that I had - with the nano + MPU6050 + HC-05 bluetooth)

I will also look for programmatic ways to mimic a reset but is that good programming in this world? am new to electronics in a way so pls bear with that question.

thanks.

Go Up