You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Tim Hardisty <ti...@hardisty.co.uk> on 2023/01/27 15:55:44 UTC

RNDIS

Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I need to use CDC-ECM for Linux (which works), but there's no generic driver for that in Windows (unless anyone knows differently?).



So I am still trying to get RNDIS working...2 days of prodding and poking so far and no luck :(



Can anyone confirm that they have actually had RNDIS working to a Windows 10 or 11 machine recently? With Nuttx 11 or 12 maybe? And, if so, share a working .config with me?


Re: RNDIS

Posted by Michael Jung <mi...@secore.ly>.
Hello Tim,

I was playing around with RNDIS a couple of years ago and could not get it
to work either.  Which is why I started the CDC-ECM driver back then.

The right thing to do would probably be to create an CDC-NCM driver, as
CDC-NCM is supposed to be supported on Linux, MacOS and contemporary
Windows releases out of the box.  I am planning to look into this
eventually, but currently am fully booked.

Bye,
Michael



On Fri, Jan 27, 2023 at 5:12 PM Alan C. Assis <ac...@gmail.com> wrote:

> Strange, it still available here:
>
> $ sudo modprobe rndis_host
>
> BR,
>
> Alan
>
> On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> > Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I
> need
> > to use CDC-ECM for Linux (which works), but there's no generic driver for
> > that in Windows (unless anyone knows differently?).
> >
> >
> >
> > So I am still trying to get RNDIS working...2 days of prodding and
> poking so
> > far and no luck :(
> >
> >
> >
> > Can anyone confirm that they have actually had RNDIS working to a
> Windows 10
> > or 11 machine recently? With Nuttx 11 or 12 maybe? And, if so, share a
> > working .config with me?
> >
> >
>

Re: RNDIS

Posted by "Alan C. Assis" <ac...@gmail.com>.
Other alternative that people can explore in this mean time:

Reverse tethering:

https://github.com/Genymobile/gnirehtet

Since NuttX has support to USB ADB, eventually it could work (I'm not
100% sure it will work)

More info: https://www.youtube.com/watch?v=96J-pHZ1kR0

BR,

Alan

On 1/28/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> If someone has the time and skills to do a CDC-NCM driver I will test it
> straightaway!
>
> As I commented on GitHub - thanks for reopening and, hopefully, I'll find
> what the issue is stopping it working for me and others may find that
> useful: Microsoft have not said they will deprecate it as yet, so there is
> still a use for it until an NCM driver is available.
>
> On 28/01/2023, 14:11, "Alan C. Assis" <acassis@gmail.com
> <ma...@gmail.com>> wrote:
>
>
> Ok, I re-opened it.
>
>
> If there are inconsistencies they are not specify of RNDIS driver by
> itself, but could be in the USB implementation of other architectures.
>
>
> BTW, since RNDIS is deprecated it doesn't make sense to invest more time on
> it.
>
>
> Like Michael said, it is time to look for a better alternative that
> works on all OS.
>
>
> BR,
>
>
> Alan
>
>
> On 1/28/23, Tim Hardisty <tim@hardisty.co.uk <ma...@hardisty.co.uk>>
> wrote:
>> Please don't close my issue. There are too many inconsistencies here to
>> be
>> sure it is closed:
>>
>> Processor - I am not using stm32
>> OS - Windows/Linux/Ubuntu version maybe
>> RNDIS is likely to be deprecated
>>
>> If I can get RNDIS working for me, that is the time to close it.
>>
>> On 28/01/2023, 13:45, "Alan C. Assis" <acassis@gmail.com
>> <ma...@gmail.com>
>> <mailto:acassis@gmail.com <ma...@gmail.com>>> wrote:
>>
>>
>> Hi Tim,
>>
>>
>> I just confirmed that it still working fine and I'll close your issue.
>>
>>
>> This is a step-by-step process that everyone can follow to get it
>> working:
>>
>>
>> Configure your board:
>> =====================
>>
>>
>> $ ./tools/configure.sh stm32f4discovery:rndis
>>
>>
>> Compile NuttX to your board:
>> ============================
>>
>>
>> $ make -j
>>
>>
>> Flash to your board:
>> ====================
>>
>>
>> $ sudo openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c init
>> -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
>> Open On-Chip Debugger 0.11.0
>> Licensed under GNU GPL v2
>> For bug reports, read
>> http://openocd.org/doc/doxygen/bugs.html
>> <http://openocd.org/doc/doxygen/bugs.html>
>> <http://openocd.org/doc/doxygen/bugs.html>
>> <http://openocd.org/doc/doxygen/bugs.html&gt;>
>> Info : auto-selecting first available session transport "hla_swd". To
>> override use 'transport select <transport>'.
>> Info : The selected transport took over low-level target control. The
>> results might differ compared to plain JTAG/SWD
>> Info : clock speed 2000 kHz
>> Info : STLINK V2J14S0 (API v2) VID:PID 0483:3748
>> Info : Target voltage: 3.203144
>> Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
>> Info : starting gdb server for stm32f4x.cpu on 3333
>> Info : Listening on port 3333 for gdb connections
>> target halted due to debug-request, current mode: Thread
>> xPSR: 0x01000000 pc: 0x08000188 msp: 0x20003f24
>> Info : device id = 0x10036413
>> Info : flash size = 1024 kbytes
>> auto erase enabled
>> wrote 262144 bytes from file nuttx.bin in 11.043253s (23.182 KiB/s)
>>
>>
>> Info : Listening on port 6666 for tcl connections
>> Info : Listening on port 4444 for telnet connections
>>
>>
>>
>>
>> Reset your board
>> ================
>>
>>
>> Run dmesg to confirm that USB RNDIS device was detected:
>> ========================================================
>>
>>
>> [ 1099.821480] usb 3-3: new full-speed USB device number 12 using
>> xhci_hcd
>> [ 1099.972379] usb 3-3: New USB device found, idVendor=584e,
>> idProduct=5342, bcdDevice= 0.01
>> [ 1099.972389] usb 3-3: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [ 1099.972393] usb 3-3: Product: RNDIS gadget
>> [ 1099.972396] usb 3-3: Manufacturer: NuttX
>> [ 1099.972398] usb 3-3: SerialNumber: 1234
>> [ 1099.988952] usbcore: registered new interface driver cdc_ether
>> [ 1099.990144] rndis_host 3-3:1.0: skipping garbage
>> [ 1099.990641] rndis_host 3-3:1.0: dev can't take 1558 byte packets
>> (max 660), adjusting MTU to 602
>> [ 1099.992089] rndis_host 3-3:1.0 eth0: register 'rndis_host' at
>> usb-0000:00:14.0-3, RNDIS device, a0:e0:de:ad:ca:fe
>> [ 1099.992102] usbcore: registered new interface driver rndis_host
>> [ 1099.994026] usbcore: registered new interface driver rndis_wlan
>> [ 1099.997001] rndis_host 3-3:1.0 enxa0e0deadcafe: renamed from eth0
>>
>>
>>
>>
>> Configure your Ubuntu or other Linux distro to share network:
>> =============================================================
>>
>>
>> Click in the top right corner of your Ubuntu and go to:
>>
>>
>> NuttX Ethernet -> Wired Settings
>>
>>
>> Click in the 'Gear icon' and in the tab "IPv4" select: "Shared to
>> other computers"
>>
>>
>> Click on "Apply" button
>>
>>
>> Disconnect and connect the USB cable to force it to get IP.
>>
>>
>> Verify which IP your board got:
>> ===============================
>>
>>
>> $ tail -f /var/log/syslog
>> ...
>> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPDISCOVER(enxa0e0deadcafe)
>> 00:e0:de:ad:ca:fe
>> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPOFFER(enxa0e0deadcafe)
>> 10.42.0.86 00:e0:de:ad:ca:fe
>> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPREQUEST(enxa0e0deadcafe)
>> 10.42.0.86 00:e0:de:ad:ca:fe
>> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPACK(enxa0e0deadcafe)
>> 10.42.0.86 00:e0:de:ad:ca:fe nuttx
>> Jan 28 10:30:29 dev systemd[1]: NetworkManager-dispatcher.service:
>> Deactivated successfully.
>> ^C
>>
>>
>> Ping this IP to confirm it is working:
>> ======================================
>>
>>
>> alan@dev:~/nuttxspace/nuttx$ ping 10.42.0.86
>> PING 10.42.0.86 (10.42.0.86) 56(84) bytes of data.
>> 64 bytes from 10.42.0.86: icmp_seq=1 ttl=64 time=0.809 ms
>> 64 bytes from 10.42.0.86: icmp_seq=2 ttl=64 time=0.849 ms
>> ^C
>> --- 10.42.0.86 ping statistics ---
>> 2 packets transmitted, 2 received, 0% packet loss, time 1027ms
>> rtt min/avg/max/mdev = 0.809/0.829/0.849/0.020 ms
>>
>>
>> Connect to your board over telnet:
>> ==================================
>>
>>
>> alan@dev:~/nuttxspace/nuttx$ telnet 10.42.0.86
>> Trying 10.42.0.86...
>> Connected to 10.42.0.86.
>> Escape character is '^]'.
>>
>>
>> NuttShell (NSH) NuttX-12.0.0
>> nsh>
>>
>>
>>
>>
>> BR,
>>
>>
>> Alan
>>
>>
>> On 1/28/23, Tim Hardisty <tim@hardisty.co.uk <ma...@hardisty.co.uk>
>> <mailto:tim@hardisty.co.uk <ma...@hardisty.co.uk>>>
>> wrote:
>>>> On 28/01/2023, 00:09, "Masayuki Ishikawa"wrote:
>>>
>>>> Shall we move the discussions to the github issues?
>>>
>>> https://github.com/apache/nuttx/issues/8325
>>> <https://github.com/apache/nuttx/issues/8325>
>>> <https://github.com/apache/nuttx/issues/8325>
>>> <https://github.com/apache/nuttx/issues/8325&gt;>
>>>
>>>
>>> :)
>>>
>>>
>>
>>
>>
>>
>
>
>
>

Re: RNDIS

Posted by Tim Hardisty <ti...@hardisty.co.uk>.
If someone has the time and skills to do a CDC-NCM driver I will test it straightaway!

As I commented on GitHub - thanks for reopening and, hopefully, I'll find what the issue is stopping it working for me and others may find that useful: Microsoft have not said they will deprecate it as yet, so there is still a use for it until an NCM driver is available.

On 28/01/2023, 14:11, "Alan C. Assis" <acassis@gmail.com <ma...@gmail.com>> wrote:


Ok, I re-opened it.


If there are inconsistencies they are not specify of RNDIS driver by
itself, but could be in the USB implementation of other architectures.


BTW, since RNDIS is deprecated it doesn't make sense to invest more time on it.


Like Michael said, it is time to look for a better alternative that
works on all OS.


BR,


Alan


On 1/28/23, Tim Hardisty <tim@hardisty.co.uk <ma...@hardisty.co.uk>> wrote:
> Please don't close my issue. There are too many inconsistencies here to be
> sure it is closed:
>
> Processor - I am not using stm32
> OS - Windows/Linux/Ubuntu version maybe
> RNDIS is likely to be deprecated
>
> If I can get RNDIS working for me, that is the time to close it.
>
> On 28/01/2023, 13:45, "Alan C. Assis" <acassis@gmail.com <ma...@gmail.com>
> <mailto:acassis@gmail.com <ma...@gmail.com>>> wrote:
>
>
> Hi Tim,
>
>
> I just confirmed that it still working fine and I'll close your issue.
>
>
> This is a step-by-step process that everyone can follow to get it working:
>
>
> Configure your board:
> =====================
>
>
> $ ./tools/configure.sh stm32f4discovery:rndis
>
>
> Compile NuttX to your board:
> ============================
>
>
> $ make -j
>
>
> Flash to your board:
> ====================
>
>
> $ sudo openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c init
> -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
> Open On-Chip Debugger 0.11.0
> Licensed under GNU GPL v2
> For bug reports, read
> http://openocd.org/doc/doxygen/bugs.html <http://openocd.org/doc/doxygen/bugs.html>
> <http://openocd.org/doc/doxygen/bugs.html> <http://openocd.org/doc/doxygen/bugs.html&gt;>
> Info : auto-selecting first available session transport "hla_swd". To
> override use 'transport select <transport>'.
> Info : The selected transport took over low-level target control. The
> results might differ compared to plain JTAG/SWD
> Info : clock speed 2000 kHz
> Info : STLINK V2J14S0 (API v2) VID:PID 0483:3748
> Info : Target voltage: 3.203144
> Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
> Info : starting gdb server for stm32f4x.cpu on 3333
> Info : Listening on port 3333 for gdb connections
> target halted due to debug-request, current mode: Thread
> xPSR: 0x01000000 pc: 0x08000188 msp: 0x20003f24
> Info : device id = 0x10036413
> Info : flash size = 1024 kbytes
> auto erase enabled
> wrote 262144 bytes from file nuttx.bin in 11.043253s (23.182 KiB/s)
>
>
> Info : Listening on port 6666 for tcl connections
> Info : Listening on port 4444 for telnet connections
>
>
>
>
> Reset your board
> ================
>
>
> Run dmesg to confirm that USB RNDIS device was detected:
> ========================================================
>
>
> [ 1099.821480] usb 3-3: new full-speed USB device number 12 using xhci_hcd
> [ 1099.972379] usb 3-3: New USB device found, idVendor=584e,
> idProduct=5342, bcdDevice= 0.01
> [ 1099.972389] usb 3-3: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 1099.972393] usb 3-3: Product: RNDIS gadget
> [ 1099.972396] usb 3-3: Manufacturer: NuttX
> [ 1099.972398] usb 3-3: SerialNumber: 1234
> [ 1099.988952] usbcore: registered new interface driver cdc_ether
> [ 1099.990144] rndis_host 3-3:1.0: skipping garbage
> [ 1099.990641] rndis_host 3-3:1.0: dev can't take 1558 byte packets
> (max 660), adjusting MTU to 602
> [ 1099.992089] rndis_host 3-3:1.0 eth0: register 'rndis_host' at
> usb-0000:00:14.0-3, RNDIS device, a0:e0:de:ad:ca:fe
> [ 1099.992102] usbcore: registered new interface driver rndis_host
> [ 1099.994026] usbcore: registered new interface driver rndis_wlan
> [ 1099.997001] rndis_host 3-3:1.0 enxa0e0deadcafe: renamed from eth0
>
>
>
>
> Configure your Ubuntu or other Linux distro to share network:
> =============================================================
>
>
> Click in the top right corner of your Ubuntu and go to:
>
>
> NuttX Ethernet -> Wired Settings
>
>
> Click in the 'Gear icon' and in the tab "IPv4" select: "Shared to
> other computers"
>
>
> Click on "Apply" button
>
>
> Disconnect and connect the USB cable to force it to get IP.
>
>
> Verify which IP your board got:
> ===============================
>
>
> $ tail -f /var/log/syslog
> ...
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPDISCOVER(enxa0e0deadcafe)
> 00:e0:de:ad:ca:fe
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPOFFER(enxa0e0deadcafe)
> 10.42.0.86 00:e0:de:ad:ca:fe
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPREQUEST(enxa0e0deadcafe)
> 10.42.0.86 00:e0:de:ad:ca:fe
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPACK(enxa0e0deadcafe)
> 10.42.0.86 00:e0:de:ad:ca:fe nuttx
> Jan 28 10:30:29 dev systemd[1]: NetworkManager-dispatcher.service:
> Deactivated successfully.
> ^C
>
>
> Ping this IP to confirm it is working:
> ======================================
>
>
> alan@dev:~/nuttxspace/nuttx$ ping 10.42.0.86
> PING 10.42.0.86 (10.42.0.86) 56(84) bytes of data.
> 64 bytes from 10.42.0.86: icmp_seq=1 ttl=64 time=0.809 ms
> 64 bytes from 10.42.0.86: icmp_seq=2 ttl=64 time=0.849 ms
> ^C
> --- 10.42.0.86 ping statistics ---
> 2 packets transmitted, 2 received, 0% packet loss, time 1027ms
> rtt min/avg/max/mdev = 0.809/0.829/0.849/0.020 ms
>
>
> Connect to your board over telnet:
> ==================================
>
>
> alan@dev:~/nuttxspace/nuttx$ telnet 10.42.0.86
> Trying 10.42.0.86...
> Connected to 10.42.0.86.
> Escape character is '^]'.
>
>
> NuttShell (NSH) NuttX-12.0.0
> nsh>
>
>
>
>
> BR,
>
>
> Alan
>
>
> On 1/28/23, Tim Hardisty <tim@hardisty.co.uk <ma...@hardisty.co.uk> <mailto:tim@hardisty.co.uk <ma...@hardisty.co.uk>>>
> wrote:
>>> On 28/01/2023, 00:09, "Masayuki Ishikawa"wrote:
>>
>>> Shall we move the discussions to the github issues?
>>
>> https://github.com/apache/nuttx/issues/8325 <https://github.com/apache/nuttx/issues/8325>
>> <https://github.com/apache/nuttx/issues/8325> <https://github.com/apache/nuttx/issues/8325&gt;>
>>
>>
>> :)
>>
>>
>
>
>
>




Re: RNDIS

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Tim,

Thank you for confirming! I noticed that Mr. Xiang Xiao already closed
the issue as well.

BR,

Alan

On 2/11/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
>> On 28/01/2023, 14:11, "Alan C. Assis" <ac...@gmail.com> wrote:
>
>> If there are inconsistencies, they are not specify of RNDIS driver by
>> itself, but could be in the USB implementation of other architectures.
>
> Just for completeness, there was indeed a fix needed in the SAMA5
> sam_udphs.c code.
>
> This is now done and merged to master.
>
> RNDIS is now working for this processor with Linux and Win11.
>
>

Re: RNDIS

Posted by Tim Hardisty <ti...@hardisty.co.uk>.
> On 28/01/2023, 14:11, "Alan C. Assis" <ac...@gmail.com> wrote:

> If there are inconsistencies, they are not specify of RNDIS driver by
> itself, but could be in the USB implementation of other architectures.

Just for completeness, there was indeed a fix needed in the SAMA5 sam_udphs.c code.

This is now done and merged to master.

RNDIS is now working for this processor with Linux and Win11.


Re: RNDIS

Posted by "Alan C. Assis" <ac...@gmail.com>.
Ok, I re-opened it.

If there are inconsistencies they are not specify of RNDIS driver by
itself, but could be in the USB implementation of other architectures.

BTW, since RNDIS is deprecated it doesn't make sense to invest more time on it.

Like Michael said, it is time to look for a better alternative that
works on all OS.

BR,

Alan

On 1/28/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> Please don't close my issue. There are too many inconsistencies here to be
> sure it is closed:
>
> Processor - I am not using stm32
> OS - Windows/Linux/Ubuntu version maybe
> RNDIS is likely to be deprecated
>
> If I can get RNDIS working for me, that is the time to close it.
>
> On 28/01/2023, 13:45, "Alan C. Assis" <acassis@gmail.com
> <ma...@gmail.com>> wrote:
>
>
> Hi Tim,
>
>
> I just confirmed that it still working fine and I'll close your issue.
>
>
> This is a step-by-step process that everyone can follow to get it working:
>
>
> Configure your board:
> =====================
>
>
> $ ./tools/configure.sh stm32f4discovery:rndis
>
>
> Compile NuttX to your board:
> ============================
>
>
> $ make -j
>
>
> Flash to your board:
> ====================
>
>
> $ sudo openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c init
> -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
> Open On-Chip Debugger 0.11.0
> Licensed under GNU GPL v2
> For bug reports, read
> http://openocd.org/doc/doxygen/bugs.html
> <http://openocd.org/doc/doxygen/bugs.html>
> Info : auto-selecting first available session transport "hla_swd". To
> override use 'transport select <transport>'.
> Info : The selected transport took over low-level target control. The
> results might differ compared to plain JTAG/SWD
> Info : clock speed 2000 kHz
> Info : STLINK V2J14S0 (API v2) VID:PID 0483:3748
> Info : Target voltage: 3.203144
> Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
> Info : starting gdb server for stm32f4x.cpu on 3333
> Info : Listening on port 3333 for gdb connections
> target halted due to debug-request, current mode: Thread
> xPSR: 0x01000000 pc: 0x08000188 msp: 0x20003f24
> Info : device id = 0x10036413
> Info : flash size = 1024 kbytes
> auto erase enabled
> wrote 262144 bytes from file nuttx.bin in 11.043253s (23.182 KiB/s)
>
>
> Info : Listening on port 6666 for tcl connections
> Info : Listening on port 4444 for telnet connections
>
>
>
>
> Reset your board
> ================
>
>
> Run dmesg to confirm that USB RNDIS device was detected:
> ========================================================
>
>
> [ 1099.821480] usb 3-3: new full-speed USB device number 12 using xhci_hcd
> [ 1099.972379] usb 3-3: New USB device found, idVendor=584e,
> idProduct=5342, bcdDevice= 0.01
> [ 1099.972389] usb 3-3: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 1099.972393] usb 3-3: Product: RNDIS gadget
> [ 1099.972396] usb 3-3: Manufacturer: NuttX
> [ 1099.972398] usb 3-3: SerialNumber: 1234
> [ 1099.988952] usbcore: registered new interface driver cdc_ether
> [ 1099.990144] rndis_host 3-3:1.0: skipping garbage
> [ 1099.990641] rndis_host 3-3:1.0: dev can't take 1558 byte packets
> (max 660), adjusting MTU to 602
> [ 1099.992089] rndis_host 3-3:1.0 eth0: register 'rndis_host' at
> usb-0000:00:14.0-3, RNDIS device, a0:e0:de:ad:ca:fe
> [ 1099.992102] usbcore: registered new interface driver rndis_host
> [ 1099.994026] usbcore: registered new interface driver rndis_wlan
> [ 1099.997001] rndis_host 3-3:1.0 enxa0e0deadcafe: renamed from eth0
>
>
>
>
> Configure your Ubuntu or other Linux distro to share network:
> =============================================================
>
>
> Click in the top right corner of your Ubuntu and go to:
>
>
> NuttX Ethernet -> Wired Settings
>
>
> Click in the 'Gear icon' and in the tab "IPv4" select: "Shared to
> other computers"
>
>
> Click on "Apply" button
>
>
> Disconnect and connect the USB cable to force it to get IP.
>
>
> Verify which IP your board got:
> ===============================
>
>
> $ tail -f /var/log/syslog
> ...
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPDISCOVER(enxa0e0deadcafe)
> 00:e0:de:ad:ca:fe
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPOFFER(enxa0e0deadcafe)
> 10.42.0.86 00:e0:de:ad:ca:fe
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPREQUEST(enxa0e0deadcafe)
> 10.42.0.86 00:e0:de:ad:ca:fe
> Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPACK(enxa0e0deadcafe)
> 10.42.0.86 00:e0:de:ad:ca:fe nuttx
> Jan 28 10:30:29 dev systemd[1]: NetworkManager-dispatcher.service:
> Deactivated successfully.
> ^C
>
>
> Ping this IP to confirm it is working:
> ======================================
>
>
> alan@dev:~/nuttxspace/nuttx$ ping 10.42.0.86
> PING 10.42.0.86 (10.42.0.86) 56(84) bytes of data.
> 64 bytes from 10.42.0.86: icmp_seq=1 ttl=64 time=0.809 ms
> 64 bytes from 10.42.0.86: icmp_seq=2 ttl=64 time=0.849 ms
> ^C
> --- 10.42.0.86 ping statistics ---
> 2 packets transmitted, 2 received, 0% packet loss, time 1027ms
> rtt min/avg/max/mdev = 0.809/0.829/0.849/0.020 ms
>
>
> Connect to your board over telnet:
> ==================================
>
>
> alan@dev:~/nuttxspace/nuttx$ telnet 10.42.0.86
> Trying 10.42.0.86...
> Connected to 10.42.0.86.
> Escape character is '^]'.
>
>
> NuttShell (NSH) NuttX-12.0.0
> nsh>
>
>
>
>
> BR,
>
>
> Alan
>
>
> On 1/28/23, Tim Hardisty <tim@hardisty.co.uk <ma...@hardisty.co.uk>>
> wrote:
>>> On 28/01/2023, 00:09, "Masayuki Ishikawa"wrote:
>>
>>> Shall we move the discussions to the github issues?
>>
>> https://github.com/apache/nuttx/issues/8325
>> <https://github.com/apache/nuttx/issues/8325>
>>
>>
>> :)
>>
>>
>
>
>
>

Re: RNDIS

Posted by Tim Hardisty <ti...@hardisty.co.uk>.
Please don't close my issue. There are too many inconsistencies here to be sure it is closed:

Processor - I am not using stm32
OS - Windows/Linux/Ubuntu version maybe
RNDIS is likely to be deprecated

If I can get RNDIS working for me, that is the time to close it.

On 28/01/2023, 13:45, "Alan C. Assis" <acassis@gmail.com <ma...@gmail.com>> wrote:


Hi Tim,


I just confirmed that it still working fine and I'll close your issue.


This is a step-by-step process that everyone can follow to get it working:


Configure your board:
=====================


$ ./tools/configure.sh stm32f4discovery:rndis


Compile NuttX to your board:
============================


$ make -j


Flash to your board:
====================


$ sudo openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c init
-c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html <http://openocd.org/doc/doxygen/bugs.html>
Info : auto-selecting first available session transport "hla_swd". To
override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The
results might differ compared to plain JTAG/SWD
Info : clock speed 2000 kHz
Info : STLINK V2J14S0 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.203144
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000188 msp: 0x20003f24
Info : device id = 0x10036413
Info : flash size = 1024 kbytes
auto erase enabled
wrote 262144 bytes from file nuttx.bin in 11.043253s (23.182 KiB/s)


Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections




Reset your board
================


Run dmesg to confirm that USB RNDIS device was detected:
========================================================


[ 1099.821480] usb 3-3: new full-speed USB device number 12 using xhci_hcd
[ 1099.972379] usb 3-3: New USB device found, idVendor=584e,
idProduct=5342, bcdDevice= 0.01
[ 1099.972389] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1099.972393] usb 3-3: Product: RNDIS gadget
[ 1099.972396] usb 3-3: Manufacturer: NuttX
[ 1099.972398] usb 3-3: SerialNumber: 1234
[ 1099.988952] usbcore: registered new interface driver cdc_ether
[ 1099.990144] rndis_host 3-3:1.0: skipping garbage
[ 1099.990641] rndis_host 3-3:1.0: dev can't take 1558 byte packets
(max 660), adjusting MTU to 602
[ 1099.992089] rndis_host 3-3:1.0 eth0: register 'rndis_host' at
usb-0000:00:14.0-3, RNDIS device, a0:e0:de:ad:ca:fe
[ 1099.992102] usbcore: registered new interface driver rndis_host
[ 1099.994026] usbcore: registered new interface driver rndis_wlan
[ 1099.997001] rndis_host 3-3:1.0 enxa0e0deadcafe: renamed from eth0




Configure your Ubuntu or other Linux distro to share network:
=============================================================


Click in the top right corner of your Ubuntu and go to:


NuttX Ethernet -> Wired Settings


Click in the 'Gear icon' and in the tab "IPv4" select: "Shared to
other computers"


Click on "Apply" button


Disconnect and connect the USB cable to force it to get IP.


Verify which IP your board got:
===============================


$ tail -f /var/log/syslog
...
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPDISCOVER(enxa0e0deadcafe)
00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPOFFER(enxa0e0deadcafe)
10.42.0.86 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPREQUEST(enxa0e0deadcafe)
10.42.0.86 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPACK(enxa0e0deadcafe)
10.42.0.86 00:e0:de:ad:ca:fe nuttx
Jan 28 10:30:29 dev systemd[1]: NetworkManager-dispatcher.service:
Deactivated successfully.
^C


Ping this IP to confirm it is working:
======================================


alan@dev:~/nuttxspace/nuttx$ ping 10.42.0.86
PING 10.42.0.86 (10.42.0.86) 56(84) bytes of data.
64 bytes from 10.42.0.86: icmp_seq=1 ttl=64 time=0.809 ms
64 bytes from 10.42.0.86: icmp_seq=2 ttl=64 time=0.849 ms
^C
--- 10.42.0.86 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1027ms
rtt min/avg/max/mdev = 0.809/0.829/0.849/0.020 ms


Connect to your board over telnet:
==================================


alan@dev:~/nuttxspace/nuttx$ telnet 10.42.0.86
Trying 10.42.0.86...
Connected to 10.42.0.86.
Escape character is '^]'.


NuttShell (NSH) NuttX-12.0.0
nsh>




BR,


Alan


On 1/28/23, Tim Hardisty <tim@hardisty.co.uk <ma...@hardisty.co.uk>> wrote:
>> On 28/01/2023, 00:09, "Masayuki Ishikawa"wrote:
>
>> Shall we move the discussions to the github issues?
>
> https://github.com/apache/nuttx/issues/8325 <https://github.com/apache/nuttx/issues/8325>
>
>
> :)
>
>




Re: RNDIS

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Tim,

I just confirmed that it still working fine and I'll close your issue.

This is a step-by-step process that everyone can follow to get it working:

Configure your board:
=====================

$ ./tools/configure.sh stm32f4discovery:rndis

Compile NuttX to your board:
============================

$ make -j

Flash to your board:
====================

$ sudo openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c init
-c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To
override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The
results might differ compared to plain JTAG/SWD
Info : clock speed 2000 kHz
Info : STLINK V2J14S0 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.203144
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000188 msp: 0x20003f24
Info : device id = 0x10036413
Info : flash size = 1024 kbytes
auto erase enabled
wrote 262144 bytes from file nuttx.bin in 11.043253s (23.182 KiB/s)

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections


Reset your board
================

Run dmesg to confirm that USB RNDIS device was detected:
========================================================

[ 1099.821480] usb 3-3: new full-speed USB device number 12 using xhci_hcd
[ 1099.972379] usb 3-3: New USB device found, idVendor=584e,
idProduct=5342, bcdDevice= 0.01
[ 1099.972389] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1099.972393] usb 3-3: Product: RNDIS gadget
[ 1099.972396] usb 3-3: Manufacturer: NuttX
[ 1099.972398] usb 3-3: SerialNumber: 1234
[ 1099.988952] usbcore: registered new interface driver cdc_ether
[ 1099.990144] rndis_host 3-3:1.0: skipping garbage
[ 1099.990641] rndis_host 3-3:1.0: dev can't take 1558 byte packets
(max 660), adjusting MTU to 602
[ 1099.992089] rndis_host 3-3:1.0 eth0: register 'rndis_host' at
usb-0000:00:14.0-3, RNDIS device, a0:e0:de:ad:ca:fe
[ 1099.992102] usbcore: registered new interface driver rndis_host
[ 1099.994026] usbcore: registered new interface driver rndis_wlan
[ 1099.997001] rndis_host 3-3:1.0 enxa0e0deadcafe: renamed from eth0


Configure your Ubuntu or other Linux distro to share network:
=============================================================

Click in the top right corner of your Ubuntu and go to:

NuttX Ethernet -> Wired Settings

Click in the 'Gear icon' and in the tab "IPv4" select: "Shared to
other computers"

Click on "Apply" button

Disconnect and connect the USB cable to force it to get IP.

Verify which IP your board got:
===============================

$ tail -f /var/log/syslog
...
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPDISCOVER(enxa0e0deadcafe)
00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPOFFER(enxa0e0deadcafe)
10.42.0.86 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPREQUEST(enxa0e0deadcafe)
10.42.0.86 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPACK(enxa0e0deadcafe)
10.42.0.86 00:e0:de:ad:ca:fe nuttx
Jan 28 10:30:29 dev systemd[1]: NetworkManager-dispatcher.service:
Deactivated successfully.
^C

Ping this IP to confirm it is working:
======================================

alan@dev:~/nuttxspace/nuttx$ ping 10.42.0.86
PING 10.42.0.86 (10.42.0.86) 56(84) bytes of data.
64 bytes from 10.42.0.86: icmp_seq=1 ttl=64 time=0.809 ms
64 bytes from 10.42.0.86: icmp_seq=2 ttl=64 time=0.849 ms
^C
--- 10.42.0.86 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1027ms
rtt min/avg/max/mdev = 0.809/0.829/0.849/0.020 ms

Connect to your board over telnet:
==================================

alan@dev:~/nuttxspace/nuttx$ telnet 10.42.0.86
Trying 10.42.0.86...
Connected to 10.42.0.86.
Escape character is '^]'.

NuttShell (NSH) NuttX-12.0.0
nsh>


BR,

Alan

On 1/28/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
>> On 28/01/2023, 00:09, "Masayuki Ishikawa"wrote:
>
>> Shall we move the discussions to the github issues?
>
> https://github.com/apache/nuttx/issues/8325
>
>
> :)
>
>

Re: RNDIS

Posted by Tim Hardisty <ti...@hardisty.co.uk>.
> On 28/01/2023, 00:09, "Masayuki Ishikawa"wrote:

> Shall we move the discussions to the github issues?

https://github.com/apache/nuttx/issues/8325


:)


Re: RNDIS

Posted by Masayuki Ishikawa <ma...@gmail.com>.
Hi, all.

Shall we move the discussions to the github issues?


On Sat, Jan 28, 2023 at 3:13 AM Nathan Hartman <ha...@gmail.com>
wrote:

> Here's an Article about it:
> https://www.phoronix.com/news/Linux-Disabling-RNDIS-Drivers
>
>
> On Fri, Jan 27, 2023 at 1:03 PM Alan C. Assis <ac...@gmail.com> wrote:
>
> > I didn't test it since a long time, but I recall people using it some
> > month ago without issue.
> >
> > Since the "rndis" board config to stm32f4discovery still there I could
> > test it later and report my results here.
> >
> > BR,
> >
> > Alan
> >
> > On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> > > Just what I read, perhaps it *will* be deprecated...
> > >
> > > Modprobe does suggest that rndis_host is, indeed, present so, in that
> > case,
> > > RNDIS doesn't work on Linux either!
> > >
> > >>-----Original Message-----
> > >>From: Alan C. Assis <ac...@gmail.com>
> > >>Sent: 27 January 2023 16:12
> > >>To: dev@nuttx.apache.org
> > >>Subject: Re: RNDIS
> > >>
> > >>Strange, it still available here:
> > >>
> > >>$ sudo modprobe rndis_host
> > >>
> > >>BR,
> > >>
> > >>Alan
> > >>
> > >>On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> > >>> Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I
> > >>> need to use CDC-ECM for Linux (which works), but there's no generic
> > >>> driver for that in Windows (unless anyone knows differently?).
> > >>>
> > >>>
> > >>>
> > >>> So I am still trying to get RNDIS working...2 days of prodding and
> > >>> poking so far and no luck :(
> > >>>
> > >>>
> > >>>
> > >>> Can anyone confirm that they have actually had RNDIS working to a
> > >>> Windows 10 or 11 machine recently? With Nuttx 11 or 12 maybe? And, if
> > >>> so, share a working .config with me?
> > >>>
> > >>>
> > >
> >
>

Re: RNDIS

Posted by Nathan Hartman <ha...@gmail.com>.
Here's an Article about it:
https://www.phoronix.com/news/Linux-Disabling-RNDIS-Drivers


On Fri, Jan 27, 2023 at 1:03 PM Alan C. Assis <ac...@gmail.com> wrote:

> I didn't test it since a long time, but I recall people using it some
> month ago without issue.
>
> Since the "rndis" board config to stm32f4discovery still there I could
> test it later and report my results here.
>
> BR,
>
> Alan
>
> On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> > Just what I read, perhaps it *will* be deprecated...
> >
> > Modprobe does suggest that rndis_host is, indeed, present so, in that
> case,
> > RNDIS doesn't work on Linux either!
> >
> >>-----Original Message-----
> >>From: Alan C. Assis <ac...@gmail.com>
> >>Sent: 27 January 2023 16:12
> >>To: dev@nuttx.apache.org
> >>Subject: Re: RNDIS
> >>
> >>Strange, it still available here:
> >>
> >>$ sudo modprobe rndis_host
> >>
> >>BR,
> >>
> >>Alan
> >>
> >>On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> >>> Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I
> >>> need to use CDC-ECM for Linux (which works), but there's no generic
> >>> driver for that in Windows (unless anyone knows differently?).
> >>>
> >>>
> >>>
> >>> So I am still trying to get RNDIS working...2 days of prodding and
> >>> poking so far and no luck :(
> >>>
> >>>
> >>>
> >>> Can anyone confirm that they have actually had RNDIS working to a
> >>> Windows 10 or 11 machine recently? With Nuttx 11 or 12 maybe? And, if
> >>> so, share a working .config with me?
> >>>
> >>>
> >
>

Re: RNDIS

Posted by "Alan C. Assis" <ac...@gmail.com>.
I didn't test it since a long time, but I recall people using it some
month ago without issue.

Since the "rndis" board config to stm32f4discovery still there I could
test it later and report my results here.

BR,

Alan

On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> Just what I read, perhaps it *will* be deprecated...
>
> Modprobe does suggest that rndis_host is, indeed, present so, in that case,
> RNDIS doesn't work on Linux either!
>
>>-----Original Message-----
>>From: Alan C. Assis <ac...@gmail.com>
>>Sent: 27 January 2023 16:12
>>To: dev@nuttx.apache.org
>>Subject: Re: RNDIS
>>
>>Strange, it still available here:
>>
>>$ sudo modprobe rndis_host
>>
>>BR,
>>
>>Alan
>>
>>On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
>>> Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I
>>> need to use CDC-ECM for Linux (which works), but there's no generic
>>> driver for that in Windows (unless anyone knows differently?).
>>>
>>>
>>>
>>> So I am still trying to get RNDIS working...2 days of prodding and
>>> poking so far and no luck :(
>>>
>>>
>>>
>>> Can anyone confirm that they have actually had RNDIS working to a
>>> Windows 10 or 11 machine recently? With Nuttx 11 or 12 maybe? And, if
>>> so, share a working .config with me?
>>>
>>>
>

RE: RNDIS

Posted by Tim Hardisty <ti...@hardisty.co.uk>.
Just what I read, perhaps it *will* be deprecated...

Modprobe does suggest that rndis_host is, indeed, present so, in that case, RNDIS doesn't work on Linux either!

>-----Original Message-----
>From: Alan C. Assis <ac...@gmail.com>
>Sent: 27 January 2023 16:12
>To: dev@nuttx.apache.org
>Subject: Re: RNDIS
>
>Strange, it still available here:
>
>$ sudo modprobe rndis_host
>
>BR,
>
>Alan
>
>On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
>> Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I
>> need to use CDC-ECM for Linux (which works), but there's no generic
>> driver for that in Windows (unless anyone knows differently?).
>>
>>
>>
>> So I am still trying to get RNDIS working...2 days of prodding and
>> poking so far and no luck :(
>>
>>
>>
>> Can anyone confirm that they have actually had RNDIS working to a
>> Windows 10 or 11 machine recently? With Nuttx 11 or 12 maybe? And, if
>> so, share a working .config with me?
>>
>>

Re: RNDIS

Posted by "Alan C. Assis" <ac...@gmail.com>.
Strange, it still available here:

$ sudo modprobe rndis_host

BR,

Alan

On 1/27/23, Tim Hardisty <ti...@hardisty.co.uk> wrote:
> Seems that RNDIS on Linux is deprecated as it's deemed insecure, so I need
> to use CDC-ECM for Linux (which works), but there's no generic driver for
> that in Windows (unless anyone knows differently?).
>
>
>
> So I am still trying to get RNDIS working...2 days of prodding and poking so
> far and no luck :(
>
>
>
> Can anyone confirm that they have actually had RNDIS working to a Windows 10
> or 11 machine recently? With Nuttx 11 or 12 maybe? And, if so, share a
> working .config with me?
>
>