Transmitting Continuous Wifi Signals

To measure the Mesh Potato transmit power under Linux I needed to generate some continuous Wifi signals at a fixed bit rate. This is not as easy as it sounds so I’m writing a short post as an addendum to the Measuring Wifi Transmit Power post as it might be useful for some one else.

Wifi transmit signals are pulsed with a low duty cycle. For example a short packet like a beacon might only transmit for a few 100uS every second. This makes life difficult for low cost test equipment like my Tek 492 analog spectrum analyser or Wifi antenna test kit that like continuous signals.

All I wanted was a (nearly) continuous signal at a fixed rate and power level so I could check the power level on the spec-an.

However Wifi signals are usually transmitted as part of an exchange with other Wifi devices and the 802.11bg protocols themselves require an exchange of ACKs and occasional beacons that may be transmitted at different rates. On top of that there are automated algorithms that shift the channel bit rate based on packet loss statistics.

Set up

  1. Boot Mesh Potato, connect via Ethernet and kill batmand to prevent any spurious 1 Mbit HNA packets while we are measuring at other rates. We are using ad-hoc mode, AP mode may need some other foo to stop transmitting any automated packet transmission.
  2. Set spec-an for pulsed Wifi measurements (pulse stretcher on my spec-an). I used 1MHz resolution BW, narrow Video BW, min-noise and max-hold functions but this will be spec-an specific.

Generating Continuous Wifi Signals

Couple of ways to do it:

  1. ping broadcasts:
    # iwpriv ath0 mcast_rate 54000
    # ./ping 10.130.1.255 -fqb -s 1400

    Note: Use a long packet (-s 1400) to get a decent packet length and hence transmission time.

  2. regular pings:
    # iwconfig ath0 rate 54M
    # iwconfig ath0 txpower 19
    # ping 10.130.1.1 -fq -s 1400

    Note: we can use regular iwconfig interface, this is also builds up a signal much faster than (1), seems to be a higher packet rate.

  3. netcat:
    # iwconfig ath0 rate 54M
    # iwconfig ath0 txpower 19
    # cat /dev/zero | ./netcat -u 10.130.1.1 7777

    Note: this is much faster again than (2), max-hold function on spec-an not really needed. Must be sending much more data (higher packet rate) than ping.

Notes

  1. I installed the full versions of ping and netcat, the busybox ping didn’t do ping floods (-f).
  2. To get accurate power results I needed to enable the “pulse stretcher” function on my spec-an to cope with the non-continuous Wifi energy. Especially at the higher rates this had a big effect on measured power (4dB at 54M, 0dB at 1M). More modern FFT based spec-ans are better at pulsed signals.
  3. The Tx-power level on iwconfig is not accurate for all rates (e.g. it reports/allows 19dBm at 54M when it’s really 14dBm). It’s closer at rates beneath 36Mbit/s which have 19-20dBm target calibration power levels. The calibration procedure has different target power levels for each bit rate which aren’t reflected in the iwconfig information.
  4. With these spec-an settings and command lines I managed to get measured power outputs under Linux consistent with the calibration test reports of the Mesh Potato. At the lower bit rates the waveform was almost continuous so the max-hold and pulse-stretcher weren’t really required.