Topics

[TCP/MQTT] Connection issue

Guillaume Paquet
 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 

Guillaume Paquet
 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 

Guillaume Paquet
 

Hello Zephyr Community,

I found where something is wrong.
Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ? 

Thanks in advance for your help

Best Regards,

Guillaume

De : devel@... <devel@...> de la part de Guillaume Paquet via Lists.Zephyrproject.Org <guillaume.paquet=stimio.fr@...>
Envoyé : mercredi 11 décembre 2019 16:24
À : Guillaume Paquet <guillaume.paquet@...>; devel@... <devel@...>
Cc : devel@... <devel@...>
Objet : Re: [Zephyr-devel] [TCP/MQTT] Connection issue
 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 

Michael Scott
 

Hello Guillaume,


On 12/11/19 11:19 AM, Guillaume Paquet wrote:
Hello Zephyr Community,

I found where something is wrong.
Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ?

There could certainly be a bug in the socket offloading layer for UBLOX Sara R4 (I'm the maintainer for the current modem layer in Zephyr):
https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/modem/ublox-sara-r4.c


Can you open an issue here:

https://github.com/zephyrproject-rtos/zephyr/issues


Please include as much information as you can (from this email series):
- Zephyr version: 1.14.1

- Sample used: samples/net/mqtt_publisher

- Firmware version on SARA R4 modem

- etc


And add me as "Assignee"


Thanks!


- Mike



Thanks in advance for your help

Best Regards,

Guillaume

De : devel@... <devel@...> de la part de Guillaume Paquet via Lists.Zephyrproject.Org <guillaume.paquet=stimio.fr@...>
Envoyé : mercredi 11 décembre 2019 16:24
À : Guillaume Paquet <guillaume.paquet@...>; devel@... <devel@...>
Cc : devel@... <devel@...>
Objet : Re: [Zephyr-devel] [TCP/MQTT] Connection issue
 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 

-- 
Michael Scott
Embedded Software Engineer at Foundries.io
"microPlatforms™ for Connected Products"
E: mike@...
W: https://www.foundries.io

lairdjm
 

Hi,

We actually encountered the same issue, not with this driver but with a different modem based upon this driver, from what I remember (it has been a long time since I last investigated) it seemed as if each reconnect incremented the memory address of the buffers so something wasn’t getting cleaned up, I didn’t look into if this was the networking stack or the driver however. This was on Zephyr 1.14, it was also using MQTT but not that specific sample.

Thanks,

Jamie

 

> I found where something is wrong.

> Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
> For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ?

 

Guillaume Paquet
 

Hello Michael,

 

Thanks for your prompt reply.

I just open this new issue: https://github.com/zephyrproject-rtos/zephyr/issues/21328

However, I am not able to assign it to you.

 

Really thanks for your help on this case

 

Rgds,

 

Guillaume

 

De : Michael Scott <mike@...>
Envoyé : mercredi 11 décembre 2019 20:30
À : Guillaume Paquet <guillaume.paquet@...>; Guillaume Paquet via Lists.Zephyrproject.Org <guillaume.paquet=stimio.fr@...>; devel@...
Objet : Re: [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Guillaume,

 

On 12/11/19 11:19 AM, Guillaume Paquet wrote:

Hello Zephyr Community,

 

I found where something is wrong.

Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ?

 

There could certainly be a bug in the socket offloading layer for UBLOX Sara R4 (I'm the maintainer for the current modem layer in Zephyr):
https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/modem/ublox-sara-r4.c

 

Can you open an issue here:

https://github.com/zephyrproject-rtos/zephyr/issues

 

Please include as much information as you can (from this email series):
- Zephyr version: 1.14.1

- Sample used: samples/net/mqtt_publisher

- Firmware version on SARA R4 modem

- etc

 

And add me as "Assignee"

 

Thanks!

 

- Mike

 

 

Thanks in advance for your help

 

Best Regards,

 

Guillaume


De : devel@... <devel@...> de la part de Guillaume Paquet via Lists.Zephyrproject.Org <guillaume.paquet=stimio.fr@...>
Envoyé : mercredi 11 décembre 2019 16:24
À : Guillaume Paquet <guillaume.paquet@...>; devel@... <devel@...>
Cc : devel@... <devel@...>
Objet : Re: [Zephyr-devel] [TCP/MQTT] Connection issue

 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

·        MQTT (not secured)

·        TCP/IPv4

·        Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 

-- 
Michael Scott
Embedded Software Engineer at Foundries.io
"microPlatforms™ for Connected Products"
E: mike@...
W: https://www.foundries.io