Jump to content

Wifi & Ethernet

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
ki4jgt

ki4jgt

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
I'm wanting to control wifi with python. Telling it to connect to access points with certain names and to every computer (which has my program installed, I want my computer to be able to find on that wifi and on any other network interface which may be at my computer's disposal. What would I need to look into for this in Python. (Sorry, I'm a newb) :-) I've just finished about 2 online python tutorials. So now, I'm looking to experiment. I've added the pythonwifi module to my pyton, but I have no Idea what I'm doing, or even if that is the best module to use. Any and all help is appriciated :-)

#2
ki4jgt

ki4jgt

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
Is using python to control wifi even possible? If not, what language (Besides Java or C) should I use?

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
This would normally be done with BASH, I do not think you are on a Linux/Mac system though. You may need to make a driver afterall, or find some command line utility that allows access to the wireless manager of your operating system.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
ki4jgt

ki4jgt

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
Yeah, I have Ubuntu Linux. But I'm very new to programming in advanced languages. I'm usually using Just/LibertyBASIC which is kind of like Python (Except it's not as advanced) It reads the same way. IE

PRINT "HELLO WORLD!"
INPUT "WHAT IS YOUR NAME"; NAME$
PRINT NAME$

You get the picture. It was very Windows based. The program I am dealing with now needs to be available on all OSs. So naturally I chose Python. :-) I just don't know what to do past the two python tutorials which were very basic.

***EDIT: Never mind if it's possible or not. This is my intent.
If someone wanted to put this together. - Ubuntu Forums
http://forum.codecal...programing.html

Edited by ki4jgt, 20 January 2011 - 04:33 AM.
Additional details


#5
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
You can create a server with Python (with its networking modules), and listen on a dedicated port, say 4321. You can then pass a system command to nmap and parse its output to find local computers, and connect to them at port 4321 to see if they have the server software installed. That is for LAN

For wifi networks, you will need a wireless driver that support scanning (or promiscuous mode) and talk to the system command iwlist or iwscan to find an open network, connect to it with iwconfig, and then try to ping the computer at port 4321 to see if the python server is running. I am not sure what you are wanting to do with them though.

I've never written a page of Python before, so that is all I can contribute, other than theory :)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#6
ki4jgt

ki4jgt

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
to be honest, :-) I've only written around 5000 lines of BASIC so we're pretty much in the same boat. B/C Python pretty much words the same. From what I've read so far :-)