Execute Arduino from exec node

#1

Hi there,

I am trying to call the arduino cli (ps now they support) from exec node in Window 10. I got code 0 and access denied error. How can I solve it? please.

PS. For arduino, I use arduino by downloading compressed file what include all requirement rather than get it from playstore or run exe installation file. Then I also added the "arduino.exe" inside the compress file into system path.

0 Likes

#2

Would be helpful to actually see the error in context.

Not tried this myself but the implication is that you've put the arduino cli somewhere that the user running NR doesn't have execute rights.

Alternatively, it could be that the cli is trying to do something that isn't allowed. For example writing to a protected folder (under "program files" for example). Or it could be that the cli is trying to access the USB serial port and doesn't have rights?

1 Like

#3

or maybe you already have arduino nodes running which grab control of the serial port - so that then the cli can't get it.

1 Like

#4

Hi @dceejay and @TotallyInformation,

All of your information are really helpful to solve the problem. I was trying to upload the firmware via node-red. I mean read the arduino source code from node-red and use exec to call arduino cli to upload a new firmware.

Before that, I put the firmware code inside MyDocument directory and use just the name of arduino (like arduino.exe xxxx and of-course I added arduino into system path). I got the error in this way.

Now, the problem has been solved. At this time, I move source code into the arduino's folder. While calling arduino from exec, I give absolute directory location to call the arduino cli rather than just name as I did before. I don't which one solved the problem.

Thanks

0 Likes