TCP Socket Component for Flowcode, Embedded and PC-App

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
stefan.erni
Valued Contributor
Posts: 1272
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 239 times
Been thanked: 254 times

TCP Socket Component for Flowcode, Embedded and PC-App

Post by stefan.erni »

Hello everyone,

I would like to propose a new Flowcode component: TCP Sockets (Client and Server), Embedded and PC-App (Web-App?)

With the increasing use of Wi-Fi-enabled microcontrollers such as the ESP32, many projects require reliable communication between embedded devices and PCs over a local network.
At the moment, there does not appear to be a simple and user-friendly TCP socket component available in Flowcode.

Example Application
1 PC acting as a TCP server
20 ESP32 devices acting as TCP clients
Each ESP32 sends approximately 100 kB of measurement data once per hour
The PC collects, stores, and processes the data

TCP is an ideal solution for this type of application because it provides reliable, ordered data transmission without packet loss.

Suggested Features
TCP Client
Connect(IP Address, Port)
Disconnect()
SendData()
ReceiveData()
ConnectionStatus()
TCP Server
StartServer(Port)
StopServer()
AcceptClient()
SendData()
ReceiveData()
ClientCount()

For SendData and ReceiveData I would only specify those three.
2026-07-28_14-27-05.PNG
2026-07-28_14-27-05.PNG (8.66 KiB) Viewed 428 times
Sending and receiving via UART and Bluetooth in this way can be maintained.
2026-07-28_14-28-36.PNG
2026-07-28_14-28-36.PNG (21.08 KiB) Viewed 428 times
Benefits for Flowcode Users
Easy integration of ESP32 projects into existing networks
Communication with PCs, industrial PCs, Raspberry Pi systems and
Simplified development of IoT and Industry 4.0 applications
No need to create custom C code or external networking libraries
Support for multi-device data collection and monitoring systems

Additional Use Case
Communication Between Two Flowcode Applications
Another valuable use case would be communication between two Flowcode applications running on separate computers.

Example:
Flowcode Application A running on PC 1
Flowcode Application B running on PC 2
Communication over Ethernet, Wi-Fi, or a local network using TCP sockets

Possible applications include:

It could also be a great help for this post.
So Obvious.......
https://flowcode.co.uk/forums/viewtopic.php?t=3756

Data exchange between two Flowcode-based systems
Remote monitoring and control
Communication between operator and machine interfaces
Testing and simulation environments

chipfryer27
Valued Contributor
Posts: 2040
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 447 times
Been thanked: 674 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by chipfryer27 »

Hi Stefan

What's wrong with the Network Comms component? I use it to create a link to whatever / wherever is hosting my service etc and will be used in the "So Obvious" post. Well unless something better comes along :)

Regards

stefan.erni
Valued Contributor
Posts: 1272
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 239 times
Been thanked: 254 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by stefan.erni »

Hi Lian

Thanks for the information.
I assume you mean the MQTT client. Yes, it's practical and convenient for measurement data and is also very well documented.
You can install your own local broker or use one from the internet.

https://www.flowcode.co.uk/resources/da ... xample.pdf

The disadvantage is that you need a broker and that a data array is not transferred as efficiently.
"Limited data format support: JSON is available, but BSON is not supported."

With the TCP Sockets:

Should it be possible to handle small data arrays like data[30] as well as large ones like data[12000] of integers.
Very fast if both programs are on the same computer or on the same network.
No broker needed.
Of course, I have no idea how complicated that is. :)

chipfryer27
Valued Contributor
Posts: 2040
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 447 times
Been thanked: 674 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by chipfryer27 »

Hi Stefan

No, I meant creating a link using the Network Comms component.

Using it I can connect to my server / whatever and transfer.

Regards

stefan.erni
Valued Contributor
Posts: 1272
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 239 times
Been thanked: 254 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by stefan.erni »

Hi Lian

That's what I'd like to have.
I did not realize that I didn't necessarily have to link the Network Comms component.
I tried sending a string from one Flowcode program to another Flowcode program,
on the same computer, using the Network Comms, and it worked fine.

I'm going to try transferring a data array now.

stefan.erni
Valued Contributor
Posts: 1272
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 239 times
Been thanked: 254 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by stefan.erni »

Hi Lian, Hello everyone

I wrote a simple server and client program to send data from one Flowcode program to another Flowcode program .
It works with strings and byte arrays.
Maybe it will also work with an ESP32 over Wi-Fi.
2026-07-31_14-52-22.PNG
2026-07-31_14-52-22.PNG (50.61 KiB) Viewed 323 times
2026-07-31_14-52-37.PNG
2026-07-31_14-52-37.PNG (23.82 KiB) Viewed 323 times
Programs:
TCp_Server.fcpcd
(22.01 KiB) Downloaded 12 times
TCp_Client.fcpcd
(25.95 KiB) Downloaded 12 times
So strings and byte arrays work, and it would be handy to have type conversion for arrays just like for variable types.
Then it would also be very easy to send and receive integer arrays simply by using type conversion.
2026-07-31_14-58-04.PNG
2026-07-31_14-58-04.PNG (6.63 KiB) Viewed 323 times
2026-07-31_14-58-21.PNG
2026-07-31_14-58-21.PNG (6.72 KiB) Viewed 323 times

stefan.erni
Valued Contributor
Posts: 1272
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 239 times
Been thanked: 254 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by stefan.erni »

Hi Lian, Hello everyone

Sending with the ESP32-S3 worked right away.
I just used the macro and added the Wi-Fi

I don't think this easy way is available for the WEB App....

Later, I'll also test the Wi-Fi range
2026-08-03_10-49-25.PNG
2026-08-03_10-49-25.PNG (38.38 KiB) Viewed 16 times
2026-08-03_10-48-56.PNG
2026-08-03_10-48-56.PNG (145.24 KiB) Viewed 16 times
I used a SparkFun Thing Plus - ESP32-S3
2026-08-03_10-53-11.PNG
2026-08-03_10-53-11.PNG (601.79 KiB) Viewed 16 times
Sparkfun_esp-s3_thingspluss1_wifi.fcfx
(23.07 KiB) Downloaded 6 times

chipfryer27
Valued Contributor
Posts: 2040
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 447 times
Been thanked: 674 times

Re: TCP Socket Component for Flowcode, Embedded and PC-App

Post by chipfryer27 »

Hi

I think it was in the old forum, another member was using ESPs and I think, from memory, he needed to have around a 30m range which he managed.

I would be interested to hear how you get on.

Regards

Post Reply