Send message to broker MQTT

onire77
Posts: 1
Joined: Mon Oct 22, 2018 5:39 pm

Send message to broker MQTT

Postby onire77 » Sun Nov 18, 2018 6:17 pm

Hi,
I want to change this example https://github.com/espressif/esp-mqtt/b ... pp_main.c to send every 10 seconds a temperature to a broker. I don’t understand how to modify the mqtt_event_handler for my necessity.

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Send message to broker MQTT

Postby Ritesh » Mon Nov 19, 2018 7:42 pm

onire77 wrote:
Sun Nov 18, 2018 6:17 pm
Hi,
I want to change this example https://github.com/espressif/esp-mqtt/b ... pp_main.c to send every 10 seconds a temperature to a broker. I don’t understand how to modify the mqtt_event_handler for my necessity.
This example is just to start MQTT client which will do some configuration and will start MQTT.

So, You need to create pusblisher and subscriber as per your requirement and then create example to fulfill your end application

MQTT event handler is just to provide few MQTT related events which also you can used based on event you will get from MQTT
Regards,
Ritesh Prajapati

Auguste
Posts: 1
Joined: Tue Dec 18, 2018 1:40 pm

Re: Send message to broker MQTT

Postby Auguste » Tue Dec 18, 2018 4:01 pm

Hello,

I understand that I have to create my own event handler but I don't know how to do it. In the tcp exemple we have the user_context but I don't know how to use it. Could you explain me how it works ?

Thanks

Who is online

Users browsing this forum: MicroController and 132 guests