# Notes About Injection

## Atheros AR9271

A great chip with open source drivers & **firmware**. However it got some very strange behaviour when it comes to injection bit rates. Path of packets is as follows:

* Data rate specified in Radiotap header. Visible in Wireshark on sending interface
* Data rate gets overwritten by driver to 1Mbit?! Visible as a second packet in Wireshark in sending interface
* Sent packet has data rate configured by `iw dev "$interface" set bitrates legacy-2.4 11`
* Data rate must be set while interface is in managed mode. Command will fail if device is on monitor mode

*The final data rate used by the system for sending is not visible in Wireshark on the sending interface*. This means that the firmware decides about the final data rate. To verify the transmission rate a second adapter is required. Rates can be set using following script:

{% code title="enable\_monitor" %}

```bash
#!/bin/bash
declare -a wifi_adps=("wlx00c0ca973410" "wlxfgdfgd513d1fg51")

frequency="2472"
bitrate="36"

for adapter in "${wifi_adps[@]}"
do
   echo "$adapter"
   interface="$adapter"
   ip link set "$interface" down
   iw dev "$interface" set type managed
   ip link set "$interface" up
   iw dev "$interface" set bitrates legacy-2.4 "$bitrate"
   ip link set "$interface" down
   iw dev "$interface" set type monitor
   ip link set "$interface" up
   iw dev "$interface" set freq $frequency
done

iwconfigc
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dronebridge.gitbook.io/docs/developer-guide/notes-about-injection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
