Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Use NetworkManager #241

Merged
merged 4 commits into from
Aug 4, 2017
Merged

Use NetworkManager #241

merged 4 commits into from
Aug 4, 2017

Conversation

zehortigoza
Copy link
Contributor

@zehortigoza zehortigoza commented Aug 1, 2017

No description provided.

@avinash-palleti
Copy link
Contributor

avinash-palleti commented Aug 2, 2017

@zehortigoza I tried with this PR and it is working.
I am able to camp to live network.

I am getting below message in journalctl, but i think it is just warning.
"Couldn't load power state: 'Failed to parse +CFUN? response '1,0' "

PACKAGECONFIG += "ppp"

DEPENDS += "nss"
PACKAGECONFIG += "systemd"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline


IMAGE_INSTALL += "modemmanager"
IMAGE_INSTALL += "networkmanager"
IMAGE_INSTALL += "ppp"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline

@vosst
Copy link

vosst commented Aug 2, 2017

We tested the latest changes, too, and we can connect the drone to the network. Great work, thanks a lot 👍

@zehortigoza zehortigoza force-pushed the modem branch 2 times, most recently from 4cb25a1 to 240b86b Compare August 2, 2017 20:12
@zehortigoza
Copy link
Contributor Author

Now it is setting the DNS automatically.

@lucasdemarchi
Copy link
Collaborator

You need to configure NetworkManager to ignore the usb-ethernet interface, otherwise it will fight with systemd-networkd.

@lucasdemarchi
Copy link
Collaborator

@@ -243,9 +243,6 @@ RDEPENDS_packagegroup-core-full-cmdline-sys-services_remove=" nfs-utils at tcp-w
PACKAGE_EXCLUDE+=" ed"
RDEPENDS_packagegroup-core-full-cmdline-utils_remove = " ed"

PACKAGE_EXCLUDE+=" wireless-tools"
RDEPENDS_packagegroup-base-wifi_remove = " wireless-tools"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These PACKAGE_EXCLUDE, RDEPENDS_packagegroup-xyz should be moved to the images bb files. RDEPENDS_packagegroup_xyz lines remain the same, PACKAGE_EXCLUDE lines becomes IMAGE_INSTALL_remove.

@zehortigoza zehortigoza force-pushed the modem branch 2 times, most recently from d7575fe to be094f9 Compare August 2, 2017 23:08
@zehortigoza
Copy link
Contributor Author

You need to configure NetworkManager to ignore the usb-ethernet interface, otherwise it will fight with systemd-networkd.

I will leave this as it is because it is working and when I try to set the usb-ethernet as unmanageable by NM it loses the ip address.

@zehortigoza zehortigoza force-pushed the modem branch 4 times, most recently from a334b7b to 218d652 Compare August 3, 2017 00:54
@anselmolsm anselmolsm added this to the v1.5 milestone Aug 3, 2017
@@ -1,5 +1,7 @@
Supported targets:
intel-aero-image
intel-aero-image-test
intel-aero-image-modem
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not create another image...


# Let NetworkManager start dnsmasq with the right configuration file
systemctl disable dnsmasq
systemctl stop dnsmasq
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a bbappend on dnsmasq recipe to not enable it.

WIFI_AP_DEFAULTPASSWORD="1234567890"

# This is the APN name for AT&T HSPA+ user should change this with:
# nmcli con modify Modem gsm.apn <name>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess this should be read from a configuration file

nmcli con add type gsm ifname '*' con-name Modem apn $MODEM_APN_NAME autoconnect yes
nmcli con up Modem

# USB over ethernet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should touch this interface. It's the one "debug port" we have and I'd prefer to leave it with systemd-networkd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the solution that I found to fix the resolv.conf bug, systemd created a symbolic link in /etc/resolv.conf and it do not let NM to se the modem dns.
Although I did not had time to flash the image with this last patch.

@avinash-palleti
Copy link
Contributor

I verified latest commit, AP mode is working fine. Able to connect to Aero hotspot.
Not able to switch to client mode. I followed the steps from below wiki,
https://github.com/intel-aero/meta-intel-aero/wiki/Functionality

Scripts that wiki is pointing to are not available in current image, got those scripts from below commit,
1e17012

Scripts i took autostart-supplicant.sh, autostart-hostapd.sh and p2p_supplicant.conf
These scripts require dhclient to be available in the system which is not present in current image. I installed same using rpm.

It is showing the type as manager after running "autostart-supplicant start" but when i run "wpa_cli status" it is giving below error,

"Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory"

I found below difference in networkmanager recipe when compared to one in v1.3.1 image,

EXTRA_OECONF = --disable-polkit
--enable-more-warnings
--disable-gtk-doc
--disable-vala
--without-docs
--with-gnu-ld
--with-session-tracking=none
--with-dhclient=${base_sbindir}/dhclient
--with-dhcpcd=no
--with-resolvconf=no
--with-iptables=${sbindir}/iptables
--enable-ifupdown
--with-modem-manager-1
--disable-ifcfg-rh
--disable-ifcfg-suse
--disable-ifnet
--without-netconfig
--without-resolvconf
--enable-introspection=no \

Am i missing anything ?

@avinash-palleti
Copy link
Contributor

usb net is working i can able to ssh from Ubuntu to Aero through usb interface.

But i observed by default ip address is not getting assigned to usb interface, i ran below command on Aero to get ip address assigned to usb interface,

ifconfig usb0 192.168.7.2 up

Then again i ran below command on Ubuntu,

sudo ifconfig enp0s20u12 192.168.7.1 up

After this i could able to do ssh.

@@ -28,6 +28,11 @@ done
systemctl disable dnsmasq
systemctl stop dnsmasq

rm /etc/resolv.conf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a change to the installed tmpfiles.d

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the systemd recipe to do that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.bbappend

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe for next release we could bring NM 1.6 that plays better with systemd-resolved so we wouldn't need resolveconf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not better keep all the workarrounds in here than spread it into .bbappend of systemd and dnsmasq? This way if in future we want to go back to connman(after someone adds support to our modem in ofono) it would be just remove the nm and mm from image and add comman and ofono.

@zehortigoza
Copy link
Contributor Author

zehortigoza commented Aug 3, 2017

@avinash-palleti we will provide new instructions of how change to wifi client.

This would do it:

# Turn Wifi hostspot down and disable the auto connect
nmcli c down Wifi-hostspot
nmcli c modify Wifi-hostspot connection.autoconnect no

# To scan Wifi networks
nmcli dev wifi
# Connect to Wifi network(by default it will auto connect)
nmcli d wifi connect '<SSID>' password '<password>'

@zehortigoza zehortigoza force-pushed the modem branch 5 times, most recently from 6a1d1d7 to fc71b43 Compare August 3, 2017 23:09
This is necessary to build network manager
ModemManager have support to Intel modems, ofono still don't have.
So replacing Connman with NetworkManager in image.
Same setup as we had with connman + modem connection.
@zehortigoza zehortigoza changed the title WIP: Enable modem Enable modem Aug 3, 2017
@zehortigoza
Copy link
Contributor Author

@avinash-palleti Thanks for the test and review, we decided to keep usb0 over systemd so now it should be working again

But i observed by default ip address is not getting assigned to usb interface, i ran below command on Aero to get ip address assigned to usb interface,

@lucasdemarchi lucasdemarchi mentioned this pull request Aug 4, 2017
@lucasdemarchi lucasdemarchi changed the title Enable modem Use NetworkManger Aug 4, 2017
@lucasdemarchi lucasdemarchi changed the title Use NetworkManger Use NetworkManager Aug 4, 2017
@lucasdemarchi lucasdemarchi merged commit 62b679c into intel-aero:master Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants