Re: [openwisp] Custom interface to the device 'status' menu

2024-04-17 Thread f.capoano
Sorry for my late response.
I am not sure how to help here, the OpenWISP Monitoring package relies on 
the system to get the interface information from OpenWrt, so the key is to 
make sure ubus returns this.

More info:
- https://openwrt.org/docs/techref/ubus
- 
https://github.com/openwisp/openwrt-openwisp-monitoring/blob/dcf0b7d5ada317b7e5abd082f7bc22ce609087ae/openwisp-monitoring/files/lib/openwisp-monitoring/interfaces.lua#L12-L15

I hope this helps.

Federico
 
On Tuesday, March 26, 2024 at 8:12:11 AM UTC-4 d.cer...@gematica.com wrote:

> I tried defining the interface in the /etc/config/network file with both 
> proto to 'none' and 'static' but openwisp still doesn't recognize it. 
> As you can see in the attached screen, the interface is recognized using 
> the 'ifconfig' command.[image: image.png]
>  Is there anything else I can try or should something be changed in the 
> code? If yes, in what way?
>
> Il giorno sab 16 mar 2024 alle ore 12:00 Federico Capoano <
> f.ca...@openwisp.io> ha scritto:
>
>> Hi Daniele,
>>
>> OpenWrt doesn't "see" interfaces which are not defined in its network 
>> configuration.
>>
>> Try defining a new interface called "bond0" and set it to "proto" none. 
>> That may help OpenWrt to see this interface and allow openwisp to report 
>> its address to the controller.
>>
>> I hope it helps.
>>
>> Federico
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "OpenWISP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to openwisp+u...@googlegroups.com.
>>
> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BH4phXnp3rEH38964yfzKBmzn7NceJY230JSTAQ-HUiA%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> *Daniele Cerasuolo*
>
> Via Diocleziano, 107 
>
> 80125 – Napoli (NA) , Italy 
>
> Mail: d.cer...@gematica.com 
>
> Website: www.gematica.com 
>
> INFO PRIVACY 
>
> = = = = = = = = = = = = = = = = = = = = 
>
> The content of this e-mail and its attachments are exclusively directed to 
> the receiver and must be considered  confidential under embargo or use 
> for any purpose for which this e-mail was sent. Therefore, it is prohibited 
>  the dissemination and communication by persons other than the receiver, 
> under Italian Law, ( Artt. 616 e ss.  c.p. e D.lgs n. 196/03 Codice 
> Privacy). If this e-mail and its attachments have been received in error, 
> please destroy what has been received and  notify the sender at the 
> following address:in...@gematica.com 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/adaf8ad9-77bd-44f3-9888-b16dccb0d155n%40googlegroups.com.


Re: [openwisp] Custom interface to the device 'status' menu

2024-03-26 Thread Daniele Cerasuolo
I tried defining the interface in the /etc/config/network file with both
proto to 'none' and 'static' but openwisp still doesn't recognize it.
As you can see in the attached screen, the interface is recognized using
the 'ifconfig' command.[image: image.png]
 Is there anything else I can try or should something be changed in the
code? If yes, in what way?

Il giorno sab 16 mar 2024 alle ore 12:00 Federico Capoano <
f.capo...@openwisp.io> ha scritto:

> Hi Daniele,
>
> OpenWrt doesn't "see" interfaces which are not defined in its network
> configuration.
>
> Try defining a new interface called "bond0" and set it to "proto" none.
> That may help OpenWrt to see this interface and allow openwisp to report
> its address to the controller.
>
> I hope it helps.
>
> Federico
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BH4phXnp3rEH38964yfzKBmzn7NceJY230JSTAQ-HUiA%40mail.gmail.com
> 
> .
>


-- 

*Daniele Cerasuolo*

Via Diocleziano, 107

80125 – Napoli (NA) , Italy

Mail: d.cerasu...@gematica.com

Website: www.gematica.com

INFO PRIVACY

= = = = = = = = = = = = = = = = = = = =

The content of this e-mail and its attachments are exclusively directed to
the receiver and must be considered  confidential under embargo or use for
any purpose for which this e-mail was sent. Therefore, it is prohibited  the
dissemination and communication by persons other than the receiver,
under Italian
Law, ( Artt. 616 e ss.  c.p. e D.lgs n. 196/03 Codice Privacy). If this
e-mail and its attachments have been received in error, please destroy what
has been received and  notify the sender at the following address:
i...@gematica.com

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CA%2B7VT_CuG-wBc59uJRykLS-5tPZDp0KQJmDRySxXihi--LFVgA%40mail.gmail.com.


Re: [openwisp] Custom interface to the device 'status' menu

2024-03-16 Thread Federico Capoano
Hi Daniele,

OpenWrt doesn't "see" interfaces which are not defined in its network
configuration.

Try defining a new interface called "bond0" and set it to "proto" none.
That may help OpenWrt to see this interface and allow openwisp to report
its address to the controller.

I hope it helps.

Federico

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BH4phXnp3rEH38964yfzKBmzn7NceJY230JSTAQ-HUiA%40mail.gmail.com.


Re: [openwisp] Custom interface to the device 'status' menu

2024-03-15 Thread Daniele Cerasuolo
We created a bond interface formed by the eth1 and eth2 interfaces, set
with an IP.
We defined the bond interface (named "*bond0*") as follow:
"
ip link set eth1 down
ip link set eth2 down
echo "+bond0" > /sys/class/net/bonding_masters
echo active-backup > /sys/class/net/bond0/bonding/mode
echo "+eth1" > /sys/class/net/bond0/bonding/slaves
echo "+eth2" > /sys/class/net/bond0/bonding/slaves
echo 5 > /sys/devices/virtual/net/bond0/bonding/num_grat_arp
echo 50 > /sys/class/net/bond0/bonding/miimon
echo "eth1:1" > /sys/class/net/bond0/bonding/queue_id
echo "eth2:2" > /sys/class/net/bond0/bonding/queue_id
echo eth1 > /sys/devices/virtual/net/bond0/bonding/primary
echo "1" > /sys/devices/virtual/net/bond0/bonding/all_slaves_active
ip link set eth1 up
ip link set eth2 up
ip link set dev bond0 up
ip addr add 192.168.101.2/24 brd 192.168.101.255 dev bond0

"
the file */etc/config/network* is:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option packet_steering '1'
option ula_prefix '::/48'

config device 'device1'
option name 'br-lan'
list ports 'lan0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
option type 'bridge'

config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '8.8.8.8'

config device 'device2'
option macaddr 'x'
option name 'eth2'

config interface 'plc1'
option device 'eth2'
option proto 'static'
option ipaddr '192.168.30.10'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'plc0'
option device 'eth1'
option proto 'static'
option ipaddr '192.168.20.10'
option netmask '255.255.255.0'
option ip6assign '60'

The device is connected to openwisp via the ip address associated with the
bond0 interface , I would like to add this information to the status menu.




Il giorno ven 15 mar 2024 alle ore 15:22 Federico Capoano <
f.capo...@openwisp.io> ha scritto:

> Hi Daniele,
>
> Could you share the OpenWrt UCI configuration sample for your use case so
> we can better understand what you're trying to do?
> What do you mean by "main ip address"? Is this the management interface
> address? Or what exactly?
>
> The library which deals with configurations is here:
> https://github.com/openwisp/netjsonconfig/
> Docs: https://netjsonconfig.openwisp.org/en/latest/
>
> Federico
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BLA-9p9VBLLb0NRx%3DgYkBC%3D5xQXMQQZMPSzdx4U9JNJg%40mail.gmail.com
> 
> .
>


-- 

*Daniele Cerasuolo*

Via Diocleziano, 107

80125 – Napoli (NA) , Italy

Mail: d.cerasu...@gematica.com

Website: www.gematica.com

INFO PRIVACY

= = = = = = = = = = = = = = = = = = = =

The content of this e-mail and its attachments are exclusively directed to
the receiver and must be considered  confidential under embargo or use for
any purpose for which this e-mail was sent. Therefore, it is prohibited  the
dissemination and communication by persons other than the receiver,
under Italian
Law, ( Artt. 616 e ss.  c.p. e D.lgs n. 196/03 Codice Privacy). If this
e-mail and its attachments have been received in error, please destroy what
has been received and  notify the sender at the following address:
i...@gematica.com

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CA%2B7VT_DMHy8bpBoq3wVuFMPBNrDy5T3C1B%2BS%3DKJ4onOo84p3Ww%40mail.gmail.com.


Re: [openwisp] Custom interface to the device 'status' menu

2024-03-15 Thread Federico Capoano
Hi Daniele,

Could you share the OpenWrt UCI configuration sample for your use case so
we can better understand what you're trying to do?
What do you mean by "main ip address"? Is this the management interface
address? Or what exactly?

The library which deals with configurations is here:
https://github.com/openwisp/netjsonconfig/
Docs: https://netjsonconfig.openwisp.org/en/latest/

Federico

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BLA-9p9VBLLb0NRx%3DgYkBC%3D5xQXMQQZMPSzdx4U9JNJg%40mail.gmail.com.