cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring Nucleo-F767ZI as a server to send commands (Ethernet & LwIP)

t888
Associate II

Hello community,

I have configured the Nucleo-F767ZI LwiP (no RTOS) and Ethernet through CubeMx. I have also setup the echo_server configuration on the board. I can successfully ping and send a receive back messages from the board (using python on another machine) with an assigned IP and port number.

Since I have configured the board to operate as a server, I want to send commands (such as strings if possible from the python end) and toggle LEDs on the board for example.

I am new to TCP/IP protocol and I would gladly appreciate any input and resource.

My project will utilize ethernet communication as a primary protocol. I will not use HTTP server.

Thank you,

Michael T.

5 REPLIES 5
AvaTar
Lead

You could use the TCP and the generic socket interface, and implement your own protocol. There are plenty of example source codes available, no need for MCU/STM32 specifics. Just remember that the "Lw" stands for light weight, i.e. LwIP does not implement the full IP stack.

Or, you can check out an existing protocol that seems appropriate for your use case. Modbus TCP or home automation protocols (https://en.wikipedia.org/wiki/List_of_automation_protocols) come to my mind.

Thanks for the response. So this means I won't be able to modify the server code to allow commands from by backend to instruct commands on the board?

My overall goal is to stream video through the Ethernet.

Thank you

Piranha
Chief II

F7 is powerful and some reasonable video streaming should be possible, but I can't comment on resolution and frame rate. I've integrated FreeRTOS and lwIP in my project by myself (not using CubeMX generated non-working bloatware). It uses zero-copy buffers and hardware checksum offload, and I can say that with TCP traffic at 95 Mbps (maximum possible) it makes 33% of CPU load on F7 at 216 MHz. Though I don't use D-cache at this stage, so maybe that number can be even lower. As F7 series has hardware JPEG codec, it should be possible to stream M-JPEG.

That's great to hear.

I figured out to break down the main packet buffer and assign commands depending on strings sent from a client.

However, I believe that I would need to establish 2-way operation, meaning, that for data transfer, the board would switch from being a server to a client, and the computer being the server.

How would I go by establishing two tcp connection lines: one for command line from a client, and one for data line.

Or should I create another question to the community since this one is resolved.

aviato
Associate

Hi is it possible if you can post your code and .ioc file? I am having trouble implementing the TCP server on my own board. Thanks so much!