Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IoT and VFP

Status
Not open for further replies.

dkean4

Programmer
Feb 15, 2015
282
US
Is there any way for a VFP app on a PC (Win 7) to automate connections to WiFi IoT devices which offer WiFi connections to users. Any simple working code... via automation, WMI script...??


TIA,


Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Of which IoT devices are you talking? The typical devices will not act as a wifi access point and provide wifi for phones, tablets or computers, but need an access point to get wifi access to the internet. It's called internet of things for that reason and not the inverse.

But of course, I would also assume everything you can do "manually" also has an API function or a WMI class or a COM server you're able to use from within VFP.

What I found about WMI is a base class MSNdis_80211_BSSIList but also, that WMI access to instances of this depends on wifi adapter vendors providing a WMI class. Lower level access seems to be done via Native Wifi API: You might dig into this.

Bye, Olaf.
 
Olaf,

One of several devices I want to start experimenting is the ACROBOTIC ESP8266 ESP-12e. It has a good reputation, by now as being stable. It can act as a server or as a client. The client side of that device will have to access my router, I guess. I'm not sure that it is possible to turn around and issue commands to that device when it is logged into my router's SSID account. But at first, I guess I will need to log in to the SSID account it offers and I guess AT commands or some other way send commands to it. I just ordered it today. I'm just exploring how far VFP can bridge the gap.






Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Prehaps this

[pre]Public Array aconnections[1]
aconnections[1]=''
LOCAL singleconnection
i = 1
o = Createobject("Shell.Application")
ns=o.NameSpace (3)
For Each oItems In ns.Items
If oItems.Name ="Network Connections" && Windows Anglais
colNetwork = oItems.getfolder
If Vartype(colNetwork) = "O"
For Each colConn In colNetwork.Items
If Alen(aconnections)= 1 And Empty(aconnections[1])
Else
Dimension aconnections[ALEN(aconnections)+1]
Endif
aconnections=colConn.Name
i = i +1
Next
Endif
Endif
Next
For i = 1 To Alen(aconnections)
If "Titan" $ aconnections &&Un example
Connect(aconnections)
Endif
Next
Function Connect(lcConnexion)
For Each colConn In colNetwork.Items
If colConn.Name = lcConnexion
singleconnection = colConn
Exit
Endif
Next
For Each clsVerb In singleconnection.Verbs
If "C&onnect" = clsVerb.Name Or "En&able" = clsVerb.Name
Try
singleconnection.InvokeVerb("C&onnect")
Catch
singleconnection.InvokeVerb("En&able")
ENDTRY
Endif
Next
Endfunc
[/pre]

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

Sorry for the late response. My PC croaked and it took me a whole week to restore some of the data lost.

Thanks for the code. Very interesting.



Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top