[net] net samples not working?


Richard Peters <mail@...>
 

Hi Community,

i have several problems with the net examples.
Maybe there are some bugs involved?

1st Problem
===========

Sample: echo_server / echo_client

On 'make server' on server side and 'make client' on client side:

Some frames gets sent and received successfully and than my screen is
flood by these
messages on the client side:

[net/buf] [ERR] net_buf_alloc_debug: net_nbuf_get_reserve():329: Failed
to get free buffer


2nd Problem
===========

Sample: echo_server / echo_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on both sides:

does not build, because the Makefile contains this line:

CONF_FILE ?= prj_$(BOARD).conf

But there is no prj_qemu_cortex_m3.conf.

When i try it with

make BOARD=qemu_cortex_m3 CONF_FILE=prj_slip.conf [server/client]

or

make BOARD=qemu_cortex_m3 CONF_FILE=prj_qemu_x86.conf [server/client]

than the communication between client and server does not work.


3rd Problem
===========

Sample zoap_server, zoap_client

On 'make server' on server side and 'make client' on client side, i get
on the server side:

[zoap-server] [ERR] udp_receive: Invalid data received (-22)


4th Problem
===========

Sample zoap_server, zoap_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on client side, i get on the client side:

Unable add option to request.


5th Problem
===========

Sample: coaps_server, coaps_client

On 'make server' on server side and 'make client' on client side, i get
on the server side:

failed!
mbedtls_ssl_handshake returned -0x7900
Packet without payload
No handler for such request (-22)


6th Problem
===========

Sample: coaps_server, coaps_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on both sides

same as 2nd Problem.


Tested on:

- Ubuntu 16.04 (64 Bit)
- Zephyr rev: e2bbad9600d655287496e3434641576e39a6582b
- Toolchain: Zephyr-SDK 0.8.2


Jukka Rissanen
 

Hi Richard,

On Wed, 2017-02-08 at 11:52 +0100, Richard Peters wrote:
Hi Community,

i have several problems with the net examples.
Maybe there are some bugs involved?

1st Problem
===========

Sample: echo_server / echo_client

On 'make server' on server side and 'make client' on client side:

Some frames gets sent and received successfully and than my screen is
flood by these
messages on the client side:

[net/buf] [ERR] net_buf_alloc_debug: net_nbuf_get_reserve():329:
Failed
to get free buffer
You are running out of buffers, please increase the TX/RX/DATA buf
count.



2nd Problem
===========

Sample: echo_server / echo_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on both sides:

does not build, because the Makefile contains this line:

CONF_FILE ?= prj_$(BOARD).conf

But there is no prj_qemu_cortex_m3.conf.
Could you provide such a conf file and send a patch?


When i try it with

make BOARD=qemu_cortex_m3  CONF_FILE=prj_slip.conf [server/client]

or

make BOARD=qemu_cortex_m3  CONF_FILE=prj_qemu_x86.conf
[server/client]

than the communication between client and server does not work.
Conf file is probably wrong and has wrong settings.



3rd Problem
===========

Sample zoap_server, zoap_client

On 'make server' on server side and 'make client' on client side, i
get
on the server side:

[zoap-server] [ERR] udp_receive: Invalid data received (-22)


4th Problem
===========

Sample zoap_server, zoap_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on client side, i get on the client
side:

Unable add option to request.
No idea to zoap issues in 3rd and 4th.



5th Problem
===========

Sample: coaps_server, coaps_client

On 'make server' on server side and 'make client' on client side, i
get
on the server side:

failed!
mbedtls_ssl_handshake returned -0x7900
Packet without payload
No handler for such request (-22)


6th Problem
===========

Sample: coaps_server, coaps_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on both sides

same as 2nd Problem.
Ditto



Tested on:

- Ubuntu 16.04 (64 Bit)
- Zephyr rev: e2bbad9600d655287496e3434641576e39a6582b
- Toolchain: Zephyr-SDK 0.8.2

Cheers,
Jukka


Richard Peters <mail@...>
 

Sample: echo_server / echo_client

On 'make server' on server side and 'make client' on client side:

Some frames gets sent and received successfully and than my screen is
flood by these
messages on the client side:

[net/buf] [ERR] net_buf_alloc_debug: net_nbuf_get_reserve():329:
Failed
to get free buffer
You are running out of buffers, please increase the TX/RX/DATA buf
count.
Maybe should this be patched in the out-of-the-box samples?



2nd Problem
===========

Sample: echo_server / echo_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on both sides:

does not build, because the Makefile contains this line:

CONF_FILE ?= prj_$(BOARD).conf

But there is no prj_qemu_cortex_m3.conf.
Could you provide such a conf file and send a patch?
I hope so, have to fiddle around with this :)

What is the workflow for the other issues?
Should i create tickets in jira?

Regards,
Richard


Richard Peters <mail@...>
 

Hi,

the SLIP-TAP driver seems not to be working in qemu for cortex-m
targets,too.
I can not get any network traffic between, either between to
qemu_cortex_m3 targets nor to the PC.

Has anyone tried networking in qemu with qemu_cortex_m3 target?

I don't think that this is a configuration problem.
The SLIP-TAP driver was disabled in the cortex_m3 defconfig.
I enabled it, but no luck.

Would be great to get some help on this!

Regards,
Richard


Jukka Rissanen
 

On Wed, 2017-02-08 at 12:39 +0100, Richard Peters wrote:
Sample: echo_server / echo_client

On 'make server' on server side and 'make client' on client side:

Some frames gets sent and received successfully and than my
screen is
flood by these
messages on the client side:

[net/buf] [ERR] net_buf_alloc_debug: net_nbuf_get_reserve():329:
Failed
to get free buffer
You are running out of buffers, please increase the TX/RX/DATA buf
count.
Maybe should this be patched in the out-of-the-box samples?
Sure, can you provide patches?




2nd Problem
===========

Sample: echo_server / echo_client

On 'make BOARD=qemu_cortex_m3 server' on server side and 'make
BOARD=qemu_cortex_m3 client' on both sides:

does not build, because the Makefile contains this line:

CONF_FILE ?= prj_$(BOARD).conf

But there is no prj_qemu_cortex_m3.conf.
Could you provide such a conf file and send a patch?
I hope so, have to fiddle around with this :)

What is the workflow for the other issues?
Should i create tickets in jira?
Yes, creating a tickets in jira is a good idea in this case.


Regards,
Richard

Cheers,
Jukka


Paul Sokolovsky
 

Hello Richard,

Let me start with saying that I agree that Zephyr networking does have
issues. They say that any bug is shallow given enough eyes, and Zephyr
networking clearly lacks enough eyes. So, I was in about the same
situation as you 2 weeks ago - after working on other things and
holidays, I was back to networking, and trying to do something I faced
1st, 2nd, 3rd, 4th, etc. issue in row. Well, I took care to report
them, fix which I could, research the other, ping other folks who work
on networking, etc. I'm happy to report that after these 2 weeks, I see
visible improvements, thanks to both core team's and contributors'
work.

So, please join the party - we definitely need more eyes and hands.

Please see below.

On Wed, 8 Feb 2017 13:39:06 +0100
Richard Peters <mail@...> wrote:

Hi,

the SLIP-TAP driver seems not to be working in qemu for cortex-m
targets,too.
I can not get any network traffic between, either between to
qemu_cortex_m3 targets nor to the PC.

Has anyone tried networking in qemu with qemu_cortex_m3 target?
I did. It didn't work. Looking into that is on my to-do since July last
year. But I find that relatively complex (well, wide) task, and
there're more priority stuff anyway. So, to make qemu_cortex_m3 work,
you'd need to understand: a) basic facts about such networking, that
there should be 2 UARTs, one for console, another for networking; b)
exact details of how QEMU does UART emulation on "output" side (which
connects to POSIX object on a host); c) exact details of a MCU/board
qemu_cortex_m3 emulates, its UART setup, etc.; d) other magic
ingredients.

If you know these points well, I encourage you to look into it. If not,
you can use qemu_x86 for now and there're many more lower-hanging, and
oftentimes more important, tasks.


I don't think that this is a configuration problem.
The SLIP-TAP driver was disabled in the cortex_m3 defconfig.
I enabled it, but no luck.

Would be great to get some help on this!
Re: your other questions from the initial mail: I personally don't go
with testing beyond echo_server application so far. What's the point of
trying MQTT/ZOAP/OCF/whatever if basic TCP and pings don't work? Well,
both are working now, but I'd still recommend to start with playing
well withe echo_server. It should work well now for UDP/TCP * IPv4/IPv6
on QEMU. Just in case, walkthru is here:
https://wiki.zephyrproject.org/view/Networking-with-Qemu .

By all means, file the issues you see, but feel free to have a look
at what's already filed:

https://jira.zephyrproject.org/browse/ZEP-1673?jql=project%20%3D%20ZEP%20AND%20component%20%3D%20%22Networking%20%2F%20IP%20Stack%22%20AND%20status%20!%3D%20Closed

And somebody (well, many people!) need to triage, investigate, then
test solutions for already filed issues too ;-).


Regards,
Richard
--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Richard Peters <mail@...>
 

Hello Paul,

So, please join the party - we definitely need more eyes and hands.

the SLIP-TAP driver seems not to be working in qemu for cortex-m
targets,too.
I can not get any network traffic between, either between to
qemu_cortex_m3 targets nor to the PC.

Has anyone tried networking in qemu with qemu_cortex_m3 target?
have submitted a patch for this as my first contribution to an
open-source projekt :-)


최형준 <hj210.choi@...>
 

 

Hello Richard,

 

>the SLIP-TAP driver seems not to be working in qemu for cortex-m targets,too.

>I can not  get any network traffic between, either between to

>qemu_cortex_m3 targets nor to the PC.

 

>Has anyone tried networking in qemu with qemu_cortex_m3 target?

I did it and it works well even if it printed some error messages about “net_buf_get_reserve()”.

I used "echo_server" sample app. 

 

>I don't think that this is a configuration problem.

>The SLIP-TAP driver was disabled in the cortex_m3 defconfig.

>I enabled it, but no luck.

 

>Would be great to get some help on this!

 

I’ll share the conf file for qemu_cortex_m3 when I tested it.

Please make a file in your PC. (i.e.: zephyr/samples/net/echo_server/prj_qemu_cortex_m3.conf)

 

“prj_qemu_cortex_m3.conf” file has below configurations.

--------------------------------------------

CONFIG_NETWORKING=y

CONFIG_NET_IPV6=y

CONFIG_NET_IPV4=y

CONFIG_NET_UDP=y

CONFIG_NET_TCP=y

CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_NET_BUF_LOG=y

CONFIG_SYS_LOG_NET_BUF_LEVEL=2

CONFIG_NET_LOG=y

CONFIG_SYS_LOG_NET_LEVEL=2

CONFIG_NET_SLIP_TAP=y

CONFIG_SYS_LOG_SHOW_COLOR=y

CONFIG_INIT_STACKS=y

CONFIG_PRINTK=y

CONFIG_NET_STATISTICS=y

CONFIG_NET_NBUF_RX_COUNT=14

CONFIG_NET_NBUF_TX_COUNT=14

CONFIG_NET_NBUF_DATA_COUNT=30

CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3

CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=2

CONFIG_NET_MAX_CONTEXTS=10

 

CONFIG_NET_SHELL=y

 

CONFIG_NET_SAMPLES_IP_ADDRESSES=y

CONFIG_NET_SAMPLES_MY_IPV6_ADDR="2001:db8::1"

CONFIG_NET_SAMPLES_PEER_IPV6_ADDR="2001:db8::2"

CONFIG_NET_SAMPLES_MY_IPV4_ADDR="192.0.2.1"

CONFIG_NET_SAMPLES_PEER_IPV4_ADDR="192.0.2.2"

 

 

CONFIG_UART_PIPE_ON_DEV_NAME="UART_1"

-------------------------------------------- 

 

You can check your echo_server app's connection status by “net shell” after running it.

(e.g.: > select net and conn)

 

Here is my test scenario.

a.     Run echo_server app on qemu_cortex_m3. (e.g.: make BOARD=qemu_cortex_m3 V=1 DEBUG=1 run)

b.     Send echo message on Host(Linux) (e.g.: $ echo HELLO | nc -u 192.0.2.1 4242)

 

I hope it'll help you.

 

Best Regards,

Hyungjun.

 

 

 

 


최형준 <hj210.choi@...>
 

 

 

--------- Original Message ---------

Sender : 최형준 <hj210.choi@...> S5(책임)/책임/IoT Lab(S/W센터)/삼성전자

Date : 2017-02-09 09:54 (GMT+9)

Title : FW: Re: [Zephyr-devel] [net] net samples not working?

 

 

 

Hello Richard,

 

>the SLIP-TAP driver seems not to be working in qemu for cortex-m targets,too.

>I can not  get any network traffic between, either between to

>qemu_cortex_m3 targets nor to the PC.

 

>Has anyone tried networking in qemu with qemu_cortex_m3 target?

I did it and it works well even if it printed some error messages about “net_buf_get_reserve()”.

I used "echo_server" sample app. 

 

>I don't think that this is a configuration problem.

>The SLIP-TAP driver was disabled in the cortex_m3 defconfig.

>I enabled it, but no luck.

 

>Would be great to get some help on this!

 

I’ll share the conf file for qemu_cortex_m3 when I tested it.

Please make a file in your PC. (i.e.: zephyr/samples/net/echo_server/prj_qemu_cortex_m3.conf)

 

“prj_qemu_cortex_m3.conf” file has below configurations.

--------------------------------------------

CONFIG_NETWORKING=y

CONFIG_NET_IPV6=y

CONFIG_NET_IPV4=y

CONFIG_NET_UDP=y

CONFIG_NET_TCP=y

CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_NET_BUF_LOG=y

CONFIG_SYS_LOG_NET_BUF_LEVEL=2

CONFIG_NET_LOG=y

CONFIG_SYS_LOG_NET_LEVEL=2

CONFIG_NET_SLIP_TAP=y

CONFIG_SYS_LOG_SHOW_COLOR=y

CONFIG_INIT_STACKS=y

CONFIG_PRINTK=y

CONFIG_NET_STATISTICS=y

CONFIG_NET_NBUF_RX_COUNT=14

CONFIG_NET_NBUF_TX_COUNT=14

CONFIG_NET_NBUF_DATA_COUNT=30

CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3

CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=2

CONFIG_NET_MAX_CONTEXTS=10

 

CONFIG_NET_SHELL=y

 

CONFIG_NET_SAMPLES_IP_ADDRESSES=y

CONFIG_NET_SAMPLES_MY_IPV6_ADDR="2001:db8::1"

CONFIG_NET_SAMPLES_PEER_IPV6_ADDR="2001:db8::2"

CONFIG_NET_SAMPLES_MY_IPV4_ADDR="192.0.2.1"

CONFIG_NET_SAMPLES_PEER_IPV4_ADDR="192.0.2.2"

 

 

CONFIG_UART_PIPE_ON_DEV_NAME="UART_1"

-------------------------------------------- 

I think this problem is happened because of "CONFIG_UART_PIPE_ON_DEV_NAME".

You can check your echo_server app's connection status by “net shell” after running it.

(e.g.: > select net and conn)

 

Here is my test scenario.

a.     Run echo_server app on qemu_cortex_m3. (e.g.: make BOARD=qemu_cortex_m3 V=1 DEBUG=1 run)

b.     Send echo message on Host(Linux) (e.g.: $ echo HELLO | nc -u 192.0.2.1 4242)

 

I hope it'll help you.

 

Best Regards,

Hyungjun.