Search found 11 matches

by teltonique21
Wed Jun 22, 2022 10:22 am
Forum: Other Boards
Topic: Openwrt mqtt
Replies: 3
Views: 19451

Re: Openwrt mqtt

ok tried this library https://github.com/peterhinch/micropython-mqtt/tree/master/mqtt_as with TLS certificates, it only works if I comment in mqtt_as.py the setblocking(True) and thus make the connection synchronous. async def _connect(self, clean): self._sock = socket.socket() self._sock.setblockin...
by teltonique21
Wed Jun 22, 2022 7:26 am
Forum: Other Boards
Topic: Openwrt mqtt
Replies: 3
Views: 19451

Re: Openwrt mqtt

Since you're facing issues with MQTT, I think you can try this one: https://randomnerdtutorials.com/micropython-mqtt-esp32-esp8266/ I am using the Linux / OpenWRT port not the ESP32, also the code uses: while True: try: client.check_msg() which is the same method I am having problems with. My code ...
by teltonique21
Tue Jun 21, 2022 3:43 pm
Forum: Other Boards
Topic: Openwrt mqtt
Replies: 3
Views: 19451

Openwrt mqtt

I tried the official benchmark script which connects to MQTT from the Peter Hinch github: https://github.com/peterhinch/micropython-samples/blob/master/ESP8266/benchmark.py however I get: micropython benchmark.py Connected to mqtt.blabla.net, subscribed to b'test/test' topic Traceback (most recent c...
by teltonique21
Tue May 24, 2022 3:38 pm
Forum: General Discussion and Questions
Topic: Calling an OS system command
Replies: 5
Views: 5097

Re: Calling an OS system command

os.system() and os.fork() don't support standard output redirect unfortunately unlike subprocess.Popen
by teltonique21
Tue May 24, 2022 3:35 pm
Forum: MicroPython pyboard
Topic: Sending large array of numbers to host computer
Replies: 7
Views: 33436

Re: Sending large array of numbers to host computer

import os os.system('pyboard.py --device /dev/pyboard -c "import rats10" >> result.py') from result import a print(a[99]) # a is the array, retrieve an element I'm sure there's a much more elegant way to do this on MicroPython... Is there a way to get the standard output of the launched command? I ...
by teltonique21
Tue May 24, 2022 3:16 pm
Forum: Programs, Libraries and Tools
Topic: I can’t interact with micropython by Popen
Replies: 11
Views: 9048

Re: I can’t interact with micropython by Popen

where is the subprocess package for unix port located in the github repository?
I can't find it and in my "/usr/lib/micropython/" folder inside my OpenWRT device there's an empty "subprocess" module only, how can I get the subprocess package and replace the empty one?
by teltonique21
Mon Mar 21, 2022 4:36 pm
Forum: General Discussion and Questions
Topic: Implementing a C function that takes a Python function as argument
Replies: 11
Views: 13226

Re: Implementing a C function that takes a Python function as argument

Turbinenreiter wrote:
Thu Dec 15, 2016 1:50 pm
Thank you!

I can now register a method and run a dbus Service from MicroPython.
Can you please post an example using dbus?
by teltonique21
Tue Mar 08, 2022 10:27 am
Forum: ESP32 boards
Topic: ESP32 to Mosquitto Broker over TLS
Replies: 7
Views: 8406

Re: ESP32 to Mosquitto Broker over TLS

Ok first install a working Mosquitto broker and enable SSL and check it is working with a client like MQTT-Fx. Then the .pem working certificates must be transformed to DER format with the following command: openssl x509 -outform der -in your-cert.pem -out your-cert.crt Then create a Micropython cod...
by teltonique21
Fri Mar 04, 2022 10:18 am
Forum: ESP32 boards
Topic: ussl.CERT_NONE
Replies: 3
Views: 2284

Re: ussl.CERT_NONE

Do you have some recomendation how to overcome this issue? The docs are a bit confusing for historical reasons (the ussl module differents between different MicroPython ports, but the docs are for the CC3200 version). On every other port, the cert_reqs argument isn't supported. You don't need to sp...
by teltonique21
Fri Mar 04, 2022 10:08 am
Forum: ESP32 boards
Topic: ESP32 to Mosquitto Broker over TLS
Replies: 7
Views: 8406

Re: ESP32 to Mosquitto Broker over TLS

The mqtt_as library has been tested on ESP32 with TLS. Thanks so much for your answer, i'll check it out mqtt_as for sure. I managed to make it work using mqtt.simple by adding the content of the certificates to the code. Thanks guys! Do you mind sharing the code where the connection is made with T...