TCP API Echo Example Does not Build for ESP8266

I had an issue about UDP Echo Server and Client. It is already solved because of module includes. However this time i am sure that i have included necessary modules. Board is esp8266-esp-12x. I thought that there might be a problem on TCP API porting for esp8266?

The code is offical example in TCP Api in https://riot-os.org/api/group__net__sock__tcp.html#ga0144778bc074e291fcb0d43bd35c0179

My makefile is given below name of your application APPLICATION = tcp-simple-server If no BOARD is found in the environment, use this default: BOARD ?= esp8266-esp-12x This has to be the absolute path to the RIOT base directory: RIOTBASE ?= $(CURDIR)/…/… BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-leonardo
arduino-mega2560 arduino-nano
arduino-uno blackpill bluepill calliope-mini
chronos hifive1 i-nucleo-lrwan1 mega-xplained
microbit msb-430 msb-430h
nucleo-f031k6 nucleo-f042k6 nucleo-f303k8
nucleo-l031k6 nucleo-f030r8 nucleo-f070rb
nucleo-f072rb nucleo-f103rb nucleo-f302r8
nucleo-f334r8 nucleo-l053r8 saml10-xpro
saml11-xpro spark-core stm32f0discovery
stm32l0538-disco telosb
waspmote-pro wsn430-v1_3b wsn430-v1_4 z1 Include packages that pull up and auto-init the link layer. NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif Activate ICMPv6 error messages USEMODULE += gnrc_icmpv6_error Specify the mandatory networking modules for IPv6 and UDP USEMODULE += gnrc_ipv6_router_default USEMODULE += gnrc_sock_check_reuse # gnrc_udp, gnrc_sock_udp , gnrc_ipv6 USEMODULE += gnrc_sock_tcp USEMODULE += gnrc_tcp USEMODULE += gnrc_ipv6_default USEMODULE += gnrc_ipv6 Add a routing protocol USEMODULE += gnrc_rpl USEMODULE += auto_init_gnrc_rpl This application dumps received packets to STDIO using the pktdump module USEMODULE += gnrc_pktdump Additional networking modules that can be dropped if not needed USEMODULE += gnrc_icmpv6_echo Add also the shell, some shell commands USEMODULE += shell USEMODULE += shell_commands USEMODULE += ps USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 USEMODULE += netstats_rpl … … ` And output of the fail build is given below ;

/home/riot/RIOT-master/examples/tcp-simple-server/server.c:6:12: error: array type has incomplete element type sock_tcp_t sock_queue[SOCK_QUEUE_LEN]; ^ /home/riot/RIOT-master/examples/tcp-simple-server/server.c: In function 'main': /home/riot/RIOT-master/examples/tcp-simple-server/server.c:15:22: error: storage size of 'queue' isn't known sock_tcp_queue_t queue; ^ /home/riot/RIOT-master/examples/tcp-simple-server/server.c:30:9: error: too few arguments to function 'sock_tcp_accept' if (sock_tcp_accept(&queue, &sock) < 0) { ^ In file included from /home/riot/RIOT-master/examples/tcp-simple-server/server.c:2:0: /home/riot/RIOT-master/sys/include/net/sock/tcp.h:474:5: note: declared here int sock_tcp_accept(sock_tcp_queue_t *queue, sock_tcp_t **sock, ^ /home/riot/RIOT-master/examples/tcp-simple-server/server.c:15:22: error: unused variable 'queue' [-Werror=unused-variable] sock_tcp_queue_t queue; ^ cc1: all warnings being treated as errors /home/riot/RIOT-master/Makefile.base:83: recipe for target '/home/riot/RIOT-master/examples/tcp-simple-server/bin/esp8266-esp-12x/application_tcp-simple-server/server.o' failed make[1]: *** [/home/riot/RIOT-master/examples/tcp-simple-server/bin/esp8266-esp-12x/application_tcp-simple-server/server.o] Error 1 /home/riot/RIOT-master/examples/tcp-simple-server/../../Makefile.include:478: recipe for target '/home/riot/RIOT-master/examples/tcp-simple-server/bin/esp8266-esp-12x/application_tcp-simple-server.a' failed make: *** [/home/riot/RIOT-master/examples/tcp-simple-server/bin/esp8266-esp-12x/application_tcp-simple-server.a] Error 2 make: Leaving directory '/home/riot/RIOT-master/examples/tcp-simple-server'

Thanks for your help

is there anyone to have an idea? Thanks.

Burak Karaduman <bburakkaraduman@gmail.com>, 18 Tem 2019 Per, 14:16 tarihinde şunu yazdı:

Hi,

Burak Karaduman <bburakkaraduman@gmail.com>, 18 Tem 2019 Per, 14:16 tarihinde şunu yazdı:

I had an issue about UDP Echo Server and Client. It is already solved because of module includes. However this time i am sure that i have included necessary modules. Board is esp8266-esp-12x. I thought that there might be a problem on TCP API porting for esp8266?

I am not sure about the state of the TCP API implementation on GNRC, but it looks like its not implemented yet. Maybe you should try lwip instead of GNRC which implements the API as far as i can see.

Can someone confirm this? I always worked soley with the UDP implementation.

Robin

Well the thing is there are offical example for tcp. If it is not implemented but an offical example is given on it, then a Warning must be written to example page. Otherwise, somebody will think that it is implemented , exampled and ready to run. I hope that it is implemented and another case causes error. Thanks for your reply.

19 Tem 2019 Cum 14:22 tarihinde Robin <robin@chilio.net> şunu yazdı:

This is an API documentation, not the documentation of an actual implementation. The API is (as an example) implemented in the lwip network stack.

Also the example only shows the usage of the API and explicitly states that you need to include an implementation "First you need toinclude <https://riot-os.org/api/creating-an-application.html#including-modules>a module that implements this API in your application's Makefile."

Maybe the hint "For example the implementation forGNRC <https://riot-os.org/api/group__net__gnrc.html>is called>gnrc_sock_tcp|." should be removed, since this implementation does not exists.

There is an actual TCP implementation for gnrc but no sock_tcp implementation (this API). You can use the tcp implementation directly without the socket abstraction if you want or switch to lwip and use the sock API.

An issue for the missing implementation of the sock API is here[1].

Robin

[1]https://github.com/RIOT-OS/RIOT/issues/10664

Thank you Robin i get the idea and order an esp32 to be work with lwip

19 Tem 2019 Cum 16:43 tarihinde Robin <robin@chilio.net> şunu yazdı: