Page 1 of 1

Arduino changes serial port automatically

Posted: Fri Aug 23, 2019 7:47 pm
by SophieLiu
I want to control NeoPixel LED lights with Raspberry pi. The lights are connected with Arduino. When I just check the arduino through my own laptop, the outputs are stable. However, when arduino is connected with Raspberry pi, the code can run for two times (I write while loop for the light) and then arduino changes the Serial Port automatically. I want to know why it will change automatically since I don't touch or move anything so I don't think it's the contact problem. Thanks.

Re: Arduino changes serial port automatically

Posted: Sun Aug 25, 2019 2:11 am
by wh7qq
SophieLiu wrote:
Fri Aug 23, 2019 7:47 pm
I want to control NeoPixel LED lights with Raspberry pi. The lights are connected with Arduino. When I just check the arduino through my own laptop, the outputs are stable. However, when arduino is connected with Raspberry pi, the code can run for two times (I write while loop for the light) and then arduino changes the Serial Port automatically. I want to know why it will change automatically since I don't touch or move anything so I don't think it's the contact problem. Thanks.
Puzzling problem. First off, are you using the latest Arduino update or the outdated one from the Raspbian repositories? You should probably download and install the latest version (1.8.9 as of this writing) from the Arduino web site if you have not done so already. Second, have you actually selected ttyACM0 (linux IDE) from the "Tools" menu in the Arduino IDE? Finally, is there anything in your code loop that will close the serial port? Dumb questions that may or may not help as I am pretty new with the Arduino myself.

Oh, is the IDE running on your RPi (model?) or on another computer/OS such as Windows? And what language are you using...Arduino modified C from the IDE or something else? More dumb questions.

Re: Arduino changes serial port automatically

Posted: Mon Aug 26, 2019 6:34 pm
by SophieLiu
I think the packages are all the latest version. I have done with sudo apt-get upgrade/update. And I have selected the Serial port. That's why I'm confused why it still changes even though I have selected the port. In my code, it has some part to close and open the serial port. However, before I decide to close the port, it changes. But this doesn't always happen. Sometimes it doesn't change and works well. But sometimes it changes. For IDE, I use Python.