Serial port COM4 error: Error: Opening COM4: File not found

Good afternoon, i have a problem starting my node-red.
when I run the command to open "node-red", it shows me serial port COM4 error: Error: Opening COM4: File not found.
Before this error happened, I managed to perform an LED test connected with the Arduino and everything worked correctly, when I went to perform a test with the DHT22 sensor and then closed my Node-Red, this error appears.
The Arduino IDE works normally with the COM4 port, I can normally program the program on it and run it.
I want to open my Node-Red, how can I solve this?

Thanks, Matheus

Does device manager show you have a COM4?

Is there any application still open & accessing COM4 (e.g. is Arduino IDE still open when you start node-red)

Yes, the manager recognizes the COM4 input so much that I can run the program directly in the Arduino IDE.

There is no application open when I try to start Node-Red..

I would restart your PC - potentially something has a hold on the port.

Alternatively, try this: https://www.equisys.com/Support/Technotes/howto-identifying-which-process-is-using-the-serial-port


PS,

  • what version of node and node-red are you running?
  • what does npm list serialport show...
    image

check this screenshot :cry:

you did not CD into your .node-red folder - look at my screenshot.

is the command to enter the folder right? I can't get into node-red CD

no.

from your earlier screenshot i see your user name is user

So enter
cd c:\users\user\.node-red
then
npm list serialport

ALSO - you never stated what version of node-red you are running - it is listed in the console when you start node-red (it is missing from the opt your first screenshot)

there's the error, how do I fix it?

Sorry, its a typo by me.

So enter
cd c:\users\user\.node-red
then
npm list serialport



ALSO - you never stated what version of node-red you are running - it is listed in the console when you start node-red (it is missing from the top your first screenshot)

check

ok, so do you have any arduino nodes in your flows?

use ctrl-f to search node-red flows for aurduino

Perhaps you have added a node and set it to use COM4?

Yes, I used Arduino node and configured to use COM4, how do I delete? I can't get into the dashboard

Its not dashboard (its the node-red editor)

start node-red in safe mode

node-red --safe

find and delete, then deploy.

1 Like

incredible friend, thank you very much you found the solution! thank you so much :star_struck:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.