nRF24 / RF24Ethernet

OSI Layers 4&5 Wireless (not WiFi) TCP/IP networking on Arduino devices using nrf24l01+ & nrf52x radios
http://nrf24.github.io/RF24Ethernet
120 stars 50 forks source link

USB Ethernet support #2

Open martin-mat opened 9 years ago

martin-mat commented 9 years ago

creating a ticket to bookmark this feature. This is a point I've been thinking about recently and this comes to me as a really neat idea to add to RF24Ethernet: Support of USB Network device.

Idea: create an USB Stick with nRF24l01 supporting one of standard USB Ethernet interfaces (ECM, RNDIS, ...) so the stick is detected by OS as a regular USB ethernet device.

My explorations on this so far:

The code to be added for this purpose to RF24Network would be probably not that complicated from my point of view and maybe it's already mostly there: get an ethernet frame from LUFA/network, check it's type:

Expected scenario - plug Leonardo into usb -> you get an Ethernet device, assign it's IP and here you go, you are connected to RF24 network.

@TMRh20 any opinion about that?

TMRh20 commented 9 years ago

Heh, sounds like a plan. I mostly have questions about the best approach, but limited knowledge, so I'll just throw out some random info here:

With RF24Ethernet, there are 2 main issues with using TAP/ARP right now:

  1. Arp requests to nodes multiple hops from the master node can be a bit spotty.
  2. Ethernet headers add 14 bytes to each IP payload (54 bytes for headers total)

The alternative of course, is to use either static mapping of MAC/IP or include RF24Mesh. The benefits of using RF24Mesh include faster lookups, no multicast ARP-type requests, and auto-confguration of nodes. A very simple application of this can be seen in the SLIP-Gateway example, and RF24toTUN includes both TAP & TUN options.

The resulting code tends to be about the same size currently, since removing ARP code clears up room for the mesh code. Personally, most of my development has been with TAP/ARP/Ethernet, so I would consider that the more stable side of things right now though.

Another note, the Arduino re-assembly code is nowhere near as robust as the RPi re-assembly code. Arduino will only reassemble one frame at a time from a single host, where RPi will cache a frame fragment from each node, and assemble them independantly of each other. It might be worth beefing up that code in RF24Network, since gateway type nodes typically don't need to run the IP stack, and have more free memory etc. Not quite sure if its worth the effort though.

This is definitely something I would put time into, if you need any info etc. regarding the current libraries, functionality, etc. or if there is anything I can do to help, just let me know.

martin-mat commented 9 years ago

Thanks for info @TMRh20. For now I'll let this topic sleep for a while concerning my activities, but definitely at some point of time I'd like to see that implemented. If you or anyone else interested - feel free to pick this topic.

2bndy5 commented 3 years ago

I know this is an old thread, but I just wanted to mention that the new RP2040's PicoSDK would be the most flexible/easiest way to make this feature happen. Because the PicoSDK allows direct configuration of the tinyUSB bootloader, one can easily declare their own patented VID and PID numbers which the OS could then assess to use the custom-made software/drivers for a USB-RF24Ethernet adapter.