EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Suggestions on solutions to develop an embedded web server over Ethernet interface

Started by pozz February 10, 2017
I will develop a device that must be monitored and controlled by remote 
through an IP connection over Ethernet interface. I'm not an expert of 
embedded TCP/IP and HTTP server, so I would prefer to separate the main 
MCU (Cortex-Mx that I already know) from the "remote MCU" (it is a block 
box at the moment). This separation could be useful if someone will 
decide to give the remote connection as an option.

The big question is how to design an embedded HTTP server, starting from 
the hw to the sw. The device is low-cost and the web pages will be simple.

I understood there's Microchip with its ready-to-use solutions (mainly 
16- and 32-bits PICs), including a free (even for commercial) 
open-source TCP/IP stack. I think it has a simple HTTP server too.

Many others (Atmel, NXP, ST), with their Cortex-Mx MCUs with integrated 
Ethernet controller (with external PHY), use lwip free open-source 
TCP/IP stack. Simple HTTP server implementation is included.

Is there a low-size low-cost embedded Linux solution? Maybe a cheap 
System On Module (with processor and some volatile and non-volatile 
memories)?

The link between the "remote CPU" and the "main MCU" could be a simple 
asyncronous serial link.
pozz <pozzugno@gmail.com> wrote:
> I will develop a device that must be monitored and controlled by remote > through an IP connection over Ethernet interface. I'm not an expert of > embedded TCP/IP and HTTP server, so I would prefer to separate the main > MCU (Cortex-Mx that I already know) from the "remote MCU" (it is a block > box at the moment). This separation could be useful if someone will > decide to give the remote connection as an option. > > The big question is how to design an embedded HTTP server, starting from > the hw to the sw. The device is low-cost and the web pages will be simple.
You say simple, but I think the complexity is going to rise: By 'IP' do you mean 'internet' or is this strictly local? Will it have login credentials? Will it be monitoring/controlling anything where it would be bad if an attacker got hold of it? If yes to the above, it's likely to need TLS. Some would argue that any answer to #1 requires TLS - any organisation's network starts looking like the internet when it gets large enough. That means you need a webserver capable of TLS, and then a way to manage certificates. While there are things like mbedTLS, the amount of software work means it's heading towards a Linux solution. The danger with Linux solutions is too many are sold as 'fit and forget', when really you need something that keeps up with security updates. Many are terrible at that, and vendors often give up on a particular SoC after a time that can be measured in months.
> Is there a low-size low-cost embedded Linux solution? Maybe a cheap > System On Module (with processor and some volatile and non-volatile > memories)?
You could have a look at the Raspberry Pi Compute Modules. The I/O is a bit limited (GPIO is good, but ethernet is hung off USB) but they have a good software update story and the community documentation is very good. I don't recall the supply lifetime guarantees for the SoMs but I think they do exist.
> The link between the "remote CPU" and the "main MCU" could be a simple > asyncronous serial link.
Should be doable. Theo
On Fri, 10 Feb 2017 18:27:38 +0100, pozz wrote:

> I will develop a device that must be monitored and controlled by remote > through an IP connection over Ethernet interface. I'm not an expert of > embedded TCP/IP and HTTP server, so I would prefer to separate the main > MCU (Cortex-Mx that I already know) from the "remote MCU" (it is a block > box at the moment). This separation could be useful if someone will > decide to give the remote connection as an option. > > The big question is how to design an embedded HTTP server, starting from > the hw to the sw. The device is low-cost and the web pages will be simple. > > I understood there's Microchip with its ready-to-use solutions (mainly > 16- and 32-bits PICs), including a free (even for commercial) > open-source TCP/IP stack. I think it has a simple HTTP server too. > > Many others (Atmel, NXP, ST), with their Cortex-Mx MCUs with integrated > Ethernet controller (with external PHY), use lwip free open-source > TCP/IP stack. Simple HTTP server implementation is included. > > Is there a low-size low-cost embedded Linux solution? Maybe a cheap > System On Module (with processor and some volatile and non-volatile > memories)? > > The link between the "remote CPU" and the "main MCU" could be a simple > asyncronous serial link.
I agree with the other post and suggest a Raspberry Pi. That is probably the quickest solution. Another possibility is FreeRTOS. There are ports to many different MCUs and various dev boards. There is a lwip port and examples of web servers, flash file systems and more. I have used FreeRTOS on a NXP M3 and micro ip (uip) tcp/ip stack. I have not used lwip but there is active support and discussion groups. -- Chisolm Republic of Texas
On 2/10/2017 10:27 AM, pozz wrote:
> I will develop a device that must be monitored and controlled by remote through > an IP connection over Ethernet interface. I'm not an expert of embedded TCP/IP > and HTTP server, so I would prefer to separate the main MCU (Cortex-Mx that I
I seem to have missed the step where you jumped from "IP" to "TCP/IP & HTTPd".
> already know) from the "remote MCU" (it is a block box at the moment). This > separation could be useful if someone will decide to give the remote connection > as an option. > > The big question is how to design an embedded HTTP server, starting from the hw > to the sw. The device is low-cost and the web pages will be simple. > > I understood there's Microchip with its ready-to-use solutions (mainly 16- and > 32-bits PICs), including a free (even for commercial) open-source TCP/IP stack. > I think it has a simple HTTP server too. > > Many others (Atmel, NXP, ST), with their Cortex-Mx MCUs with integrated > Ethernet controller (with external PHY), use lwip free open-source TCP/IP > stack. Simple HTTP server implementation is included. > > Is there a low-size low-cost embedded Linux solution? Maybe a cheap System On > Module (with processor and some volatile and non-volatile memories)? > > The link between the "remote CPU" and the "main MCU" could be a simple > asyncronous serial link.
On Fri, 10 Feb 2017 18:27:38 +0100, pozz wrote:

> I will develop a device that must be monitored and controlled by remote > through an IP connection over Ethernet interface. I'm not an expert of > embedded TCP/IP and HTTP server, so I would prefer to separate the main > MCU (Cortex-Mx that I already know) from the "remote MCU" (it is a block > box at the moment). This separation could be useful if someone will > decide to give the remote connection as an option. > > The big question is how to design an embedded HTTP server, starting from > the hw to the sw. The device is low-cost and the web pages will be > simple. > > I understood there's Microchip with its ready-to-use solutions (mainly > 16- and 32-bits PICs), including a free (even for commercial) > open-source TCP/IP stack. I think it has a simple HTTP server too. > > Many others (Atmel, NXP, ST), with their Cortex-Mx MCUs with integrated > Ethernet controller (with external PHY), use lwip free open-source > TCP/IP stack. Simple HTTP server implementation is included. > > Is there a low-size low-cost embedded Linux solution? Maybe a cheap > System On Module (with processor and some volatile and non-volatile > memories)? > > The link between the "remote CPU" and the "main MCU" could be a simple > asyncronous serial link.
Have you web-searched? I haven't done this myself, but I've seen web servers working on some impressively small microprocessors. AFAIK, once you have a TCP/IP stack going, the web server itself can be fairly small -- all that a really basic web server does is blarfing out HTML in response to requests. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
On 2/10/2017 9:27 AM, pozz wrote:
> I will develop a device that must be monitored and controlled by remote > through an IP connection over Ethernet interface. I'm not an expert of > embedded TCP/IP and HTTP server, so I would prefer to separate the main > MCU (Cortex-Mx that I already know) from the "remote MCU" (it is a block > box at the moment). This separation could be useful if someone will > decide to give the remote connection as an option. > > The big question is how to design an embedded HTTP server, starting from > the hw to the sw. The device is low-cost and the web pages will be simple. > > I understood there's Microchip with its ready-to-use solutions (mainly > 16- and 32-bits PICs), including a free (even for commercial) > open-source TCP/IP stack. I think it has a simple HTTP server too. > > Many others (Atmel, NXP, ST), with their Cortex-Mx MCUs with integrated > Ethernet controller (with external PHY), use lwip free open-source > TCP/IP stack. Simple HTTP server implementation is included. > > Is there a low-size low-cost embedded Linux solution? Maybe a cheap > System On Module (with processor and some volatile and non-volatile > memories)? > > The link between the "remote CPU" and the "main MCU" could be a simple > asyncronous serial link.
This board provides a Wi-Fi solution, not Ethernet so may be way off but the ESP8266 with its numerous variants may work for you: http://www.ebay.com/itm/NodeMCU-ESP-12E-ESP8266-WiFi-LUA-IoT-CH340G-V3-New-Version-Arduino-Compatibile-/322389923742?hash=item4b0fefd79e:g:hagAAOSwvg9XUjnP HTH Philip
Il 10/02/2017 19:28, Theo Markettos ha scritto:
 >> Is there a low-size low-cost embedded Linux solution? Maybe a cheap
 >> System On Module (with processor and some volatile and non-volatile
 >> memories)?
 >
 > You could have a look at the Raspberry Pi Compute Modules.  The I/O 
is a bit
 > limited (GPIO is good, but ethernet is hung off USB) but they have a good
 > software update story and the community documentation is very good. 
I don't
 > recall the supply lifetime guarantees for the SoMs but I think they do
 > exist.

Recently Raspberry company released a new version of Compute Module, 
named CM3 (Compute Module 3).  I already used the original CM1 version 
in an old project.  I think Raspberry solutions are very good if the 
project provides an HDMI interface, otherwise I think there are better 
solutions at a similar price.

In my current project, where I need an Ethernet interface, CM SOMs 
aren't good because, as you wrote, Ethernet is not CPU native.

The cheapest embedded Linux SOM I know is A13-SOM-256 from Olimex[1]. It 
is sold for 18EUR (12.60EUR@1000pcs).  It is cheaper than CM1 and CM3 
from Raspberry.
However A13-SOM-256 (and is big brother A13-SOM-512) doesn't provide 
Ethernet connectivity (I think because A13 CPU from Allwinner hasn't 
this feature natively).

We need the A20-SOM to have Ethernet connectivity, but the price rises 
to 40EUR (30.10EUR@1000pcs).
Maybe adding a USB/Ethernet bride (such as LAN9512 from Microchip) to 
A13-SOM-256 is cheaper than A20-SOM (but I don't know what the 
performance will be).

Another nice SOM is CORE9X35[2] from CoreWind.  It is a SMD SOM running 
Linux and provides and Ethernet interface with integrated PHY. The price 
of the model with 256MB is only 36USD (32.4USD@1000pcs)

[1] https://www.olimex.com/Products/SOM/A13/A13-SOM-256/
[2] http://www.armdevs.com/Product/CORE9X35.html
Il 10/02/2017 19:28, Theo Markettos ha scritto:
 >> Is there a low-size low-cost embedded Linux solution? Maybe a cheap
 >> System On Module (with processor and some volatile and non-volatile
 >> memories)?
 >
 > You could have a look at the Raspberry Pi Compute Modules.  The I/O 
is a bit
 > limited (GPIO is good, but ethernet is hung off USB) but they have a good
 > software update story and the community documentation is very good. 
I don't
 > recall the supply lifetime guarantees for the SoMs but I think they do
 > exist.

Recently Raspberry company released a new version of Compute Module, 
named CM3 (Compute Module 3).  I already used the original CM1 version 
in an old project.  I think Raspberry solutions are very good if the 
project provides an HDMI interface, otherwise I think there are better 
solutions at a similar price.

In my current project, where I need an Ethernet interface, CM SOMs 
aren't good because, as you wrote, Ethernet is not CPU native.

The cheapest embedded Linux SOM I know is A13-SOM-256 from Olimex[1]. It 
is sold for 18EUR (12.60EUR@1000pcs).  It is cheaper than CM1 and CM3 
from Raspberry.
However A13-SOM-256 (and is big brother A13-SOM-512) doesn't provide 
Ethernet connectivity (I think because A13 CPU from Allwinner hasn't 
this feature natively).

We need the A20-SOM to have Ethernet connectivity, but the price rises 
to 40EUR (30.10EUR@1000pcs).
Maybe adding a USB/Ethernet bride (such as LAN9512 from Microchip) to 
A13-SOM-256 is cheaper than A20-SOM (but I don't know what the 
performance will be).

Another nice SOM is CORE9X35[2] from CoreWind.  It is a SMD SOM running 
Linux and provides and Ethernet interface with integrated PHY. The price 
of the model with 256MB is only 36USD (32.4USD@1000pcs)

[1] https://www.olimex.com/Products/SOM/A13/A13-SOM-256/
[2] http://www.armdevs.com/Product/CORE9X35.html
pozz <pozzugno@gmail.com> wrote:
> Recently Raspberry company released a new version of Compute Module, > named CM3 (Compute Module 3). I already used the original CM1 version > in an old project. I think Raspberry solutions are very good if the > project provides an HDMI interface, otherwise I think there are better > solutions at a similar price. > > In my current project, where I need an Ethernet interface, CM SOMs > aren't good because, as you wrote, Ethernet is not CPU native.
I didn't realise also the Ethernet chip is not on the Compute Module - ie you need to add the LAN9512 (or another USB ethernet chip) plus magnetics on your board. That makes for slightly more pain. I would caution about picking random modules based on price alone. There's a lot of race-to-the-bottom stuff out of China (eg the Pi knockoffs like Orange Pi, Banana Pi etc). The problem is that the software story is not very good - you end up running old kernels, updates don't happen, nobody is supporting the Linux distro, there are binary blobs in the tree so you can't just build a recent kernel. I'm think of Allwinner particularly, though I understand some parts are better supported than others[1]. Maybe you can make it work for you - if you sell enough volume you can pay someone to keep on top of it. But things like binary blobs can't be fixed no matter how much manpower you throw at it. Unfortunately what seems to happen is products are thrown out the door and nobody keeps up: I bought a product recently with a 2009 Linux kernel. When I asked for the GPL source they sent me source for 2.6.15 from 2006 (and there were binary blobs too). Maybe you can navigate all those things (eg binary graphics drivers don't matter for your application), but something to be aware of rather than buying on price. Perhaps a suggestion for good support would be: don't buy anything that isn't in the mainline Linux tree. But I think that very much limits your options. Theo [1] Allwinner seems to be getting there: http://linux-sunxi.org/Linux_mainlining_effort
pozz <pozzugno@gmail.com> writes:
> Is there a low-size low-cost embedded Linux solution? Maybe a cheap > System On Module (with processor and some volatile and non-volatile > memories)?
This might be of interest: https://www.seeedstudio.com/AI7688H-p-2739.html Also: https://www.seeedstudio.com/LinkIt-Smart-7688-Duo-p-2574.html Both supposedly have ethernet pins. Linux is almost certainly easier to program, but there are also Cortex-M solutions. Do you absolutely need ethernet? There's tons of cheap wifi stuff: https://www.seeedstudio.com/E-p-2497.html Or even smaller and cheaper ESP8266 boards: http://www.wemos.cc/ https://www.aliexpress.com/item//32630518881.html

The 2024 Embedded Online Conference