Re: [lwip-users] Errors during build of lwip in Windows

2023-04-17 Thread Giuseppe Modugno
Il 17/04/2023 12:41, Simon Goldschmidt ha scritto: Am 17. April 2023 08:38:56 MESZ schrieb Giuseppe Modugno : Il 15/04/2023 01:58, Giuseppe Modugno ha scritto: [...] I don't know exactly why, but the problem disappeared in my build system after postponing lwipallapps

Re: [lwip-users] Errors during build of lwip in Windows

2023-04-17 Thread Giuseppe Modugno
Il 15/04/2023 01:58, Giuseppe Modugno ha scritto: [...] Now I enabled LWIP_MQTT_APP and I receive the following errors during build: [ 99%] Linking C executable example_app.exe liblwipcontribexamples.a(mqtt_example.obj): In function `mqtt_connection_cb': C:/temp/lwip/contrib/examples/mqtt

[lwip-users] Errors during build of lwip in Windows

2023-04-14 Thread Giuseppe Modugno
I cloned lwip and mbedtls repositories in the same folder on a Windows system. I also put WpdPack in the same folder. I have a mingw compiler that I'd like to use instead of Visual Studio. It works well with the following command: c:\tools\cmake\bin\cmake.exe -G "MinGW Makefiles" ..

[lwip-users] lwip win32 port: pcapif_poll() doesn't return

2023-04-14 Thread Giuseppe Modugno
I was testing an http client that downloads a file from a server, with NO_SYS=1 and raw api. It seems works well, but I noticed pcapif_poll() doesn't return during all the download process that takes several seconds. Indeed pcapif_poll() contains a loop: void pcapif_poll(struct netif *netif)

Re: [lwip-users] mbedtls

2023-04-14 Thread Giuseppe Modugno
Il 14/04/2023 20:19, Simon Goldschmidt ha scritto: On 13.04.2023 13:23, Giuseppe Modugno wrote: What is the latest mbedtls version that is compatible with lwip, specifically the layer altcp_tls_mbedtls.c? Sorry, the current source did not track the version which it is compatible

[lwip-users] mbedtls integration

2023-04-14 Thread Giuseppe Modugno
In the past I enabled ALTCP layer to add TLS and I used altcp_tls_mbedtls examples present in lwip repo. I thought it was the way to add TLS to lwip. Recently I looked at some example projects of NXP, such as this[1]. This is an example of a TLS httpd server. TLS is added by mbedtls, but ALTCP

[lwip-users] mbedtls

2023-04-13 Thread Giuseppe Modugno
What is the latest mbedtls version that is compatible with lwip, specifically the layer altcp_tls_mbedtls.c? For sure, current development source code of lwip is not compatible with latest mbedtls version. Indeed, you can see in altcp_tls_mbedtls.c the following includes: |#include

Re: [lwip-users] [OT] Sync local time to NTP

2023-01-05 Thread Giuseppe Modugno
Il 04/01/2023 21:46, goldsi...@gmx.de ha scritto: Am 30.12.2022 um 17:10 schrieb Giuseppe Modugno: The typical scenario of lwip is an embedded platform. When a wall clock is needed and the device is network connected, NTP is usually used to retrieve automatically the correct time at startup

[lwip-users] [OT] Sync local time to NTP

2022-12-30 Thread Giuseppe Modugno
The typical scenario of lwip is an embedded platform. When a wall clock is needed and the device is network connected, NTP is usually used to retrieve automatically the correct time at startup and stay in sync with an accurate reference (in other cases, the user can set a time as he wants).

Re: [lwip-users] Test offloading checksum for receive path

2022-10-14 Thread Giuseppe Modugno
Il 13/10/2022 20:02, Simon Goldschmidt ha scritto: On 13.10.2022 12:59, Giuseppe Modugno wrote: LPC546xx MCUs have the capability to offload checksum for IP, TCP, UDP and ICMP, for outgoing and ingoing packets. I enabled the generation of checksum for IPv4 for outgoing packets and it seems

[lwip-users] Test offloading checksum for receive path

2022-10-13 Thread Giuseppe Modugno
LPC546xx MCUs have the capability to offload checksum for IP, TCP, UDP and ICMP, for outgoing and ingoing packets. I enabled the generation of checksum for IPv4 for outgoing packets and it seems working well. Now I want to enable and test checksum offload for incoming IPv4 datagrams, but I'm

Re: [lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-13 Thread Giuseppe Modugno
Il 12/10/2022 21:11, goldsi...@gmx.de ha scritto: Am 11.10.2022 um 17:11 schrieb Giuseppe Modugno: Another thing I can't understand is why the code around LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is needed if:   * NO_SYS=1   * MEM_USE_POOLS=0   * MEM_LIBC_MALLOC=0   * SYS_LIGHTWEIGHT_PROT=1

Re: [lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-11 Thread Giuseppe Modugno
fragmented heap) and having interrupts disabled for so long time is not good? So the interrupts are enabled and disabled for each loop to give them opportunity to run? Il 11/10/2022 11:10, Giuseppe Modugno ha scritto: Thanks Simon. I want to summarize here all the possibilities with NO_SYS

Re: [lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-11 Thread Giuseppe Modugno
:25, Simon Goldschmidt ha scritto: Am 10. Oktober 2022 18:32:15 MESZ schrieb Giuseppe Modugno : I'm sorry to post again. I just understood LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEX is used in mem.c for MEM_USE_POOLS=0 and MEM_LIBC_MALLOC=0 (default lwip heap management from a statically allocated buff

Re: [lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-10 Thread Giuseppe Modugno
and pbuf_free is called in ISR, with or without LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT? It seems memory pools free is safe to be used from ISR, because I don't see any protection for them (differently of lwip default dynamic allocator). Il 10/10/2022 18:22, Giuseppe Modugno ha scritto: I'm sorry, I'm

Re: [lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-10 Thread Giuseppe Modugno
I'm sorry, I'm using MEM_USE_POOLS=0 *and* MEM_LIBC_MALLOC=1 *and* mem_clib_free/mem_clib_malloc redefined to a  custom buffer-based memory allocator (derived from mbedtls[1]. Il 10/10/2022 18:15, Giuseppe Modugno ha scritto: After studying a little more, I understood the problem of using

Re: [lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-10 Thread Giuseppe Modugno
/library/memory_buffer_alloc.c Il 04/10/2022 16:46, Giuseppe Modugno ha scritto: I started from an example of NXP SDK for LPC546xx MCUs. I'm using baremetal (NO_SYS=1) and I found the following warning in enet_ethernetif_lpc.c, function ethernetif_tx_release(): --- #if NO_SYS #if defined

[lwip-users] LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

2022-10-04 Thread Giuseppe Modugno
I started from an example of NXP SDK for LPC546xx MCUs. I'm using baremetal (NO_SYS=1) and I found the following warning in enet_ethernetif_lpc.c, function ethernetif_tx_release(): --- #if NO_SYS #if defined(LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT) && LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT    

[lwip-users] PPPoSerial and 4G modem

2022-02-25 Thread Giuseppe Modugno
I'm trying to make a data connection with a 4G modem from SIMCOM (A7672E). After AT+CGDATA=... and ATD*99#, the modem replies with CONNECT and enters in online data state. Now I'm ready to launch lwip app configured to use PPPoSerial and sntp_example (just to understand if the full stack is

Re: [lwip-users] LPC1788 Ethernet Based Socket Communication Randomly Stops Working After Few Hours

2022-01-04 Thread Giuseppe Modugno
I'm using LPC1788 for a product that is in full production for a couple of years without many problems. Unfortunately I'm using now RTOS and raw API, so I don't think I can help you. Most probably, other users will reply with suggestions on how to track and identify your issue. Il

Re: [lwip-users] lwip with 4G modem

2021-10-13 Thread Giuseppe Modugno
Il 12/10/2021 19:17, Sylvain Rochet ha scritto: Hi Giuseppe, On Tue, Oct 12, 2021 at 09:26:00AM +0200, Giuseppe Modugno wrote: I have an embedded project where lwip is used in a microcontroller (Cortex-M3 by LPC). The network interface is a standard Ethernet. The MCU features a MMI interface

Re: [lwip-users] lwip with 4G modem

2021-10-12 Thread Giuseppe Modugno
Il 12/10/2021 11:29, Gisle Vanem ha scritto: Giuseppe Modugno wrote: The serial channel for ppp/data and AT commands is single, so how can I multiplex them? Should I use CMUX? The PPP protocol handles this multiplexing itself. Using an escape octet "stuffing procedure" (octet 0

[lwip-users] lwip with 4G modem

2021-10-12 Thread Giuseppe Modugno
I have an embedded project where lwip is used in a microcontroller (Cortex-M3 by LPC). The network interface is a standard Ethernet. The MCU features a MMI interface with an external Ethernet PHY. It works well, I'm able to open a MQTTs connection with a broker, enable NTP request, download

[lwip-users] lwip and ATWINC1500

2020-02-06 Thread Giuseppe Modugno
ATWINC1500 is a WiFi module that could work in Ethernet/Bypass mode. It's very interesting, because I already developed a network board with Ethernet connectivity and now I need to develop a similar network board with WiFi connectivity. I would like to reuse as much software as I can, mostly

[lwip-users] DHCP and Ethernet disconnection

2019-12-10 Thread Giuseppe Modugno
I designed a network adapter board with Ethernet interface and lwip TCP/IP stack, with DHCP client enabled. It works well. What happens if I disconnect the Ethernet cable from one network and connect it to a second network where is a different DHCP server? Mainly if the first network works on

[lwip-users] How to override altcp_tls_mbedtls_mem.c

2019-06-11 Thread Giuseppe Modugno
As is written in altcp_tls_mbedtls_mem.c, I want to override this module with my own implementation. However I don't find an option to exclude lwip implementation from the build. Actually I changed the source code of altcp_tls_mbedtls_mem.c, but I'd prefer to leave lwip code identical to the

Re: [lwip-users] MQTT using lwip/pppos secure communication

2019-06-10 Thread Giuseppe Modugno
Hello Thomas, I actually involved in a project similar to yours: NXP MCU (LPC1768) that connects to AWS IoT Core through MQTT over TLS. It is complex, in my case because of limited RAM (only internal 32k+32kB). I hope you have more space. Anyway I was able to connect to AWS including lwip

[lwip-users] MQTT: is the incoming message always complete?

2019-06-04 Thread Giuseppe Modugno
I'm using lwip MQTT client implementation to publish messages and subscribe to topics. I receive messages on subscribed topics with success. Now I'm implementing a parser of incoming messages (maybe I'll use ASN.1 uPER encoded). However I'm not sure if I will receive always the complete message

[lwip-users] How to manage non null-terminated strings

2019-05-30 Thread Giuseppe Modugno
Many times in the application payloads you have a message with non null-terminated string, where the length of the string is in another variable (derived from the length of the packet). I think of MQTT messages that have strings. The callback parameters are the pointer to the first char of

[lwip-users] Multiple instance of lwip on Windows

2019-05-16 Thread Giuseppe Modugno
I have a project that uses lwip/pcapif on Windows and it works well. I wanted to run two instances of the same program with different mac address, ip address and so on. I started patching pcapif_low_level_init() to retrieve the mac address from an externa function (the original code used a

[lwip-users] MQTTs: connect after disconnect

2019-04-02 Thread Giuseppe Modugno
First MQTTs connection works fine. However I noticed that the second connection attempt after a disconnection doesn't work. For example, if I unplug Ethernet cable, MQTT client detects connection failure (because of lacks of PINGRESP from server) and disconnect. The MQTT connection callback

Re: [lwip-users] NXP LPC 17xx lwip port: use of pbuf for rx

2019-04-01 Thread Giuseppe Modugno
Il 29/03/2019 15:53, Sergio R. Caprile ha scritto: The recommendations are to use separate pools for rx and tx so they can not starve each other. Since PBUF_RAM is used for tx, then rx is expected to use PBUF_POOL. I bet you can also use separate pools but I don't know how. Last time I checked,

[lwip-users] NXP LPC 17xx lwip port: use of pbuf for rx

2019-03-29 Thread Giuseppe Modugno
I'm using LPC1769 MCU. I'm using source code from NXP SDK that works. I need to free some RAM to use mbedTLS libraries, so I was studying the code better. I found that NXP Ethernet driver preallocates a number of pbufs for RX DMA descriptors. The code uses:     p = pbuf_alloc(PBUF_RAW,

Re: [lwip-users] altcp_tls_mbedtls

2019-02-26 Thread Giuseppe Modugno
Il 26/02/2019 09:58, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: An: lwip-users@nongnu.org Betreff: Re: [lwip-users] altcp_tls_mbedtls Il 25/02/2019 20:19, goldsi...@gmx.de ha scritto: Am 22.02.2019 um 10:24 schrieb Giuseppe Modugno: Il 22/02/2019 09:43, Simon Goldschmidt ha

Re: [lwip-users] altcp_tls_mbedtls

2019-02-26 Thread Giuseppe Modugno
Il 25/02/2019 20:19, goldsi...@gmx.de ha scritto: Am 22.02.2019 um 10:24 schrieb Giuseppe Modugno: Il 22/02/2019 09:43, Simon Goldschmidt ha scritto: [snip] Is this warning correct? I think TCP_WND should be compared with MBEDTLS_SSL_IN_CONTENT_LEN or MBEDTLS_SSL_OUT_CONTENT_LEN

Re: [lwip-users] Again confused about tcp_recved() and pbuf_free()

2019-02-26 Thread Giuseppe Modugno
Il 25/02/2019 20:23, goldsi...@gmx.de ha scritto: Am 23.02.2019 um 10:20 schrieb Giuseppe Modugno: I know, this is a hot topic and many times this was explaied in the list and in doc/rawapi.txt, however now I'm in trouble understanding this. tcp_recved() is related to the TCP window size

[lwip-users] Again confused about tcp_recved() and pbuf_free()

2019-02-23 Thread Giuseppe Modugno
I know, this is a hot topic and many times this was explaied in the list and in doc/rawapi.txt, however now I'm in trouble understanding this. tcp_recved() is related to the TCP window size of the receiver: "The purpose is to advertise a larger window when the data has been processed.". Isn't the

Re: [lwip-users] altcp_tls_mbedtls

2019-02-22 Thread Giuseppe Modugno
Il 22/02/2019 09:54, Andy Pont ha scritto: Giuseppe wrote... I'm trying to integrate lwip and mbedTLS on a project running on LPC1769 MCU from NXP. This MCU features 64kB SRAM in two separate banks of 32kB. I don’t have any particular experience of the lwIP + mbedTLS combination that you are

Re: [lwip-users] altcp_tls_mbedtls

2019-02-22 Thread Giuseppe Modugno
Il 22/02/2019 09:43, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: I'm trying to integrate lwip and mbedTLS on a project running on LPC1769 MCU from NXP. This MCU features 64kB SRAM in two separate banks of 32kB. If it works at all, it will certainly get *very* hard. Aside from

[lwip-users] altcp_tls_mbedtls

2019-02-22 Thread Giuseppe Modugno
I'm trying to integrate lwip and mbedTLS on a project running on LPC1769 MCU from NXP. This MCU features 64kB SRAM in two separate banks of 32kB. As you can understand, I'm fighting putting all together with so small SRAM. I'm not sure mbedTLS+lwip could really work in 64kB. I'm interested in

[lwip-users] lwip version for mbedTLS integration

2019-02-19 Thread Giuseppe Modugno
I'm going to add mbedTLS to my lwip project. I noticed many recent commits with changes regaring mbedTLS integration. Do you suggest to use lwip STABLE_2_1_2_RELEASE commit, last commit in STABLE_2_1_x branch, or last commit in master branch? ___

[lwip-users] http_client.c: add custom header at run-time

2019-02-19 Thread Giuseppe Modugno
I'm trying to implement a dynamic DNS client with lwip. The update protocol[1] is very simple: it's HTTP based, so I thought to use http_client.c that comes with lwip project. Unfortunately this protocol needs the header "Authorization" in the request. It seems http_client.c doesn't support

Re: [lwip-users] Custom placement of memory pool

2018-11-09 Thread Giuseppe Modugno
Il 09/11/2018 04:05, uaz ha scritto: Hi all, I'm currently running lwip v2.0.3 on LPC4357 platform. I have some issue with pbuf mem_alloc(), which I believe is fragmentation issue because after several packet transfers, I'm unable to allocate pbuf anymore. I don't know if it is the same

[lwip-users] [OT]Sending push notifications from lwip electronic device to mobile devices

2018-11-08 Thread Giuseppe Modugno
It isn't strictly related to lwip. I'm sorry for that, but I couldn't find useful info out there. I have an embedded device running lwip and an Ethernet interface. The device is connected to Internet. I need to send push notifications to a group of mobile devices associated with that embedded

Re: [lwip-users] Decode HTTP URI

2018-05-24 Thread Giuseppe Modugno
Il 22/05/2018 22:12, goldsi...@gmx.de ha scritto: On 22.05.2018 11:11, Giuseppe Modugno wrote: I'm not sure. Is there a decoding function for URI? I mean, a function that converts %20 and similar escape codes in the corresponding ASCII char. Our httpd does not (yet?) support this. If you

[lwip-users] Decode HTTP URI

2018-05-22 Thread Giuseppe Modugno
I'm not sure. Is there a decoding function for URI? I mean, a function that converts %20 and similar escape codes in the corresponding ASCII char. ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Download a file for firmware upgrade

2018-05-21 Thread Giuseppe Modugno
Il 21/05/2018 14:26, Sergio R. Caprile ha scritto: You can do whatever you want. The question is probably not what can you do but what do you have available to obtain what you need with lesser effort. There are FTP clients around, I've collaborated in one of them using the RAW API, search the

[lwip-users] Download a file for firmware upgrade

2018-05-21 Thread Giuseppe Modugno
I have a device running lwip stack and httpd server. The device has an external 2MB SPI Flash memory. The CPU is a microcontroller with 512kB internal Flash. I'd like to upgrade the firmware (the internal Flash memory) by download the new binary from Internet. The user can check the presence

Re: [lwip-users] Tunnel solution for HTTP server expose to Internet

2018-04-09 Thread Giuseppe Modugno
Il 09/04/2018 15:00, Sergio R. Caprile ha scritto: My personal opinion follows: Do you absolutely need HTTP ? As long as we don't have IPv6 (and fixed addresses), we have to go DDNS and port forwarding. Yes, this requires an end user holding a PhD or at least the techie ones. So... the whole

[lwip-users] Tunnel solution for HTTP server expose to Internet

2018-04-06 Thread Giuseppe Modugno
My embedded device, running lwip httpd server, is under a router with a dynamic public IP address and a local private network 192.168.1.x. I know how to configure DDNS and NAT on the router to reach the server from outside, but these are tedious and tricky steps for most users. So I'm

Re: [lwip-users] MEM_SIZE

2018-03-15 Thread Giuseppe Modugno
Il 15/03/2018 11:28, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: [..] I think with the following options: #define MEM_LIBC_MALLOC  0 #define MEM_USE_POOLS  1 #define MEM_USE_CUSTOM_POOLS 1  /* Needed by MEM_USE_POOLS */ It's MEMP_USE_CUSTOM_POOLS, not MEM_USE_CUSTOM_POOLS

Re: [lwip-users] Problems when setting MEMP_MEM_MALLOC

2018-03-15 Thread Giuseppe Modugno
Il 14/03/2018 21:24, Nathan Hartman ha scritto: On Mar 14, 2018, at 3:24 PM, "goldsi...@gmx.de" <goldsi...@gmx.de> wrote: On 14.03.2018 17:09, Giuseppe Modugno wrote: #define MEM_LIBC_MALLOC 1 If I try to set MEMP_MEM_MALLOC, I have some strange problems. I suspect thr

Re: [lwip-users] Problems when setting MEMP_MEM_MALLOC

2018-03-15 Thread Giuseppe Modugno
Il 14/03/2018 20:24, goldsi...@gmx.de ha scritto: On 14.03.2018 17:09, Giuseppe Modugno wrote: #define MEM_LIBC_MALLOC   1 If I try to set MEMP_MEM_MALLOC, I have some strange problems. I suspect threading issues. I checked on win32 and it seems to work fine. In the end, there's not really

Re: [lwip-users] MEM_SIZE

2018-03-15 Thread Giuseppe Modugno
Il 14/03/2018 16:42, Giuseppe Modugno ha scritto: I was experimenting with lwip memory allocator. I defined: #define MEM_LIBC_MALLOC  0 #define MEM_USE_POOLS  0 #define MEM_SIZE  (32 * 1024) #define LWIP_RAM_HEAP_POINTER  ( (void *)0x2007C000 ) I'm using LPC1768 that has a 32kB SRAM block

Re: [lwip-users] MEM_SIZE

2018-03-15 Thread Giuseppe Modugno
Il 14/03/2018 20:26, goldsi...@gmx.de ha scritto: On 14.03.2018 16:42, Giuseppe Modugno wrote: I was experimenting with lwip memory allocator. I defined: #define MEM_LIBC_MALLOC  0 #define MEM_USE_POOLS  0 #define MEM_SIZE  (32 * 1024) #define LWIP_RAM_HEAP_POINTER  ( (void *)0x2007C000

[lwip-users] Problems when setting MEMP_MEM_MALLOC

2018-03-14 Thread Giuseppe Modugno
#define MEM_LIBC_MALLOC   1 If I try to set MEMP_MEM_MALLOC, I have some strange problems. After many HTTP GET requests, the HTTP server stops answering. It seems the Ethernet MAC driver (from NXP, I'm using LPC1768) isn't able to receive Ethernet frames and ethernet_input() isn't called

[lwip-users] MEM_SIZE

2018-03-14 Thread Giuseppe Modugno
I was experimenting with lwip memory allocator. I defined: #define MEM_LIBC_MALLOC  0 #define MEM_USE_POOLS  0 #define MEM_SIZE  (32 * 1024) #define LWIP_RAM_HEAP_POINTER  ( (void *)0x2007C000 ) I'm using LPC1768 that has a 32kB SRAM block starting from address 0x2007C000. However I have a

[lwip-users] Set IP address as none

2018-03-13 Thread Giuseppe Modugno
I have ip4_addr_t and I want to set it to a "null"/invalid value. Is it better to use IPADDR_NONE or IPADDR_ANY? At first, I thought IPADDR_NONE was the best choice, but I found that dns.c uses IPADDR_ANY to flag a DNS server as invalid. Moreover, there are ip4_addr_isany() and

Re: [lwip-users] Dealloc in fs_close_custom()?

2018-02-28 Thread Giuseppe Modugno
Il 27/02/2018 08:54, Giuseppe Modugno ha scritto: Il 27/02/2018 06:36, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: And another thing I couldn't explain. The example uses pextension pointer for malloc/free. However it sets file->data = file->pextension immediately.   So why don

Re: [lwip-users] MEMP_MEM_MALLOC

2018-02-27 Thread Giuseppe Modugno
Il 27/02/2018 13:08, Giuseppe Modugno ha scritto: I'm thinking if it's better to set MEMP_MEM_MALLOC or not in my application. I'm working with MEMP_MEM_MALLOC=1 (I started from an example) and it works. However I'm not sure it's the best choice for me. So what are the arguments

[lwip-users] MEMP_MEM_MALLOC

2018-02-27 Thread Giuseppe Modugno
I'm thinking if it's better to set MEMP_MEM_MALLOC or not in my application. I'm working with MEMP_MEM_MALLOC=1 (I started from an example) and it works. However I'm not sure it's the best choice for me. So what are the arguments for and against MEMP_MEM_MALLOC? This is what I have

Re: [lwip-users] Dealloc in fs_close_custom()?

2018-02-27 Thread Giuseppe Modugno
Il 27/02/2018 06:39, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: #ifndef HTTP_IS_DATA_VOLATILE #if LWIP_HTTPD_SSI /* Copy for SSI files, no copy for non-SSI files */ #define HTTP_IS_DATA_VOLATILE(hs)   ((hs)->ssi ? TCP_WRITE_FLAG_COPY : 0) #else /* LWIP_HTTPD_SSI */ /** Default: do

Re: [lwip-users] Dealloc in fs_close_custom()?

2018-02-26 Thread Giuseppe Modugno
Il 27/02/2018 06:36, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: And another thing I couldn't explain. The example uses pextension pointer for malloc/free. However it sets file->data = file->pextension immediately. So why don't use just file->data? It seems pextension

Re: [lwip-users] Dealloc in fs_close_custom()?

2018-02-26 Thread Giuseppe Modugno
2018-02-26 16:51 GMT+01:00 Giuseppe Modugno < giuseppe.modugno.lo...@gmail.com>: > I read the examples in lwip-contrib, mainly genfiles_example.c. And another thing I couldn't explain. The example uses pextension pointer for malloc/free. However it sets file->data = file->pextens

Re: [lwip-users] Dealloc in fs_close_custom()?

2018-02-26 Thread Giuseppe Modugno
2018-02-26 19:45 GMT+01:00 goldsi...@gmx.de <goldsi...@gmx.de>: > On 26.02.2018 16:51, Giuseppe Modugno wrote: > >> I read the examples in lwip-contrib, mainly genfiles_example.c. The >> dynamic memory allocated for the file content is freed in >> fs_close_custom().

[lwip-users] Dealloc in fs_close_custom()?

2018-02-26 Thread Giuseppe Modugno
I read the examples in lwip-contrib, mainly genfiles_example.c. The dynamic memory allocated for the file content is freed in fs_close_custom(). However I couldn't explain why. Indeed, mostly if the content is small, it is completely sent in

Re: [lwip-users] makefsdata producing compressed files

2018-02-26 Thread Giuseppe Modugno
Il 26/02/2018 12:57, Simon Goldschmidt ha scritto: Giuseppe Modugno wrote: I compiled makefsdata.c with miniz.c and enabled compression, that is only deflate. It seems it works well here with my files (I tested with Chrome). However I have a doubt. Is deflate the right compression scheme

[lwip-users] makefsdata producing compressed files

2018-02-26 Thread Giuseppe Modugno
I compiled makefsdata.c with miniz.c and enabled compression, that is only deflate. It seems it works well here with my files (I tested with Chrome). However I have a doubt. Is deflate the right compression scheme to use? I read something confusing about deflate, something related to early

[lwip-users] UPnP support

2018-02-22 Thread Giuseppe Modugno
Does lwip supports UPnP protocol? I need to open port forwarding on the Internet Gateway Device in the LAN where lwip is connected. I tried to search for this, but I found only old and confusing info. If lwip doesn't support UPnP, does someone implemented it in its application code? I'm

[lwip-users] [OT] Minimize .html, .js and .css files

2018-02-20 Thread Giuseppe Modugno
Another OT. In order to reduce Flash space for the filesystem used by httpd, I'm thinking to reduce the size of .html, .css and .js files. This means removing comments, spaces (when not needed) and maybe changing variable names (from "my_long_variable" in "xtr"). Do you know of some tools

Re: [lwip-users] [OT] httpd: download static files from an external HTTP server

2018-02-20 Thread Giuseppe Modugno
Il 20/02/2018 08:51, goldsi...@gmx.de ha scritto: On 20.02.2018 08:15, Giuseppe Modugno wrote: I think this isn't strictly related to lwip, but it's a request typical on electronic devices where lwip runs, i.e. devices with limited and restricted resources. It is somewhat related to lwIP

[lwip-users] [OT] httpd: download static files from an external HTTP server

2018-02-19 Thread Giuseppe Modugno
I think this isn't strictly related to lwip, but it's a request typical on electronic devices where lwip runs, i.e. devices with limited and restricted resources. I have a limited non-volatile memory where to save html (and css, and images, and javascript, ...) files. Considering that the

Re: [lwip-users] httpd: how to redirect to a new address

2018-02-19 Thread Giuseppe Modugno
Consider that the browser can't continue the communication with the server if you change the server IP address. So I implemented the IP address change of the web server in the following way. The client requests a URI with a query string with the new IP configuration. httpd calls a CGI

[lwip-users] An external filesystem for httpd

2018-02-01 Thread Giuseppe Modugno
Until now, I was using the embedded fs generated by the tool makefsdata. Unfortunately the filesystem I'd like to create is bigger than the internal Flash memory of the MCU. I'm thinking to use an external SPI Flash memory to save the filesystem. So I need another tool that creates an ouput

Re: [lwip-users] How to use LWIP_HTTPD_FS_ASYNC_READ

2017-11-28 Thread Giuseppe Modugno
Il 27/11/2017 20:38, goldsi...@gmx.de ha scritto: Giuseppe Modugno wrote: [..] Why the server should close the connection when the Content Length header is not send? Because the client cannot reuse this connection to send more requests as it doesn't know when the server is finished. HTTP

Re: [lwip-users] No-IP Update Client implementation

2017-11-27 Thread Giuseppe Modugno
Il 27/11/2017 16:53, Giuseppe Modugno ha scritto: Is there some example how to implement an Update Client for a Dynamic DNS service, such as No-IP? It seems not too difficult to implement an Update Client for No-Ip: the update is a simple HTTP GET request to No-IP server. In that case, I have

[lwip-users] No-IP Update Client implementation

2017-11-27 Thread Giuseppe Modugno
Is there some example how to implement an Update Client for a Dynamic DNS service, such as No-IP? Thanks ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] How to use LWIP_HTTPD_FS_ASYNC_READ

2017-11-27 Thread Giuseppe Modugno
Il 24/11/2017 16:43, goldsimon ha scritto: You're right in that it doesn't work. The browser has no way to know the body size. The downside of not sending conten length is that the server will have to close the connection. Reopening it might take longer than just sending zero bytes to create

Re: [lwip-users] How to use LWIP_HTTPD_FS_ASYNC_READ

2017-11-24 Thread Giuseppe Modugno
1. I don't know the content length in advance. So I have to start with a length that is surely greater than the final length, otherwise the browser stops receveing data before the end. However what happens if Content Length header says 300 and only 100 bytes were received?

Re: [lwip-users] TCP_WRITE_FLAG_MORE, tcp_write(), tcp_output() and real output TCP segment

2017-11-23 Thread Giuseppe Modugno
Il 22/11/2017 17:09, goldsi...@gmx.de ha scritto: Giuseppe Modugno wrote: I'm sorry for the second email. I noticed in tcp_output(): /**/* First, check if we are invoked by the TCP input processing// // code. If so, we do not output anything. Instead, we rely

Re: [lwip-users] TCP_WRITE_FLAG_MORE, tcp_write(), tcp_output() and real output TCP segment

2017-11-23 Thread Giuseppe Modugno
Il 22/11/2017 17:07, goldsi...@gmx.de ha scritto: Giuseppe Modugno wrote: I'm trying to understand the mechanisms under TCP_WRITE_FLAG_MORE, tcp_write() and tcp_output(). I'm using raw API. First of all, I couldn't understand if tcp_output() is useful or not. Why do you think all

Re: [lwip-users] httpd: how to implement AJAX

2017-11-22 Thread Giuseppe Modugno
Il 13/11/2017 21:25, goldsi...@gmx.de ha scritto: Giuseppe Modugno wrote: The prototype for SSI callbacks is: [..] I don't see any reference to query string parameters. So how to select the right action? Sorry for the confusion. This is a mix of resource optimization, missing documentation

Re: [lwip-users] httpd: how to implement AJAX

2017-11-14 Thread Giuseppe Modugno
Il 14/11/2017 13:54, Noam Weissman ha scritto: Hi, HTTPD is widely used and if you look around you can find examples from ST micro TI and other vendors. Do you mean HTTPD *without* a secure layer? Yes, I know there are many examples of it, but IMHO because it is simpler than a full HTTPS

Re: [lwip-users] httpd: how to implement AJAX

2017-11-14 Thread Giuseppe Modugno
Il 13/11/2017 21:25, goldsi...@gmx.de ha scritto: Giuseppe Modugno wrote: The prototype for SSI callbacks is: [..] I don't see any reference to query string parameters. So how to select the right action? Sorry for the confusion. This is a mix of resource optimization, missing documentation

Re: [lwip-users] httpd: how to implement AJAX

2017-11-14 Thread Giuseppe Modugno
ped, Noam. *From:*lwip-users [mailto:lwip-users-bounces+noam=silrd@nongnu.org] *On Behalf Of *Giuseppe Modugno *Sent:* Monday, November 13, 2017 6:09 PM *To:* lwip-users@nongnu.org *Subject:* Re: [lwip-users] httpd: how to implement AJAX Il 13/11/2017 14:34, Noam Weissman ha scritto: Hi,

Re: [lwip-users] httpd: how to implement AJAX

2017-11-13 Thread Giuseppe Modugno
Il 13/11/2017 14:34, Noam Weissman ha scritto: Hi, I am using the following technic for AJAX. Create an empty file named ajax.shtml or ajax.html and add it to your file list. Inside the file you only write one tag without anything else. For example Do not add CR or LF just the tag !!.

[lwip-users] httpd: how to implement AJAX

2017-11-13 Thread Giuseppe Modugno
I'm trying to create a website with AJAX technology: the client polls, at regular intervals, the server with GET requests of file /status.json. The response is dynamic. I could use only LWIP_HTTPD_CUSTOM_FILES and create the file at runtime in fs_open_custom(). It works, but I can't decode

Re: [lwip-users] httpd and authentication

2017-11-12 Thread Giuseppe Modugno
Il 11/11/2017 09:07, goldsimon ha scritto: Giuseppe Modugno wrote: I'd like to protect some or all web pages and show them only to authorized people. I understood there are two methods: basic and digest. I guess both are outdated. Modern web pages use a custom input field which is sent

[lwip-users] httpd and authentication

2017-11-10 Thread Giuseppe Modugno
I'd like to protect some or all web pages and show them only to authorized people. I understood there are two methods: basic and digest. Basic is simpler, but it is unsecure (because it uses base64). In this case you need TLS. Digest is more complicated but it is more secure (it uses MD5

Re: [lwip-users] win32 porting contrib: double IP address

2017-11-10 Thread Giuseppe Modugno
Il 09/11/2017 17:43, Joel Cunningham ha scritto: On 11/09/2017 03:41 AM, Giuseppe Modugno wrote: Il 08/11/2017 16:34, Joel Cunningham ha scritto: The ping works well if I launch "ping 192.168.1.156" command from *another* computer on the same network. You're most likely running into

Re: [lwip-users] win32 porting contrib: double IP address

2017-11-09 Thread Giuseppe Modugno
Il 08/11/2017 18:20, Gisle Vanem ha scritto: Giuseppe Modugno wrote: So I have an Ethernet interface with two IP and MAC addresses. It seems it works, except for one thing. I tested connectivity by running "ping 192.168.1.156" command from a shell on the same computer. No reply! The

Re: [lwip-users] win32 porting contrib: double IP address

2017-11-09 Thread Giuseppe Modugno
Il 08/11/2017 16:34, Joel Cunningham ha scritto: The ping works well if I launch "ping 192.168.1.156" command from *another* computer on the same network. You're most likely running into a checksum offload problem since you can't contact the LwIP stack from the Windows host, but you CAN from

[lwip-users] win32 porting contrib: double IP address

2017-11-08 Thread Giuseppe Modugno
Hello lwip users, this is my first post. I hope this is the right mailing list for my question. I started with lwip, so I downloaded both lwip and lwip-contrib. I was able to compile lwip test application for win32 (mingw compiler). When I launch test application on third adapter interface