Master script for NetStumbler 0.4

Take a script, leave a script - Like the penny tray only different

Postby Dutch » Wed Aug 10, 2005 8:04 am

madd wrote:... doh.

No I dont.

Any suggested GPS that would be best?


Junlygust... Junlygust.. *sigh*

Dutch
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
User avatar
Dutch
 
Posts: 6698
Joined: Fri Mar 05, 2004 12:00 pm
Location: City of Mermaids, Denmark

Postby wrzwaldo » Wed Aug 10, 2005 8:19 am

madd wrote:... doh.

No I dont.

Any suggested GPS that would be best?


Now I'm going to have to refer you to the forum search as there are several threads discussing this very topic.
wrzwaldo
 
Posts: 8995
Joined: Sun Dec 14, 2003 12:43 pm

Postby lobalt » Tue Aug 30, 2005 5:05 am

[quote="goldfndr"]
My guess is that it's the CentreVehicle functionality. Please try setting CentreVehicle to 0 or False and see if that makes a difference]

That didn't change anything for me but reverting to the previous version did. I'll get the coords for ya later unless someone else beats me to it.
lobalt
Mini Stumbler
 
Posts: 9
Joined: Fri Oct 22, 2004 6:40 am

Postby goldfndr » Tue Sep 06, 2005 3:11 am

Anyone else here with Mappoint (Europe or 2004 or not) care to report success/failure with positioning? If failure, I'm interested in the coordinates it chooses; maybe I can figure out something from there. Oh, and also if failure, please try ragmanii's code with the previous version, see if it works any better. Please post version info with report, of course.

Due to my hard drive going into "limbo" (noises at ~3:45am on Aug30, failed to boot a half hour later, haven't tried booting it since then), I've lost some of my development stuff... time to download what got mirrored... but if there are any requests for stuff to add, of course post them. Something I'd changed before the loss was making TellSpeed actually functional - it's currently broken. I was thinking of having it False make it still able to tell directions if TellDirection is True; useful if your GPS is a mouse-type.
goldfndr
 
Posts: 181
Joined: Sat Aug 28, 2004 3:30 am
Location: Bellevue, WA, USA

Trouble with the script

Postby DodgerMP » Tue Sep 06, 2005 6:59 am

I am running windows XP SP2 on a Dell Lattitude C640 2 Gig Proc 512 MB memory with Netstumbler 0.4.0. I was running this script about a month ago with no problems. Now after a re-install of windows I can not get the script to work. When I run the master script I get speach but no map point. I tried running just the mappoint script and it will open mappoint but no tracking or point show up. I tried the stumble-track-location script and I will get data from netstumbler, ie my position only no points. I do not know what is causing this so anyhelp would be great.
DodgerMP
Mini Stumbler
 
Posts: 1
Joined: Fri Apr 29, 2005 6:07 pm

Postby goldfndr » Tue Sep 06, 2005 7:43 pm

I'm guessing that the GPS isn't being read correctly; default tends to be 4800bps for NMEA... Make sure you have coordinates displayed in the lower right corner of the NetStumbler display, or remove NetStumbler from "the equation" completely and try just GPS and Mappoint (in which case a Mappoint-specific forum would be more suitable).

Also, could you reread the upper paragraph of my message (the one to which you replied) and perform what it requests of you? It'd enable easier troubleshooting. If any specific part is unclear, I'll attempt to clarify it.
goldfndr
 
Posts: 181
Joined: Sat Aug 28, 2004 3:30 am
Location: Bellevue, WA, USA

Fix for the mid-atlantic problem

Postby tpeer » Thu Sep 22, 2005 3:26 pm

The distance function was changing the value of the lat and lon fields that carried the original gps values.

I've attached a fixed ns04mappoint.txt file. Rename it to ns04mappoint.vbs

tpeer
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

tpeer
Mini Stumbler
 
Posts: 21
Joined: Fri Apr 23, 2004 5:13 pm

Postby goldfndr » Wed Sep 28, 2005 7:21 pm

tpeer wrote:The distance function was changing the value of the lat and lon fields that carried the original gps values.

I've attached a fixed ns04mappoint.txt file. Rename it to ns04mappoint.vbs
Ah, thanks. Lesson learned: don't alter a function's arguments unless they explicitly have ByValue set.

BTW, both (your and my) copies are in error: in the Distance function (the only difference), when converting to radians, they refer to "Las2" instead of "Lat2". Did you upload the wrong copy? Is it really working? Having a permanent latitude of 0 seems like an issue, but maybe Mappoint users prefer to hang out at the equator? From my reading, the effect away from the equator would be an additional crumb at every reading rather than merely at CrumbGap distances.
goldfndr
 
Posts: 181
Joined: Sat Aug 28, 2004 3:30 am
Location: Bellevue, WA, USA

Postby tpeer » Fri Sep 30, 2005 5:01 am

goldfndr wrote:Distance function (the only difference), when converting to radians, they refer to "Las2" instead of "Lat2". Did you upload the wrong copy? Is it really working? Having a permanent latitude of 0 seems like an issue, but maybe Mappoint users prefer to hang out at the equator? From my reading, the effect away from the equator would be an additional crumb at every reading rather than merely at CrumbGap distances.


Ah crap. I don't do crumbs, just a track, so didn't catch this, and I actually turned of my track today, as I just split the gps output to multiple com ports, and use software with more up to date maps. :)

Ted
tpeer
Mini Stumbler
 
Posts: 21
Joined: Fri Apr 23, 2004 5:13 pm

Postby goldfndr » Thu Oct 06, 2005 5:45 pm

Does the unnamed software you're using support tracks? Additional track or crumb output could be written dynamically and imported later, assuming there's a specification.

In other news, I found out last night that the WavFolder bad setting code was horribly broken: it'll find the WAV files in the scripts' folder but it doesn't change WavFolder. What one needs to do to correct this:
  • Change const WavFolder = to dim WavFolder : WavFolder = in ns04settings.vbs
  • Change a few lines in the "Get list of WAVs" code in ns04thread.vbs, it should be:
    Code: Select all
    'Get list of WAVs - this should perhaps be done with Scripting.Dictionary
    Dim fl
    if len(WavFolder) then
       if FSO.FolderExists(WavFolder) then
          set f = FSO.GetFolder(WavFolder)
       else
          MsgBox "WavFolder (" & WavFolder & ") not found, reverting to script folder!" _
             , vbExclamation, nameScript
          WavFolder = nameDir
          set f = FSO.GetFolder(WavFolder)
       end if
    else
       WavFolder = nameDir
       set f = FSO.GetFolder(WavFolder)
    end if
  • For good measure, make similar change in ns04speech.vbs (bad oversight, oops)
My apologies for not testing this better (or, apparently, at all).
goldfndr
 
Posts: 181
Joined: Sat Aug 28, 2004 3:30 am
Location: Bellevue, WA, USA

Postby tpeer » Mon Oct 10, 2005 6:30 pm

goldfndr wrote:Does the unnamed software you're using support tracks? Additional track or crumb output could be written dynamically and imported later, assuming there's a specification.


I use MapPoint 2004 to plot the APs found. I use XPort to split the GPS output to multiple programs: NetStumbler (of course), and either Street Atlas 2006 or Streets & Trips 2005 (well 2006 now) or both. :D

As far as the wav folder thing, I don't use wavs, so I think I disabled that folder functionality in the version I'm using...

Ted
tpeer
Mini Stumbler
 
Posts: 21
Joined: Fri Apr 23, 2004 5:13 pm

Specifics with ns04master.vbs

Postby supermanwah » Mon Nov 07, 2005 4:54 pm

Sorry for the length on this one guys but too much info is never a bad thing...(right? :) ) Also, I hope I posted this in the right place; there is nothing like looking for cookies in the cookie jar and finding 10 day old pieces of pizza and thinking, "What the hell is this doing here!?" (if you catch my meaning). So I apologize in advance. Anywho...

I work for an agency that has wireless AP’s setup all over a city (around 15 probably) that are using 1w (I think) amps and omni antennas. This backhaul network is specifically used for patrol cars and each car is equipped with an amped omni, proxim wireless gold cards using either sr2.2 or sr2.3 drivers, WinXPSp2, and a secondary ‘Bluetree’ wireless device. The SSID (let’s use WIRELESS NET for an example) is the same for all AP’s but the channels, for signal bleeding reasons, are set to 3, 6, and 11. We use BlueTree modems using the Cingular infrastructure network as our failover when wireless reception drops out but it is pretty slow. The system works fairly well but we have a fair amount of ‘holes’ in our network where 802.11b fails and I would like to remedy this. We are planning on deploying and developing a ‘mesh’ network using Orinoco AP4000’s as repeaters and probably placing them at street intersections where we have decent power and backup batteries. I would like to provide our IT team with a decent ‘map’ of where these bad boys need to be deployed.

I am trying to modify the ns04master script to chart in Mappoint (I have MP 04), along the main street routes the officers would likely use, every point in which Netstumbler detects the specific ‘wireless net’ SSID. I envision having it place pins in Mappoint that are the same size in three or four different colors all based on signal strength or SNR. At each level of SNR, the pins placed would be different colors. Let’s say for example, Green for SNR of 28 or better, Yellow for SNR between 27-20, Orange for SNR between 19-15, and Red for SNR 14-5. I’ll have to research what SNR yield to decent data transfer or communication but you get the point. This way, I could have a color coded map of the streets and basically outline a decent deployment area of probable locations where these AP4000’s could go.
I’ve tested the script out already and it seems to work fine in detecting and plotting the points of all access points in the range of my test unit (Which, by the way, I’ll add the specs of at the end of this post). I however would like it to display ONLY every point it detects the ‘wireless net’ network. I have exported the ns1 files as text and found that the data is probably there to do this, I just am not super sure on how to display it. There have been a few posts that I’ve read on this subject to a small extent but nothing definitive. I’m fairly familiar with VB scripting so I’ll hash away at it tonight but any help would be greatly appreciated!

Toshiba CF29 Toughbook
Proxim gold w/ SR 2.3 drivers (I may have to swap these back to 2.2 from what I’ve read in the past few days on this forum)
WinXPSP2
Amped omni, magmount antenna.
Current v. of Netstumbler.

Thanks!
SW
User avatar
supermanwah
Mini Stumbler
 
Posts: 4
Joined: Sun Nov 06, 2005 6:50 pm

Postby tpeer » Mon Nov 07, 2005 6:13 pm

Wrong place, or at least it sounds like it to me... :D

That being said...
I'd put some code in the "OnScanResultMappoint" sub that checks for the name of the network you want to check. You might also have to change it because it looks like it's tracking the mac address, and moves the pushpin if the strength changes...

Ted
tpeer
Mini Stumbler
 
Posts: 21
Joined: Fri Apr 23, 2004 5:13 pm

Postby supermanwah » Mon Nov 14, 2005 3:46 pm

Code: Select all
' Copyright Marius Milner 2004.
' Use with NetStumbler. Edit. Enjoy.
Dim ActiveMap
Dim LastLocation
Dim MapPointApp
Dim HistoryPushpins
Dim MotionPushpins
Dim WLANPushpins
Dim Vehicle
Dim Initialized
Dim BSSID_Dictionary, Spoken_BSSIDs, New_SSIDs
Dim IsScanning
Dim HadGPSData
Dim LastLatitude, LastLongitude, LastAltitude
Dim DropCrumbs, TrackVehicle, UseSpeech, UseAudio
Dim LastHighlighted
Dim SNR
Dim WNetSSID
Dim WNetMac
Dim WNetLast
Dim WnetCap
Dim WnetMaxSNR

DropCrumbs = True ' True to put black dots everywhere we go, False otherwise
TrackVehicle = True ' True to follow your location while scanning
UseSpeech = True ' Speak names of networks in view
UseAudio = True ' Traditional script audio
const CrumbGap = 2

AddItemContextMenu "HighlightOnMap", "Highlight on map"
Set LastHighlighted = Nothing
Set WLANPushpins = Nothing

Dim TTS
If UseSpeech Then
   Set TTS = CreateObject("Sapi.SpVoice")
   If TTS Is Nothing Then
      UseSpeech = False
   End If
End If

If UseSpeech Then
   TTS.Speak "Good Day two u Duesh bag!"
   Set Spoken_BSSIDs = CreateObject("Scripting.Dictionary")
   Set New_SSIDs = CreateObject("Scripting.Dictionary")
End If

' Initialize

Sub Initialize
   On Error Resume Next

   HadGPSData = False
   SNR = 0
   set BSSID_Dictionary = CreateObject("Scripting.Dictionary")
   
   ' Try to get a handle to an existing instance of MapPoint
   set MapPointApp = GetObject(, "MapPoint.Application")
   
   ' No instance found, create one.
   if Err <> 0 then
      Err.Clear

      set MapPointApp = CreateObject("MapPoint.Application")
      MapPointApp.Visible = true
      MapPointApp.UserControl = false
      MapPointApp.Activate
   end if

   set ActiveMap = MapPointApp.ActiveMap

   dim StartLoc
   Set StartLoc = ActiveMap.FindResults("Broomfield, CO")(1) ' Middle of, uh, somewhere
   
   If DropCrumbs Then
      Set HistoryPushpins = ActiveMap.Datasets.AddPushpinSet("Location History")
      if Err <> 0 then
         Err.Clear
   
         Set HistoryPushpins = ActiveMap.Datasets("Location History")
      end if
   End If
   
   Set WLANPushpins = ActiveMap.Datasets.AddPushpinSet("Wireless LAN data")
   if Err <> 0 then
      Err.Clear

      Set WLANPushpins = ActiveMap.Datasets("Wireless LAN data")
   end if

   If TrackVehicle Then
      Set MotionPushpins = ActiveMap.Datasets.AddPushpinSet("Last Location")
      if Err <> 0 then
         Err.Clear
   
         Set MotionPushpins = ActiveMap.Datasets("Last Location")
      end if
   
      Set Vehicle = MotionPushpins("Last Location")
      if Err <> 0 then
         Err.Clear
         Set Vehicle = FindOrAddPushpin(StartLoc, "Last Location", False)
      end if
   
      Vehicle.Symbol = 176      ' Pirate icon :-)
      Vehicle.Highlight = True
      Vehicle.MoveTo(MotionPushpins)
   End If
   
   Initialized = True
End Sub

Sub HighlightOnMap(bssid, ssid)
   If Not LastHighlighted Is Nothing Then
      LastHighlighted.Highlight = False
      LastHighlighted.BalloonState = 0
   End If
   If BSSID_Dictionary.Exists(bssid) Then
      Set LastHighlighted = BSSID_Dictionary.Item(bssid)
      LastHighlighted.Highlight = True
      LastHighlighted.BalloonState = 2

      LastHighlighted.GoTo
   End If
End Sub

Function FindOrAddPushpin(Loc, Title, InDict)
   On Error Resume Next
   Dim pp
   Set pp = Nothing
   Set pp = ActiveMap.AddPushpin(loc, Title)
'   If pp Is Nothing Then Set pp = ActiveMap.FindPushpin(Title)
   Set BSSID_Dictionary.Item(Title) = pp
   Set FindOrAddPushpin = pp
End Function

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Sub OnGPSPosition (Lat, Lon, Alt)
   ' Lat : double : Latitude, degrees east
   ' Lon : double : Longitude, degrees north
   ' Alt : double : Altitude above sea level, meters

   if not Initialized then
      Initialize
   end if

   if HadGPSData then
      ' If we haven't moved, do nothing.
      if LastLatitude = Lat And LastLongitude = Lon And LastAltitude = Alt Then Exit Sub
   end if
   LastLatitude = Lat
   LastLongitude = Lon
   LastAltitude = Alt
   
   set LastLocation = ActiveMap.GetLocation(Lat, Lon, Alt)
      If DropCrumbs Then
         Dim Crumb
         Set Crumb = FindOrAddPushpin(LastLocation, WNetMac, False)
         IF SNR >= 30 Then
            Crumb.Symbol = 22
         ElseIf SNR >= 21 Then
            Crumb.Symbol = 22
         ElseIf SNR >= 15 Then
            Crumb.Symbol = 18
         ElseIf SNR < 15 Then
            Crumb.Symbol = 17
         End if
         SNR=0
         Dim Flags
         Flags = ""
         if (WnetCap Mod 2) = 1 then Flags = Flags & "ESS "
         if ((WnetCap / 2) Mod 2) = 1 then Flags = Flags & "IBSS "
         if ((WnetCap / 16) Mod 2) = 1 then Flags = Flags & "WEP "
         crumb.Note = "SSID:  " & WNetSSID & vbCrLf & _
         "BSSID:  " & WNetMac & vbCrLf & _
         "CapFlags:  " & Flags & " (" & Hex(Wnetcap) & ")" & vbCrLf & _
         "SNR:  " & SNR
         Crumb.MoveTo(HistoryPushpins)
      End If

   If TrackVehicle Then
      ' Move the visual indicator to the new location.
      Set Vehicle.Location = LastLocation

      MotionPushpins.ZoomTo
   End If
      
   HadGPSData = True
End Sub


' Called when user requests that scanning start, or when scanning is started automatically.
Sub OnEnableScan
   If Not HadGPSData Then Exit Sub ' Discard while no GPS

   if not Initialized then
      Initialize
   end if

   IsScanning = True
End Sub


' Called when user requests that scanning stop.
Sub OnDisableScan
   If WLANPushpins Is Nothing Then
      ' Blah
   Else
      WLANPushpins.ZoomTo
   End If
   IsScanning = False
End Sub

Sub OnScanResult(SSID, BSSID, CapFlags, Signal, Noise, LastSeen)
   ' SSID : String : SSID (Network name)
   ' BSSID : String : BSSID (MAC address)
   ' CapFlags : Integer : 802.11 capability flags
   ' Signal : Integer : signal level (dBm)
   ' Noise : Integer : noise level(dBm)
   ' LastSeen : Time
   If SSID = "Wireless Net" Then
      SNR = Signal - Noise
      IF SNR > WnetMaxSNR Then WnetMaxSNR = SNR
      WNetSSID = SSID
      WNetMac = BSSID
      WNetLast = LastSeen
      WnetCap = CapFlags
      If Not Spoken_BSSIDs.Exists(BSSID) Then
         New_SSIDs.Item(SSID) = 1
         Spoken_BSSIDs.Item(BSSID) = LastSeen
      End If
   End If
End Sub

' Called to indicate that NetStumbler has changed its location information
' for a BSSID. The new location may not necessarily be the place where you
' are right now.
' History: New in 0.4.
Sub OnPositionChange (SSID, BSSID, CapFlags, MaxSNR, Lat, Lon, Alt, FixType)
   ' SSID : String : SSID (Network name)
   ' BSSID : String : BSSID (MAC address)
   ' CapFlags : Integer : 802.11 capability flags
   ' MaxSNR: Integer : highest seen signal-to-noise ratio (dB) that had a position fix associated with it
   ' Lat : Double : Newly calculated latitude, degrees
   ' Lon : Double : Newly calculated longitude, degrees
   ' Alt : Double : Newly calculated altitude (currently not calculated)
   ' FixType : Integer : Reserved for future use.
   if not Initialized then
      ' To get here, start with no script, start scan, then enable script
      Initialize
      IsScanning = True
   end if
   If SSID = "Wireless Net" Then
      WnetMaxSNR = MaxSNR
   End If

   Set newLocation = Nothing
End Sub

' Called when a scan cycle has completed (typically right before a new one starts).
Sub OnScanComplete(FoundNew, SeenBefore, LostContact, BestSNR)
   ' FoundNew : Integer : Count of new BSSIDs
   ' SeenBefore : Integer : Count of not-new BSSIDs
   ' LostContact : Integer : Count of BSSIDs missed since last scan
   ' BestSNR : Integer : SNR of strongest signal (dBm)
   If UseSpeech Then
      If (New_SSIDs.Count > 0) Then
         Dim n, a
         n = New_SSIDs.Count
         a = New_SSIDs.Keys
         For i = 0 to n-1
            TTS.Speak "   New  " & a(i) & "   AP   Found!", SVSFlagsAsync
         Next
         New_SSIDs.RemoveAll
      ElseIf UseAudio Then
         If FoundNew>0 Then
            'PlaySound "ns-aos-new.WAV"
   '      ElseIf LostContact>0 Then
   '         PlaySound "ns-los.WAV"
         ElseIf SeenBefore>0 Then
            ' Still seeing some
            If WnetMaxSNR >= 40 Then
               TTS.Speak "Kick Ass!", SVSFlagsAsync
               'PlaySound "ns-signal-4.WAV"
            ElseIf WnetMaxSNR >= 30 Then
               TTS.Speak "Good!", SVSFlagsAsync
               'PlaySound "ns-signal-3.WAV"
            ElseIf WnetMaxSNR >= 21 Then
               TTS.Speak "Marginal!", SVSFlagsAsync
               'PlaySound "ns-signal-2.WAV"
            ElseIf WnetMaxSNR >= 15 Then
               TTS.Speak "Signal is Crap!", SVSFlagsAsync
               'PlaySound "ns-signal-1.WAV"
            Else
               TTS.Speak "No Signal!", SVSFlagsAsync
               'PlaySound "ns-signal-0.WAV"
            End If
         End if
      Else
         ' Nothing seen
   '      PlaySound "ns-tick.WAV"
      End If
      WnetMaxSNR = 0
   End If
End Sub



I modified the above code (more liked hacked it all to hell) and It seems to produce the results I'm looking for. What do you guys think?

edit: I figured I would add to this thread because I was using a version of the MasterScript. Thanks for the help though Ted.
User avatar
supermanwah
Mini Stumbler
 
Posts: 4
Joined: Sun Nov 06, 2005 6:50 pm

Postby Thorn » Mon Nov 14, 2005 4:48 pm

supermanwah wrote: What do you guys think

I think in the future you should learn why the "Edit" button is on the page. Pull a move like that again, and your posts will not be edited, they will simply be deleted. I'm not spending time here just to clean up your messes.
Thorn
Stop the TSA now! Boycott the airlines.
Thorn
 
Posts: 10340
Joined: Sat Apr 13, 2002 3:00 am
Location: Villa Straylight

PreviousNext

Return to Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron