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 <Ti...@JTi.uk.com> on 2022/01/20 17:39:11 UTC

RNDIS

Following suggestions relating to FAT/MSD/USB I have been playing with RNDIS
following the NuttX Channel video by Alan C. de Assis  (thank you Alan -
only just found all of your videos!!).

It all builds OK and ifconfig suggests all is good:

nsh> ifconfig
lo         Link encap:Local Loopback at UP
            inet addr:127.0.0.1 DRaddr:127.0.0.1 Mask:255.0.0.0

eth0    Link encap:Ethernet HWaddr e0:de:00:ad:be:ef at UP
            inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0

But Linux (Ubuntu 20.04) doesn't "see" it and I can't ping it.

Connecting to Windows just results in loads of error messages in nsh to do
with unrecognised rndis messages. Leave that for another day.

If I try and do a local ping it suggests there's an error with sockets, or
ping?

nsh> ping 127.0.0.1
psock_socket: ERROR: socket address family unsupported: 2
socket: ERROR: psock_socket() failed: -106
ERROR: socket() failed: 106
nsh>

106 is endpoint already connected; it's the same whether the USB is
connected to the Linux machine or not.

As usual, any suggestions welcomed!!


Re: RNDIS

Posted by Barbiani <ba...@gmail.com>.
Wsl2 works fine with usb but needs a usb-tcp bridge.
Maybe a kernel recompile too.

I am using usb-serial cables with it.

On Fri, Jan 21, 2022, 15:38 TimH <Ti...@jti.uk.com> wrote:

> There are ways, like there are via some VMs, but I've not tried them. I
> do have an old, spare, laptop and also a PC so can always load 18.04 on
> those if all else fails.
>
> On 21/01/2022 18:15, Alan Carvalho de Assis wrote:
> > WSL doesn't have USB support AFAIK, I think even WSL2 it doesn't work
> fine
> > yet.
> >
> > On 1/21/22, TimH<Ti...@jti.uk.com>  wrote:
> >> I guess I can try it on WSL too, but I'll also set up my Linux machine
> >> to dual boot 20.04 and 18.04. All part of the "Tim gets to grips with
> >> Linux" life experience :)
> >>
> >>
> >> On 21/01/2022 16:30, Alan Carvalho de Assis wrote:
> >>> Hi Tim,
> >>> did you try other Linux distro? Maybe it could be some incompatibility
> >>> in recent Linux kernel.
> >>>
> >>> I suggest you to test on an old Linux distro (i.e. Ubuntu 18.04 LTS)
> >>> just to double check.
> >>>
> >>> BR,
> >>>
> >>> Alan
> >>>
> >>> On 1/21/22, Tim<Ti...@jti.uk.com>   wrote:
> >>>> Windows now working properly but not Linux. My board can be powered
> via
> >>>> the
> >>>> USB and I think it all got confused as I had been leaving the USB
> cable
> >>>> connected, coupled with not flashing code but using JTAG download for
> >>>> debugging, coupled with not repowering the board very often.
> >>>>
> >>>> I can now telnet from Windows.
> >>>>
> >>>> Linux remains an issue, but I'm looking at whether there are any RNDIS
> >>>> driver updates for Ubuntu or something like that.
> >>>>
> >>>> But, for once, I at least have *something* working :)
>
>

Re: RNDIS

Posted by TimH <Ti...@JTi.uk.com>.
There are ways, like there are via some VMs, but I've not tried them. I 
do have an old, spare, laptop and also a PC so can always load 18.04 on 
those if all else fails.

On 21/01/2022 18:15, Alan Carvalho de Assis wrote:
> WSL doesn't have USB support AFAIK, I think even WSL2 it doesn't work fine
> yet.
>
> On 1/21/22, TimH<Ti...@jti.uk.com>  wrote:
>> I guess I can try it on WSL too, but I'll also set up my Linux machine
>> to dual boot 20.04 and 18.04. All part of the "Tim gets to grips with
>> Linux" life experience :)
>>
>>
>> On 21/01/2022 16:30, Alan Carvalho de Assis wrote:
>>> Hi Tim,
>>> did you try other Linux distro? Maybe it could be some incompatibility
>>> in recent Linux kernel.
>>>
>>> I suggest you to test on an old Linux distro (i.e. Ubuntu 18.04 LTS)
>>> just to double check.
>>>
>>> BR,
>>>
>>> Alan
>>>
>>> On 1/21/22, Tim<Ti...@jti.uk.com>   wrote:
>>>> Windows now working properly but not Linux. My board can be powered via
>>>> the
>>>> USB and I think it all got confused as I had been leaving the USB cable
>>>> connected, coupled with not flashing code but using JTAG download for
>>>> debugging, coupled with not repowering the board very often.
>>>>
>>>> I can now telnet from Windows.
>>>>
>>>> Linux remains an issue, but I'm looking at whether there are any RNDIS
>>>> driver updates for Ubuntu or something like that.
>>>>
>>>> But, for once, I at least have *something* working :)


Re: RNDIS

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
WSL doesn't have USB support AFAIK, I think even WSL2 it doesn't work fine yet.

On 1/21/22, TimH <Ti...@jti.uk.com> wrote:
> I guess I can try it on WSL too, but I'll also set up my Linux machine
> to dual boot 20.04 and 18.04. All part of the "Tim gets to grips with
> Linux" life experience :)
>
>
> On 21/01/2022 16:30, Alan Carvalho de Assis wrote:
>> Hi Tim,
>> did you try other Linux distro? Maybe it could be some incompatibility
>> in recent Linux kernel.
>>
>> I suggest you to test on an old Linux distro (i.e. Ubuntu 18.04 LTS)
>> just to double check.
>>
>> BR,
>>
>> Alan
>>
>> On 1/21/22, Tim<Ti...@jti.uk.com>  wrote:
>>> Windows now working properly but not Linux. My board can be powered via
>>> the
>>> USB and I think it all got confused as I had been leaving the USB cable
>>> connected, coupled with not flashing code but using JTAG download for
>>> debugging, coupled with not repowering the board very often.
>>>
>>> I can now telnet from Windows.
>>>
>>> Linux remains an issue, but I'm looking at whether there are any RNDIS
>>> driver updates for Ubuntu or something like that.
>>>
>>> But, for once, I at least have *something* working :)
>

Re: RNDIS

Posted by TimH <Ti...@JTi.uk.com>.
I guess I can try it on WSL too, but I'll also set up my Linux machine 
to dual boot 20.04 and 18.04. All part of the "Tim gets to grips with 
Linux" life experience :)


On 21/01/2022 16:30, Alan Carvalho de Assis wrote:
> Hi Tim,
> did you try other Linux distro? Maybe it could be some incompatibility
> in recent Linux kernel.
>
> I suggest you to test on an old Linux distro (i.e. Ubuntu 18.04 LTS)
> just to double check.
>
> BR,
>
> Alan
>
> On 1/21/22, Tim<Ti...@jti.uk.com>  wrote:
>> Windows now working properly but not Linux. My board can be powered via
>> the
>> USB and I think it all got confused as I had been leaving the USB cable
>> connected, coupled with not flashing code but using JTAG download for
>> debugging, coupled with not repowering the board very often.
>>
>> I can now telnet from Windows.
>>
>> Linux remains an issue, but I'm looking at whether there are any RNDIS
>> driver updates for Ubuntu or something like that.
>>
>> But, for once, I at least have *something* working :)

Re: RNDIS

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Tim,
did you try other Linux distro? Maybe it could be some incompatibility
in recent Linux kernel.

I suggest you to test on an old Linux distro (i.e. Ubuntu 18.04 LTS)
just to double check.

BR,

Alan

On 1/21/22, Tim <Ti...@jti.uk.com> wrote:
> Windows now working properly but not Linux. My board can be powered via the
> USB and I think it all got confused as I had been leaving the USB cable
> connected, coupled with not flashing code but using JTAG download for
> debugging, coupled with not repowering the board very often.
>
> I can now telnet from Windows.
>
> Linux remains an issue, but I'm looking at whether there are any RNDIS
> driver updates for Ubuntu or something like that.
>
> But, for once, I at least have *something* working :)
>
>>-----Original Message-----
>>From: Tim <Ti...@JTi.uk.com>
>>Sent: 21 January 2022 14:14
>>To: dev@nuttx.apache.org
>>Subject: RE: RNDIS
>>
>>>From: Tim Hardisty <Ti...@JTi.uk.com>
>>>Sent: 21 January 2022 11:15
>>
>>>[ 3399.339551] rndis_host 1-2:1.0: dev can't take 1558 byte packets
>>>(max 1364), adjusting MTU to 1306
>>
>>Easily fixed:
>>
>>CONFIG_NET_ETH_PKT_SIZE=1518
>>
>>But RNDIS still doesn't work, having checked every option I can find.
>>
>>Windows doesn't like it, with nsh reporting loads of unknown message types
>> (e.g.
>>1162626371, 1030976101), and Bad packet size dropper (0). But it does show
>> as a
>>network adapter on the PC.
>>
>>Linux dmesg still shows the same: rndis_host 1-2:1.0:
>>RNDIS_MSG_QUERY(0x01010101) failed, -32
>>
>>CDC-ECM Ethernet-over-USB worked straight away, which is fine for Linux
>> but
>>not for Windows.
>>
>>
>
>
>

RE: RNDIS

Posted by Tim <Ti...@JTi.uk.com>.
Windows now working properly but not Linux. My board can be powered via the USB and I think it all got confused as I had been leaving the USB cable connected, coupled with not flashing code but using JTAG download for debugging, coupled with not repowering the board very often.

I can now telnet from Windows.

Linux remains an issue, but I'm looking at whether there are any RNDIS driver updates for Ubuntu or something like that.

But, for once, I at least have *something* working :)

>-----Original Message-----
>From: Tim <Ti...@JTi.uk.com>
>Sent: 21 January 2022 14:14
>To: dev@nuttx.apache.org
>Subject: RE: RNDIS
>
>>From: Tim Hardisty <Ti...@JTi.uk.com>
>>Sent: 21 January 2022 11:15
>
>>[ 3399.339551] rndis_host 1-2:1.0: dev can't take 1558 byte packets
>>(max 1364), adjusting MTU to 1306
>
>Easily fixed:
>
>CONFIG_NET_ETH_PKT_SIZE=1518
>
>But RNDIS still doesn't work, having checked every option I can find.
>
>Windows doesn't like it, with nsh reporting loads of unknown message types (e.g.
>1162626371, 1030976101), and Bad packet size dropper (0). But it does show as a
>network adapter on the PC.
>
>Linux dmesg still shows the same: rndis_host 1-2:1.0:
>RNDIS_MSG_QUERY(0x01010101) failed, -32
>
>CDC-ECM Ethernet-over-USB worked straight away, which is fine for Linux but
>not for Windows.
>
>



RE: RNDIS

Posted by Tim <Ti...@JTi.uk.com>.
>From: Tim Hardisty <Ti...@JTi.uk.com>
>Sent: 21 January 2022 11:15

>[ 3399.339551] rndis_host 1-2:1.0: dev can't take 1558 byte packets (max
>1364), adjusting MTU to 1306

Easily fixed:

CONFIG_NET_ETH_PKT_SIZE=1518

But RNDIS still doesn't work, having checked every option I can find.

Windows doesn't like it, with nsh reporting loads of unknown message types (e.g. 1162626371, 1030976101), and Bad packet size dropper (0). But it does show as a network adapter on the PC.

Linux dmesg still shows the same: rndis_host 1-2:1.0: RNDIS_MSG_QUERY(0x01010101) failed, -32

CDC-ECM Ethernet-over-USB worked straight away, which is fine for Linux but not for Windows.




Re: RNDIS

Posted by Tim Hardisty <Ti...@JTi.uk.com>.
Thanks Alanm - my lack on Linux knowledge failed me again. Never used 
dmesg...luckily I like learning lol.


 From Linux machine:

[ 3399.181365] usb 1-2: new high-speed USB device number 21 using xhci_hcd
[ 3399.337980] usb 1-2: New USB device found, idVendor=584e, 
idProduct=5342, bcdDevice= 0.01
[ 3399.337985] usb 1-2: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[ 3399.337987] usb 1-2: Product: RNDIS NuttX
[ 3399.337988] usb 1-2: Manufacturer: NuttX
[ 3399.337990] usb 1-2: SerialNumber: 1234
[ 3399.339311] rndis_host 1-2:1.0: skipping garbage
[ 3399.339551] rndis_host 1-2:1.0: dev can't take 1558 byte packets (max 
1364), adjusting MTU to 1306
[ 3399.339857] rndis_host 1-2:1.0: RNDIS_MSG_QUERY(0x01010101) failed, -32
[ 3399.339859] rndis_host 1-2:1.0: rndis get ethaddr, -32
[ 3399.339930] rndis_host: probe of 1-2:1.0 failed with error -32
[ 3399.339996] rndis_wlan 1-2:1.0: skipping garbage
[ 3399.340140] rndis_wlan 1-2:1.0: dev can't take 1558 byte packets (max 
1364), adjusting MTU to 1306


No debug warnings in nuttx for USB or network.

So now hunting through the menuconfig to find relevant settings!


On 20/01/2022 23:45, Alan Carvalho de Assis wrote:
> Please verify if dmesg can give use some hint about the issue.
>
> On 1/20/22, TimH <Ti...@jti.uk.com> wrote:
>> Nope, doesn't show. So RNDIS is not working right on my board. What a
>> surprise!
>>
>> On 20/01/2022 19:30, Alan Carvalho de Assis wrote:
>>> Exactly, knowing Unix/Linux makes your live easier with NuttX.
>>>
>>> Using "ip list" (or ifconfig) on Linux should display the new USB
>>> RNDIS interface.
>>>
>>> BR,
>>>
>>> Alan
>>>

Re: RNDIS

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Please verify if dmesg can give use some hint about the issue.

On 1/20/22, TimH <Ti...@jti.uk.com> wrote:
> Nope, doesn't show. So RNDIS is not working right on my board. What a
> surprise!
>
> On 20/01/2022 19:30, Alan Carvalho de Assis wrote:
>> Exactly, knowing Unix/Linux makes your live easier with NuttX.
>>
>> Using "ip list" (or ifconfig) on Linux should display the new USB
>> RNDIS interface.
>>
>> BR,
>>
>> Alan
>>
>

Re: RNDIS

Posted by TimH <Ti...@JTi.uk.com>.
Nope, doesn't show. So RNDIS is not working right on my board. What a 
surprise!

On 20/01/2022 19:30, Alan Carvalho de Assis wrote:
> Exactly, knowing Unix/Linux makes your live easier with NuttX.
>
> Using "ip list" (or ifconfig) on Linux should display the new USB
> RNDIS interface.
>
> BR,
>
> Alan
>

Re: RNDIS

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Exactly, knowing Unix/Linux makes your live easier with NuttX.

Using "ip list" (or ifconfig) on Linux should display the new USB
RNDIS interface.

BR,

Alan

On 1/20/22, TimH <Ti...@jti.uk.com> wrote:
> At home now, but don't recall USB settings of any sort there, just the
> wired Ethernet adapter of my machine. I set that to the same subnet but
> that's irrelevant. ifconfig on the Linux machine didn't show a USB
> adapter, from memory.
>
> I'll have to hunt around for USB adapter settings - they're probably
> there somewhere!! Or Linux is not detecting the RNDIS adapter connection
> perhaps. Is there an RNDIS equivalent of "msconn"?
>
> My Linux abilities are on a par with my NuttX abilities...very very bad!
> Which is the lesson I'm learning the very hard way...NuttX is extremely
> hard if you don't know Linux :(
>
> On 20/01/2022 18:08, Alan Carvalho de Assis wrote:
>> Hi Tim,
>>
>> You we welcome!
>>
>> Are your Linux usb interface on this 10.0.0.x range as well? Is they
>> are not in the same network class it will not work.
>>
>> BR,
>>
>> Alan
>>
>> On 1/20/22, Tim<Ti...@jti.uk.com>  wrote:
>>> Following suggestions relating to FAT/MSD/USB I have been playing with
>>> RNDIS
>>> following the NuttX Channel video by Alan C. de Assis  (thank you Alan -
>>> only just found all of your videos!!).
>>>
>>> It all builds OK and ifconfig suggests all is good:
>>>
>>> nsh> ifconfig
>>> lo         Link encap:Local Loopback at UP
>>>              inet addr:127.0.0.1 DRaddr:127.0.0.1 Mask:255.0.0.0
>>>
>>> eth0    Link encap:Ethernet HWaddr e0:de:00:ad:be:ef at UP
>>>              inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
>>>
>>> But Linux (Ubuntu 20.04) doesn't "see" it and I can't ping it.
>>>
>>> Connecting to Windows just results in loads of error messages in nsh to
>>> do
>>> with unrecognised rndis messages. Leave that for another day.
>>>
>>> If I try and do a local ping it suggests there's an error with sockets,
>>> or
>>> ping?
>>>
>>> nsh> ping 127.0.0.1
>>> psock_socket: ERROR: socket address family unsupported: 2
>>> socket: ERROR: psock_socket() failed: -106
>>> ERROR: socket() failed: 106
>>> nsh>
>>>
>>> 106 is endpoint already connected; it's the same whether the USB is
>>> connected to the Linux machine or not.
>>>
>>> As usual, any suggestions welcomed!!
>>>
>>>
>

Re: RNDIS

Posted by TimH <Ti...@JTi.uk.com>.
At home now, but don't recall USB settings of any sort there, just the 
wired Ethernet adapter of my machine. I set that to the same subnet but 
that's irrelevant. ifconfig on the Linux machine didn't show a USB 
adapter, from memory.

I'll have to hunt around for USB adapter settings - they're probably 
there somewhere!! Or Linux is not detecting the RNDIS adapter connection 
perhaps. Is there an RNDIS equivalent of "msconn"?

My Linux abilities are on a par with my NuttX abilities...very very bad! 
Which is the lesson I'm learning the very hard way...NuttX is extremely 
hard if you don't know Linux :(

On 20/01/2022 18:08, Alan Carvalho de Assis wrote:
> Hi Tim,
>
> You we welcome!
>
> Are your Linux usb interface on this 10.0.0.x range as well? Is they
> are not in the same network class it will not work.
>
> BR,
>
> Alan
>
> On 1/20/22, Tim<Ti...@jti.uk.com>  wrote:
>> Following suggestions relating to FAT/MSD/USB I have been playing with
>> RNDIS
>> following the NuttX Channel video by Alan C. de Assis  (thank you Alan -
>> only just found all of your videos!!).
>>
>> It all builds OK and ifconfig suggests all is good:
>>
>> nsh> ifconfig
>> lo         Link encap:Local Loopback at UP
>>              inet addr:127.0.0.1 DRaddr:127.0.0.1 Mask:255.0.0.0
>>
>> eth0    Link encap:Ethernet HWaddr e0:de:00:ad:be:ef at UP
>>              inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
>>
>> But Linux (Ubuntu 20.04) doesn't "see" it and I can't ping it.
>>
>> Connecting to Windows just results in loads of error messages in nsh to do
>> with unrecognised rndis messages. Leave that for another day.
>>
>> If I try and do a local ping it suggests there's an error with sockets, or
>> ping?
>>
>> nsh> ping 127.0.0.1
>> psock_socket: ERROR: socket address family unsupported: 2
>> socket: ERROR: psock_socket() failed: -106
>> ERROR: socket() failed: 106
>> nsh>
>>
>> 106 is endpoint already connected; it's the same whether the USB is
>> connected to the Linux machine or not.
>>
>> As usual, any suggestions welcomed!!
>>
>>

Re: RNDIS

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Tim,

You we welcome!

Are your Linux usb interface on this 10.0.0.x range as well? Is they
are not in the same network class it will not work.

BR,

Alan

On 1/20/22, Tim <Ti...@jti.uk.com> wrote:
> Following suggestions relating to FAT/MSD/USB I have been playing with
> RNDIS
> following the NuttX Channel video by Alan C. de Assis  (thank you Alan -
> only just found all of your videos!!).
>
> It all builds OK and ifconfig suggests all is good:
>
> nsh> ifconfig
> lo         Link encap:Local Loopback at UP
>             inet addr:127.0.0.1 DRaddr:127.0.0.1 Mask:255.0.0.0
>
> eth0    Link encap:Ethernet HWaddr e0:de:00:ad:be:ef at UP
>             inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
>
> But Linux (Ubuntu 20.04) doesn't "see" it and I can't ping it.
>
> Connecting to Windows just results in loads of error messages in nsh to do
> with unrecognised rndis messages. Leave that for another day.
>
> If I try and do a local ping it suggests there's an error with sockets, or
> ping?
>
> nsh> ping 127.0.0.1
> psock_socket: ERROR: socket address family unsupported: 2
> socket: ERROR: psock_socket() failed: -106
> ERROR: socket() failed: 106
> nsh>
>
> 106 is endpoint already connected; it's the same whether the USB is
> connected to the Linux machine or not.
>
> As usual, any suggestions welcomed!!
>
>