Embedded device controlled from the Web without ESP

Discuss PC Developer and Web Developer projects and features here.
User avatar
Nico595
Posts: 76
http://meble-kuchenne.info.pl
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Flowcode v10 Embedded device controlled from the Web without ESP

Post by Nico595 »

Hello,

Many possibilities exist with App Developer to control a device from the Web. I must add ESP03 in my hardware but later.
Can I control the device by the Web without ESP with Pc App ? It's possible like this or not ?


The first solution is use MQTT server with Web Server to provide html pages.

The second solution use MQTT serve without html pages but I have a doubt.


Mqtt_hardware_design.png
Mqtt_hardware_design.png (94.22 KiB) Viewed 274 times
Mqtt_hardware_design_2.png
Mqtt_hardware_design_2.png (58.62 KiB) Viewed 274 times





Thank you for your advices.

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Embedded device controlled from the Web without ESP

Post by chipfryer27 »

Hi

Whilst I haven't got great experience in App Developer, the overall concept of what you are trying to do seems very reasonable to me.

Recently I created a RAMP install and could control an LED on a RPi from anywhere via local LAN, internet and cell network using the mosquitto broker on the RAMP.

One your broker has passed the message to your client, then it is "just a variable" as far as FC cares, so can be used however you wish.

Regards

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: Embedded device controlled from the Web without ESP

Post by Nico595 »

Hi Chipfryer27,


Thank you for your answer :)

You have right, Mosquitto is a very nice solution to drive a device by the Web. But my doubt is also about the speed of the communication.

In the HTTP Comms example from Matrix, the project use also other method to send and return data: URL variables to send a value and JSON to display the returned variable. I like this method because it's very easy to design a web page. But you must send a new URL with a variable to set a new value. In Web Design we use this method to transfer data between two pages, it's local and fast. I don't know if this method is the best way to send quickly many values of variable and drive a device. I will try it when I will add the ESP in the device.

In your project, do you use only Mosquitto ? Is it Fast ?


Our projects are like this schematic but in place of Web App, I ask me if we can have also a second Pc App with MQTT client.

appdev - example system 3.png
appdev - example system 3.png (159.95 KiB) Viewed 247 times


I also need simultaneous connections on different devices.

So, many questions before design the web controller App to choice the best way.

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Embedded device controlled from the Web without ESP

Post by chipfryer27 »

Hi

As I am sure you apreciate, the speed over the internet is not something we can control. If updates were in any way critical to you (and you decide what is) then some form of redundancy and qualification should be considered.

In another post I document sending a URL containing key-pairs to a server that you control, which can easily be on a RPi or PC (Windows / linux). I show updating 3rd parties such as ThingSpeak as well as how to host your own server and send / receive using GET and json. I then added a section on hosting mosquitto. I also included some FC charts as examples.

Examples given were just switching on/off an led depending on value (above x = on, below x = off) via a URL The server accepted updates from Flowcode powered client and timestamped as they were entered into a database. The database was polled as required by a Flowcode client and the latest value returned. GET or json, you decide :)

I like the database as you have a permanent record of things.

For MQTT I just sent On / Off as message to a specific Topic. FC client published, another FC client subscribed and acted.

As mentioned, I've not really played with app developer in a while so I would need to go remind myself about it, but I don't think your overall concept is troublesome especially as app developer has a template for MQTT client and therefore must be able to do what you need. It could also "poll" a server too.

This may be of help / interest viewtopic.php?t=2248&start=10

I'll try and have a further look at AD later this evening.

Regards

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: Embedded device controlled from the Web without ESP

Post by Nico595 »

This is great, Thank you so much.

Your message is very interesting.
My Linux WebServer with Mosquitto are already. In fact we host our website.

I opened the pdf file, great job.
MySQL and MQTT with FC is probably exactly the thing I need to create a list of connection and send to connected users.


I will read your topic and your great documentation tonight.
Thanks.

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Embedded device controlled from the Web without ESP

Post by chipfryer27 »

Hi

When I wrote it a few years ago I used to use FileMaker a lot, which to me is the Flowcode of databases. I still use it for numerous tasks but haven't updated in well over a decade. Once Apple took over it became too expensive for me.

When looking for a way to allow remote-sensors be centrally monitored I used a LAMP install. Sensor key-pair updated MySqyl. This was for a proof of concept. I didn't like it because I was well used to the simplicity of creating very user friendy (including front-end) databases in FileMaker. Looking for a way to marry PHP and FileMaker I found I needed to also buy FileMaker server...... Way, way too expensive for my limited needs. I therefore got a bit more into MySql and PHP (but in no way an expert).

Flowcode however allowed me to not care too much about the actual database. By accessing a PHP script I can have whatever info I wish returned and Flowcode can display this in numerous forms such as levels / gauges / numeric display etc. Now I can have my nice front end again :)

The document was written for (much) older versions of PHP and MySqyl, with a guide to some changes if using newer versions (current at time of writing). However when I included RAMP, as it uses the latest everything, the code there should work with not too much trouble in all the latest offerings, or at least point you in the direction.

If Mosquitto is on the same machine as your app developer, you should be able to use the MQTT component to obtain messages (127.0.0.1) or use a GET for MySql.

I'll try and look at AD later, but see no reason as to why it shouldn't be able to obtain external data to pass on.

Regards

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: Embedded device controlled from the Web without ESP

Post by Nico595 »

Hi,


I tried Serial COM Port example Web App the last night, but it don't work. I have error message "Serial not available" in the console. I added Text to see the result of the Request button but I obtain only "object Promise" message. As this component is only a Beta version I don't lost more time with this component.

Annotation 2025-04-29 101017.png
Annotation 2025-04-29 101017.png (59.15 KiB) Viewed 160 times




When I prepared the Web App project to drive our device, I firstly think to use AJAX. But I will try with the FC to drive the device from the local network in a second time. I think win many time with FC. The reason why I don't develop the Web local control in a first time is about the WiFi consummation.

About the web control, I think design a connection Web page with MySQL database. After that, connected user can select the target device in a list and control the device like this from a PC: Pc App -> Mosquitto -> Pc App -> USB -> Embedded device.

To use a tablet or a phone I must also design this solution: Web App -> Mosquitto -> Pc App -> USB -> Embedded device.


Thank you again for your great job, it help me good to understand how to design a MQTT broker.
Last edited by Nico595 on Tue Apr 29, 2025 9:39 am, edited 1 time in total.

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Embedded device controlled from the Web without ESP

Post by chipfryer27 »

Hi

"Serial not available" sounds a bit like an incorrect com port has been selected. Does it give you options?

Regards

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: Embedded device controlled from the Web without ESP

Post by Nico595 »

In fact I don't understand how select the number of the Port Com with this component. If I understand good, the "RequestPort" function select the port number per VID / PID.

I restricted the list to obtain connection only with my VID PID in the Filter properties. But with or without this parameter, I have also the same error. Embedded device is connected and linked on port com 14.

Annotation 2025-04-29 105627.png
Annotation 2025-04-29 105627.png (149.69 KiB) Viewed 150 times

Steve-Matrix
Matrix Staff
Posts: 1465
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 204 times
Been thanked: 347 times

Re: Embedded device controlled from the Web without ESP

Post by Steve-Matrix »

Have you tried other browsers? The Serial API is relatively new and some browsers might not fully support it. When I created that Web Developer Serial component, I did most of my testing on Chrome on a PC. I've not done much with Firefox.

Another issue is there are a few different ways for virtual COM ports to be 'known' by the OS. If the browser is not detecting your serial device, then it might be using a serial driver that is not fully compatible with the Serial API.

Post Reply