-
Notifications
You must be signed in to change notification settings - Fork 13
CPython sockets compatibility #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@askpatrickw CPython sockets now work in v5.0.0 of MiniMQTT. Do you want to tackle this issue? |
@brentru woot!! I may not get to it this week, but 100% Yes I will give it a go! |
Thanks! |
I finally have time to look at this. I'll commit to my fork and ping back if I get stuck. |
Gotta take a break... but I'm moving along getting it working first just with native wifi, then I was thinking I'd figure out how to add the esp32spi support back. Currently hitting the same error as this, not sure its the same problem yet. My current revisions are in my fork.
|
Quick update from me... I've not given up on this. I wanted to be able to side-by-side test\verify with the SPI implementation. I only have ESP32S2 boards, so I ordered some hardware from Adafruit back on 5 March and it looks like its finally going to be delivered today 21 March. (Yay USPS!) so over the next week I'll look at this again. |
@askpatrickw I also have hardware handy if you'd like me to test a PR. |
I'm not finding great docs (which is weird for Msft) on the API version changes, but I do see this library was coded against the following version (constants.py) # The version of the IoT Central MQTT API this code is built against
IOTC_API_VERSION = "2016-11-14"
# The version of the Azure Device Provisioning Service this code is built against
DPS_API_VERSION = "2018-11-01" I changed these to This is what IOT_MQTT looks like at _create_mqtt_client {
"_passwd": "SharedAccessSignature sig=snip1NN9%2B7y%2F8wZZftBtl8s%3D&se=1616847681&sr=iotc-snip-03dd-4ad0-be4a-snip.azure-devices.net%2Fdevices%snip",
"_device_id": "snip",
"_token_expires": 21600,
"_logger": <Logger object at 200034b0>,
"_auth_response_received": False,
"_socket": <module "adafruit_esp32spi.adafruit_esp32spi_socket" from "/lib/adafruit_esp32spi/adafruit_esp32spi_socket.mpy">,
"_hostname": "iotc-snip-03dd-4ad0-be4a-snip.azure-devices.net",
"_mqtts": None,
"_username": "iotc-snip-03dd-4ad0-be4a-snip.azure-devices.net/snip/api-version=2018-06-30",
"_key": "snip",
"_mqtt_connected": False,
"_iface": <ESP_SPIcontrol object at 200035e0>,
"_callback": <IoTCentralDevice object at 20003460>,
"_is_subscribed_to_twins": False
} username, passwd, and hostname and device_id all look good to me and look like the IoT Hub MQTT docs. |
A typical setup requires an esp object which is related to the ESP32 wifi add-on boards.
device = IoTCentralDevice(socket, esp, secrets["id_scope"], secrets["device_id"], secrets["key"])
With the ESP32-s2 and its native wifi support, there is now a CPython-like socketpool.
IoTCentralDevice needs to be udpated to support both methods similarly if not the same way Requests does and MiniMQTT is going to be.
The text was updated successfully, but these errors were encountered: