Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual ethernet port #94

Open
Gregwar opened this issue Sep 24, 2014 · 6 comments
Open

Virtual ethernet port #94

Gregwar opened this issue Sep 24, 2014 · 6 comments

Comments

@Gregwar
Copy link
Contributor

Gregwar commented Sep 24, 2014

Hello

I know this would be really hard to do, but what about writing an adapter to emulate an ethernet over the usb?

Actually, that sounds more powerful and flexible than virtual com port

We could ping the board, netcat to it (with a basic tcp stack) and why not accessing to network

Again, I know it's not easy, and what I've read about that (usb device creating) seems insanely complicated. How feasible would be that?

@poslathian
Copy link
Member

I suppose the "correct" way to do this would be to implement one of the
ethernet over USB device classes:
http://en.wikipedia.org/wiki/Ethernet_over_USB#Protocols

This would either mean losing the serial port (CDC/ACM) functionality, or
implementing a dual-enumeration strategy so that when you plug in the
device both an ethernet and a COM port appear. Last I tried this (years
ago) there was a fundamental Windows/*nix incompatibility where it was
basically impossible to have dual enumeration work on both platforms
simultaneously (since they handled it in different ways).

An alternative approach would be to implement a custom device driver that
uses the virtual COM port (CDC/ACM) interface for communication but
presents an ethernet device to the rest of the system. This is almost
certainly harder than the first option, but both sound pretty hard ;)

If you want to actually have the stm32 talk to ethernet, you will need a
firmware stack for that as well (e.g. uip or lwip).

I know ST made a few chips with ethernet MAC hardware peripherals, so it is
possible that someone has done this for STM32 already. I would also look
into other Internet of Things projects that focus on internet connectivity
for micro-controllers (e.g. thingsquare, contiki OS, lwip, uip).

I have to say, the chances of LeafLabs writing this sort of thing is pretty
slim, but if you want to take it on we would happily look at the pull
request and promote it on the blog!

Thanks for the suggestion!

AJ

On Wed, Sep 24, 2014 at 4:10 PM, Grégoire Passault <notifications@github.com

wrote:

Hello

I know this would be really hard to do, but what about writing an adapter
to emulate an ethernet over the usb?

Actually, that sounds more powerful and flexible than virtual com port

We could ping the board, netcat to it (with a basic tcp stack) and why not
accessing to network

Again, I know it's not easy, and what I've read about that (usb device
creating) seems insanely complicated. How feasible would be that?


Reply to this email directly or view it on GitHub
#94.

@Gregwar
Copy link
Contributor Author

Gregwar commented Sep 24, 2014

I think leaving the COM port should be ok, with an appropriated bootloader

Unfortunately I won't help on this, USB devices are like sorcery to me :-)

But, once we'd have the interface working, writing MAC/IP/TCP/UDP stack and
packets would really be fun
Le 24 sept. 2014 22:36, "poslathian" notifications@github.com a écrit :

I suppose the "correct" way to do this would be to implement one of the
ethernet over USB device classes:
http://en.wikipedia.org/wiki/Ethernet_over_USB#Protocols

This would either mean losing the serial port (CDC/ACM) functionality, or
implementing a dual-enumeration strategy so that when you plug in the
device both an ethernet and a COM port appear. Last I tried this (years
ago) there was a fundamental Windows/*nix incompatibility where it was
basically impossible to have dual enumeration work on both platforms
simultaneously (since they handled it in different ways).

An alternative approach would be to implement a custom device driver that
uses the virtual COM port (CDC/ACM) interface for communication but
presents an ethernet device to the rest of the system. This is almost
certainly harder than the first option, but both sound pretty hard ;)

If you want to actually have the stm32 talk to ethernet, you will need a
firmware stack for that as well (e.g. uip or lwip).

I know ST made a few chips with ethernet MAC hardware peripherals, so it
is
possible that someone has done this for STM32 already. I would also look
into other Internet of Things projects that focus on internet connectivity
for micro-controllers (e.g. thingsquare, contiki OS, lwip, uip).

I have to say, the chances of LeafLabs writing this sort of thing is
pretty
slim, but if you want to take it on we would happily look at the pull
request and promote it on the blog!

Thanks for the suggestion!

AJ

On Wed, Sep 24, 2014 at 4:10 PM, Grégoire Passault <
notifications@github.com

wrote:

Hello

I know this would be really hard to do, but what about writing an
adapter
to emulate an ethernet over the usb?

Actually, that sounds more powerful and flexible than virtual com port

We could ping the board, netcat to it (with a basic tcp stack) and why
not
accessing to network

Again, I know it's not easy, and what I've read about that (usb device
creating) seems insanely complicated. How feasible would be that?


Reply to this email directly or view it on GitHub
#94.


Reply to this email directly or view it on GitHub
#94 (comment).

@bnewbold
Copy link
Contributor

The netv device did this: http://kosagi.com/w/index.php?title=NeTV_Main_Page#USB_Ethernet_support

That ran linux though. I vaguely remember hearing about other microcontroller projects doing this recently, but don't have a reference off hand. It would be a pretty great feature!

@Gregwar
Copy link
Contributor Author

Gregwar commented Sep 28, 2014

Yes!
Another argument: having multiple applications accessing the same device simultaneously (using udp or tcp, not doable with virtual com)
We could consider getting things like zmq working directly on it :-)

@Gregwar
Copy link
Contributor Author

Gregwar commented Sep 28, 2014

(Building a minimal http server would also seems reasonable)

@poslathian
Copy link
Member

There might be some cruft HTTP server demo in the project repository
running on top of Pymite (embedded python), Maple, and one of those
tcp/ethernet modules (wiznet) that I remember being impressed by a while
back. Embedded languages - like elua, pymite, and rust, are super cool for
microcontrollers btw!

On Sun, Sep 28, 2014 at 10:18 AM, Grégoire Passault <
notifications@github.com> wrote:

(Building a minimal http server would also seems reasonable)


Reply to this email directly or view it on GitHub
#94 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants