Wifi switch on laptop not functionning

Forum Forums New users New Users and General Questions Wifi switch on laptop not functionning

Tagged: 

  • This topic has 9 replies, 2 voices, and was last updated Jun 11-7:57 am by anti-apXos.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #144652
    Member
    poseri

      Hi everybody
      i am waking up an old laptop Acer Aspire One AOA 110 ZG5 (the one with only 0.5Gb RAM and 8Gb SSD)
      i expand RAM with a 1Gb module, add 16G SD card to put /home on it and update BIOS to v3309.
      And then install antiX22. Everything is working fine fluently.
      BUT the switch in front right to switch on/off the wifi is not working.
      This switch was working with ubuntu8.04.
      Using setkeycodes & getkeycdes I can see it but that’s all.
      Do I have to change the keyboard (need french one ‘AZERTY’) ??
      Do I have to enable a specific module ??
      Any idea someone ? I need help
      Thanks in advance..

      #144656
      Member
      anti-apXos

        getkeycodes just shows which keys are in the map, but that doesn’t mean they’re actually present on your hardware. Do you get an output if you run

        showkey -a

        and press this switch? Or

        xev | grep keycode

        If so, what is it?

        In my experience, switches like this are hardware switches, not keys. If it worked in another distro, though, this one may be different and you’ll be able to set up a shortcut for it once you know the keycode.

        #144739
        Member
        poseri

          Hi anti-apXos

          thanks to look at my question.

          showkey and xev give me nothing at all, no answer, no move.

          I tried getkeycodes to show the layout of the map, i see 0 in the 2 (push once and push one more) positions used by this switch.

          after doing ‘ sudo setkeycodes e056 158 ‘ and ‘ sudo setkeycodes e055 159 ‘ (idea found on web) the 2 ‘ 0 ‘ change to ‘158’ and ‘159’ .
          and using ‘ showkey -a ‘ or ‘ showkey -k ‘ i can see 158 and 159 when i push this switch.
          I see on first push 158 press and release and then 159 press and release on second push.
          it is like the two move of the switch are set and reset of a software latch which should start/stop the wifi card.

          So questions are :
          1) are 158 and 159 the good codes ?
          2) which module in antix should be controlled that way ? how to link it to the switch ?

          Thanks

          #144782
          Member
          anti-apXos

            Why did you assign keycodes 159 and 158? Are you following a guide that suggested those? I believe they are XF86Back and XF86Forward, right? You can confirm this using the ‘xev’ command. Possibly keycodes 238 (XF86WLAN) and 237 (XF86Bluetooth) would be more natural for this switch, but it doesn’t really matter since you’ll just be setting up keybinds for them. I guess you only really care that the keycodes are not the same as any other keys on the system.

            I’m a little confused by how this “switch” works, though. Can you explain more? I think I understand it’s a momentary switch that springs back after you press it, right? Does pressing it always alternate between producing one and then the other of the keycodes you assigned, no matter how much time between presses? Or do you have to press it twice fairly quickly to produce the second keycode?

            Depending on this, it should be fairly easy to set up keybind shortcuts to ‘rfkill’ that block, unblock, or toggle the wifi. There’s many methods to do this binding, though, sohow you use the system? Will you just be using one of the default antiX window managers? If so which one? Or will you switch between window managers or install other new ones? Will you always use an Xorg session or do you plan to use Wayland? Do you want the switch to also work when you’re on a text console or just on a graphical desktop?

            #144899
            Member
            poseri

              for key-codes 159 and 158 i am just following a guide from internet (i don’t remember where) I don’t know why these values, and others can be better.
              The 2 places in keyboard layout are set to 0 before i change it. But you are right the code doesn’t really matter.
              Yes, this is a momentary switch i slide to the right, it alternate between the 2 key codes every time i slide it, no matter the time between slide, or of the slide.
              The code i see with showkey alternate (toggle) between 158 and 159.
              When i move that key on first time, it register somewhere the code detected (let’s say 158). On the next move the code detected and registered is 159,
              On third move the code detected and registered is again 158, and so on…
              One code means wifi is on, and the other means wifi is off.
              When i switch on my computer the wifi is always on. In order to save power of the battery, I only want this key to stop wifi when i don’t need it, and
              start wifi when i want. no matter what i am working.
              It was that way with Ubuntu 8.0, but Ubuntu today is too big and slow, and antix looks better for this machine.
              When i installed antix the keyboard was automatically detected, i didn’t choose it. Is there another french key-map more suitable ? key-map including that slide switch ?
              Today this machine is running with Rox-icewm. I am mainly looking for a light window manager, graphical and easy to use, but without 3D effects or other useless things.
              Today Rox-icewm looks enough to me.

              #144915
              Member
              anti-apXos

                You’ll need to check using ‘xev’ what the keycodes you set are recognized as in X11. I think they are XF86Back and XF86Forward, so that’s what I’ll assume here.

                Open the IceWM key shortcuts file:

                leafpad ~/.icewm/keys

                In this file add two new keybinds:

                key "XF86Back" rfkill block wifi
                key "XF86Forward" rfkill unblock wifi
                

                Save the file and back on the terminal tell IceWM to reload its key shortcuts:

                icesh keys

                This should work, but keep in mind it’s only for IceWM. If you switch to another window manager, it will have its own keybinds (for example, ~/.fluxbox/keys).

                There are more general keybind tools you could install such as xbindkeys (works in all X windows managers) or keyd (works everywhere, including console and Wayland). As long as you use IceWM, though, the above method is probably easiest.

                When i installed antix the keyboard was automatically detected, i didn’t choose it. Is there another french key-map more suitable ? key-map including that slide switch ?

                I don’t know. Maybe, but I suspect not. Either way, you would still have to set up yourself the keybind shortcuts to use rfkill.

                #145038
                Member
                poseri

                  Hi, here are the results of what I tried

                  using : “xmodmap -pke” I look at a list of key codes and i see

                  keycode 246 = XF86WLAN
                  keycode 255 = XF86RFKill

                  I tried the two codes (looks clever to use these ?) But why this difference of 8 between the codes (238 => 246) ?

                  sudo setkeycodes e056 238
                  sudo setkeycodes e055 247
                  and modified /icewm/keys . But still not working.
                  I tried to exchange 246/255 with 238/247 and modified /icewm/keys = the switch is not working.
                  I tried to swap 246 with 255 and modified /icewm/keys = the switch is not working.
                  I went back to first idea (codes 158 & 159) for XF86Back and XF86Forward and modified /icewm/keys according to it. But the switch is still not working.

                  The best result I had was seeing the code toggle : 158-159, or 238-247, on the tests above, as a result of “sudo showkey -k”

                  As I can see the key-code toggle every time i slide this switch, but without result on the wifi card, i think the problem is in the file /icewm/keys.
                  The key is detected, but there is no action as a result on the system.
                  Tell you truth, I’m not a specialist in Linux. I discover and learn many things dealing with this problem. But now I’m stuck with it.
                  What do you think I should try now ?

                  #145040
                  Member
                  anti-apXos

                    As far as I can see from what you’ve posted till now, you still haven’t run ‘xev’ to confirm that the setkeycodes mapping is working as expected in X11 and giving the keysyms we’re assuming. The outputs from ‘showkey’ and ‘xmodmap’ are not enough to confirm this. Please run ‘xev’ and press the switch to see what keysyms it gives. Before doing this, remove anything you added to ~/.icewm/keys and run ‘icesh keys’ again.

                    Also test running ‘rfkill block wifi’ on a terminal to make sure this command is working on your system.

                    #145101
                    Member
                    poseri

                      believe me I also tried with ‘xev’ and ‘xev | grep keycode’ even if i didn’t tell you

                      this morning, just after reading your post, i switched on my computer the way it was yesterday after all my tests.
                      ” /.icewm/keys ” with the 2 new lines added, key-map modified with codes 158 and 159.

                      here are the results
                      1) with ‘xev | grep keycode’
                      a) KeyPress event
                      …..keycode 166 (keysym 0x1008ff26 XF86Back)
                      KeyRelease event
                      …..keycode 166 (keysym 0x1008ff26 XF86Back)
                      b) KeyPress event
                      …..keycode 167 (keysym 0x1008ff27 XF86Forward)
                      KeyRelease event
                      …..keycode 167 (keysym 0x1008ff27 XF86Forward)
                      and so on, toggle between a) and b) every time i move the switch, but without action on the wifi card itself
                      2) with ‘sudo showkey -k’
                      code clavier 158 appuyé (press)
                      code clavier 158 relaché (release)
                      code clavier 159 appuyé (press)
                      code clavier 159 relaché (release)
                      and so on, toggle between 158 and 159 every time i move the switch, but without action on the wifi card itself
                      To be sure i check with ‘ rfkill list ‘ . It tells me ‘ Soft blocked: no ‘ and ‘ Hard blocked: no ‘
                      then i tried ‘ rfkill block wifi ‘ . It stopped wifi .
                      Then i tried to move the switch to see if i can wake up the wifi. Using xev I got the same result as above (toggle), without waking up wifi.
                      So i tried ‘rfkill unblock wifi’. It didn’t wake up the wifi.!!
                      So i check with ‘ rfkill list ‘ . It tells me ‘ Soft blocked: no ‘ and ‘ Hard blocked: yes ‘ !! This is the ONLY result I got !!
                      I had to logout and switch off my computer. When starting again wifi was back on.

                      I also tried all these tests after removing the 2 lines in /.icewm/keys , and ‘ icesh keys ‘ nor xev nor showkey tell me anything. showkey stopped automatically after 10s because it didn’t detect the switch, of course the wifi didn’t change.
                      All the time I can start/stop wifi from the terminal, except the time i said above (‘ Hard blocked: yes ‘)

                      #145124
                      Member
                      anti-apXos

                        ” /.icewm/keys ” with the 2 new lines added, key-map modified with codes 158 and 159.

                        here are the results
                        1) with ‘xev | grep keycode’
                        a) KeyPress event
                        …..keycode 166 (keysym 0x1008ff26 XF86Back)

                        This should not happen. If keybinds are set in IceWM, xev will not report the keypress event since IceWM intercepts it. Instead, xev (if run without the “| grep keycode”) will show FocusOut and FocusIn events.

                        Do the entries you added to ~/.icewm/keys look just like the other entries that were already there? The quote marks are the same type? Actually, the quote marks are not even necessary in this case, so you can remove them to simplify this. Also, try changing the commands to something that produces a visible event, like

                        key XF86Back leafpad
                        key XF86Forward galculator
                        

                        If these key shortcuts don’t work and xev continues to show events for the keys, I can’t explain it.

                        Maybe another useful test is to assign rfkill to keys on your regular keyboard and see if that works.

                        key Ctrl+w rfkill block wifi
                        key Ctrl+e rfkill unblock wifi
                        

                        I also tried all these tests after removing the 2 lines in /.icewm/keys , and ‘ icesh keys ‘ nor xev nor showkey tell me anything. showkey stopped automatically after 10s because it didn’t detect the switch, of course the wifi didn’t change.

                        If this was after restarting the system, did you remember to run the setkeycodes command again to assign the keycodes? That’s the only thing I can think of since ~/.icewm/keys should have no effect on showkey.

                        • This reply was modified 1 week, 1 day ago by anti-apXos.
                      Viewing 10 posts - 1 through 10 (of 10 total)
                      • You must be logged in to reply to this topic.