Skip to content

X1-C SSL connection failed #158

@amuhak

Description

@amuhak

The error:

Starting bambulabs_api example
Connecting to Bambulabs 3D printer
IP: <real_ip_here>
Serial: <real_serial_here>
Access Code: 81f8c799
ERROR:root:Failed to execute function: 522 SSL connection failed: session reuse required
Traceback (most recent call last):
  File "C:\Users\amuly\Desktop\test\bambulabs_api\test.py", line 64, in <module>
    if "226" not in result:
       ^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

I have tried the main, x1_camera, and x1_local_ftp branches. The above error is from x1_camera (main produces the same result) as that has resulted in the best output. The code used is the sample code replacing .connect() with .mqtt_start().

The x1_local_ftp branch results in the following error message:

Traceback (most recent call last):
  File "C:\Users\amuly\Desktop\test\bambulabs_api\test.py", line 49, in <module>
    printer = bl.Printer(IP, ACCESS_CODE, SERIAL)
  File "C:\Users\amuly\Desktop\test\bambulabs_api\bambulabs_api\client.py", line 38, in __init__
    self.ftp_client = PrinterFTPClient(self.ip_address,
                      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
                                       self.access_code)
                                       ^^^^^^^^^^^^^^^^^
  File "C:\Users\amuly\Desktop\test\bambulabs_api\bambulabs_api\ftp_client.py", line 91, in __init__
    self.ftps = ImplicitFTP_TLS(self._context)
                ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "C:\Users\amuly\Desktop\test\bambulabs_api\bambulabs_api\ftp_client.py", line 22, in __init__
    super().__init__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\amuly\anaconda3\envs\bl_api\Lib\ftplib.py", line 718, in __init__
    super().__init__(host, user, passwd, acct,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
                     timeout, source_address, encoding=encoding)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\amuly\anaconda3\envs\bl_api\Lib\ftplib.py", line 121, in __init__
    self.connect(host)
    ~~~~~~~~~~~~^^^^^^
  File "C:\Users\amuly\anaconda3\envs\bl_api\Lib\ftplib.py", line 158, in connect
    self.sock = socket.create_connection((self.host, self.port), self.timeout,
                ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                         source_address=self.source_address)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\amuly\anaconda3\envs\bl_api\Lib\socket.py", line 840, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\amuly\anaconda3\envs\bl_api\Lib\socket.py", line 977, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: getaddrinfo() argument 1 must be string or None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions