Node-red-node-arduino not connecting to the configured Arduinos after update

image
Here is the firmata auto scan function...

Okay so I just found something useful I think, thanks @Colin for suggestion...

Jan 24 10:48:54 raspberrypi Node-RED[1684]: 24 Jan 10:48:54 - [error] serial port /dev/ttyACM0 error: Error: Error Resource temporarily unavailable Cannot lock port

This message is being shown when redeploying.

So did a quick google search and there is already an issue for node.js serialport

Will try to follow it and hopefully report back with a solution.

Yes , this is what is happening, i had to isolate everything on a pi in my home, and when connecting/disconnecting the arduino , even sometime on the raspberry reboot the port number changes, i have been searching for a solution you mentioned to use udev rule to force a device to a device name, do you have any idea how to do this?

Edit: Please close this topic, i will create a new one.

I always have to look it up when I want to do it
Start with this How udev rules can help us to recognize a usb-to-serial device over /dev/tty interface - DEV Community

2 Likes

I tried writing a udev rule to map the Arduino to a specific /dev/ name , but the node-red-node-arduino doesn't find the newly mapped name, so something like this (at least without editing the node source code) is not possible...

Is the mapped name working correctly with another client?

Indeed, you can't just remap the name. You need to use the rule to set the name in the first place based off something like its serial number , or which physical usb connector it is plugged into.

1 Like

Well haven't tried with another client, but the map is set , tried flashing Arduino through arduino-cli and it worked...
But as @dceejay mentioned you can't just remap it...
Do you have any reference or example for the set rule?

The link I supplied describes the principles of how to do it. You have to do that and look for something specific about your device for udev to recognise and link to the name you specify. For example I have a pi where I use the vendor and product id to identify it. That wouldn't work if I plugged in another similar device at the same time of course. This is the rule
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="LinkUSB"
which links /dev/LinkUSB to whatever /dev/USBxxx the system has mounted it at.

Work through the procedure in the link I supplied and see how far you get.

2 Likes

Of course if you have two identical devices that won't won't :-)... so you may need to use ATTRS{devpath} instead which then needs the actual USB which will probably be something like 1-1:1 or 1-1:2 etc

Yes, as I said. Alternatively there may be a serial number.

Well, I followed the tutorial but I can't see my newly generated path for the configured port...
Any other idea guys?

it won't autodetect one you create - but try just typing it in... /dev/myPortName

2 Likes

Well I that worked (how stupid of me not trying to type in text :expressionless: )

1 Like