DietPi icon indicating copy to clipboard operation
DietPi copied to clipboard

DietPi-System | C1+ | Issue to setup WLAN device

Open k-plan opened this issue 10 years ago • 90 comments

http://fuzon.co.uk/phpbb/viewtopic.php?f=11&t=368

k-plan avatar Apr 11 '16 15:04 k-plan

@k-plan Thanks for the report :+1: Excellent write up.

I've got 2 different WiFi dongles, i will try them on my C1 and see if I get same results. Might be a few days, but i'll set this to v116 so I dont forget :)

Fourdee avatar Apr 11 '16 17:04 Fourdee

@k-plan Just tried a generic chinatown WiFi adapter. It doesnt appear to work on DHCP. But setting it to static did the trick.

I cant see why this is C1 specific. dietpi-config uses the same code to control the adapters. It may be a bug in the kernel/modules, or even DietPi. I'll do some more testing and see if we can find the cause.

Fourdee avatar Apr 11 '16 18:04 Fourdee

@k-plan What PSU are you using for the C1+?

Fourdee avatar Apr 11 '16 18:04 Fourdee

@Fourdee

What PSU are you using for the C1+?

I have tried different for testing.

Normally I use: Anker PowerPort 10 (60W 10-Port USB) 5V - 2.4A per Port or 12A total.

For special WiFi adapter testing: HN Power HNP18-050 - 5 V/DC 3 A 15 W

As well tested WiFi adapter with a additionally active powered USB hub Logitech H-UE5 with PSU 5 V/DC 2.5 A

Measurement current draw:

  • C1+ after boot - 0.38 A
  • C1+ after boot with active WiFi adapter - 0.51 A

I cant see why this is C1 specific.

It take a long time, until I have notion, to test it on DietPi Raspberry Pi B+. But with this, it works instantly.

a bug in the kernel/modules ...

😢 ... please no .... 😢

It doesnt appear to work on DHCP. But setting it to static did the trick.

Will test it. You will get response.

Thanks for your help. 👍

k-plan avatar Apr 11 '16 19:04 k-plan

@Fourdee

root@oDroid-C1_plus-test:~# lsusb
Bus 001 Device 003: ID 7392:7822 Edimax Technology Co., Ltd
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@oDroid-C1_plus-test:~# lsmod
Module                  Size  Used by
nls_cp437               5134  1
8192cu                523594  0
w1_gpio                 3178  0
wire                   20357  1 w1_gpio
aml_gpio                7315  0
fuse                   72461  1
autofs4                22325  2

Set WiFi to static breaks all my network connections ....

Must do a reboot via keyboard.

After this I tried:

root@oDroid-C1_plus-test:~# ifup wlan0
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not permitted.
Error for wireless request "Set Encode" (8B2A) :
    invalid argument "000test-12345".
RTNETLINK answers: File exists
Failed to bring up wlan0.

000test-12345 is my wireless-key (WEP), but my WiFi network only support WPA2 PSK !

root@oDroid-C1_plus-test:~# dmesg
 . . .
[  332.648763] WARN::hc_xfer_timeout:2719: hc_xfer_timeout: timeout on channel 4
[  332.686034] WARN::hc_xfer_timeout:2721:      start_hcchar_val 0x00d88a00
[  332.723060] WARN::hc_xfer_timeout:2726:      chn-4,ep1-IN:type:2,speed:2,len:15360,addr3

[  370.588842] WARN::hc_xfer_timeout:2719: hc_xfer_timeout: timeout on channel 2
[  370.627114] WARN::hc_xfer_timeout:2721:      start_hcchar_val 0x00d88a00
[  370.664335] WARN::hc_xfer_timeout:2726:      chn-2,ep1-IN:type:2,speed:2,len:15360,addr3

Default locale for the system environment:

root@oDroid-C1_plus-test:~# dpkg-reconfigure locales
Generating locales (this might take a while)...
  en_GB.UTF-8... done
Generation complete.

Hmmm ... think I will start from the scratch.

k-plan avatar Apr 11 '16 20:04 k-plan

@k-plan Did another test on my Edimax:

Bus 001 Device 003: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

Cant get it to connect, but scans fine. Couldn't find anything obvious in dmesg. It seems to fail receiving data during the DHCP request:

root@DietPi:~# ifup wlan0
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not permitted.
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/74:da:38:26:9d:65
Sending on   LPF/wlan0/74:da:38:26:9d:65
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

It looks like a possible kernel issue and/or modules. I found this ticket on the Odroid C1 Kernel: https://github.com/hardkernel/linux/issues/179

When I get some time, I will compile the C1 kernel/modules and retest. If you want to try it also, instructions are here: http://odroid.com/dokuwiki/doku.php?id=en:c1_building_kernel

Fourdee avatar Apr 12 '16 17:04 Fourdee

@Fourdee

Cant get it to connect, but scans fine.

Yes, all my tested adapters do scans fine, but no WiFi link connected.

Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not permitted.

You can try (test): Comment Power Management out in /etc/network/interfaces

and set up : nano /etc/modprobe.d/8192cu.conf

with following content: options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

now: service networking restart (Link)

When I get some time, I will compile the C1 kernel/modules and retest.

Nice, thanks! I have to waiting for this. Sorry, but compile "my own kernel" overcharged me. No skill, hardware or software.

Where is also a rtl8192cu-fixes USB WiFi driver, but I can't get it on work. This hint is form Igor Pečovnik. A well tried his new Odroid C1 Armbian image, but it will not boot for me.

k-plan avatar Apr 12 '16 19:04 k-plan

@Fourdee

don't think it's the module.

ubuntu-14.04.3lts-lubuntu-odroid-c1-20151020 => Edimax EW-7612UAn V2 working with dhcp

root@odroid-c1-Plus-test:~# uname -a
Linux odroid-c1-Plus-test 3.10.96-148 #1 SMP PREEMPT Thu Apr 7 10:45:50 BRT 2016 armv7l armv7l armv7l GNU/Linux

root@odroid-c1-Plus-test:~# modinfo 8192cu
filename:       /lib/modules/3.10.96-148/kernel/backports/drivers/realtek/8192cu/8192cu.ko
version:        v4.0.2_9000.20130911
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
version:        backported from Linux (next-20150129-0-g828f79f) using backports backports-20150129-0-gdd4a670
srcversion:     92ABD77EE49D06D8157B4F8

DietPi_v109_Odroid-C1-(Jessie) auto updated to v115 => Edimax EW-7612UAn V2 not working with dhcp

root@oDroid-C1-Plus-TEST:~# uname -a
Linux oDroid-C1-Plus-TEST 3.10.80 #1 SMP PREEMPT Sun Mar 13 15:50:53 CET 2016 armv7l GNU/Linux

root@oDroid-C1-Plus-TEST:~# modinfo 8192cu
filename:       /lib/modules/3.10.80/kernel/backports/drivers/realtek/8192cu/8192cu.ko
version:        v4.0.2_9000.20130911
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
version:        backported from Linux (next-20150129-0-g828f79f) using backports backports-20150129-0-gdd4a670
srcversion:     92ABD77EE49D06D8157B4F8

k-plan avatar Apr 13 '16 08:04 k-plan

@k-plan

Comment Power Management out in

Yep, that will prevent the error occurring, but theres no harm in having it there. Its used by some adapters.

All DietPi images having the following:

#wifi dongles
echo -e "options 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf
echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf

Prevents those common WiFi modules from going into powersaving mode (up and down, up then down lol).

I'll compile the C1 kernel today. As per you previous post, modules appear identical.

Fourdee avatar Apr 13 '16 09:04 Fourdee

Native compile (CC not setup). Can't get uImage to compile:

root@DietPi:~/linux# make uImage
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CC      scripts/mod/devicetable-offsets.s
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTLD  scripts/mod/modpost
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  CC      drivers/amlogic/display/osd/osd_main.o
drivers/amlogic/display/osd/osd_main.c: In function ‘osd_ioctl’:
drivers/amlogic/display/osd/osd_main.c:382:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    aml_hwc_addr_t para;
    ^
drivers/amlogic/display/osd/osd_main.c:392:11: error: implicit declaration of function ‘osd_wait_vsync_hw’ [-Werror=implicit-function-declaration]
           osd_wait_vsync_hw();
           ^
cc1: some warnings being treated as errors
scripts/Makefile.build:308: recipe for target 'drivers/amlogic/display/osd/osd_main.o' failed
make[4]: *** [drivers/amlogic/display/osd/osd_main.o] Error 1
scripts/Makefile.build:455: recipe for target 'drivers/amlogic/display/osd' failed
make[3]: *** [drivers/amlogic/display/osd] Error 2
scripts/Makefile.build:455: recipe for target 'drivers/amlogic/display' failed
make[2]: *** [drivers/amlogic/display] Error 2
scripts/Makefile.build:455: recipe for target 'drivers/amlogic' failed
make[1]: *** [drivers/amlogic] Error 2
Makefile:803: recipe for target 'drivers' failed
make: *** [drivers] Error 2
root@DietPi:~/linux# find -name "*Image*"
./arch/powerpc/boot/zImage.lds.S
./arch/powerpc/boot/zImage.coff.lds.S
./arch/powerpc/boot/zImage.ps3.lds.S

Code to compile:

apt-get install build-essential git ncurses-dev lzop u-boot-tools -y

git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidc-3.10.y
cd linux
make odroidc_defconfig

#make menuconfig
make -j $(nproc --all)
make -j $(nproc --all) modules

make modules_install

make uImage

cp arch/arm/boot/uImage /boot/
cp arch/arm/boot/dts/meson8b_odroidc.dts /boot/

Fourdee avatar Apr 13 '16 11:04 Fourdee

Restarted from scratch, uImage compiled fine:

Image Name:   Linux-3.10.96
Created:      Wed Apr 13 13:36:17 2016
Image Type:   ARM Linux Kernel Image (lzo compressed)
Data Size:    5466661 Bytes = 5338.54 kB = 5.21 MB
Load Address: 00208000
Entry Point:  00208000
  Image arch/arm/boot/uImage is ready

Fourdee avatar Apr 13 '16 12:04 Fourdee

Same issues with WiFi on this kernel.

Fourdee avatar Apr 13 '16 12:04 Fourdee

@Fourdee

Same issues with WiFi on this kernel.

fu ... :cry: Sorry

Anyway, many thanks for your help and support. :+1:

Does cursor work on display with this kernel? If you like, give me your kernel. I will test it for cursor issue.

k-plan avatar Apr 13 '16 13:04 k-plan

@k-plan Running headless.

Once I finished this compile (did some testing), i'll upload it.

Fourdee avatar Apr 13 '16 13:04 Fourdee

@k-plan It might be worth trying Meveric's image (which DietPi for C1 is based on). Just to see if we can replicate the issue. http://forum.odroid.com/viewtopic.php?f=96&t=17542#p114709.

Fourdee avatar Apr 13 '16 13:04 Fourdee

@Fourdee

yes, I can do so, but really Meveric's image you linked to?
It is: Debian-Jessie-1.0~RC2-20151123-XU3.img.xz

Or do you like : http://forum.odroid.com/viewtopic.php?f=114&t=17569 Debian-Jessie-1.0-20160131-C1.img.xz

Sorry, but only to be sure ...

k-plan avatar Apr 13 '16 14:04 k-plan

@k-plan Yep my bad, long day: http://forum.odroid.com/viewtopic.php?f=114&t=17569

Fourdee avatar Apr 13 '16 14:04 Fourdee

@k-plan Uploaded zip http://dietpi.com/downloads/testing/

Not sure about /boot/uInitrd. It wasn't compiled (check modified date), or mentioned anywhere in the documentation: http://odroid.com/dokuwiki/doku.php?id=en:c1_building_kernel

Fourdee avatar Apr 13 '16 15:04 Fourdee

@Fourdee

Yep my bad, long day

No problem, here as well.

Debian-Jessie-1.0-20160131-C1.img => downloaded with 64 kb/s !!! (what a mess)

root@odroid-jessie:~# uname -a
Linux odroid-jessie 3.10.80 #17 SMP PREEMPT Sat Oct 31 12:44:33 CET 2015 armv7l GNU/Linux

root@odroid-jessie:~#
Message from syslogd@localhost at Apr 14 18:11:48 ...
 kernel:[  243.938657@1] Kernel panic - not syncing: hung_task: blocked tasks

 [  663.414395] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[  663.667936] usbcore: registered new interface driver rtl8192cu

Done: "root@odroid-jessie:~# iwlist wlan0 scanning " => works! 👍


Done: " iface wlan0 inet dhcp "

root@odroid-jessie:~# ifup wlan0
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not permitted.
Error for wireless request "Set Encode" (8B2A) :
    invalid argument "Not_Set".
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/74:da:38:23:1c:aa
Sending on   LPF/wlan0/74:da:38:23:1c:aa
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 2
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

👎


Done: " iface wlan0 inet static "

root@odroid-jessie:~# ifup wlan0
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not permitted.
RTNETLINK answers: File exists

👎


All tests as well tested with another WiFi-Roter (Channel 4) to connect => also fail! 👎

.... deleting image: Debian-Jessie-1.0-20160131-C1.img

k-plan avatar Apr 14 '16 19:04 k-plan

Testing kernel with DietPi v115

root@oDroid-C1-Plus-TEST:~# uname -a
Linux oDroid-C1-Plus-TEST 3.10.96 #2 SMP PREEMPT Wed Apr 13 15:35:19 BST 2016 armv7l GNU/Linux

As well missing/invisible cursor on monitor/display !

Cant get it to connect ip via dhcp or static, but scans fine. As well no connect to second Test WFfi-Router.

result: forget Wifi, WiFi HotSpot or TOR HotSpot on Odroid C1+ (for the moment) If you want/need it, better will buy a Raspberry Pi.

@Fourdee Sad, not to be able to get it on work. But it is not your fault. Sorry, you have done more than enough. I have fiddling around with a lot images/distris for Odroid C1 in the past days. Thus, I can tell you, DietPi is the best and noobs frindly in my hand so far. Forget WiFi support on C1 for v.116. Maybe there is another in future, perhaps armbian. We will see.

Not sure about /boot/uInitrd.

You can have a look here, but I don't know if it is helpful. http://forum.odroid.com/viewtopic.php?f=111&t=7965#p61873

root@oDroid-C1-Plus-TEST:~# /etc/kernel/postinst.d/initramfs-tools 3.10.96
update-initramfs: Generating /boot/initrd.img-3.10.96
Image Name:   uInitrd
Created:      Thu Apr 14 18:51:43 2016
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    3887133 Bytes = 3796.03 kB = 3.71 MB
Load Address: 00000000
Entry Point:  00000000
/etc/initramfs-tools/scripts/local-top/c1_init.sh: 24: /etc/initramfs-tools/scripts/local-top/c1_init.sh: cannot create /sys/class/ppmgr/ppscaler: Directory nonexistent
/etc/initramfs-tools/scripts/local-top/c1_init.sh: 83: /etc/initramfs-tools/scripts/local-top/c1_init.sh: cannot create /sys/class/net/eth0/queues/rx-0/rps_flow_cnt: Directory nonexistent
/etc/initramfs-tools/scripts/local-top/c1_init.sh: 84: /etc/initramfs-tools/scripts/local-top/c1_init.sh: cannot create /sys/class/net/eth0/queues/rx-0/rps_cpus: Directory nonexistent
/etc/initramfs-tools/scripts/local-top/c1_init.sh: 85: /etc/initramfs-tools/scripts/local-top/c1_init.sh: cannot create /sys/class/net/eth0/queues/tx-0/xps_cpus: Directory nonexistent

k-plan avatar Apr 14 '16 19:04 k-plan