Opentrons / opentrons

Software for writing protocols and running them on the Opentrons Flex and Opentrons OT-2
https://opentrons.com
Apache License 2.0
418 stars 178 forks source link

OT-2 email updates: smtp doesn't connect | gaierror: [Errno -3] Temporary failure in name resolution #8563

Open camos95 opened 2 years ago

camos95 commented 2 years ago

I would like to receive email updates from my OT-2 when it is done with a run in Jupyter Notebook mode.

To do so I created a gmail account for my OT-2, not used for anything else. Using Python's standard library smtplib this is no problem on my local machine when using opentrons simulate mode. However, when I try the same when connected to the OT-2 I keep receiving a gaierror: [Errno -3] Temporary failure in name resolution error. The problem appears to be with smtp not even being able to connect to the gmail server.

This is the code to connect to the email server where the problem occurs:

Code

from opentrons import protocol_api, execute
import smtplib

protocol = execute.get_protocol_api('2.10')

# enter your email
rec_emails = you
# login to OT-2's gmail account
sender_email = me
password = input(str("Please enter your password :"))

server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(sender_email, password)
print("Login success")

Error Message

---------------------------------------------------------------------------
gaierror                                  Traceback (most recent call last)
<ipython-input-42-b84689d20017> in <module>()
----> 1 server = smtplib.SMTP('smtp.gmail.com', 587)
      2 server.starttls()
      3 server.login(sender_email, password)
      4 print("Login success")

/usr/lib/python3.7/smtplib.pyc in __init__(self, host, port, local_hostname, timeout, source_address)

/usr/lib/python3.7/smtplib.pyc in connect(self, host, port, source_address)

/usr/lib/python3.7/smtplib.pyc in _get_socket(self, host, port, timeout)

/usr/lib/python3.7/socket.pyc in create_connection(address, timeout, source_address)

/usr/lib/python3.7/socket.pyc in getaddrinfo(host, port, family, type, proto, flags)

gaierror: [Errno -3] Temporary failure in name resolution
mcous commented 2 years ago

Does this problem occur on more than one Wi-Fi network?

camos95 commented 2 years ago

Yes, we just changed the Wi-Fi network and the error message remains the same.