intrig-unicamp/mininet-wifi

Frequency is not changing - sta1.wintfs[0].setFreq(2437)

andredemori opened this issue · 6 comments

I'm trying to change the frequency, but after the command sta1.wintfs[0].setFreq(2437) the frequency still the same like showed below:

*** Running CLI
*** Starting CLI:
mininet-wifi> py sta1.wintfs[0].freq
2.432

It is an adhoc network


net.addLink(sta1, cls=adhoc, intf='sta1-wlan1',
                ssid='adhocNet', mode='g', channel=5, ht_cap='HT40+', **kwargs)
net.addLink(sta1, cls=adhoc, intf='sta1-wlan0',
                ssid='adhocNet', mode='g', channel=5, ht_cap='HT40+', **kwargs)

Please use iw instead.

I tried:

sta1.wintfs[0].cmd('iw dev %s set freq %d' % (sta1.wintfs[0].name, 2437))

sta1.wintfs[0].cmd('iw dev %s set freq %d' % (sta1.params['wlan'][0], 2437))

sta1.wintfs[0].cmd('wpa_cli -i %s set freq 2437' % sta1.wintfs[0].name)

But none worked and the frequency still the same

mininet-wifi> py sta1.wintfs[0].freq
2.432

Can you please check the iw doc and try the commands via terminal?

I'm trying via terminal with xterm sta1

iw dev sta1-wlan0 set freq 2437

but i'm receiving the following error:

device or resource busy

Anyway, I realy need to change frequency directly in the code, without access terminal via xterm because of my application that calls mininet-wifi

device or resource busy

This is something particular to iw. Sometimes you have to bring the interface down. You need to check its doc.

Anyway, I realy need to change frequency directly in the code, without access terminal via xterm because of my application that calls mininet-wifi

You may program your own methods with the commands you need to use.

Closing due to no new interactions.