I am trying to set my raspberry Pi's WiFi frequency to a fixed value. Is that possible through a command ? I also need to do the same thing for the embedded Bluetooth module of the raspberry. Is this possible?

Thank you

  • I assume you are talking about your Wifi set to master mode, i.e. you operate an access point at a given frequency. If not please specify the wifi mode and purpose of your question. – oh.dae.su Nov 7 '18 at 15:09
  • Yes master mode it is. Since in client mode i cannot change the frequency of the access point I am connected to – Sparky Nov 7 '18 at 17:30


I assume you use hostapd for creating the access point. To the best of my knowledge, I do not know a command line interface for hostapd to change the channel number, i.e. the frequency. So you need to change the configuration file and then restart the hostapd service.
Nevertheless, you can do this quickly from the command line, e.g. by this sequence of commands:

sudo sed -i "/channel=/c\channel=xx" /etc/hostapd/hostapd.conf
sudo systemctl stop hostapd.service
sudo systemctl start hostapd.service

The first line replaces the line in the configuration file that specifies the current channel with the channel of your choice (replace xx with the channel of your choice).
The second and third line first stop and then start the hostapd service with the changed configuration.


Bluetooth uses a frequency hopping scheme, where subsequent bluetooth messages will be exchanged on different channels. The spectrum used is the 2.4GHz ISM band, which for Bluetooth is divided into 79 channels of 1MHz width.
So for regular bluetooth operation, fixing a channel (frequency) is not possible.

| improve this answer | |
  • Yes I use the hostapd for creating the access point. Thank you for your help. – Sparky Nov 8 '18 at 14:10
  • 1
    +1, you can shorten the restart of hostapd with sudo systemctl restart hostapd.service. – Ingo Nov 9 '18 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.