Announcement

Collapse
No announcement yet.

WiFi SSID monitoring?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    WiFi SSID monitoring?

    Is this plug-in capable of monitoring a WiFi adapter and detecting the appearance of an SSID?

    Assuming, of course, that this would run on it's own WiFi adapter. The HS3 server is on it's own wired Ethernet connection. And I wouldn't configure the HS3 server to use WiFi for any sort of network connection.

    I ask this because some WiFi devices lose connectivity (for whatever reasons, not directly relevant here) and then start squawking their own SSID. Some Chromecast units tend to do this. But I've also seen it for Amazon Alexa devices.

    So I'm thinking of using HS3 to monitor WiFi SSID networks appearing (or disappearing) and using that as a trigger.

    Is that possible with this plug-in? If not, any recommendations?

    #2
    Been tinkering here with Wifi modded MQTT devices and recently decided to dedicate a modded OpenWRT WAP to these.

    On the device running a python script which monitors attached clients plus there is a built in OpenWRT scan utility which would provide SSDs via MQTT.

    Such that if you feel like tinkering with an OpenWRT OS based WAP you can configure it to chat MQTT and use mcsMQTT to monitor your OpenWRT WAP.

    I have tested running mosquitto broker and some python aps to work well on the OpenWRT upgraded WAP.

    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      I monkeyed around with some scripts, quite a while ago, for monitoring SSIDs for the WiFi on a boat. As in, scan for shore-side signals to use for connectivity. Wasn't really worth it and abandoned the effort when cell data service coverage and pricing improved.

      Comment


        #4
        For wireless devices here always utilize DHCP reservation and monitor the MAC address.

        Relating to using an OpenWRT OS you can monitor and sniff the network for connectivity and throughput.

        New FCC stuff relating to wireless embeds the MAC address in the kernel now of many wireless devices. Difficult to change or spoof these addresses.

        Did just notice a glitch of sorts in monitoring here with my new Wifi firmware Espurna devices.

        The firewall caches the ARP table and changing the name of the device such that it doesn't match the IP and or mac address then it creates havoc.

        The havoc it creates messes with the time on the device as it will not sync to the firewall. This causes all sorts of issues.

        Learned to clear the ARP cache and it continues to work.


        For the stationary cellular connection here utilize a combination modem and network switch interface which offers up an ethernet interface to a secondary WAP.

        I am still able to spoof the WAN side mac address of my home ISP and force changes here changing it..... 00:00:00:02:02:02
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
        HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

        HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

        Comment


          #5
          If you have a Windows box with an active WiFi interface, you can run the following command using a recurring event and then use a script to find specific SSIDs.

          netsh wlan show networks > ssid.log
          HS 4.2.8.0: 2134 Devices 1252 Events
          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

          Comment


            #6
            My desire isn't to detect when a device has connected to the network, it's to detect when a device DIDN'T connect (or isn't actively connected) to the network and has defaulted back to state of announcing it's own SSID. I also utilize DHCP leases and MAC monitoring. MAC or IP monitoring isn't ideal because many devices will disappear from the network if they're powered off during normal operations. I'd get a lot of false alarms if I went by MAC/IP detection alone.

            A number of devices now boot into a mode that presents their own Ad-hoc WIFI network (amazon alexa devices, google chromecasts, etc). If they lose a connection to their configured wireless network they'll skip back into an Ad-hoc advertising mode.

            I'd like to scan for (string matching) the appearance of known SSIDs and generate an HS3 event. As in, "go fix the damned chromecast, it's lost wifi... again..." Which would be detectable because there's now an SSID called "Rec Room Chromecast", which means it's decided to get confused... again, and needs to be manually rebooted. Which can only be down by a hard power cycle or using a tablet/phone to make a wifi connection to it. Simple power cycling usually resolves it. I may, at some point, have to resort to using a smart plug to power them. At least then I'd be able to cycle them automagically.

            Comment


              #7
              Unless I'm misunderstanding you, the method I posted will do what you intend to do. The command I posted will show all visible SSIDs detected by the WiFi interface, so a recurring event and a script to search the output for "Rec Room Chromecast" can notify you, or reboot the CC if you have it connected to some kind of smart plug. The WiFi interface would need to be on the HS system, or you could use a separate system as long as the output was accessible by your HS system.
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                You can maybe push on the transmitting power or stick another WAP in place or even install a dedicated WAP to your little WiFi devices such that the devices do go to ad-hoc mode.

                I've not seen this with the Amazon Echo devices.

                Have you done a WiFi survey in your home? I have seen high loads like streaming video totally mess with the through put of other wireless devices.

                A Homeseer event would be a band aid fix for an underlying infrastructure issue which you may be able to fix.

                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                Comment


                  #9
                  Originally posted by sparkman View Post
                  Unless I'm misunderstanding you, the method I posted will do what you intend to do.
                  We had posts that overlapped. I was responding before your post was made.

                  The command I posted will show all visible SSIDs detected by the WiFi interface, so a recurring event and a script to search the output for "Rec Room Chromecast" can notify you, or reboot the CC if you have it connected to some kind of smart plug. The WiFi interface would need to be on the HS system, or you could use a separate system as long as the output was accessible by your HS system.
                  Yes, using netsh that way would get a list of actively seen SSIDs. I'd just have to massage that into something HS3 could reliably process on a repeated basis. I've learned over the years to avoid assembling too fragile a set of pieces slapped together. The more I can keep integrated in one place, the better.

                  This raises the question of whether the .net framework would have access to this. Enough to make it possible to work on both windows and mono (linux)? It seems there is a Native WiFi API in .Net. Is there an equivalent in Mono?

                  https://stackoverflow.com/questions/...trength-in-net

                  Comment


                    #10
                    Originally posted by wkearney99 View Post
                    Yes, using netsh that way would get a list of actively seen SSIDs. I'd just have to massage that into something HS3 could reliably process on a repeated basis. I've learned over the years to avoid assembling too fragile a set of pieces slapped together. The more I can keep integrated in one place, the better.
                    Using a script to read the output and search for an SSID is pretty simple so should be reliable. I use the same method for a few other things and never had any issues.

                    Originally posted by wkearney99 View Post
                    This raises the question of whether the .net framework would have access to this. Enough to make it possible to work on both windows and mono (linux)? It seems there is a Native WiFi API in .Net. Is there an equivalent in Mono?

                    https://stackoverflow.com/questions/...trength-in-net
                    Some of the posts there reference 3rd party .NET libraries, but there could be something built-im as well. I’ll do some checking for that. Are you running HS on linux or Windows?

                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #11
                      Originally posted by sparkman View Post
                      Using a script to read the output and search for an SSID is pretty simple so should be reliable. I use the same method for a few other things and never had any issues.

                      Some of the posts there reference 3rd party .NET libraries, but there could be something built-im as well. I’ll do some checking for that. Are you running HS on linux or Windows?
                      I'm running it on Windows 10 Pro.

                      Comment


                        #12
                        Here's a quick script that will work on Windows. Call it from an event and pass the SSID that you want to check to it. The script performs no actions at this point, so you'd have to add those.

                        Code:
                        Imports System.Diagnostics
                        
                        Sub Main(ByVal srchTerm As String)
                        
                            Dim Debug As Boolean = True
                            Dim LogName As String = "SSID" 
                            Dim myProcess As New Process()
                            Dim output As String = ""
                        
                            myProcess.StartInfo.CreateNoWindow = True
                            myProcess.StartInfo.FileName = "netsh"
                            myProcess.StartInfo.Arguments = "wlan show networks mode=bssid"
                            myProcess.StartInfo.RedirectStandardOutput = True
                            myProcess.StartInfo.UseShellExecute = False
                            myProcess.Start()
                            output = myProcess.StandardOutput.ReadToEnd()
                            myProcess.WaitForExit()
                        
                            If Debug Then hs.writelog("SSID",output)
                        
                            If output.Contains(srchTerm) Then
                                'do something
                            ElseIf output.Contains("There is no wireless interface on the system")
                                'do something else
                            Else
                                'do something different
                            End If
                        
                        End Sub
                        HS 4.2.8.0: 2134 Devices 1252 Events
                        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                        Comment

                        Working...
                        X