You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by David Sidrane <Da...@nscdg.com> on 2020/09/17 19:59:50 UTC

Is the only option for using the network monitor....

 Is the only option for using the network monitor....

Hi,

My goal is to have a run time option to use a static IP or DHCP. (Curretly
it is compile time)

If either are used I want to "auto up" the eth0. Once the interface comes up
, if configured for DHCP it should make start the DHCP request process.

Is the only option for using the network monitor to have phy interrupts or
is there a polled option?

David

RE: Is the only option for using the network monitor....

Posted by David Sidrane <Da...@nscdg.com>.
Hi Anthony & Greg,

I tested that the F7 can do simultaneous management and link operations, as
can the PHY used

I did paths 1 and 2 that we disused and the PRs are
https://github.com/apache/incubator-nuttx/pull/1886 and
https://github.com/apache/incubator-nuttx-apps/pull/402

Anthony do you have write access now?

It is IPv4 only, at the moment.

Usage is here
https://github.com/PX4/Firmware/blob/fea0858f3c378fe35be489cb07ba2241ff002c69/src/systemcmds/netman/netman.cpp#L433-L448

Doc for that app are here
https://github.com/PX4/Firmware/commit/5148fc753ae2001eb2fee6611bf01d09223eaa21

David

-----Original Message-----
From: Anthony Merlino [mailto:anthony@vergeaero.com]
Sent: Thursday, September 17, 2020 1:17 PM
To: dev@nuttx.apache.org
Subject: Re: Is the only option for using the network monitor....

David,

I've been trying to figure out how you would do this on Linux. This seems
to be the right answer. Done via a "lease" configuration for dhcpd, or via
secondary static IP on the interface
https://stackoverflow.com/questions/12727175/set-static-ip-if-not-obtained-from-dhcp-script

For your purposes, I think there would be a few paths:

   1. Modify the netinit logic to attempt connection over DHCP, but on
   failure to connect to the server, fallback and setup the DHCP.
   2. Modify DHCP logic to support fallback static IP via configuration
   similar to lease.
   3. Add support for multiple IP addresses on a single interface within
   the network stack. Then always assign the static IP in addition to the
one
   DHCP may or may not setup.
   This is a big job, but I'd really like to see us get it done at some
   point. Right now, for IPv6, AFAIK, we can't even support a link-local IP
   address (fe80::/10 with a global IP at the same time.


On Thu, Sep 17, 2020 at 4:02 PM Gregory Nutt <sp...@gmail.com> wrote:

> On 9/17/2020 1:59 PM, David Sidrane wrote:
> >   Is the only option for using the network monitor....
> >
> > Hi,
> >
> > My goal is to have a run time option to use a static IP or DHCP.
> (Curretly
> > it is compile time)
> >
> > If either are used I want to "auto up" the eth0. Once the interface
> comes up
> > , if configured for DHCP it should make start the DHCP request process.
> >
> > Is the only option for using the network monitor to have phy interrupts
> or
> > is there a polled option?
> >
> > David
> >
> There is no polled option.  I am not certain if you can access the PHY
> while in normal operating mode either.  Doesn't management mode disable
> the MAC?
>
>

Re: Is the only option for using the network monitor....

Posted by Anthony Merlino <an...@vergeaero.com>.
David,

I've been trying to figure out how you would do this on Linux. This seems
to be the right answer. Done via a "lease" configuration for dhcpd, or via
secondary static IP on the interface
https://stackoverflow.com/questions/12727175/set-static-ip-if-not-obtained-from-dhcp-script

For your purposes, I think there would be a few paths:

   1. Modify the netinit logic to attempt connection over DHCP, but on
   failure to connect to the server, fallback and setup the DHCP.
   2. Modify DHCP logic to support fallback static IP via configuration
   similar to lease.
   3. Add support for multiple IP addresses on a single interface within
   the network stack. Then always assign the static IP in addition to the one
   DHCP may or may not setup.
   This is a big job, but I'd really like to see us get it done at some
   point. Right now, for IPv6, AFAIK, we can't even support a link-local IP
   address (fe80::/10 with a global IP at the same time.


On Thu, Sep 17, 2020 at 4:02 PM Gregory Nutt <sp...@gmail.com> wrote:

> On 9/17/2020 1:59 PM, David Sidrane wrote:
> >   Is the only option for using the network monitor....
> >
> > Hi,
> >
> > My goal is to have a run time option to use a static IP or DHCP.
> (Curretly
> > it is compile time)
> >
> > If either are used I want to "auto up" the eth0. Once the interface
> comes up
> > , if configured for DHCP it should make start the DHCP request process.
> >
> > Is the only option for using the network monitor to have phy interrupts
> or
> > is there a polled option?
> >
> > David
> >
> There is no polled option.  I am not certain if you can access the PHY
> while in normal operating mode either.  Doesn't management mode disable
> the MAC?
>
>

RE: Is the only option for using the network monitor....

Posted by David Sidrane <Da...@nscdg.com>.
Hi Greg,

Thank you responding. Then I will I will test it.

-----Original Message-----
From: Gregory Nutt [mailto:spudaneco@gmail.com]
Sent: Thursday, September 17, 2020 1:03 PM
To: dev@nuttx.apache.org
Subject: Re: Is the only option for using the network monitor....

On 9/17/2020 1:59 PM, David Sidrane wrote:
>   Is the only option for using the network monitor....
>
> Hi,
>
> My goal is to have a run time option to use a static IP or DHCP. (Curretly
> it is compile time)
>
> If either are used I want to "auto up" the eth0. Once the interface comes
> up
> , if configured for DHCP it should make start the DHCP request process.
>
> Is the only option for using the network monitor to have phy interrupts or
> is there a polled option?
>
> David
>
There is no polled option.  I am not certain if you can access the PHY
while in normal operating mode either.  Doesn't management mode disable
the MAC?

Re: Is the only option for using the network monitor....

Posted by Gregory Nutt <sp...@gmail.com>.
On 9/17/2020 1:59 PM, David Sidrane wrote:
>   Is the only option for using the network monitor....
>
> Hi,
>
> My goal is to have a run time option to use a static IP or DHCP. (Curretly
> it is compile time)
>
> If either are used I want to "auto up" the eth0. Once the interface comes up
> , if configured for DHCP it should make start the DHCP request process.
>
> Is the only option for using the network monitor to have phy interrupts or
> is there a polled option?
>
> David
>
There is no polled option.  I am not certain if you can access the PHY 
while in normal operating mode either.  Doesn't management mode disable 
the MAC?