[Info] MQTT Eclipse Paho client component

User avatar
kolban
Posts: 1441
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

[Info] MQTT Eclipse Paho client component

Postby kolban » Fri Jan 20, 2017 3:59 am

We are awash in excellent MQTT clients for ESP32 (as it should be). Here is yet another for the mix. The Eclipse Paho project provides an embedded-C client component that can be found here:

https://github.com/eclipse/paho.mqtt.embedded-c

I downloaded this and with minor tweaks got it working on ESP32 with no significant issues. I tested against a Linux hosted MQTT Mosquitto broker and it seems to be working just fine. Here is a link to the port to ESP32 with a sample ...

https://github.com/nkolban/esp32-snippe ... embedded_c

Again, let me stress that the changes from the original Github project were minor.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

f.h-f.s.
Posts: 188
Joined: Thu Dec 08, 2016 2:53 pm

Re: [Info] MQTT Eclipse Paho client component

Postby f.h-f.s. » Fri Jan 20, 2017 8:47 am

I got azure umqtt working, I used the arduino version for the esp8266 as an example.
Reworked the wificlientsecure to use openssl and got it working. Cannot share though ='( Great work!

jspark
Posts: 1
Joined: Wed May 24, 2017 6:03 am

Re: [Info] MQTT Eclipse Paho client component

Postby jspark » Wed May 24, 2017 6:56 am

esp-idf : https://github.com/espressif/esp-dif.git

i have a question in a upload code (https://github.com/nkolban/esp32-snippets.git)

1. A save paho_mqtt_embedded_c folder in esp-idf/component
2. Build the files in the esp32_sample folder
3. MQTTClient-C/src/linux/MQTTLinux.h file error generated
4. change the component.mk file (MQTTClient-C/src/linux -> MQTTClient-C/src/FreeRTOS)
5. FreeRTOS_Sockets.h FreeRTOS_IP.h ... many files (no such file or directory)error generated

How did you solve it?

User avatar
kolban
Posts: 1441
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: [Info] MQTT Eclipse Paho client component

Postby kolban » Fri May 26, 2017 12:34 am

Its been 5 months since I looked ... but if I remember ... we take the whole folder found here:

https://github.com/nkolban/esp32-snippe ... embedded_c

And place that in our ESP32 project's components directory.

This would end up with:

<YourProject>/components/paho_mqtt_embedded_c

Since "paho_mqtt_embedded_c" contains an ESP-IDF "component.mk" file, it should "just build" when you run make in your project's home directory. No other modifications are needed. The result will be that the MQTT client API is now available to your apps.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

d1_jaime
Posts: 4
Joined: Wed Nov 15, 2017 5:18 pm

Re: [Info] MQTT Eclipse Paho client component

Postby d1_jaime » Mon Nov 20, 2017 5:04 pm

Hey, I just tried it out and it couldn't finish building. Can you give me a quick hand?

It was placed to match the ESP32 documentation
- myProject/
- Makefile
- sdkconfig
- components/ - component1/ - component.mk
- Kconfig
- src1.c
- component2/ - component.mk
- Kconfig
- src1.c
- include/ - component2.h
- main/ - src1.c
- src2.c
- component.mk

- build/


The make debug
make: Circular /home/esp32/Projects/ESP32/mqtt_paho/mqtt_paho_port/build/MQTT_Test <- /home/esp32/Projects/ESP32/mqtt_paho/mqtt_paho_port/build/MQTT_Test dependency dropped.
Considering target file '.elf'.
File '.elf' does not exist.


The error
Putting child 0xe10190 (.elf) PID 25077 on the chain.
Live child 0xe10190 (.elf) PID 25077
LD .elf
Reaping winning child 0xe10190 PID 25077
Live child 0xe10190 (.elf) PID 25078
xtensa-esp32-elf-gcc: error: .map: No such file or directory
Reaping losing child 0xe10190 PID 25078
/home/esp32/esp/esp-idf/make/project.mk:373: recipe for target '.elf' failed
make: *** [.elf] Error 1
Removing child 0xe10190 PID 25078 from chain.

Who is online

Users browsing this forum: No registered users and 3 guests