Find and Connect to Com Port for Arduino with PySerial - Serial Communication

preview_player
Показать описание

This video goes over how to automatically find and connect to your arduino using pySerial!
Рекомендации по теме
Комментарии
Автор

Wonderful. Today I stopped having to reboot my raspberry pi. Bonus, Codium AI took over(without me asking) and optimized the code for performance, exception handling and best practices.

StarChild.no
Автор

Simple, but i thought would be useful. I was work at electronic company, but dont know any programming language yet. Lately learn Python as it community base good, and lot of module. Glad to know that i can use Python also on electronics (even i hear lot people python has slow performance, but stil its good for starter)

ChrisAnja
Автор

Hello from India... Thank you very much for this easy to understand and very helpful video.

sameerk
Автор

Holy smokes - this is what I've been seeking for about the last two weeks .. thank you !
Some disgruntled idiot at work decided to leave the company with his HW & SW (python) in a complete clusterfucked state of fubar. No commenting whatsoever .. what a special kind of prick, right ?
Well this tutorial got me back making progress with this diaper-change of a task. Thank you again ..

j.p.wagner
Автор

Thanks ...very much
your simple code
to be easy learn and correct program

kxlmoik
Автор

AT LINE 18: port= foundports[i] should be replace by portsfound[i]

Diwakaryou
Автор

Its refreshing to realize Im getting good enough to troubleshoot the program if something isn't going right

rverm
Автор

I use the following function which will find genuine Arduino boards and clones using the CH340 and CP210 USB to serial chips.

def find_arduino():
ports_found =
port = 'None'
look_for = ["Arduino", "CH340", "CP210"]
type = None
for l in look_for:
for p in ports_found:
str_port = str(p)
if l in str_port:
type = l
port = str_port.split(' ')[0]
break
if port != "None":
break
return port, type

gedtoon
Автор

This list ports function is hidden in the documentation, thanks for sharing this!

LopserGaming
Автор

thanks good script i'll use it for make my own arduino serial monitor

TheFreshDeals
Автор

Hi there, I can find only USB serial CH340 in device manager port (which is connected to COM 3. I can't find Arduino UNO in the device manager port which is why I am getting an error "'SerialException: could not open port 'COM3': PermissionError(13, 'Access is denied.', None, 5)"' . Could you please tell me how to add arduino in port ?

vikashkumar-cree
Автор

Hi, thanks for the good videos!

Do you have an idea how I can identify multiple Arduinos on the same Host and connect do a defined Arduino?

tomgruenewald
Автор

HELLO @WaveShapePlay
PLEASE TELL ME HOW TO FIX THE ERROR: "typeerror 'generator' object is not subscriptable" AT LINE 18: port= foundports[i]
please reply

Priyanka-hfqm
Автор

Is there a way to have this work on either mac or windows devices?

cooperthomez
Автор

I'm on a mac and the USB devices are read differently. How could one modify this code to use the USB's Manufacturer information to automate finding the Arduino? The following code seems to do the trick, but how can one have python double-check the connection? Thank you for your help!


import serial.tools.list_ports


def findArduino(manufacturer):
for pinfo in
if pinfo.manufacturer == manufacturer:
return serial.Serial(pinfo.device)
raise IOError("Could not find an arduino - is it plugged in?")


ser = (www.arduino.cc)')

timothynicholson
Автор

interesting video.
I tried this without changing code but when I run it the following error is found.

Cell In[4], line 17


Cell In[4], line 15 in findArduino
return commPort

UnboundLocalError: local variable 'commPort' referenced before assignment

****how could it be resolved tell me

oylulfq
Автор

i am getting empty list like [ ], how to solve this

bhanuprakashreddy
Автор

i was just looking for the exact video but i dident know what to type in to search for it and it appeared on my screen when i logged into utub. THANK YOU but in Linux or Ubuntu it displays its port in arduino.

charlesklein
Автор

Thanks a lot. Please leave a link to the program code in another video.

sergei
Автор

Any suggestion group of people work with these kind arduino n python stuff to join, this library kind a least update, im not to familiar with javascript or johhny5, thank u, my appologize if my text seem worst

stifenjans