wifi and girder question

Speak your mind

wifi and girder question

Postby capecodscot on Mon Sep 25, 2006 11:42 pm

Does anyone have any idea how to have girder launch xlobby on a thin client on the establishment of a wi-fi connection? Or is there any other way of having it launch automativally?

Thanks hopefully!
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Postby tomprout on Tue Sep 26, 2006 7:17 am

+1
tomprout
 
Posts: 51
Joined: Wed Mar 15, 2006 9:20 am

Postby tswhite70 on Tue Sep 26, 2006 4:49 pm

Not real sure this will be any help - is Girder running on the Thin Client? Here's a little VBS code that checks to see if the Wireless Lan Adapter is "connected"

Code: Select all
On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

regValueDataMetric = "35"

Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless Network Connection'")

if colItems.count = 0 then
   msgbox "No Wireless Adapter Present!"
else begin
For Each objItem in colItems
msgbox "Name: " & vbTab & vbTab & objItem.Name & vbCrLf _
& "Description: " & vbTab & objItem.Description & vbCrLf _
& "AdapterType: " & vbTab & objItem.AdapterType & vbCrLf _
& "MACAddress: " & vbTab & objItem.MACAddress & vbCrLf _
& "ConnectionStatus: "  & vbTab & objItem.NetConnectionStatus & vbCrLf _
& "NetConnectionID: " & vbTab & objItem.NetConnectionID
If objItem.NetConnectionStatus = 2 then
   msgBox "ONLINE!"
End if

Next
end if


You could call the script from Girder on some interval and then use either sendmessage or the Girder COM object to send the result back to Girder (ie fire your start Xlobby event).

I guess it depends on what exactly you are trying to accomplish - delay startup of Xlobby on system Reboot till network connectivity has been established? If that's the case then just create an OnStartup event in girder that waits some amount of time and then starts Xlobby. I do this on my fat clients so that WOL can get my server up and running before Xlobby starts.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby capecodscot on Tue Sep 26, 2006 5:10 pm

Thanks very much for the reply - you aremiles ahead of me here. I am basically trying to do as you ie. delay the startup of Xlobby on system reboot
untill network connectivity has been established. I have girder running on the thin client which is a UMPC and I would like Xlobby to launch automatically after the wifi connection is completed. I am new to girder so I am a bit unclear as to how to do what you are suggesting.

Thanks for your patience.

tm
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Postby tswhite70 on Tue Sep 26, 2006 6:56 pm

No problem - you didn't say which version of Girder you are using. I'm using the 3.2.9 version so my explanation will be for that. Should work in 4.0 though I would think. The event is not "smart" - it will just start Xlobby after the specified wait time.

Open Girder
Select Edit\Add Multigroup
Right-Click on the new Multigroup and rename it something like "OnStartup"
Select Edit\Add Command
Rename the command "Delay"
With the command highlighted select the "Window" tab in the right hand window.
Open the drop down box and select "Wait"
Enter the milliseconds you want to wait in X/Timeout(ms) box.
Click Apply.
Select Edit\Add Command again.
Rename the command "Start Xlobby".
With the command highlighted select the "OS" tab in the right hand window
Open the drop down box and select "Execute"
In the file box put the path to your Xlobby exe (c:\program files\xlobby2sd.exe)
Click Apply.
Now click back on the Multigroup "OnStartup".
At the top in "Learn Event" area open the drop down box and select "Girder Event".
Click the "Learn Event" button and select "GirderOpen" in the drop down box.

That's it - Girder should run the "OnStartup" multigroup each time it is opened. Put Girder in your Startup Folder so it gets executed on reboot - I'm assuming UMPC has a startup folder?

Hope that helps!
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby tswhite70 on Tue Sep 26, 2006 8:15 pm

Here's a "smart" version using the earlier code:
Code: Select all
On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

regValueDataMetric = "35"

ConnectionStatus=7

Do while ConnectionStatus <> 2
   
   Set colItems = objWMIService.ExecQuery _
   ("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless Network Connection'")

   if colItems.count = 0 then
      msgbox "No Wireless Adapter Present!"
      ConnectionStatus=2
   else begin
      For Each objItem in colItems

         If objItem.NetConnectionStatus = 2 then
            msgbox "Name: " & vbTab & vbTab & objItem.Name & vbCrLf _
            & "Description: " & vbTab & objItem.Description & vbCrLf _
            & "AdapterType: " & vbTab & objItem.AdapterType & vbCrLf _
            & "MACAddress: " & vbTab & objItem.MACAddress & vbCrLf _
            & "ConnectionStatus: "  & vbTab & objItem.NetConnectionStatus & vbCrLf _
            & "NetConnectionID: " & vbTab & objItem.NetConnectionID,,"IsConnected.vbs"
            Set GirderEvent = CreateObject("Girder.GirderEvent")
            GirderEvent.Device = 18
            GirderEvent.EventString = "Start Xlobby"
            GirderEvent.Send()
            ConnectionStatus=2
         
         End if
      Next
   end if

WScript.Sleep 1000

loop


Save the code to a notepad file.
Name the file IsConnected.vbs.
Place the file in your Girder directory.
Create a Girder command that uses OS\Execute to execute the script.
Set the Learn Event for the command to "GirderOpen"
Create another Girder Command called "Start Xlobby" that uses OS\Execute to open the Xlobby thin client exe.
Set the Learn Event for the command to "Start Xlobby" (ie select Girder Event and type "Start Xlobby".

Now whenever Girder Opens it will run the script. The script will run until it finds the Wireless Network Connection in the "connected" state, it checks the state of the connection every 1 second. It will fire the Start Xlobby command by using the Girder Com object once it's connected.

The script is taking up about 20% CPU on my system - you can set the "WScript.Sleep 1000" line in the code to a higher value (it's milliseconds) to reduce CPU usage. Also, once it's working you can delete the MSGBOX command, I just put it in there so we know what adapter we are looking at.

Hopefully this will work on a UMPC, I know it works on normal XP.
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby capecodscot on Tue Sep 26, 2006 10:44 pm

I really thank you for spending so much time on this - thank you for the education.

I am running version 4 on the umpc and very minimal programsso CPU usage should work ok.

I will try this out within the next couple of days and let you know how it works out - no doubt I'll run into more questions.

Thank you again and I wish I could assist you in exchange but it would appear you wouldn't need any!

Cheers,

tm
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Postby capecodscot on Thu Oct 05, 2006 2:18 pm

Just thought I would give an update. This works perfectly - I only had to make a minor adjustment in Girder 4.

Thanks very much.

tm
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Postby tswhite70 on Thu Oct 05, 2006 2:59 pm

Glad to hear it worked! Trust me.. I need all the help I can get :)

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby DCulver on Sun Nov 26, 2006 3:00 pm

This works perfectly - I only had to make a minor adjustment in Girder 4.


capecodscot, What was the adjustment you had to make for Girder 4? I've almost got this working on a UMPC running XP. It goes as far as displaying the message box, but won't trigger a Girder event. I just want it to close an overlay upon wifi connection.

Thanks,
DCulver
 
Posts: 13
Joined: Sat Aug 02, 2003 3:51 pm
Location: Reno, NV

Postby capecodscot on Mon Nov 27, 2006 2:08 pm

Hi,

I'll have to look it up. I had it ruunung ob my laptop which crashed last week. I can probably forward the cml which worked. Incidentally I could not get the 'automatic' script to run ont he UMPC - it only worked on the laptop running XP pro so if you do get this running I would be interested in knowing how.

I will reply later today.

Cheers,

TM
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Postby capecodscot on Mon Nov 27, 2006 4:51 pm

I have founf the 2 gml files you need. You only have to re-direct the location of your client folder. If you would like them let me know.

TM
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Postby DCulver on Tue Nov 28, 2006 1:27 am

capecodscot,

I'm using Xlobby on the UMPC only to control music, so when I'm done listening, I put it in standby, then when I start again I open an overlay and run the script with a file execute action and an OnResumeSuspend event in Girder. The script seems to run fine as I get a message box indicating that a wireless connection has been made. The problem I'm having is with the code to tell Girder to send an event to Xlobby at that point to close the overlay.

I'd like to take a look at your gml files, I'll PM you my email.

Thanks,
DCulver
 
Posts: 13
Joined: Sat Aug 02, 2003 3:51 pm
Location: Reno, NV

Postby DCulver on Wed Nov 29, 2006 1:48 am

Thanks to harleydude at the Girder forum, I've got this working.

Code: Select all
Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.Device = 18
GirderEvent.EventString = "Start Xlobby"
GirderEvent.Send()


Needs to be replaced with:

Code: Select all
Set GirderEvent = CreateObject("GirderX.Girder")
call GirderEvent.TriggerEvent("Start Xlobby", 18, "", "", "", 0)


For the script to work in Girder 4.
DCulver
 
Posts: 13
Joined: Sat Aug 02, 2003 3:51 pm
Location: Reno, NV

Postby capecodscot on Tue Jan 02, 2007 9:08 pm

Been away for a while but back to battle with this issue. I tried out the correction to the scrpit by 'harleydude' which works fine but I still have to wait for the ip address to be aquired and then have to enter 'ok' on the Isconnebted.vbs message box. This then launches xlobby on the UMPC but if I click ok beforehand it will not launc. I am basically trying to do something almost the same as you ie. put the UMPC into standby and then, later, on pressing the power button to re-launch xlobby totally automatically when the wireless connection is fully established. Have you managed to do this and if so I would really like to see your gmls.

Thanks
capecodscot
 
Posts: 81
Joined: Sun Dec 04, 2005 11:21 pm
Location: MA, USA

Next