adafruit / Adafruit_CircuitPython_ESP_ATcontrol

Use the ESP AT command sent to communicate with the Interwebs
MIT License
20 stars 17 forks source link

Update adafruit_espatcontrol_socket.py #53

Closed sidikalamini closed 2 years ago

sidikalamini commented 2 years ago

I got error when using adafruit_espatcontrol_socket.py and adafruit_minimqtt when I use port 1883 for MQTT, it is due to connection type is not defined for port 1883

Traceback (most recent call last): File "code.py", line 117, in File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 447, in connect File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 270, in _get_connect_socket File "/lib/adafruit_espatcontrol/adafruit_espatcontrol_socket.py", line 85, in connect File "/lib/adafruit_espatcontrol/adafruit_espatcontrol.py", line 202, in socket_connect RuntimeError: Connection type must be TCP, UDL or SSL

I propose to add conntype TCP for port 1883 in the condition

ladyada commented 2 years ago

hiya! thanks so much for submitting a PR! we can review & merge PRs once they have passed continuous integration (CI). that means that code is 'linted' - that means it is formatted and passes basic structure tests, so that we maintain the same text formatting for all new code if your code isnt passing, check the CI output (click on the red X next to the PR to scroll through the log and find where the error is

here is a tutorial on pylint and black: https://learn.adafruit.com/improve-your-code-with-pylint

and overall how to contribute PRs to circuitpython: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

once you get that green checkmark that indicates CI has passed, please comment reply to this post so we know its time for another review (we may not get notified on CI pass and miss that its time to look!)

sidikalamini commented 2 years ago

correctly formatted comment

ladyada commented 2 years ago

thanx!