Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

communication to hikey via network problems #1392

Closed
Valeri99 opened this issue Mar 6, 2017 · 10 comments
Closed

communication to hikey via network problems #1392

Valeri99 opened this issue Mar 6, 2017 · 10 comments

Comments

@Valeri99
Copy link

Valeri99 commented Mar 6, 2017

Hello,

Why to talk to hikey via network
is so critical for me? That is because so far I have tested three types of
UART-USB adapters (based on CP2101, PL2303HX, PL2303HXD ).
All work in some unstable manner at best.
So, now I am waiting for officially recommended one:
https://www.seeedstudio.com/96Boards-UART-p-2525.html

Good experience:

  1. The use of the kernel and debian images from
    http://builds.96boards.org/releases/hikey/linaro/debian/latest/
    (i.e. of version 20153011-387)
    flashed onto SD or EMMC
    results in normal communication to HiKey via network if
    a) I use USB-Ethernet adapters of any of two types which I typically use
    for my Linux debian systems.
    b) I configure the /etc/network/interfaces e.g. like

    auto eth0
    iface eth0 inet static
    address 10.2.9.60
    netmask 255.255.255.0

    (to be scrupulous)

    The network communications work!

Bad experience:
2) The use of kernel/debian EMMC images from
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/
for EMMC's HiKey flashing with following
usage of mentioned above USB-Ethernet adapters (a) and network configuration (b)
does not allow to get a pingable HiKey.
I.e. HiKey is not communicable via network.
(By the way, I do not see blue leds blinking)

  1. The use of kernel/debian EMMC images from
    https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/
    flashed onto EMMC or SD (the image for SD is present on the page) with following
    usage of mentioned above USB-Ethernet adapters (a) and network configuration (b)
    does not allow to ping HiKey.
    I.e. HiKey is not communicable via network.
    (Now I see blue leds blinking)

It would be very nice to get an advice how to fix images from
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/
to make them to provide network communications via USB-Ethernet adapter
as that kindly is provided by the images from:
http://builds.96boards.org/releases/hikey/linaro/debian/latest/
(i.e. of version 20153011-387)

Any help would be very much appreciated.

I also tried to configure wi-fi using static address configuration
for all mentioned above versions but I failed to get a pingable system.
(for dhcp I do not know an address to ping)
E.g. I did that in the /etc/network/interfaces as follows:

allow-hotplug wlan0
iface wlan0 inet static
wpa-ssid "CC2 Wi-Fi"
wpa-psk "USLcksifd"nbCkjdf3000"
address 182.30.9.151
netmask 255.255.248.0

Although I see yellow led blinking (some wi-fi activity)

Thank you.

@vchong
Copy link
Contributor

vchong commented Mar 7, 2017

@Valeri99 For 2 and 3, have you updated the kernel with the ones you built from https://github.com/OP-TEE/build/blob/master/hikey_debian.mk? Also, if you're able to connect the board to an HDMI monitor/tv, you can perhaps try to enable networking via the gui to see if it makes a difference.

For dhcp, you can run ifconfig wlan0 to see what address you got from the dhcp server.

@Valeri99
Copy link
Author

Valeri99 commented Mar 9, 2017

@vchong
I am sorry - I continue to need a help at the same point.
are asking:

For 2 and 3, have you updated the kernel with the ones you built from https://github.com/OP-TEE/build/blob/master/hikey_debian.mk?
I understand that https://github.com/OP-TEE/build/blob/master/hikey_debian.mk in terms of kernel exactly corresponds to (3) from my previous post:
(i.e. corresponds to https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/ )
See:
https://github.com/OP-TEE/build/blob/master/hikey_debian.mk#L29

I.e. I would like to repeat all my statements from my previous post, in particular:
It would be very nice to get an advice how to fix images from
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/
to make them to provide network communications via USB-Ethernet adapter
as that kindly is provided by the images from:
http://builds.96boards.org/releases/hikey/linaro/debian/latest/
(i.e. of version 20153011-387)

Also it would be nice to know why I can not connect to machine via wi-fi
configured with static address like follows:

allow-hotplug wlan0
iface wlan0 inet static
wpa-ssid "CC2 Wi-Fi"
wpa-psk "USLcksifd"nbCkjdf3000"
address 182.30.9.151
netmask 255.255.248.0

Thanks a lot.

@vchong
Copy link
Contributor

vchong commented Mar 9, 2017

The 96boards build are not handled by the people here. You can try to report the issue at http://bugs.96boards.org/. You can see an explanation of the difference between the reference-platform and 'linaro' builds here: https://discuss.96boards.org/t/difference-between-reference-platform-rp-and-linaro/778/2.

For wi-fi with static, there's not really enough info to troubleshoot. What's your network layout, i.e. how is the network designed? What's your wi-fi router configuration? Any other relevant info regarding the network we should know?

@Valeri99
Copy link
Author

I am sorry. I was wrong indeed to address the topic to the OPTEE forum.
As to wi-fi:
I configured wi-fi as dynamic like at the:
https://github.com/OP-TEE/build/blob/master/hikey_debian.mk#L384
Dhcp administrator says the dhcp server periodically receives messages from the
hikey mac address: "receiver not ready"
Thanks.

@vchong
Copy link
Contributor

vchong commented Mar 13, 2017

It's ok. No need to be sorry. In any case, what kind of usb-ethernet adapter are you using? I think the 'linaro' kernel builds are configured so support more adapters (https://github.com/96boards-hikey/linux/blob/hikey-mainline-rebase/arch/arm64/configs/defconfig#L191-L196) compared to the reference-platform builds (https://github.com/96boards/linux/blob/96b/releases/2016.06/arch/arm64/configs/defconfig#L122-L123). You can try rebuilding the reference-platform kernel to include the support of your usb-ethernet adapter if it's not listed.

As to wi-fi, that's still not enough info to troubleshoot. It sounds like you're trying to do this on a corporate network? If so, perhaps you can get some assistance from the IT department regarding the proper network settings.

This works.
auto eth0
iface eth0 inet static
address 10.2.9.60
netmask 255.255.255.0

This doesn't.
allow-hotplug wlan0
iface wlan0 inet static
...
address 182.30.9.151
netmask 255.255.248.0

Can you configure wlan0 to be on the 10.2.9.x network as well?

@Valeri99
Copy link
Author

I have deleted my today's post because it contains wrong statements.

@Valeri99
Copy link
Author

@vchong

Thank you so much.
As to the big difference between 10.2.9.60 and 182.30.9.151 that is because
10.2.9.60 belongs to local network that I made of two machines to detach problems
of corporate network. I will continue to collect details of the corporate wi-fi.

In the meantime, I investigated the USB-Ethernet issue a little more and did interesing observations.
Let me remind that linux images from
http://builds.96boards.org/releases/hikey/linaro/debian/latest/
(i.e. of version 20153011-387)
provide networking via my two USB-Ethernet adapters very well.
By contrast to linux images from
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/
that do not want to provide network with my USB-Ethernet adapters.

One of adapter is of the type dm9601,
another one is of the type cdc_ether.

In terms of kernel modules for USB-Ethernet adapters the linux images from

https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/

look good (see Attachment #1 below)

However, there is something suspicious in the absence of the
/lib/udev/write_net_rules in the
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/
that should generate net rules
(/etc/udev/rules.d/70-persistent-net.rules)
Consequently, the file /etc/udev/rules.d/70-persistent-net.rules
is not generated (the /etc/udev/rules.d is empty at all) for that images

By contrast, everything is OK about net rules files for
version 20153011-387 images where networking via USB adapters is OK.
(see Attachment #2 for the /etc/udev/rules.d/70-persistent-net.rules)

I also copied the file /etc/udev/rules.d/70-persistent-net.rules
from 20153011-387 file system to /16.03/ file system but the
machine is still not pingable when booted with /16.03/ images.

Thanks a lot.

Attachment #1:

The USB_NET kernel configuration of linux images from
https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/

grep USB_NET config-4.4.0-104-arm64

CONFIG_USB_NET_DRIVERS=m
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_NET_CDC_NCM=m
CONFIG_USB_NET_HUAWEI_CDC_NCM=m
CONFIG_USB_NET_CDC_MBIM=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SR9700=m
CONFIG_USB_NET_SR9800=m
CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_RNDIS_HOST=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_NET_ZAURUS=m
CONFIG_USB_NET_CX82310_ETH=m
CONFIG_USB_NET_KALMIA=m
CONFIG_USB_NET_QMI_WWAN=m
CONFIG_USB_NET_INT51X1=m
CONFIG_USB_NET_CH9200=m
CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_USB_NET2272=m
CONFIG_USB_NET2272_DMA=y
CONFIG_USB_NET2280=m

Attachment #2:

----------------------------------------------------------------------------------------------
#This file was automatically generated by the /lib/udev/write_net_rules
#program, run by the persistent-net-generator.rules rules file.
####
#You can modify it, as long as you keep each rule on a single
#line, and change only the value of the NAME= key.

#Unknown net device (/devices/f723f000.dwmmc2/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wl18xx.0.auto/net/wlan0) (wl18xx_driver)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ec:11:27:74:c2:23", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

#USB device 0x:0x (dm9601)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:53:44:59", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

#USB device 0x:0x (cdc_ether)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:36:c7:44", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
----------------------------------------------------------------------------------------------

Attachment #3:
The USB_NET kernel configuration of 20153011-387 images, that work well with
USB-Ethernet adapters:

grep -i USB_NET config-3.18.0-linaro-hikey

CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
#CONFIG_USB_NET_CDC_EEM is not set
CONFIG_USB_NET_CDC_NCM=y
#CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
#CONFIG_USB_NET_CDC_MBIM is not set
CONFIG_USB_NET_DM9601=y
#CONFIG_USB_NET_SR9700 is not set
CONFIG_USB_NET_SR9800=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
#CONFIG_USB_NET_GL620A is not set
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
#CONFIG_USB_NET_RNDIS_HOST is not set
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_NET_ZAURUS=y
#CONFIG_USB_NET_CX82310_ETH is not set
#CONFIG_USB_NET_KALMIA is not set
#CONFIG_USB_NET_QMI_WWAN is not set
#CONFIG_USB_NET_INT51X1 is not set
#CONFIG_USB_NET2272 is not set
#CONFIG_USB_NET2280 is not set 

@vchong
Copy link
Contributor

vchong commented Mar 16, 2017

@Valeri99

You should configure wifi to be on the local network as well to detach problems of corporate network.

Thank you for the detailed analysis!

Attachment 1 is showing that the drivers are built as modules. Do you see any *.ko files under /lib/modules/<kernel version, should be 4.4.0>/kernel/drivers/net/usb/? Perhaps usbnet.ko, dm9601.ko and cdc_ether.ko? If yes, after copying 70-persistent-net.rules, can you try doing 'modprobe usbnet' and 'modprobe dm9601' or 'modprobe cdc_ether' to see if it helps? If not, then you might have to try rebuilding the kernel with those configs set to 'y' instead of 'm'.

Also, please submit a bug to http://bugs.96boards.org/ with the info you provided above and request that they build and release future versions with 70-persistent-net.rules created (or rather /lib/udev/write_net_rules fixed to create it) and also the usb net drivers set to 'y' instead of 'm'.

Good luck!

@Valeri99
Copy link
Author

@vchong

Thanks a lot for your advices.
Eventually I have bypassed the problems of networking via
usb-ethernet adapter.
As I was not able to make tests on the running system
(no serial interface, no network interface), I included
commands into rc.local (with output to files if needed)
e.g. to check if modules were running, to start modules,
to run dmesg, etc.

That is the summary:

At the stage of rc.local:

  1. Network modules and usb-net modules are typically
    not running.
    To get that running there are two options:

    • to do insmod for mii, network, dm9601(e.g.)
    • to sleep for a few seconds.
      (after sleeping a proper usb-net module is started
      -- that seemingly means the udev works good in this way)
  2. Ethernet interface is not brought up.
    (not surprising as modules are not running)
    So I brought it up through ifup.

  3. For (2) to be successful I had also to
    provide proper content of the
    /etc/udev/rules.d/70-persistent-net.rules
    (this file is not generated as /lib/udev/write_net_rules is not present).
    Maybe that is sufficient just to add write_net_rules
    to provide creating the 70-persistent-net.rules (I did not check that).

My feeling about all this is that at the system start the
network interface fails to be brought up as

  • modules are not inserted
  • no net rules file is present
    (I understand that there is an attempt to bring the eth0 up as
    configured in the /etc/init/network-interface.conf)

Maybe my experience will help others to talk to the machine
via network.

Thanks a lot.

@vchong
Copy link
Contributor

vchong commented Mar 20, 2017

You're welcome! For development and debugging, it really helps to have a serial interface. You can get one here: http://www.96boards.org/product/debug/

@Valeri99 Valeri99 closed this as completed Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants