Mar-06-2022, 07:07 AM
(Mar-03-2022, 11:04 AM)Larz60+ Wrote: you should only initialize ports once and close at the end of your session.Hi,
see: https://pyserial.readthedocs.io/en/lates...intro.html
Thanks for the suggestion. But I am a bit confused, I am only initializing the ports once I believe.
By "closing at the end of your session" do you mean after the loop breaks (or after the file is filled with data and closed)?
Or do you mean in general, like at the end of the code, when I am done with everything?
Basically, in my case, I am running the code until the battery pack (power bank connected as power supply to RPi) gets dead, so I believe all the ports get reset when RPi is powered up gain.
Please correct me if I am wrong somewhere. Thanks.