Chat freely about anything...

User avatar
By htwtsang
#75602 I am trying to set the frequency of the wifi to a certain wifi channel band. I know there is a function in the SDK that allow this but how does the parameters relate to the wifi frequency channels i.e https://en.wikipedia.org/wiki/List_of_WLAN_channels.
Unfortunately I do not have a way to directly test the frequencies myself.

Code: Select allenum FIXED_RATE {
    PHY_RATE_48       = 0x8,
    PHY_RATE_24       = 0x9,
    PHY_RATE_12       = 0xA,
    PHY_RATE_6        = 0xB,
    PHY_RATE_54       = 0xC,
    PHY_RATE_36       = 0xD,
    PHY_RATE_18       = 0xE,
    PHY_RATE_9        = 0xF
};

#define FIXED_RATE_MASK_NONE    0x00
#define FIXED_RATE_MASK_STA     0x01
#define FIXED_RATE_MASK_AP      0x02
#define FIXED_RATE_MASK_ALL     0x03

/**
  * @brief     Set the fixed rate and mask of sending data from ESP8266.
  *
  * @attention 1. Only if the corresponding bit in enable_mask is 1, ESP8266 station
  *               or soft-AP will send data in the fixed rate.
  * @attention 2. If the enable_mask is 0, both ESP8266 station and soft-AP will not
  *               send data in the fixed rate.
  * @attention 3. ESP8266 station and soft-AP share the same rate, they can not be
  *               set into the different rate.
  *
  * @param     uint8 enable_mask : 0x00 - disable the fixed rate
  *    -  0x01 - use the fixed rate on ESP8266 station
  *    -  0x02 - use the fixed rate on ESP8266 soft-AP
  *    -  0x03 - use the fixed rate on ESP8266 station and soft-AP
  * @param     uint8 rate  : value of the fixed rate
  *
  * @return    0         : succeed
  * @return    otherwise : fail
  */
sint32 wifi_set_user_fixed_rate(uint8 enable_mask, uint8 rate);
User avatar
By btidey
#75605 I assume you mean setting the channel of an esp8266 AP

WiFi.softAP(ssid, password, channel, hidden) is the standard call where channel (1-13) sets the channel frequency used to the standard Wifi channel frequencies.