Page 1 of 1

MQTT_ESP32_AppDev did not work.

Posted: Tue Nov 16, 2021 10:16 am
by kevin22630582
大家好, 這是我第一次在論壇上發帖。希望你能幫到我。

我從youtube上看到了這段視頻, 關於如何使用ESP32與 Mqtt 協定的視頻 (https://www.youtube.com/watch?v=efDrZdLGeTY), 我試圖寫相同的代碼, 但它不工作。

問題1: . fcfx 和 .fcsx 無法像視頻一樣連接。

問題 2 : AppDev. fcsx 將在 5 秒後自動停止運行。

我用 Rpi4b 是我的 Mqtt 經紀人 (https://www.flowcode.co.uk/wiki/index.p ... QTT_Broker
Picture_2是我的 Rpi 設置。(MQTT 經紀商測試和 IP 位址)

Re: MQTT_ESP32_AppDev did not work.

Posted: Tue Nov 16, 2021 10:26 am
by Steve-Matrix
For convenience, here's a translation of the original post into English:
Hi everyone, this is my first time posting on the forum. Hope you can help me.

I saw this video from youtube, about how to use ESP32 and Mqtt protocol video ( https://www.youtube.com/watch?v=efDrZdLGeTY), I tried to write the same code, but it doesn't work.

Question 1: .fcfx and .fcsx cannot be connected like video.

Question 2: AppDev. fcsx will automatically stop running after 5 seconds.

I use Rpi4b as my Mqtt broker ( https://www.flowcode.co.uk/wiki/index.p ... QTT_Broker)
Picture_2 is my Rpi setting. (MQTT broker test and IP address)

Re: MQTT_ESP32_AppDev did not work.

Posted: Tue Nov 16, 2021 2:24 pm
by medelec35
Welcome to the Flowocde forums.
If It was me,
The first thing I would do is check that both the ESP32 and RPI can be seen on the network.
I would use a network utility tool.
Then I would check that RPI IP matches up with the stated IP within IOT Made Easy component.
As you have set up a broker name and password, within IOT Made Easy (Pi,a0953530662), have you set up the same name and password within the RPI?

Re: MQTT_ESP32_AppDev did not work.

Posted: Tue Nov 16, 2021 3:32 pm
by LeighM
Also...
If you stop the mosquitto server as a service, then run with the command

Code: Select all

mosquitto -v
you will get on screen messages that will help,
such as when the client connects etc..

Re: MQTT_ESP32_AppDev did not work.

Posted: Wed Nov 17, 2021 2:30 am
by kevin22630582
Thanks Steve-Matrix for the translation.

Reply to medelec35 :
First, thank you for your reply. I followed your suggestion, check my hardware.

(1) Rpi and ESP32 both can be seen on the network.
Picture_3.png
Picture_3.png (198.63 KiB) Viewed 2595 times
(2) Rpi IP address matches up with the stated IP within IoT Made Easy component.
Picture_4.png
Picture_4.png (750.82 KiB) Viewed 2595 times
(3) I found I didn't set up the broker name and password, so I changed the component properties.
Picture_5.png
Picture_5.png (30.14 KiB) Viewed 2595 times

Re: MQTT_ESP32_AppDev did not work.

Posted: Wed Nov 17, 2021 2:35 am
by kevin22630582
LeighM wrote:
Tue Nov 16, 2021 3:32 pm
Also...
If you stop the mosquitto server as a service, then run with the command

Code: Select all

mosquitto -v
you will get on screen messages that will help,
such as when the client connects etc..
Thanks you for you reply!

This was the screen message, is it got some wrong ?
Picture_6.png
Picture_6.png (224.75 KiB) Viewed 2593 times

Re: MQTT_ESP32_AppDev did not work.

Posted: Thu Nov 18, 2021 11:12 am
by BenR
Hello,

Mosquitto version 2.0 and after requires a bit of additional configuration to enable remote access.

The clue is the "starting in local only mode"

The details are available here.

https://mosquitto.org/documentation/aut ... n-methods/

Fingers crossed :D