[Solved] Wifi on/off slider Archer C7 V2

I have stated several times, including flashing with the stable release image, the switch does not do anything. The problem lies with the gpios, not with the rfkill script.

Unfortunately, I cannot see the allocations of the gpios any longer, since this file "/sys/kernel/debug/gpio" is no longer available.Please see here for the entire story of the problem, which persists on Archer C7 v2 at least.

Thanks for the advice, seems very helpful. I get back after testing tomorrow, have to leave for now.

Do you have a debugfs mounted at /sys/kernel/debug? You can check by:

mount | grep debugfs

This should give the following output:

root@router:/etc/rc.button# mount | grep debugfs
nodev on /sys/kernel/debug type debugfs (rw,relatime)

If not, maybe try mounting it manually?

mount -t debugfs nodev /sys/kernel/debug

No, because there is no directory /sys/kernel/debug. Tried to create it, but "operation not permitted".
fstab is empty and mtab contains:

cat /etc/mtab 
/dev/root /rom squashfs ro,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
/dev/mtdblock3 /overlay jffs2 rw,noatime 0 0
overlayfs:/overlay / overlay rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600,ptmxmode=000 0 0

o no chance to mount it manually. Something wrong here?

Ah well that explains. Those images are built with:

#
# Kernel build options
#
CONFIG_KERNEL_BUILD_USER="r00t"
CONFIG_KERNEL_BUILD_DOMAIN=""
CONFIG_KERNEL_PRINTK=y
# CONFIG_KERNEL_CRASHLOG is not set
CONFIG_KERNEL_SWAP=y
# CONFIG_KERNEL_DEBUG_FS is not set
# CONFIG_KERNEL_KALLSYMS is not set
# CONFIG_KERNEL_DEBUG_KERNEL is not set
# CONFIG_KERNEL_DEBUG_INFO is not set
# CONFIG_KERNEL_MAGIC_SYSRQ is not set
# CONFIG_KERNEL_DEBUG_PINCTRL is not set
# CONFIG_KERNEL_DEBUG_GPIO is not set

Whereas my .config contains: (which are the default)

#
# Kernel build options
#
CONFIG_KERNEL_BUILD_USER=""
CONFIG_KERNEL_BUILD_DOMAIN=""
CONFIG_KERNEL_PRINTK=y
CONFIG_KERNEL_CRASHLOG=y
CONFIG_KERNEL_SWAP=y
CONFIG_KERNEL_DEBUG_FS=y
CONFIG_KERNEL_KALLSYMS=y
CONFIG_KERNEL_DEBUG_KERNEL=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_MAGIC_SYSRQ=y
# CONFIG_KERNEL_DEBUG_PINCTRL is not set
# CONFIG_KERNEL_DEBUG_GPIO is not set

So that's why you do not have the file "/sys/kernel/debug/gpio".

EDIT:
I just tried the build you named. You are correct, the switch does not work on that build.

1 Like

Where is the kernel config? How did you manage to get it for the mod I am using? I made kernel compilations quite often on Linux, but with this router firmware I have no clue how I would call 'make menuconfig' etc.
I would be grateful for a short description how to get there. I read a lot about this "built environment" without understanding a single word .... hope this is not the required procedure :confounded:

This is the .config file of the build from your used custom image.

I assume you have setup build environment as here

The procedure to build this custom image by yourself is:

  • git clone https://github.com/openwrt/openwrt.git
  • git clone https://github.com/infinitnet/lede-ar71xx-optimized-archer-c7-v2.git
  • cd openwrt
  • ./scripts/feeds update -a && ./scripts/feeds install -a
  • patch -p1 < $(find ../lede-ar71xx-optimized-archer-c7-v2/patches -name "*.patch" | sort)
  • cp -r ../lede-ar71xx-optimized-archer-c7-v2/files .
  • cp ../lede-ar71xx-optimized-archer-c7-v2/config.seed ./.config
  • make defconfig
  • make menuconfig # optional: enable debugfs and probably other stuff
  • make download world -j4

If you are afraid of building your image yourself... You could try my ath79 C7v2 build...
DonΒ΄t think your used "optimized" image is much faster than the ath79 build!
Here you will have flow offload and debugfs... No need for this shortcut fe enabled build and you could install all packages you want with opkg.

1 Like

Also, enabling debugfs won't fix your first problem. That's probably related to another build option.

1 Like

The author of this "optimized" image has disabled this:
# CONFIG_PACKAGE_kmod-gpio-button-hotplug is not set

If i do a clean config for ath79 or ar71xx this config option is enabled!

From a clean ath79 config:

  β”‚ Symbol: PACKAGE_kmod-button-hotplug [=n]                                                                                                                                                                   β”‚  
  β”‚ Type  : tristate                                                                                                                                                                                           β”‚  
  β”‚ Prompt: kmod-button-hotplug................................ Button Hotplug driver                                                                                                                          β”‚  
  β”‚   Location:                                                                                                                                                                                                β”‚  
  β”‚     -> Kernel modules                                                                                                                                                                                      β”‚  
  β”‚ (1)   -> Other modules                                                                                                                                                                                     β”‚  
  β”‚   Defined at tmp/.config-package.in:12820                                                                                                                                                                  β”‚  
  β”‚   Selects: PACKAGE_kmod-input-core [=n]                                                                                                                                                                    β”‚  
  β”‚   Selected by: MODULE_DEFAULT_kmod-button-hotplug [=n] && TARGET_PER_DEVICE_ROOTFS [=n] && m && MODULES [=y]                                                                                               β”‚  
  β”‚                                                                                                                                                                                                            β”‚  
  β”‚                                                                                                                                                                                                            β”‚  
  β”‚ Symbol: PACKAGE_kmod-gpio-button-hotplug [=y]                                                                                                                                                              β”‚  
  β”‚ Type  : tristate                                                                                                                                                                                           β”‚  
  β”‚ Prompt: kmod-gpio-button-hotplug............... Simple GPIO Button Hotplug driver                                                                                                                          β”‚  
  β”‚   Location:                                                                                                                                                                                                β”‚  
  β”‚     -> Kernel modules                                                                                                                                                                                      β”‚  
  β”‚ (2)   -> Other modules                                                                                                                                                                                     β”‚  
  β”‚   Defined at tmp/.config-package.in:12891                                                                                                                                                                  β”‚  
  β”‚   Selected by: MODULE_DEFAULT_kmod-gpio-button-hotplug [=n] && TARGET_PER_DEVICE_ROOTFS [=n] && m && MODULES [=y]

:sweat_smile: but he enabled:

CONFIG_USE_RFKILL=y
CONFIG_WPA_RFKILL_SUPPORT=y
1 Like

I am not that kind of person that gets fascinated by figure comparisons. The reason for using that image is just the assumption that someone has taken a great deal of time to tailor the firmware to this particular router. The discussion on this image is pretty much focussed on speed, too much for me in fact. I will check your build ... only 2 days old ... a little challenge.

Nope. This has always been the part that I did not understand. In a virtual machine, or just on a Linux (Debian) Desktop? A quick check of your link did not improve my knowledge, but I shall check more in depth tomorrow.

Flow offloading in the ath79 target makes the out-of-tree optimizations in that build pretty much obsolete.

You may be right, as previously it was enabled also in my installations (moved to an update few weeks ago only). However, as reported earlier in this thread, the allocation of the switch to gpio.23 has been fixed recently. So cross fingers, I'll find out tomorrow.

but more than a month to make it ready :slight_smile: !

1 Like

For sure you could optimize a lot in code performance, but the most important part of a router is definitely the kernel and not the high optimized packages.
The new 4.14 kernel is optimized for performance instead for size as on kernels <= 4.9
IΒ΄m not a fan of the highest compiler optimization option "-O3", because this could break a lot...

The gpio for the switch was fixed in 2016!

As i said, my assumption is that the following config option is disabled in your image:
# CONFIG_PACKAGE_kmod-gpio-button-hotplug is not set

1 Like

:smiley:

@juppin Downloaded and installed your image.

Had some problems because I could not use my configs from backup - just copied over network, wireless, firewall, dhcp - as they broke the settings completely. Configured through LuCI.

Works like a charm. Not only the image itself but also the wifi on/off slider. You made my day ... It seems that with the later images

and kmod-gpio-button-hotplug activated this switch is properly set up.

Thanks a million
Oscar

PS: @juppin can I get back to you on your image thread to ask for the vlan tagging for my ISP? Can't get it working so far

If your problem is solved, please consider marking this topic as [Solved]. (Click the pencil behind the topic...)

Sure you can. Should be the same as on the other image...

@oscar did you tried this package https://github.com/jefferyto/openwrt-slide-switch it states that it can detect the position of the switch at start

It might not be applicable to the Archer C7. The switch remains in the position/action during turn-off/reboot, i.e. the last action is "remembered" by the device.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.