Showing posts with label MQTT Broker. Show all posts
Showing posts with label MQTT Broker. Show all posts

Wednesday, November 9, 2016

ESP32 increase the maximum number of sockets

Still didn't found an ESP32 with a decent delivery price so today I've tested the environment provided by EspressIf looking on the maximum number of sockets. On ESP8266 I've managed to have more then 20 sockets opened and carrying MQTT packets ( see https://myesp8266.blogspot.co.uk/2016/11/mqtt-broker-on-esp8266-5.html)

I've noticed that the maximum number of sockets that you can setup from make menuconfig is 16. 

All the values that you are setting from make menuconfig are ending in a file named sdkconfig in the root of you app directory. This sdkconfig file will be converted to sdkconfig.h located in app/build/include/sdkconfig.h.

Even you are modifying a value direct in the sdkconfig on the compile time you will be invited to enter a value 1..16 for maximum number of sockets.

Solution #1. (Safest one)

Change the sdkconfig.h file overwrite the desired value and recompile

#define CONFIG_LWIP_MAX_SOCKETS 20

Solution #2. (not recommended but possible )

Modify directly the file:

esp-idf/components/lwip/include/lwip/port/lwipopts.h
#define MEMP_NUM_NETCONN          20 //CONFIG_LWIP_MAX_SOCKETS


If you modified values in make menuconfig and you don't know what was before don't worry just do a diff between the app/sdkconfig and app/sdkconfig.old file.





Saturday, September 3, 2016

MQTT Broker on ESP32 #2

MQTT Broker on ESP32

I've managed to put an MQTT broker on ESP32 (aka ESP31B).

The code is under development and ESP32 at this time is not yet released, but when it will be I'll also have the code complete. There are some problems but let's hope they will be resolved by the Espressif System. 

I will try to see if I can do the same with ESP8266 which is already on the market. 



Don't forget that the same broker is running on its little brother ESP8266. Check it here.

Monday, May 23, 2016

MQTT Broker on ESP32

Code from ESP8266 has been ported to ESP32 module, except the WI-Fi configure that was using  functions not present into the FreeRTOS SDK.

Everything is working great, having more heap is a big relief. In the next SDK EspressIf must tune a little bit the window sizes and some buffers in FreeRTOS so will achieve same performance like the ESP8266 FreeRTOS SDK.