OSError -12 while running mqtt demo

Discussion related to "under the hood" OpenMV topics.
Ascarron
Posts: 4
Joined: Fri Jul 05, 2019 5:40 pm

OSError -12 while running mqtt demo

Postby Ascarron » Mon Jul 08, 2019 7:11 pm

I am trying to run the mqtt demo on the OpenMV cam H7 using the given examples and while connecting to the server and sending the message it gives me the following output leading to OSError -12:
>>> Trying to connect... (may take a while)...
Running in Station mode...
[-56, 2, 'MyWiFi', 'f8:f0:05:a3:05:46', '192.168.54.65']

Traceback (most recent call last):
File "<stdin>", line 22, in <module>
File "mqtt.py", line 77, in connect
OSError: -12
I tried resetting the device using pyb.hard_reset(), but it didn't work.
I am unable to find any solution for this. What can I do to debug this?
User avatar
iabdalkader
Posts: 1141
Joined: Sun May 24, 2015 3:53 pm

Re: OSError -12 while running mqtt demo

Postby iabdalkader » Mon Jul 08, 2019 7:44 pm

I'll test it and get back to you.
User avatar
iabdalkader
Posts: 1141
Joined: Sun May 24, 2015 3:53 pm

Re: OSError -12 while running mqtt demo

Postby iabdalkader » Tue Jul 09, 2019 6:27 pm

Hi, it looks like an issue with the broker... This one works:

broker.hivemq.com
Ascarron
Posts: 4
Joined: Fri Jul 05, 2019 5:40 pm

Re: OSError -12 while running mqtt demo

Postby Ascarron » Wed Jul 10, 2019 6:50 pm

Thanks! I will try this out.
I want to publish the mqtt messages over to the cloud using certificates for authentication. Is there a way for the module to connect to the cloud (like aws/google/azure iot)directly without a broker? How can we attach the CA and private certificates for this?
User avatar
iabdalkader
Posts: 1141
Joined: Sun May 24, 2015 3:53 pm

Re: OSError -12 while running mqtt demo

Postby iabdalkader » Thu Jul 11, 2019 7:55 am

Sorry I'm not an expert in MQTT, can't help with that.
Ascarron
Posts: 4
Joined: Fri Jul 05, 2019 5:40 pm

Re: OSError -12 while running mqtt demo

Postby Ascarron » Wed Jul 17, 2019 1:45 pm

Thanks for the reply.
I did some digging and found that the ussl module allows for adding certificated and wrapping the connection.
However when I do

Code: Select all

import ussl
, I get the error
Import Error: module not found
. Then I open up a serial terminal from the OpenMV IDE and type

Code: Select all

 import upip
 upip_install(ussl)
, it says that I dont have upip installed. Could you please let me know of the correct way to install packages using the IDE?
Thanks in advance
User avatar
kwagyeman
Posts: 3806
Joined: Sun May 24, 2015 2:10 pm

Re: OSError -12 while running mqtt demo

Postby kwagyeman » Wed Jul 17, 2019 1:53 pm

I don't think we have ussl installed on our system. We have flash space for it however. Please create a GitHub bug tracker. We are starting another firmware push now and bug fixes will be brought in.
Nyamekye,
User avatar
iabdalkader
Posts: 1141
Joined: Sun May 24, 2015 3:53 pm

Re: OSError -12 while running mqtt demo

Postby iabdalkader » Wed Jul 17, 2019 6:02 pm

I think it was just recently supported by the stm32 port (used to be for the Unix port). This will be enabled when we update our MicroPython fork.
Ascarron
Posts: 4
Joined: Fri Jul 05, 2019 5:40 pm

Re: OSError -12 while running mqtt demo

Postby Ascarron » Thu Jul 18, 2019 1:04 pm

Thanks! Looking forward to it.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests