Resolution to an old issue with Conky and Wireless adapters

Forum Forums General Tips and Tricks Resolution to an old issue with Conky and Wireless adapters

  • This topic has 2 replies, 2 voices, and was last updated Jan 4-3:58 am by seaken64.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #74501
    Member
    seaken64

      Resolution to wireless connections not showing on the standard Conky

      I like to use the LiveUSB and persistence features of the antiX and MX releases so that I can set up a working system while I have not yet upgraded my desktop boxes or laptops to the new version. I use the LiveUSB and install the packages I regularly use and set it up with persistence so that my changes are saved. Then I boot this LiveUSB on my machines that I use regularly and get accustomed to the new release. Once I am ready I install the new version of the OS onto the hard drive of my desktop or laptop. The resulting installation always has my user already setup and all the packages that I regularly use are setup since I have installed from the persistent LiveUSB.

      This has always worked well for me but I have always had a small issue that shows up once in awhile that relates to the display of the wireless connection on the default antiX Conky. For some reason the Conky does not always show the wireless connection as active. A couple of years ago I traced it down to the fact that the Conky I use only has entries for eth0, eth1, wlan0 and wlan1. If the wireless adapter is assigned another logical interface designation that differs from those four entries in Conky then the Conky report will not show the wireless.

      I started a forum topic on this issue here:

      https://www.antixforum.com/forums/topic/see-active-network-connection-in-liveusb/

      At the time I did not resolve the issue since I was satisfied that I could live with the issue and it was not essential that I solved it. I had moved on to other projects, and, even though I have noticed this issue a few times in subsequent installs I never followed up with it. Until today.

      To @skidoo I owe an apology. Had I followed up with his suggestion back then I would have resolved this before nearly three years have past. (Time flies when you’re having fun, right?) Today I had this same issue when I installed antiX-21 from a LiveUSB that I setup with persistence. I went looking on the forum to see if this was something already discussed. I did a search on “wlan2 conky” and up popped my old topic.

      So, the short answer to that topic is that if I edit the /etc/udev/rules.d/70-persistent-net.rules and rename my interface to one of the four interface names used in the Conky the wireless connection shows up.

      In that file is a list of adapters. I presume these adapters on the list were gathered from the various machines I used with the LiveUSB. Since I install from the Persistent instance of the Live system I guess this file comes with the install. But since most of the adapters on the list are not on the machine I am installing to I get unexpected results as far as the logical interface names are concerned. After two or more wireless adapters are on this list the interface name ends up wlan2 or wlan3, etc.

      I have not tried renaming or deleting this file. Maybe that also would be a solution. But editing it to assign my adapter to wlan0 or wlan1 does work.

      In that old topic one of my helpers insisted that what I was experiencing was not possible unless something ‘not normal’ was being done. They insisted that if I only had one wireless adapter I would get wlan0. The second adapter would get wlan1. I maintained that I was not doing anything out of the normal. I explained that I was installing antiX to a hard drive but I was using a LiveUSB with persistence. I think what is happening here is that the LiveUSB routines with persistence are writing this file as I move from machine to machine with the LiveUSB. Then, when I install to the hard drive this same file gets copied over to the new install. Since it is loaded with now non-existent device names I end up with wlan2, or wlan3, etc. And then the Conky won’t show anything.

      So, the ‘abnormal’ thing is that the LiveUSB maintains a list of interfaces it encounters on various machines and then this list gets installed to the hard drive. Unless I edit this file after the install the system just pulls the logical device name that matches the device I have in the machines to which I installed to the hard drive.

      I don’t know if there is a way to modify this behavior when installing to a hard drive from a LiveUSB with persistence. Maybe it is something the developers can consider. (And I am not even sure I am correct on my supposition that it’s the persistence routines that lead to this condition. Others will have to decide if my conclusions make sense or not). But I do know that now that I know what to look for I will no longer be annoyed by the Conky missing my wireless connection.

      Thank you @skidoo for pointing me in the right direction, and sorry for being so tardy in doing my homework.

      Seaken64

      #74568
      Anonymous
        Helpful
        Up
        0
        ::

        You could extend Conky so that with the if_up command also the interfaces eth3,4 – wlan3,4 etc. are queried.
        So e.g.
        ${if_up wlan4}xxxx

        But this is not useful, because actually no human(computer) has so many interfaces.
        The solution of your “problem” is actually as old as users tried to “move” with their OS from one computer to the other. After starting the new computer they were left without a network.

        In your linked thread, the first post by @BitJam already contains said solution. You have to delete the said file (/etc/udev/rules.d/70-persistent-net.rules) after the installation from your persistent stick and before the first reboot, because the new system will automatically recreate this file on the first boot.
        So if eth0 and wlan0 are already “present through the stick”, the new system will simply count up to eth1/wlan1 etc.
        Do the whole thing often, as in your case, and you’ll eventually get to 3 and 4, etc.

        Look closely at the contents of this terminal output:

        $ egrep 'eth|ath|wlan|ra|ppp' /etc/udev/rules.d/*net_persistent* /etc/udev/rules.d/*persistent-net*
        grep: /etc/udev/rules.d/*net_persistent*: Datei oder Verzeichnis nicht gefunden
        /etc/udev/rules.d/70-persistent-net.rules:# This file was automatically generated by the /lib/udev/write_net_rules
        /etc/udev/rules.d/70-persistent-net.rules:# program, run by the persistent-net-generator.rules rules file.
        /etc/udev/rules.d/70-persistent-net.rules:SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
        /etc/udev/rules.d/70-persistent-net.rules:SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
        #74620
        Member
        seaken64
          Helpful
          Up
          0
          ::

          Thank you @male. So I also owe an apology to @BitJam and you. I went back and read that previous thread three times. And yes, it was suggested to delete the /etc/udev/rules.d/70-persistent-net.rules file. But I was not understanding a lot of what was being said. At that time I was not very well versed in Linux administration (and only marginally more accomplished now). Maybe I thought it was only necessary to delete that file IF I had turned off savestate, which I had not, at least not as I understood.

          When @skidoo asked if I had edited the file I confessed I had not. It was not until this week that I tried that. And that prompted me to add this second thread to report that it was indeed the answer to the problem. I now see that you also were a contributor in that old thread, but it shows your avatar as “Anonymous”,

          Anyway, it appears that BitJam, yourself, NoClue and Skidoo were all trying to tell me the same thing and I wasn’t “hearing” it. Now I understand and I know what to look for when installing from a persistent LiveUSB. Lesson learned.

          Thanks again,

          Seaken64

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.