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?
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
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.