Worked examples for Serial, HTTP and MQTT

Discuss PC Developer and Web Developer projects and features here.
chipfryer27
Valued Contributor
Posts: 1147
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Worked examples for Serial, HTTP and MQTT

Post by chipfryer27 »

Hi

Created a simple chart that would serve the standard Flowcode page in a browser. Works fine when I simulate using Network component set to Simulation DLL but not Component Simulation (which should then simulate via the esp).

It's not a big issue for me really.

Regards

daddytims_tims
Posts: 20
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 17 times

Flowcode v10 Re: Worked examples for Serial, HTTP and MQTT

Post by daddytims_tims »

Good morning ALL

I am here now,

I am going to try and search for it. It an Embedded project 01 with the app developer

I had enter my Ip address along with my Wi-Fi etc. IT work yes, The only thing I had to disable some stuff out of it.

I have my stuff with me, Gonna try the voting one and let you know.

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Worked examples for Serial, HTTP and MQTT

Post by chipfryer27 »

Hi

First time playing with HW in a while :)

Opened Embedded Project 01 and changed target to an esp32-lolin-lite, modifying parameters to suit. I included a couple of loops that flashed onboard LED a few times depending on connection status. Saved to target without issue using

Python 3.11.2
Git 2.39.2
idf 5.1.2

It connected without issue to my router.

Opened Web Project 01, modified IP address to suit target saved and created webpage.

Using Firefox, I opened the newly creaed webpage and could see the two buttons which worked perfectly. I could switch on/off the onboard LED on the esp32 at will.

Quick question, although we have the Web Server, Network Component and WLAN ESP components, we only initialise the WLAN not the other two. Any reason for this?

Good examples which hopefully will inspire more uses.

Regards

daddytims_tims
Posts: 20
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 17 times

Re: Worked examples for Serial, HTTP and MQTT

Post by daddytims_tims »

Hi Chipfryer,

thanks for the Information, when I get the chance. I will try it out.

I am not using any of these updated versions.

Python 3.11.2
Git 2.39.2
idf 5.1.2

I saw that you guys having some issues with them, I don't know how you guys do the roll back version.
so, I don't mess with it...
Is Those Version Working Fine Now without any Problem.??

Ryan.

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Worked examples for Serial, HTTP and MQTT

Post by chipfryer27 »

Hi

I have a couple of machines and depending on what other software gets installed then Python / Git gets updated as part of the instal process that I have little control over. Unless I specifically have issues with esp, then I don't try and "roll back".

The official line for FC/esp is still as per the install instructions as only those versions have been tested to work. I would not go out of my way to update Python / Git though. My inclusion of revision is more FYI in case of issues.

I don't use esp32s that much (never used their Bluetooth) so any use I have is quite basic in functionality.

Although I have desktop PCs I use a laptop as my main machine and only recently updated to one that can run web developer so I'm quite keen to start playing with it. The first example is exactly what I was going to try first and happy to report that it ran without problems.

Regards

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Worked examples for Serial, HTTP and MQTT

Post by Steve-Matrix »

chipfryer27 wrote:
Sat Mar 09, 2024 2:17 pm
Quick question, although we have the Web Server, Network Component and WLAN ESP components, we only initialise the WLAN not the other two. Any reason for this?
I believe that the WLAN takes care of the initialisation of the other components.

daddytims_tims
Posts: 20
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 17 times

Flowcode v10 2 Way Communication

Post by daddytims_tims »

Good Day

Hi Steve,Chipfryer

I found the problem now.
I re Read what Steve had said above found d problem

I accidentally remove the variable ". successful" in the WLAN Component, which I didn't Realized. That's what giving me the problem,
now it's working. I am Connected. :D

There something else that I want to Do as well. I want to add something to that Program

I want to be able to control that led using a push button from the Esp32 ITSELF,
for example.
Incase if my Internet is down or I am unreachable, someone at home could shut down the "motor/Led". but the web app itself should be able relate to the state of that signal when its trigger via push button from the Esp32.

Meaning if the web app is logic 1, pin 23 become High
when I Press the Push button on the Esp32 it should only go logic 0
and vice versa

How Can I Achieve that in my Program?
Ant Help Would be greatly appreciate

Ryan.
Attachments
EmbeddedProject-01_Ryan.fcfx
(27.95 KiB) Downloaded 11 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Worked examples for Serial, HTTP and MQTT

Post by chipfryer27 »

Hi

No access to FC at the moment.

In the second example, we turn on/off the led and obtain status from browser.

To do as you want, in the esp main loop add test for the button and act accordingly.

That will allow both button and app to control.

The app only retrieves status after it updates so won't initially know current status when it opens. Therefore you will need to copy and include the section of code that retrieves the status into the main branch (I think). That way it will update status upon opening, then update at each press.

Of course if the app is already open you won't see any manual button change automatically updating app. You would need to include some timed function if you wanted the app to automatically update status every x-seconds.

It may be helpful to keep working through examples first though as perhaps the MQTT broker may be more suited.

Regards

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Worked examples for Serial, HTTP and MQTT

Post by chipfryer27 »

Hi

In another post I documented an issue I had with git 2.44 on my W11 laptop and returning to the recommended versions appeared to solve my issues. I created a flash test for a Lolin_Lite and successfully downloaded to target. All good.

As per a post above, I had successfully changed target to a Lolin-Lite for Example-01 and had this first example working fine. This was on a W10 machine.

On the W11 laptop I changed the Example-01 to run on a Lolin_Lite and modified credentials etc. This failed to compile. I then just tried to compile to Hex the example itself with no modifications at all and this too failed to compile.

Attached is the message file. Any ideas as to what's went wrong?

EmbeddedProject-01.msg.txt
(194.59 KiB) Downloaded 14 times

Regards

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Worked examples for Serial, HTTP and MQTT

Post by Steve-Matrix »

The error seems related to circular dependency issue. You could try disabling Bluetooth if you are not using it, or use and initialise it (as per their recommendation). Or you could possibly try v5.2.

I developed all of these examples using IDF v4.4 with our BL0058 E-Block board. I've not tried them on the later versions of IDF yet.

Post Reply