@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 :)
@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.
@k-plan
What PSU are you using for the C1+?
@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:
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. π
@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
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
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.
@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
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.
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/
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
Same issues with WiFi on this kernel.
@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
Running headless.
Once I finished this compile (did some testing), i'll upload it.
@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
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
Yep my bad, long day:
http://forum.odroid.com/viewtopic.php?f=114&t=17569
@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
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
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
Found the issue :+1: Always the simple things, cant believe I missed it.
I compared Wifi packages across C1 and C2. Seems we were missing some on the C1 (most importantly the wpasupplicant, iw):
C2
root@DietPi:~# dpkg -l | grep wire
ii crda 3.13-1 arm64 wireless Central Regulatory Domain Agent
ii firmware-atheros 0.43 all Binary firmware for Atheros wireless cards
ii firmware-brcm80211 0.43 all Binary firmware for Broadcom 802.11 wireless cards
ii firmware-ralink 0.43 all Binary firmware for Ralink wireless cards
ii firmware-realtek 0.43 all Binary firmware for Realtek wired and wireless network adapters
ii iw 3.17-1 arm64 tool for configuring Linux wireless devices
ii wireless-regdb 2014.11.18-1 all wireless regulatory database
ii wireless-tools 30~pre9-8 arm64 Tools for manipulating Linux Wireless Extensions
root@DietPi:~# dpkg -l | grep wpa
ii wpasupplicant 2.3-1+deb8u3 arm64 client support for WPA and WPA2 (IEEE 802.11i)
Install the following missing packages on your C1, reboot, then try reconnecting wifi
apt-get install wireless-regdb iw crda wpasupplicant
root@DietPi:~# ifup wlan0
Error for wireless request "Set Power Management" (8B2C) :
SET failed on device wlan0 ; Operation not permitted.
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
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 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.0.1
DHCPACK from 192.168.0.1
bound to 192.168.0.101 -- renewal in 686767077 seconds.
@k-plan
Ran a 2nd test to confirm, working fine.
The missing packages will be installed during the patch in the v116 update.
If you can confirm the issue is resolved for you also, let me know so we can close this ticket :+1:
@Fourdee (Coding Beast π )
Found the issue :+1: Always the simple things, cant believe I missed it.
Will it be so easy? I can't believe.
Clean automate install from the scratch is running now.
But http://oph.mdrjr.net/ is so slow (max. 64 kB/s)
Yes, I have tested before to install iw and same other wireless/wifi packages without success.
On Meveric's image I have to install, iw, usb-tools, wireless-tools and same more, to get scanning on work.
wireless-regdb , crda I have never install. I will test it.
@Fourdee
apt-get install wireless-regdb iw crda wpasupplicant
Because it is v.109, configuration with keyboard and monitor as infrastructure wifi network with dhcp.
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 "test-12345".
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
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 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.88.1
DHCPACK from 192.168.88.1
bound to 192.168.88.50 -- renewal in 233 seconds.
it works! π
Update to v.116:
root@oDroid-C1-Plus-Test:~# dietpi-update
After reboot configuration wifi with dhcp via dietpi-config
and scanning:
It works! π π
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 "test-12345".
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
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 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.88.1
DHCPACK from 192.168.88.1
bound to 192.168.88.50 -- renewal in 233 seconds.
Configuration wifi with static IP via dietpi-config
and scanning:
root@oDroid-C1-Plus-Test:~# ifdown wlan0
ifdown: interface wlan0 not configured
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 "test-12345".
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Error: an inet prefix is expected rather than "Adresse:192.168.88.100/Maske:255.255.255.0".
Failed to bring up wlan0.
π’ π
@Fourdee
Now installed DietPi WiFi HotSpot. Tested. Works! π π
Installed DietPi Tor WiFi Hotspot. Tested. Works! π π
Should I test some of the other USB Wireless adapters?
@k-plan
Thanks for the results :+1:
Configuration wifi with static IP via dietpi-config and scanning:
https://cloud.githubusercontent.com/assets/17237601/14573615/64fa46fa-0356-11e6-9390-7536ab7ee562.gif
Looks like a possible locale + grep
issue we might need to fix. Static addresses shouldn't be pulling in any text, just the IP. Can you set this to static, apply, exit, then paste results of /etc/network/interfaces
.
Also, what locale are you running? (eg: en_GB, de_DE)
@k-plan
Did some testing, appears we need to apply the same fix we did here: https://github.com/Fourdee/DietPi/issues/233#issuecomment-196413520.
By forcing en_GB
, all our grep parsing (which is based on English) should work regardless of system locale.
#!/bin/bash
LANG=en_GB.UTF-8
ifconfig
test(){
ifconfig
date
}
test
So I'am going to look at adding LANG=en_GB.UTF-8
to all the DietPi scripts.
@k-plan
Ok, we will start with the main scripts 1st:
dietpi-config dietpi-software dietpi-cloudshell
Has been added to testing branch: https://github.com/Fourdee/DietPi/commit/aaf33009c717b42cab74353c0324590dbd8af182
I'll run some tests my end. If you can do a fresh install and test the static IP's again, i'd be greatful.
@k-plan
Working fine my end using de_DE
system locale (minus the UTF char visual issues with whiptail):
@Fourdee
sorry for delay. Saturday = shopping and family-visit-day.
Also, what locale are you running? (eg: en_GB, de_DE)
Last testing : de_DE , en_GB, C
All before: without touching dpkg-reconfigure locales
so it was en_GB (Dietpi) or en_US (Meveric's image) or en_AU (Ubuntu Odroid)
/etc/network/interfaces
Content is the same, equal of change in locales.
Testing with en_GB and wifi static IP (v.116) via dietpi-config:
(and where are some red messages at the end, while restarting the network. But I can't read it so quick)
root@oDroid-C1-Plus-Test:~# ifdown wlan0
ifdown: interface wlan0 not configured
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 "test-12345".
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
RTNETLINK answers: File exists
Failed to bring up wlan0.
root@oDroid-C1-Plus-Test:~# cat /etc/network/interfaces
#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.
# Local
auto lo
iface lo inet loopback
# Ethernet
auto eth1
iface eth1 inet static
address 192.168.0.54
netmask 255.255.255.0
gateway 192.168.0.3
dns-nameservers 192.168.0.3 192.168.0.1
# Wifi
auto wlan0
iface wlan0 inet static
address 192.168.88.101
netmask 255.255.255.0
gateway 192.168.88.1
wireless-essid T2-Net
wireless-key test-12345
wireless-mode Managed
wireless-power off
wpa-ssid T2-Net
wpa-psk test-12345
dns-nameservers 192.168.88.1
TWO active DNS server?
If you can do a fresh install and test the static IP's again, i'd be greatful.
Will do, but this will have some time, because of the slow kernel update from http://oph.mdrjr.net/ ...
@Fourdee
comment wifi dns-nameservers out by hand and restart networking:
root@oDroid-C1-Plus-Test:~# service networking restart
root@oDroid-C1-Plus-Test:~# ifdown wlan0
ifdown: interface wlan0 not configured
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 "test-12345".
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
RTNETLINK answers: File exists
Failed to bring up wlan0.
Starting from the scratch now ....
@Fourdee
running automated installation (without WiFi adapter plugged in). Kernel panic and freeze while automated apt-get update ...
manual power cycle
and (without WiFi adapter plugged in) the next Kernel panic and freeze ....
trying now: manual installation and dietpi_check_for_updates=0
install without automated to v.109. Set static IP for eth1. Finished installation. Update to v115. Reboot.
manual setting and update to testing branch. Reboot.
After restart plugged in Edimax EW-7612UAn V2 . It will not recognize.
[ 9.069219] [adjust link] -> eth: full-duplex
[ 9.070037] [adjust link] -> eth: phy_speed <> priv_speed)
[ 9.070960] [adjust link -> eth: am_adjust_link state change (new_state=true)
[ 9.072049] libphy: 0:01 - Link is Up - 1000/Full
[ 9.072955] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
root@DietPi:~# lsusb
Bus 001 Device 003: ID 045e:0800 Microsoft Corp.
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@DietPi:~# lsmod
Module Size Used by
nls_cp437 5134 1
w1_gpio 3178 0
wire 20357 1 w1_gpio
aml_gpio 7315 0
fuse 72461 1
autofs4 22325 2
Starting dietpi-config
:
and ... Kernel panic and freeze .... manual power cycle
@k-plan
sorry for delay. Saturday = shopping and family-visit-day.
No worries, family comes 1st and enjoy the weekend :+1:
If you are getting Kernel panics and freezing, sounds like your SDcard is corrupt and/or PSU instability. This shouldn't be occurring. I'd suggest trying another SDcard if you can. If not, a picture of the screen with those errors on would be helpful to try and debug it.
@Fourdee
After a reboot with plugged in Edimax EW-7612UAn V2, starting dietpi-config:
enable WiFi, set only static IP, mask and gateway, scanning (works) but nothing.
Yes, it is all default, no changing any stetting, language, install extra software. Only things i have done, set a static IP on eth1 and update to testing branch.
root@DietPi:~# dpkg-reconfigure locales
Generating locales (this might take a while)...
en_GB.UTF-8... done
Generation complete.
root@DietPi:~# uname -a
Linux DietPi 3.10.80 #1 SMP PREEMPT Sun Mar 13 15:50:53 CET 2016 armv7l GNU/Linux
root@DietPi:~# cat /DietPi/dietpi/.version
116
Wifi with DHCP is working, but only you done it twice via dietpi-config
:
1.)
root@DietPi:~# ip a
. . .
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 74:da:38:73:2c:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.0.100/24 brd 192.168.0.255 scope global wlan0
valid_lft forever preferred_lft forever
inet 192.168.88.100/24 brd 192.168.88.255 scope global wlan0
valid_lft forever preferred_lft forever
inet 192.168.88.50/24 brd 192.168.88.255 scope global secondary wlan0
valid_lft forever preferred_lft forever
inet6 fe80::76da:38ff:fe73:2caa/64 scope link
valid_lft forever preferred_lft forever
2.)
root@DietPi:~# ip a
. . .
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 74:da:38:73:2c:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.88.50/24 brd 192.168.88.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::76da:38ff:fe73:2caa/64 scope link
valid_lft forever preferred_lft forever
PSU instability.
Sorry, no. (siehe oben)
SDcard is corrupt
No, it's the same, I used manny times before (ScanDisk Ultra 16GB). And yes, I formatting the SDcard every time before writting a image on it.
But only you be sure, I will use a other now. But it is the last try for now ...
@k-plan
No worries, leave it with me. I'll run a few tests my end.
@Fourdee
please don't miss understand me, i really want to help, to get it on work.
Sorry , a long day and English not my preferred language. So it is really difficult for me.
Please make your choice:
π
@k-plan
Nice collection, Sandisk Extreme looking nice :+1: You want to see mine? :)
I understand and appreciate the help :). I just want to make sure you are testing the right areas. At the moment i'am doing all the DietPi images which takes time and all my concentration: https://github.com/Fourdee/DietPi/issues/278#issue-148344897.
Once they are done, I will come back here and refresh my memory on what it is I would like you to test. Not to waste your time :)
Edit: Also, I can give you the latest C1 image, save you having to update kernel each time :)
@Fourdee
Sandisk Extreme looking nice
yes, nice looking, but a lot of freeze and kernel panic
You want to see mine? :)
Yes for sure.
But then I had to turn out the rest of my sd-cards, who are in use on my other devices.
Sorry, only joke around. π
Not to waste your time :)
Do nothing but whine here , is as well waste of time.
So I choice SD-Card Verbatin 8GB, the slowest in the sample.
nano /DietPi/dietpi.txt
with gitbranch=testing
, then dietpi-update
v.115 => v.116Please reboot your system, using the command reboot
but done a poweroff
and plugged in my Edimax EW-7612UAn V2[ 3.334554] checked enable EXT4 DISCARD here
[ 3.336610] EXT4-fs (mmcblk0p2): mounting with "discard" option, but the device does not support discard
[ 3.338645] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
. . .
[ 5.569889] usbcore: registered new interface driver rtl8192cu
root@DietPi:~# lsusb
Bus 001 Device 004: ID 045e:0800 Microsoft Corp.
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@DietPi:~# lsmod
Module Size Used by
nls_cp437 5134 1
8192cu 540446 0
w1_gpio 3178 0
wire 20357 1 w1_gpio
aml_gpio 7315 0
fuse 72461 1
autofs4 22325 2
looks fine (for me)
dietpi-config
and enable WiFi adapterScan and Connect
with DHCP => works!Scan and Connect
with static IP => nothing[ 571.220545] rtw_wx_set_mlme
[ 571.224316] rtw_wx_set_mlme, cmd=0, reason=3
[ 572.918064] rtw_wx_set_mlme
[ 572.919617] rtw_wx_set_mlme, cmd=0, reason=3
root@DietPi:~# ifdown wlan0
ifdown: interface wlan0 not configured
root@DietPi:~# 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 "test-12345".
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
RTNETLINK answers: File exists
Failed to bring up wlan0.
root@DietPi:~# ip a
. . .
5: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 74:da:38:73:2c:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.88.101/24 brd 192.168.88.255 scope global wlan0
valid_lft forever preferred_lft forever
root@DietPi:~# cat /etc/network/interfaces
#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.
# Local
auto lo
iface lo inet loopback
# Ethernet
auto eth1
iface eth1 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4
# Wifi
auto wlan0
iface wlan0 inet static
address 192.168.88.101
netmask 255.255.255.0
gateway 192.168.88.1
wireless-essid T2-Net
wireless-key test-12345
wireless-mode Managed
wireless-power off
wpa-ssid T2-Net
wpa-psk test-12345
dns-nameservers 8.8.8.8 8.8.4.4root@DietPi:~#
Is it possible, that line break is missing in /etc/network/interfaces
?
Once they are done, I will come back here and refresh my memory on what it is I would like you to test.
Yes, please do so. I will go to make a fresh coffee now. π
@k-plan
- Scan and Connect with static IP => nothing
Are you able to ping the ip address?
Although ip a
reports the wlan0 adapter being "down", I can ping the IP address assigned to the adapter. Strange.
@Fourdee
Are you able to ping the ip address?
root@DietPi:~# ping 192.168.88.101
PING 192.168.88.101 (192.168.88.101) 56(84) bytes of data.
64 bytes from 192.168.88.101: icmp_seq=1 ttl=64 time=0.074 ms
64 bytes from 192.168.88.101: icmp_seq=2 ttl=64 time=0.453 ms
64 bytes from 192.168.88.101: icmp_seq=3 ttl=64 time=0.738 ms
64 bytes from 192.168.88.101: icmp_seq=4 ttl=64 time=0.484 ms
64 bytes from 192.168.88.101: icmp_seq=5 ttl=64 time=0.458 ms
64 bytes from 192.168.88.101: icmp_seq=6 ttl=64 time=0.450 ms
64 bytes from 192.168.88.101: icmp_seq=7 ttl=64 time=0.444 ms
^C
--- 192.168.88.101 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6009ms
rtt min/avg/max/mdev = 0.074/0.443/0.738/0.179 ms
root@DietPi:~#
Yes, but this indicate only that ip stack is running correct, not interface wlan0 it self.
from outside (Wifi-Router)
[admin@RB_mAP-lite] > ping 192.168.88.101
SEQ HOST SIZE TTL TIME STATUS
0 192.168.88.101 timeout
1 192.168.88.101 timeout
2 192.168.88.101 timeout
3 192.168.88.101 timeout
4 192.168.88.101 timeout
5 192.168.88.101 timeout
6 192.168.88.101 timeout
7 192.168.88.101 timeout
8 192.168.88.101 timeout
9 192.168.88.101 timeout
10 192.168.88.101 timeout
11 192.168.88.101 timeout
sent=12 received=0 packet-loss=100%
No. Make sense, because wlan0 interface is not in registration table of AP.
to be really sure:
root@DietPi:~# apt-get install tcpdump
root@DietPi:~# tcpdump -i wlan0
tcpdump: wlan0: That device is not up
_edit:_ have done another look in dmesg after:
[ 564.612399] libphy: 0:01 - Link is Up - 1000/Full
[ 564.638256] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 571.035407] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 571.167835] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 571.220545] rtw_wx_set_mlme
[ 571.224316] rtw_wx_set_mlme, cmd=0, reason=3
[ 572.918064] rtw_wx_set_mlme
[ 572.919617] rtw_wx_set_mlme, cmd=0, reason=3
[ 680.656040] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 680.688424] rtw_wx_set_mlme
[ 680.690094] rtw_wx_set_mlme, cmd=0, reason=3
[ 4771.034445] TCP checksum Error rx desc-mask[4096]
[ 6772.513901] TCP checksum Error rx desc-mask[4096]
[ 8149.610514] TCP checksum Error rx desc-mask[4096]
[11150.863442] TCP checksum Error rx desc-mask[4096]
[12845.666038] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[12847.204348] rtw_wx_set_mlme
[12847.205857] rtw_wx_set_mlme, cmd=0, reason=3
@k-plan
Thanks :+1:
Just to confirm, when you reboot with static IP, it works fine?
This should be all we need. Its already in dietpi-config
but has no effect to static IP on wifi.
systemctl restart networking.service
@Fourdee
root@DietPi:~# reboot
root@DietPi:~# ip a
. . .
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 74:da:38:73:2c:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.88.101/24 brd 192.168.88.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::76da:38ff:fe73:2caa/64 scope link
valid_lft forever preferred_lft forever
root@DietPi:~# ping 192.168.88.1
PING 192.168.88.1 (192.168.88.1) 56(84) bytes of data.
64 bytes from 192.168.88.1: icmp_seq=1 ttl=64 time=22.7 ms
64 bytes from 192.168.88.1: icmp_seq=2 ttl=64 time=14.7 ms
64 bytes from 192.168.88.1: icmp_seq=3 ttl=64 time=14.2 ms
64 bytes from 192.168.88.1: icmp_seq=4 ttl=64 time=14.3 ms
64 bytes from 192.168.88.1: icmp_seq=5 ttl=64 time=12.9 ms
^C
--- 192.168.88.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4009ms
rtt min/avg/max/mdev = 12.928/15.789/22.758/3.538 ms
[ 10.674298] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 15.313900] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 16.762384] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[admin@RB_mAP-lite] > ping 192.168.88.101
SEQ HOST SIZE TTL TIME STATUS
0 192.168.88.101 56 64 14ms
1 192.168.88.101 56 64 12ms
2 192.168.88.101 56 64 30ms
3 192.168.88.101 56 64 11ms
4 192.168.88.101 56 64 15ms
5 192.168.88.101 56 64 8ms
6 192.168.88.101 56 64 13ms
sent=7 received=7 packet-loss=0% min-rtt=8ms avg-rtt=14ms max-rtt=30ms
Why is reboot obligation?
@k-plan
Thanks. Think i've found the cause. Only 1 gateway entry is needed, 2 is whats preventing wlan0 up.
Can you:
/etc/network/interfaces
and comment out #gateway 192.168.0.1
under wlan0
dietpi-config
set dhcp, applydietpi-config
set static, applydietpi-config
@Fourdee
root@DietPi:~# cat /etc/network/interfaces
#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.
# Local
auto lo
iface lo inet loopback
# Ethernet
auto eth1
iface eth1 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4
# Wifi
auto wlan0
iface wlan0 inet static
address 192.168.88.101
netmask 255.255.255.0
## gateway 192.168.88.1
wireless-essid T2-Net
wireless-key test-12345
wireless-mode Managed
wireless-power off
wpa-ssid T2-Net
wpa-psk test-12345
dns-nameservers 8.8.8.8 8.8.4.4
after:
root@DietPi:~# cat /etc/network/interfaces
#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.
# Local
auto lo
iface lo inet loopback
# Ethernet
auto eth1
iface eth1 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4
# Wifi
auto wlan0
iface wlan0 inet static
address 192.168.88.101
netmask 255.255.255.0
## gateway gateway
wireless-essid T2-Net
wireless-key test-12345
wireless-mode Managed
wireless-power off
wpa-ssid T2-Net
wpa-psk test-12345
dns-nameservers 8.8.8.8 8.8.4.4
@Fourdee
but what will happened, if I plugged eth1 out or disable it?
root@DietPi:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.16.10.3 0.0.0.0 UG 0 0 0 eth1
172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.88.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
but what will happened, if I plugged eth1 out or disable it?
I assume both eth0 and/or wlan0 when static will share a single gateway=
entry. I'll need to test it.
Edit: Yep, it does. Disabled eth0, wlan0 still using the static gateway.
So i'll need to change the DietPi code to allow for a single shared gateway=
entry when both, or 1 adapter is static.
Will work in your network (example):
eth1: 192.168.0.100/24
wlan0: 192.168.0.200/24
GW: 192.168.0.1
DNS: 192.168.0.1, 8.8.8.8
DHCP-Server: 192.168.0.1
(Wifi) Router: 192.168.0.1/24
If you have a network with a Router and, for example, with a guest WLAN and segregate DHCP / IP address block (example: 10.0.0.0/24), you will need to configure two gateways.
@Fourdee
But for now (v.116) it is okay! π
leave it as it is and do your release. Let's do the rest later.
It's more than enough for today. π
And have some fun now.
_Note (for me or whomever):_
Useful Things / Idea:
_1. WiFi HotSpot_
_2. TOR HotSpot_
_3. PiHole_
@Fourdee
Edit: Yep, it does. Disabled eth0, wlan0 still using the static gateway.
Hmm ... please can you show ip a
and route -n
?
So i'll need to change the DietPi code to allow for a single shared gateway= entry when both, or 1 adapter is static.
Hmm .. if ready, please give it to me. I like to test it. Thanks.
@Fourdee
Think i've found the cause. Only 1 gateway entry is needed, 2 is whats preventing wlan0 up.
hmm ... please have a look here: Debian Network setup
especially:
https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_ifmetric_package
root@oDroid-C1-Plus-Test:~# apt-get install ifmetric
then set an option line with "metric 0
" just below the "iface eth1 inet static
" line
and an option line with "metric 1
" just below the "iface wlan0 inet static
" line
in "/etc/network/interfaces
".
Controlling network interface only works via ifdown eth1
or ifup wlan0
.
( service networking restart
fail, dietpi-config
partially ruin the new config)
Now you can run tests (e.g. ping, trace, wget, digg, nslookup ...), switching network interfaces on and off.
You will run into problems, if you have set dns-nameservers
in both iface
to the same ip addresses.
(e.g.ifup wlan0
fail , look into cat /etc/resolv.conf
)
I have run some tests with static ip addresses on eth1 and wlan0, then they are in the same broadcast domain (e.g. 192.168.0.0/24). I think, it's your preferred scenario, which you will be able to test in your home network.
.
_BTW: You have a amazon wish list? Can/will you please post/send me a link? Thanks!_
@k-plan
Did some testing today and 1 gateway entry is not a fix. Its just a workaround to get a wifi static adapter to come up when eth is up. Each device needs it own gateway
entry when static, else, the device that doesn't have it set in /etc/network/interfaces
will not be able to route traffic.
I'll look into your metric suggestion and see what comes up :+1: For now, I'll mark this as a known issue in v116 and leave this ticket open for v117.
My amazon wish list is private, its full of baby stuff, why do you want it? lol
@Fourdee
its full of baby stuff
no thanks. π
why do you want it?
Do you want no geek stuff? :flushed:
PayPal feel too non-personal for me. But anyway, forget it. For now. :wink:
@k-plan
I main use amazon to buy nappies, wet wipes and all that general stuff lol. RS and Hardkernel for everything "gadget".
@k-plan
The ifmetric addition you mentioned seemed to have resolved the issue :+1: :
So it looks like this resolves the issue of incorrect IP/routing on wlan0, when using both adapters and wlan0 as static.
As far as I can tell, problem solved. Can you try ifmetric on your system, just to confirm it fixes the issue? All I did was add metric 0
under eth, metric 1
under wlan, in /etc/network/interfaces
as per your suggestion.
@Fourdee
only tested on Odroid C1+.
1.) connect to the same network segment ( layer-2 broadcast domain) e.g. 192.168.0.0/24
2.) connect to two different network segment ( layer-2 broadcast domains) e.g. 192.168.0.0/24 and 10.0.0.0/24
Not tested with WiFi HotSpot and Tor WiFi Hotspot.
Not tested on other devices, like C2, XU4 , RPis, VM, OrangePi, PINE 64
Sometimes you will run into problems, if dietpi-config
have set (active) dns-nameservers on both iface, especially to the same dns server ip addresses. (e.g.ifup wlan0 fail , look into cat /etc/resolv.conf)
DonΒ΄t know, why dietpi-config
did this sometimes.
Controlling network interface only works via ifdown eth1 or ifup wlan0 .
( service networking restart fail, dietpi-config
partially ruin the new config)
(_and OT dietpi-config
ruin my manual ipv6 setting in /etc/network/interfaces
if I have added metric
to each interface_)
Is it in the testing branch for now?
Which testing scenario should we focus first?
@k-plan
Thanks.
Is it in the testing branch for now?
Not currently, i'll add it in today so we can test.
and OT dietpi-config ruin my manual ipv6 setting in /etc/network/interfaces if I have added metric to each interface
What manual setting did you use for ipv6?
@k-plan
ifmetric is in testing branch: https://github.com/Fourdee/DietPi/commit/3d3668b48eb3fceced2dec1dc7fd5f4766a11999
@Fourdee
Not currently, i'll add it in today so we can test.
Very nice, thanks! :blush: I will make a fresh install on C1+ and give it a shot.
What manual setting did you use for ipv6?
This: #212
@Fourdee
only do a quick test on a fresh install with DHCP/DHCP and static IP/DHCP connect to the same broadcast domain. It's working per ifup/ifdown.
But it seems, we have do do some work. If you e.g. plugged in or out the ethernet cable. It's freeze the network connections. (because e.g. route = static metric0 on eth1)
Where is no reaction to carrier loss.
Did some quick research, but I'm in hurry.
Please have a look:
http://natisbad.org/dyn-net/index.html
... or something similar like this (w/o using NetworkManager):
https://packages.debian.org/jessie/ifplugd
https://packages.debian.org/jessie/netplug
http://linux.die.net/man/8/netplugd
http://www.red-bean.com/~bos/
.. or get a simple and good NetworkManager for CLI using /etc/network/interfaces
advisement (for me):
But it seems, we have do do some work. If you e.g. plugged in or out the ethernet cable. It's freeze the network connections. (because e.g. route = static metric0 on eth1)
It will do that regardless of metric or not. To support hotplug, you need to change the auto eth0
reference to allow-hotplug eth0
.
@Fourdee
To support hotplug, you need to change the
auto eth0
reference toallow-hotplug eth0
.
Hmmm... have you test it?
By my testing it doesn't work. If iface not going through ifup
- ifdown
, it will not switch the route.
Seems, metric
is matches first.
@k-plan
ifup - ifdown , it will not switch the route.
I'll run some tests tomorrow, how are you testing the route, traceroute? I'd like to replicate your tests.
@Fourdee
ping -s 1500 192.168.0.100
wlan0 and eth1 ping -s 1500 192.168.0.200
ip of C1 from router/PC and ping simultaneously from C1 to ping -s 1500 dietpi.com.
(example)
But simple test:
allow-hotplug eth1
dhcp or static ip (active and working)auto wlan0
dhcp (active and working)if ifup
/ ifdown
eth1
andwlan0
is working. ping must going on with a short break.-> poweroff
-> unplug Ethernet cable
-> power on the device
Can you now connect to wlan0 ip per ssh?
Look on you access-point. wlan0 MAC-address is registered and connected.
This should be the scenario user wanted to have working, if I don't got it all wrong.
@k-plan
Thanks for the info :+1:
I couldn't get round to this today, so apologies for that. I'll give it a spin first chance I get tomorrow.
@k-plan
I've also been meaning to post this picture for the last week lol:
^ looks my lab, but no complaints as it took long enough to get back into free time!
@k-plan
But simple test:
allow-hotplug eth1 dhcp or static ip (active and working)
auto wlan0 dhcp (active and working)
test if ifup / ifdown eth1andwlan0 is working. ping must going on with a short break.
-> poweroff
-> unplug Ethernet cable
-> power on the device
Can you now connect to wlan0 ip per ssh?
eth = dhcp
wlan = static
Unplugged eth and rebooted. I can ping wlan fine. As far as I can see, implementing ifmetric has no negative effects.
Is there any more tests you can think of that can replicate any issues?
Hehehe - try and bond the two interfaces (no, seriously DO NOT).
@Fourdee
eth1 and wlan are connected to same Layer2 Network (e.g 192.168.0.0/24)
# Ethernet
allow-hotplug eth1
iface eth1 inet static
metric 0
# Wifi
auto wlan0
iface wlan0 inet dhcp
metric 1
ifdown eth1
ifup eth1
poweroff
-> unplug Ethernet cable
-> switch on power supply
-> boot up C1 complete
-> plugin Ethernet cable
@Fourdee
eth1 and wlan are connected to same Layer2 Network (e.g 192.168.0.0/24)
# Ethernet
auto eth1
iface eth1 inet static
metric 0
# Wifi
auto wlan0
iface wlan0 inet dhcp
metric 1
ifdown eth1
ifup eth1
poweroff
-> unplug Ethernet cable
-> switch on power supply
-> boot up C1 complete
-> plugin Ethernet cable
@Fourdee
eth1 and wlan are connected to same Layer2 Network (e.g 192.168.0.0/24)
# Ethernet
auto eth1
iface eth1 inet static
metric 0
# Wifi
auto wlan0
iface wlan0 inet dhcp
metric 1
root@oDroid-C1-TEST:~# ifdown eth1
root@oDroid-C1-TEST:~# dmesg
. . .
[ 311.539637] NET DMA is stopped, ETH_DMA_Status=8502!
[ 311.596153] eth1: closed
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 1 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 1 0 0 wlan0
root@oDroid-C1-TEST:~# ifup eth1
root@oDroid-C1-TEST:~# dmesg
. . .
[ 345.341681] eth1: opened (irq 40).
[ 349.338586] [adjust link] -> eth: full-duplex
[ 349.345851] [adjust link] -> eth: phy_speed <> priv_speed)
[ 349.353250] [adjust link -> eth: am_adjust_link state change (new_state=true)
[ 349.360977] libphy: 0:01 - Link is Up - 1000/Full
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 1 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 1 0 0 wlan0
-> unplug Ethernet cable
root@oDroid-C1-TEST:~# dmesg
. . .
[ 1070.500226] libphy: 0:01 - Link is Down
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
-> plugin Ethernet cable
root@oDroid-C1-TEST:~# dmesg
. . .
[ 1092.498852] [adjust link] -> eth: full-duplex
[ 1092.527414] [adjust link] -> eth: phy_speed <> priv_speed)
[ 1092.555618] [adjust link -> eth: am_adjust_link state change (new_state=true)
[ 1092.584081] libphy: 0:01 - Link is Up - 1000/Full
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 1 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 1 0 0 wlan0
@Fourdee
eth1 and wlan are connected to same Layer2 Network (e.g 192.168.0.0/24)
# Ethernet
allow-hotplug eth1
iface eth1 inet static
metric 0
# Wifi
auto wlan0
iface wlan0 inet dhcp
metric 1
root@oDroid-C1-TEST:~# ifdown eth1
root@oDroid-C1-TEST:~# dmesg
. . .
[ 1895.492057] NET DMA is stopped, ETH_DMA_Status=8502!
[ 1895.553041] eth1: closed
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 1 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 1 0 0 wlan0
root@oDroid-C1-TEST:~# ifup eth1
root@oDroid-C1-TEST:~# dmesg
. . .
[ 2266.065803] eth1: opened (irq 40).
[ 2270.058998] [adjust link] -> eth: full-duplex
[ 2270.088858] [adjust link] -> eth: phy_speed <> priv_speed)
[ 2270.118935] [adjust link -> eth: am_adjust_link state change (new_state=true)
[ 2270.149272] libphy: 0:01 - Link is Up - 1000/Full
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 1 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 1 0 0 wlan0
-> unplug Ethernet cable
root@oDroid-C1-TEST:~# dmesg
. . .
[ 2306.178909] [adjust link -> eth: am_adjust_link state change (new_state=true)
[ 2306.209903] libphy: 0:01 - Link is Down
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
-> plugin Ethernet cable
root@oDroid-C1-TEST:~# dmesg
. . .
[ 2350.239068] [adjust link] -> eth: full-duplex
[ 2350.269896] [adjust link] -> eth: phy_speed <> priv_speed)
[ 2350.300790] [adjust link -> eth: am_adjust_link state change (new_state=true)
[ 2350.332345] libphy: 0:01 - Link is Up - 1000/Full
root@oDroid-C1-TEST:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 1 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 1 0 0 wlan0
@Fourdee
allow-hotplug is no solution.
There are some more packets:
https://packages.debian.org/jessie/ifupdown-extra
https://packages.debian.org/jessie/ifupdown-multi
@k-plan
Thanks for the test reports, great stuff :+1: . I'll replicate your tests today and see if there is anything we can do about it :)
Ethernet
auto eth0
iface eth1 inet static
metric 0
Wifi
auto wlan0
iface wlan0 inet dhcp
metric 1
ifdown eth0
= WiFi oksystemctl restart networking.service
= Works fine.Ethernet
auto eth0
iface eth1 inet static
metric 0
Wifi
auto wlan0
iface wlan0 inet dhcp
metric 1
ifdown wlan0
= eth oksystemctl restart networking.service
= Works fine.Ethernet
allow-hotplug eth0
iface eth1 inet static
metric 0
Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
Ethernet
allow-hotplug eth0
iface eth1 inet static
metric 0
Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
allow-hotplug
reduces the need for running systemctl restart networking.service
after physical disconnect/reconnect.As far as i'am aware, there's nothing much we can do as this is all controlled by the kernel.
We can only hope when our users have both eth
and wlan
enabled, they run systemctl restart networking.service
after unplugging and replugging eth
. Or, if we roll out allow-hotplug
, just plug eth
back in.
I'am going to consider rolling out allow-hotplug
, as standard to all DietPi systems. This will allow users to physically disconnect/reconnect with no need for running systemctl restart networking.service
.
We expect our users to only use 1 network device, unless they are running WiFi hotspot. Enabling both devices should be a temporary procedure to allow users to configure the other device over SSH, before dropping the other device and its connection.
@Fourdee
Sorry, but I think, we talk at cross-purposes. (the language barrier)
if metric 0 device is unplugged, kills other device connections.
As far as i'am aware, there's nothing much we can do as this is all controlled by the kernel.
No and yes. If a state of any interface change, it must have to run throughifdown
and ifup
.
Nothing more do systemctl restart networking.service
. Have a look in cat /etc/init.d/networking
After this, route will set correctly and routing is working proper.
metric
defined the preferred, in this case the faster interface, generally ethx.
The possible solution are:
1.) Use a _"network-manager"_ with or without a GUI (the modern network configuration)
" _They allow us to configure network independent of the legacy ifupdown package_ "
But I think, it is not what you want to do. It's to heavy and not like "diet". So there would be a lot of work at your really well working scripts.
2.) Using some "packets" which do it for you and stay on "The basic network configuration with ifupdown (legacy)β
or
or
All packets are available for armel, armhf, arm64:
https://packages.debian.org/jessie/ifmetric
https://packages.debian.org/jessie/ifplugd
https://packages.debian.org/jessie/netplug
https://packages.debian.org/jessie/ifupdown-extra
It is your choice, which way you like or prefer.
ifplugd and netplugd run as services in background and have to be configured.
example:
Linux already supports plugging in and configuring the likes of
Cardbus network interfaces, in the form of the hotplug subsystem.
Netplug provides the corresponding support for plugging and unplugging
cables into network interfaces.When an Ethernet-style network interface on a host is plugged into a
powered-up switch, hub, or other host, the two use a carrier signal to
establish that the link is alive. The Linux kernel makes this
information available through its netlink interface.The netplug daemon listens for carrier detection and loss messages
from the kernel's netlink subsystem. When a carrier signal is
detected on an interface, it runs a script to bring the interface up.
When carrier is lost, netplug runs a script to bring the interface
down.
ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected.
ifplugd interfaces with your distribution's native network configuration utilities.
Some features:
Uses your distribution's native ifup/ifdown programs.
Supports the Linux SIOCETHTOOL (newer, aka ethtool API), SIOCGMIIREG (older, aka mii-diag/mii-tool API) and SIOCDEVPRIVATE (oldest, aka mii-tool API) ioctl()s for getting link status. Release 0.24 introduces support for link detection with the IFF_RUNNING interface flag.
Syslog support
Small program - the binary is just 25 KB (plus 16 KB for libdaemon).
Multiple ethernet interface support
Can be configured to ignore short "unplugged" periods (-d option) or short "plugged" periods(-u option)
Support for wireless networking. Whenever an association to an AP is detected the network is configured. Have a look on waproamd if you need a facility to configure WEP keys before AP associations succeed.
Compatibility mode for network devices which do not support cable detection (-F option)
Sorry for the numerousness of links, but better you read it in one's own right.
It's a difficult subject.
Or may I write it in german? π
I'am going to consider rolling out allow-hotplug, as standard to all DietPi systems. This will allow users to physically disconnect/reconnect with no need for running systemctl restart networking.service.
Hmm ... , it will/can not help/fix in all possible use cases. http://natisbad.org/dyn-net/index.html
But will not keep quiet about possible side effect, please see advisement above.
We have to do some test e.g. with DNS, WiFi and TOR HotSpot, PiHole, VPN etc.
Or kick out the feature of having both eth/wlan active iface at the same time, because it's not proper working in every circumstances.
What we want to do as next step?
@Fourdee
a quick test:
Ethernet
allow-hotplug eth0
iface eth1 inet static
metric 0
Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
root@oDroid-C1-TEST:~# apt-get install netplug
The following NEW packages will be installed:
iproute netplug
root@oDroid-C1-TEST:~# service netplug stop
root@oDroid-C1-TEST:~# cat /etc/netplug/netplugd.conf
eth*
wlan*
root@oDroid-C1-TEST:~# service netplug start
root@oDroid-C1-TEST:~# service netplug status
β netplug.service - LSB: Brings up/down network automatically
Loaded: loaded (/etc/init.d/netplug)
Active: active (running) since Sat 2016-04-30 22:55:17 CEST; 3s ago
Process: 5300 ExecStop=/etc/init.d/netplug stop (code=exited, status=0/SUCCESS)
Process: 7618 ExecStart=/etc/init.d/netplug start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/netplug.service
ββ7895 /sbin/netplugd -p /var/run/netplugd.pid
Apr 30 22:55:17 oDroid-C1-TEST systemd[1]: Started LSB: Brings up/down network automatically.
Apr 30 22:55:17 oDroid-C1-TEST netplugd[7896]: /etc/netplug/netplug eth1 in -> pid 7896
Apr 30 22:55:17 oDroid-C1-TEST netplugd[7897]: /etc/netplug/netplug wlan0 in -> pid 7897
Apr 30 22:55:17 oDroid-C1-TEST netplugd[7895]: eth1: state INNING pid 7896 exited status 0
Apr 30 22:55:17 oDroid-C1-TEST netplugd[7895]: wlan0: state INNING pid 7897 exited status 0
To see what is going on (some debugging):
root@oDroid-C1-TEST:~# service netplug stop
root@oDroid-C1-TEST:~# cat eth1-wlan0
eth1
wlan0
root@oDroid-C1-TEST:~# netplugd -F -c eth1-wlan0
Repeat testing (unplug/plug eth/wlan in)
Will you please test ifplugd
on your device?
@k-plan
Will you please test ifplugd on your device?
Looks promising :+1: , i'll run some tests today and report back.
@k-plan
ifplugd
has same issues (no effect):
root@DietPi:~# service ifplugd status
β ifplugd.service - LSB: Brings up/down network automatically
Loaded: loaded (/etc/init.d/ifplugd)
Active: active (running) since Sun 2016-05-01 15:03:24 BST; 8s ago
CGroup: /system.slice/ifplugd.service
ββ5528 /usr/sbin/ifplugd -i eth0 -q -f -u0 -d10 -w -I
ββ5543 /usr/sbin/ifplugd -i wlan0 -q -f -u0 -d10 -w -I
Ethernet
allow-hotplug eth0
iface eth1 inet static
metric 0
Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
unplug eth = Kills both connections
Plug eth back in = WiFi and Eth working fine.
I'll try netplug
@Fourdee
ifplugd
has same issues (no effect):
Hmm ... have you done dpkg-reconfigure ifplugd
after installation?
@k-plan
Hmm ... have you done dpkg-reconfigure ifplugd after installation?
Yes:
auto
all
None for suspend mode
@k-plan
Netplug working :+1:
cat << _EOF_ > /etc/netplug/netplugd.conf
eth*
wlan*
_EOF_
Also tested with WiFiHotspot installation.
Netplug looks like the winner :+1:
EDIT:
I'll roll it out to v117 for testing. Aiming to get this released today, v117 is well overdue.
@k-plan
I'll roll it out to v117 for testing. Aiming to get this released today, v117 is well overdue.
Netplug is now in the testing branch: https://github.com/Fourdee/DietPi/commit/2e19a57050d594adaaa37b03348e2d62cbe229d0
@Fourdee
ifplugd
has same issues (no effect):
no, it will work
Yes:
auto
all
None for suspend mode
auto
( no entry for hotplugged interface)
arguments: -q -f -u0 -d2 -w -I -b
suspend behaviour: Stop
a quick test (starting from a fresh install v117 testing):
Ethernet
allow-hotplug eth0
iface eth1 inet static
metric 0
Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
metric 1
root@RPi-3-test:~# apt-get install ifplugd
The following extra packages will be installed:
libdaemon0
The following NEW packages will be installed:
ifplugd libdaemon0
root@oDroid-C1-TEST2:~# dpkg-reconfigure ifplugd
root@oDroid-C1-TEST2:~# cat /etc/default/ifplugd
# This file may be changed either manually or by running dpkg-reconfigure.
#
# N.B.: dpkg-reconfigure deletes everything from this file except for
# the assignments to variables INTERFACES, HOTPLUG_INTERFACES, ARGS and
# SUSPEND_ACTION. When run it uses the current values of those variables
# as their default values, thus preserving the administrator's changes.
#
# This file is sourced by both the init script /etc/init.d/ifplugd and
# the udev script /lib/udev/ifplugd.agent to give default values.
# The init script starts ifplugd for all interfaces listed in
# INTERFACES, and the udev script starts ifplugd for all interfaces
# listed in HOTPLUG_INTERFACES. The special value all starts one
# ifplugd for all interfaces being present.
INTERFACES="auto"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d2 -w -I -b"
SUSPEND_ACTION="stop"
root@oDroid-C1-TEST2:~#
root@oDroid-C1-TEST2:~# ps -fC ifplugd
UID PID PPID C STIME TTY TIME CMD
root 11531 1 0 17:25 ? 00:00:00 /usr/sbin/ifplugd -i eth1 -q -f -u0 -d2 -w -I -b
root 11546 1 0 17:25 ? 00:00:00 /usr/sbin/ifplugd -i wlan0 -q -f -u0 -d2 -w -I -b
Working! π π
_*_Difference: *__
ping
over WiFi will working again.Netplug looks like the winner
π π
Also tested with WiFiHotspot installation.
Nice π
I'll roll it out to v117 for testing.
... another fresh install .... π’ π’ ... not tested connected with two different broadcast domains
Aiming to get this released today, v117 is well overdue.
π― posting to resolve a issue π
But I'm really unsure, if it is a good idea to use allow-hotplug
for all interfaces ...
Some distributions have done it in the past, but all deviate later ...
@k-plan
But I'm really unsure, if it is a good idea to use allow-hotplug for all interfaces ...
Some distributions have done it in the past, but all deviate later ...
I can't see any negative effects of this across DietPi at the moment. I will keep an eye on it.
Interesting results for ifplugd, although I think we will stick with netplug for now, seems to work a treat.
With allow-hotplug ifmetric and netplug, all the issues listed in this ticket have now been resolved. Great work on this K-plan :+1:
... another fresh install .... :cry: :cry: ... not tested connected with two different broadcast domains
After installing DietPi, do a dietpi-backup 1
. Then when you want to test something new run dietpi-backup -1 && reboot
to restore.
You can also run the following to update from testing branch:
echo 116 > /DietPi/dietpi/.version
dietpi-update
reboot
I've been testing netplug (and all these changes in the ticket) on the C2 and RPi's today, no issues.
I'll mark this ticket (lengthy lol) completed and closed. Please reopen if required.
Most helpful comment
@k-plan
Looks promising :+1: , i'll run some tests today and report back.