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.
Sending and receiving via UART and Bluetooth in this way can be maintained.
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
TCP Socket Component for Flowcode, Embedded and PC-App
-
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
-
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
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
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
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.
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
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
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
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.
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
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. Programs: 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.
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. Programs: 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.
-
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
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
I used a SparkFun Thing Plus - ESP32-S3
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
I used a SparkFun Thing Plus - ESP32-S3
-
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
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
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