Author Topic: Ethernet in embedded application  (Read 4193 times)

0 Members and 1 Guest are viewing this topic.

Offline Kittu20Topic starter

  • Regular Contributor
  • *
  • Posts: 115
  • Country: in
Ethernet in embedded application
« on: February 25, 2023, 03:41:59 pm »
have you ever used ethernet in embedded application maybe you can clear my confusion. I just wanted to know what was the reason in your project that you think you should use ethernet.

I know one example of ethernet, suppose we have a computer and a printer that we want to connect to a network. We can connect them to a switch or router using Ethernet cables. The switch or router will act as a central hub for communication between the devices, allowing them to exchange data and communicate with other devices on the network.

I have no idea how and when to use Ethernet in embedded application. can anyone tell me about your project where you have used ethernet
 

Offline tellurium

  • Frequent Contributor
  • **
  • Posts: 345
  • Country: ua
Re: Ethernet in embedded application
« Reply #1 on: February 25, 2023, 04:05:30 pm »
Isn't printer an "embedded application"?
Mongoose - a full-stack embedded network library for STM32, NXP and other - https://mongoose.ws
TCP/IP stack + drivers + TLS1.3 + HTTP/WebSocket/MQTT + OTA in a single file
 
The following users thanked this post: cantata.tech

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11485
  • Country: fi
Re: Ethernet in embedded application
« Reply #2 on: February 25, 2023, 04:07:43 pm »
One example: building automation system, which primarily just needs internet access, but also in some specific cases, needs TCP connectivity to a solar inverter, for example.

Choice had to be made between WiFi and ethernet. Ethernet was chosen because:
(a) most customers (households, commercial, light industrial) have a router with at least one free ethernet port,
(b) Ethernet is more reliable than WiFi especially against configuration errors and changes
(c) No configuration is (usually) needed - just plug it in, router gives it an IP address with DHCP, and you have access. WiFi requires configuration procedure, which needs to be explained to the customer, and which also needs to be redone if new router is installed.

How? We ended up with Wiznet W6100. There were no large problems and it works fine. Was probably at least somewhat easier to integrate than software TCP/IP stacks.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2913
  • Country: fr
    • kripton2035 schematics repository
Re: Ethernet in embedded application
« Reply #3 on: February 25, 2023, 05:03:47 pm »
W32-ETH01
https://www.aliexpress.com/item/1005003807175034.html
you program it with the arduino IDE...
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10095
  • Country: us
Re: Ethernet in embedded application
« Reply #4 on: February 25, 2023, 05:24:34 pm »
Back around 1970, I was introduced to the IBM 1130 and Fortran.  I spent a LOT of time programming that machine and I really enjoyed using it for EE classes, especially the drum plotter for Bode' Plots and such.

Some time back, I built an FPGA emulation that runs the IBM software unchanged and at about 100 times faster but I didn't have a plotter; I had a LaserJet.

So, I picked up an mbed LPC1768, built a daughter card with the required MagJack and used the Ethernet library to connect the uC to the LaserJet and SPI to communicate with the FPGA.  There was a lot  of code to convert from IBM 6 bit commands to HPGL sentences but I'll skip over that.  The entire IBM plotter library works unchanged.

Here's a photo of the real system but ours were IBM blue:
http://computermuseum.informatik.uni-stuttgart.de/dev/ibm1130/ibm1130.html

Note the drum plotter...

This use of Ethernet is about embedded as it gets!  The uC takes an input stream, does some transformations and sends an output stream to the LaserJet using Berkeley Sockets.  This protocol is native at the printer, no real effort to make the connection and send the stream.
« Last Edit: February 25, 2023, 05:37:25 pm by rstofer »
 
The following users thanked this post: MK14

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10095
  • Country: us
Re: Ethernet in embedded application
« Reply #5 on: February 25, 2023, 05:54:15 pm »
Hint to beginning uC developers:  Berkeley Sockets is easy to implement because almost every Ethernet library will implement the lower level stuff.  Client and Server code is pretty easy and, since TCP guarantees correct delivery, next layer up software is easy to write.

There is code all over the Internet including:
https://www.paulgriffiths.net/program/c/sockets.php
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6174
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet in embedded application
« Reply #6 on: February 25, 2023, 06:01:24 pm »
Ethernet adds huge complexity to an embedded project. Even lifting everything you can find online, you will spend months of your life debugging, fixing, going down rabbit holes (half of github is nonworking junk). Don't ask me how I know...
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30436
  • Country: nl
    • NCT Developments
Re: Ethernet in embedded application
« Reply #7 on: February 25, 2023, 06:18:37 pm »
One example: building automation system, which primarily just needs internet access, but also in some specific cases, needs TCP connectivity to a solar inverter, for example.

Choice had to be made between WiFi and ethernet. Ethernet was chosen because:
(a) most customers (households, commercial, light industrial) have a router with at least one free ethernet port,
(b) Ethernet is more reliable than WiFi especially against configuration errors and changes
(c) No configuration is (usually) needed - just plug it in, router gives it an IP address with DHCP, and you have access. WiFi requires configuration procedure, which needs to be explained to the customer, and which also needs to be redone if new router is installed.

How? We ended up with Wiznet W6100. There were no large problems and it works fine. Was probably at least somewhat easier to integrate than software TCP/IP stacks.
I second the suggestion to use the Wiznet chips. I have used the uIP and LWIP software stacks as well but these are horrible to configure & use.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6174
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet in embedded application
« Reply #8 on: February 25, 2023, 06:32:13 pm »
Depends on the cost sensitivity, performance, security (various aspects) and futureproofing that you need.
« Last Edit: February 25, 2023, 06:39:25 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10095
  • Country: us
Re: Ethernet in embedded application
« Reply #9 on: February 25, 2023, 06:50:40 pm »
Today, I would be inclined to use the Raspberry Pi Pico W (for wifi).  My application is trivial, monitor the running current of a remote sump  pump and display the run status to a browser via an HTTP Server on the Pico.  It's trivial given that there is an HTTP Server example to copy.  The device is about $6 at Adafruit but you will probably have to solder the two 20 pin headers if you want delivery:

https://www.adafruit.com/product/5525

This is a neat module and connects right up to my WiFi LAN.

I bought several of the Picos, some with WiFi, some without.  They are really easy to work with using MicroPython and the Thonny IDE.
 
The following users thanked this post: elecdonia

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14859
  • Country: gb
    • Mike's Electric Stuff
Re: Ethernet in embedded application
« Reply #10 on: February 25, 2023, 07:06:02 pm »
Ethernet adds huge complexity to an embedded project. Even lifting everything you can find online, you will spend months of your life debugging, fixing, going down rabbit holes (half of github is nonworking junk). Don't ask me how I know...
That depends a lot on what you are doing. I used the Wiznet chips to do UDP for data for a lighting system - took maybe 3 days to get it all up & running.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 
The following users thanked this post: pardo-bsso

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14859
  • Country: gb
    • Mike's Electric Stuff
Re: Ethernet in embedded application
« Reply #11 on: February 25, 2023, 07:07:49 pm »
One example: building automation system, which primarily just needs internet access, but also in some specific cases, needs TCP connectivity to a solar inverter, for example.

Choice had to be made between WiFi and ethernet. Ethernet was chosen because:
(a) most customers (households, commercial, light industrial) have a router with at least one free ethernet port,
(b) Ethernet is more reliable than WiFi especially against configuration errors and changes
(c) No configuration is (usually) needed - just plug it in, router gives it an IP address with DHCP, and you have access. WiFi requires configuration procedure, which needs to be explained to the customer, and which also needs to be redone if new router is installed.

How? We ended up with Wiznet W6100. There were no large problems and it works fine. Was probably at least somewhat easier to integrate than software TCP/IP stacks.
I second the suggestion to use the Wiznet chips. I have used the uIP and LWIP software stacks as well but these are horrible to configure & use.
I Third it. The only issues I've had are lack of support for long fragmented UDP packets, and packet loss problems when using a MEMS oscillator instead of a crystal.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11485
  • Country: fi
Re: Ethernet in embedded application
« Reply #12 on: February 25, 2023, 07:16:22 pm »
I also bolted mbedTLS on top of the W6100 code and it was not too bad, but maybe 1-2 weeks worth of hard full-time work, mostly working through what all those TLS-related acronyms mean. It is working flawlessly though and I'm happy about that. If all you need are raw TCP sockets or UDP datagrams, then I'm sure the project's going to be very simple with Wiznet chips. Their example code is crappy, but crappy in a good way - no overengineering or complex architecture.
« Last Edit: February 25, 2023, 07:18:14 pm by Siwastaja »
 
The following users thanked this post: hans, nctnico

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6174
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet in embedded application
« Reply #13 on: February 25, 2023, 08:10:29 pm »
Quote
I would be inclined to use the Raspberry Pi Pico W

How do you deal with a production application?

Quote
If all you need are raw TCP sockets or UDP datagrams, then I'm sure the project's going to be very simple with Wiznet chips.

IF indeed :)

That's where LWIP comes in.

Quote
but maybe 1-2 weeks worth of hard full-time work, mostly working through what all those TLS-related acronyms mean. It is working flawlessly though and I'm happy about that. I

You are an expert. Then all this is easy :)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30436
  • Country: nl
    • NCT Developments
Re: Ethernet in embedded application
« Reply #14 on: February 25, 2023, 10:35:30 pm »
Quote
I would be inclined to use the Raspberry Pi Pico W

How do you deal with a production application?

Quote
If all you need are raw TCP sockets or UDP datagrams, then I'm sure the project's going to be very simple with Wiznet chips.

IF indeed :)

That's where LWIP comes in.
FYI: the Wiznet chips also support raw sockets (getting packets from the network directly). Still, all the network stuff, low level packet handling and buffering is done by the Wiznet chip.
« Last Edit: February 25, 2023, 11:28:38 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10095
  • Country: us
Re: Ethernet in embedded application
« Reply #15 on: February 26, 2023, 02:10:59 am »
Quote
I would be inclined to use the Raspberry Pi Pico W

How do you deal with a production application?


Not even a remote consideration, I am LONG retired. 

It is still worth noting that the mbed LPC1768 requires only a MagJack to get wired ethernet.  The mbed library is based on LWIP so it's pretty solid. 

As to WiFi?  I might think about the WizNet approach.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6174
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet in embedded application
« Reply #16 on: February 26, 2023, 06:28:17 am »
Quote
The mbed library is based on LWIP so it's pretty solid.

That's exactly my view. The main issue with LWIP is the configuration learning curve. But you cut out much of that if you are doing this just to be able to advertise that your product has "ethernet" i.e. you are happy with low performance, which is exactly what you will get with an SPI attached ETH module ;)

Also with some chips e.g. ESP32 you get an LWIP config which does actually work out of the box. With ST, basically nothing works out of the box.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4676
  • Country: us
Re: Ethernet in embedded application
« Reply #17 on: February 26, 2023, 06:48:45 am »
Quote
Ethernet adds huge complexity to an embedded project.
Compared to WiFi that amateurs are pros alike are throwing around like candy?  Hah!

 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6174
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet in embedded application
« Reply #18 on: February 26, 2023, 07:41:24 am »
I think wifi and bluetooth are even harder to get right. But usually the very large companies that tend to make such products have the resources to make it work.

It's funny how the OP tossed in a little piece of chewing gum and a whole bunch of people are fighting over it :) And he's gone.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17863
  • Country: fr
Re: Ethernet in embedded application
« Reply #19 on: February 26, 2023, 07:06:24 pm »
It's funny how the OP tossed in a little piece of chewing gum and a whole bunch of people are fighting over it :) And he's gone.

Happens very frequently here. ;D
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4676
  • Country: us
Re: Ethernet in embedded application
« Reply #20 on: February 27, 2023, 12:39:12 am »
Happens very frequently everywhere.
My impression is that this particular "drive-by" problem is worse on the highly official vendor forums; people will ask a question and apparently never show up to see the answers.  At least on these less official forums, we frequently get interesting (and even useful to many) conversations out of such prompts...

 
The following users thanked this post: tellurium

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6174
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet in embedded application
« Reply #21 on: February 27, 2023, 06:21:50 am »
I dont have much experience of vendor forums - only the ST one - but that may be because usually nobody on there posts a sensible or useful reply and then - due to the vast volume of questions posted by variously desperate people - the question scrolls off rapidly and nobody sees it anyway. On the ST forum that is basically what happens all day long.

Addressing this unfortunately requires mod/admin participation. For example I co-run a forum (in technology, not electronics) and every morning when I get out of bed I "promote" new topics to home page banners. There is room for about 5 of these. They stay up there for 24hrs. Exceptionally 48hrs. And > 95% of readers come in via this home page. So if somebody asks a question which looks intelligent, it gets promoted for a day and usually draws good responses, and we get a good thread. If it looks like it was a drive-by posting, I don't promote it :)

But somebody has to do this work... and the mod has to actually understand the subject to perform this function.

But then we have no adverts so no income.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->