Getting and setting MAC address, Subnet Mask Address | Thread profile
Thread profile page for "Getting and setting MAC address, Subnet Mask Address" on http://www.forum.nokia.com.
This report page is a snippet summary view from a single thread "Getting and setting MAC address, Subnet Mask Address", located on the Message Board at http://www.forum.nokia.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity, which are reported in a table below.
Additional thread profile information is also shown in the following ways:
Warning: These statistics are generated using 'best efforts' and can experience delays and reporting errors at times. Please note that such statistics do not constitute a thread's popularity and/or exact posting volumes at any given reporting period.
Title:
Getting and setting MAC address, Subnet Mask Address
Started 4 months, 2 weeks ago (2008-07-18 16:41:00)
by Blackhawk255
Hey I'm new to this forum, so sorry if I'm not use to the customs. I am writing a program on an N80 in pys60. I have come across the need to get the MAC address, and get and set the Subnet mask address programmatically through python. I've been looking all over the web and I have not found a way to do it. I was wondering if someone could help me with this.
Started 4 months, 2 weeks ago (2008-07-18 16:52:00)
by gaba88
HI Blackhawk225 first of all welcome to the python discussion board as far as i know you can get the IP address of your phone using pys60 if you know bit networking concepts then you can easily get other things. i hope this works for you.
Started 4 months, 2 weeks ago (2008-07-19 17:18:00)
by jethro.fn
Quote: Originally Posted by Blackhawk255 I have come across the need to get the MAC address, and get and set the Subnet mask address programmatically through python. This is not possible as far as I can tell. It would require an extension written in C++ and there aren't any yet. Also note, that these low ...
Started 4 months, 2 weeks ago (2008-07-19 22:31:00)
by krtrivdi
Hi, Its not possible to get the physical address but surely you can get the logical address of the device. Because it falls under the device capabilities. If you can play with the root level of symbian OS and hardware you can get it but as you know S60 is layer above symbian OS so you have to penetrate the OS first !
Started 4 months, 2 weeks ago (2008-07-19 23:30:00)
by croozeus
Hi Blackhawk, Looks like you would need to hard code your MAC address, which would make your app : non portable. (Which is the only possible solution, I can see using Pys60) You can get the MAC Address by using code *#62209526# on the device Br, Croozeus
Started 4 months, 2 weeks ago (2008-07-20 05:32:00)
by gaba88
hi Blackhawk255 yes once you get the mac address i think certainly get the other things with a little bit of manipulations on it. @kiran sir great to see you again in the discussion boards.
Started 4 months ago (2008-07-31 09:35:00)
by reaper7
How to check with Pyton which IP I received from DHCP while connecting to AP? I've found such script: Code: import socket ap_id = socket.select_access_point() apo = socket.access_point(ap_id) apo.start() print "PHONE IP IS", apo.ip() But for me it works only in case I select connection different than WLAN (e.g. GPRS); while selecting WLAN IP address is always 196.254...
Started 4 months ago (2008-08-03 21:09:00)
by reaper7
@szallah: Of course you're right - if IP is set up manualny the script will show it correctly. But if I set it up manually of course I know it well and so don't have to check it I've set DHCP, connect to different APs and want to know which IP was assigned for me and this doesn't work correctly.
Started 3 months, 4 weeks ago (2008-08-05 10:02:00)
by reaper7
another way to get the real address: Code: msg = "Ok" intip = "0.0.0.0" port = 8511 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) apid = None apid = socket.select_access_point() if not apid: sys.exit() apo = socket.access_point(apid) socket.set_default_access_point(apo) apo.start() s.bind(("0.0.0.0", port)) s.sendto(msg, ("255.255.255.255", port))...
Size: 1,056 bytes
Customize:
Top contributing authors for Getting and setting MAC address, Subnet Mask Address
Quote: Originally Posted by marcelobarrosalmeida Same problem. Sometimes ip.start() seems not to have enough time to get a valid IP and returns 192.254.x.y IP (link local addressing - RFC 3927). I tried to stop/start the selected access point but the problem (?) remains. Any workaround or is this the expected behavior ? hi marcelobarrosalmeida welcome to the forum nokia python discussion boards. Have you tried the method given by reaper7 in...
croozeus in another post gave a link to an interesting application in c++. IfInfo shows twice a single interface with different settings! Here are the results of operations on my phone with the active WLAN (working Nokia Internet Browser) Code: Interface Name: EthWlan4 State: Up Speed Metric: 10000 Mac Address: 00:1C:D6:xx:xx:xx IP Address: 196.254.13.225 Netmask: 0.0.0.0 Broadcast: 0.0.0.0 Gateway: 0.0.0.0 DNS 1: 192.168.0.1 DNS 2: Interface...
Quote: Originally Posted by gaba88 hi lhuovine have you tried the another way provided by reaper7 in this thread earlier it may work for you also. Enjoy Pythoning Gaba88 Sure, it works well enough (btw. thanks for reaper7 for the workaround). Of course it would be nice that the "apo.ip()" method worked, too I guess it would be time to file a bug report regarding this issue (unless someone hasn't done that already).
Quote: Originally Posted by croozeus Hi Blackhawk, Looks like you would need to hard code your MAC address, which would make your app : non portable. (Which is the only possible solution, I can see using Pys60) You can get the MAC Address by using code *#62209526# on the device Br, Croozeus I was wondering what you mean by code *#62209526# on the device. What do you mean by code? Code where?
Hi Blackhawk, Looks like you would need to hard code your MAC address, which would make your app : non portable. (Which is the only possible solution, I can see using Pys60) You can get the MAC Address by using code *#62209526# on the device Br, Croozeus
And the code is easier to remember, if you think of it as *#MAC WLAN# ('M' on the regular mobile phone (ITU-T) keypad is on the key '6', 'A' is on the key '2', 'C' is also on '2', etc.).
croozeus in another post gave a link to an interesting application in c++. IfInfo shows twice a single interface with different settings! Here are the results of operations on my phone with the active WLAN (working Nokia Internet Browser) Code: Interface Name: EthWlan4 State: Up Speed Metric: 10000 Mac Address: 00:1C:D6:xx:xx:xx IP Address: 196.254.13.225 Netmask: 0.0.0.0 Broadcast: 0.0.0.0 Gateway: 0.0.0.0 DNS 1: 192.168.0.1 DNS 2: Interface...
Same problem. Sometimes ip.start() seems not to have enough time to get a valid IP and returns 192.254.x.y IP (link local addressing - RFC 3927). I tried to stop/start the selected access point but the problem (?) remains. Any workaround or is this the expected behavior ?
Quote: Originally Posted by Blackhawk255 I have come across the need to get the MAC address, and get and set the Subnet mask address programmatically through python. This is not possible as far as I can tell. It would require an extension written in C++ and there aren't any yet. Also note, that these low level networking parameters require the CommDD and NetworkControl capabilities to access.
Related threads on "Nokia Developer Discussion Boards":
The router settings say it has an IP address, subnet... The router settings say it has an IP address, subnet mask, etc - I tried entering those manually into the iMac also with no success
01:24 PM March 29, 2008
from twitterrific