Results 1 to 7 of 7

Thread: For those having trouble setting tx power and/or country for crda

  1. #1
    Join Date
    2015-May
    Posts
    7

    For those having trouble setting tx power and/or country for crda

    I have made a script that fixed it for me and maybe others. For some reason crda needs to be woken up first before country is actually set (which is odd) even if it outputs an error.

    this fixes error -22 for me and can possibly fix other issues people may be having.

    I assume in the script your device is wlan0 and your target tx power is 30, as for the country it is US

    So say you have your country set first and then start crda, it wont listen and outputs error as well as for setting tx power from iwconfig but I found out that starting it without a country set then after error setting country and then starting it again only with no error.

    only then would it read from iw reg set

    apt-get update
    apt-get install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev rfkill


    Code:
    echo "                                        !!WARNING!!"
    echo "MAKE SURE YOU HAVE COMPILED AND INSTALLED LATEST crda-x.xx.tar.xz AND wireless-regdb-xxxx.xx.xx.tar.xz"
    echo "needs python-m2crypto, libgcrypt11, libgcrypt11-dev, libnl-dev and rfkill"
    echo "This can be found here https://www.kernel.org/pub/software/network/"
    echo "Be sure to use these instructions: http://pastebin.com/pY3i5f8h"
    echo "Hit ^C to stop now if you wish. Also, it is prefered to do this on a fresh boot/reboot"
    echo "-----------------------------------------------------------------------------------------------"
    sleep 2
    echo "To change this script to work for a specfic device and/or country do something like this:  e.g."
    sleep 1
    echo "# sed -i ‘s/wlan0/wlan1/’ path/to/this/script"
    echo "# sed -i ‘s/US/BO/’ path/to/this/script"
    echo "Starting in 10 seconds"
    sleep 11
    echo "Stopping Possible Conflicting Services"
    service NetworkManager stop &> /dev/null
    service wicd stop &> /dev/null
    service networking stop &> /dev/null
    systemctl stop NetworkManager wicd networking &> /dev/null
    sleep 2
    rfkill unblock wlan &> /dev/null
    echo "" > /etc/default/crda &> /dev/null
    echo "Starting crda"
    crda &> /dev/null
    sleep 2
    export COUNTRY=00
    crda
    iw reg set US
    iw reg get
    echo "Taking down wlan0"
    ifconfig wlan0 down
    sleep 3
    echo "Setting Region to United States"
    iw reg set US
    sleep 3
    echo "Setting TxPower to 30"
    iwconfig wlan0 txpower 30
    sleep 2
    echo "Starting wlan0"
    ifconfig wlan0 up
    echo "Putting wlan0 interface up"
    echo "------------------"
    echo " Max tx Power Set "
    echo "------------------"
    sleep 3
    echo "Turning Power Management off..."
    ifconfig wlan0 down
    sleep 1
    iwconfig wlan0 power off
    sleep 1
    ifconfig wlan0 up
    sleep 1
    echo "-------------------"
    echo "  Power Managment  "
    echo "    is now OFF     "
    echo "-------------------"
    sleep 3
    echo "==================================="
    echo "Here are your all your new settings"
    echo "==================================="
    iw reg get
    echo
    echo "==================================="
    iwconfig wlan0
    echo "==================================="
    echo "Restoring Stopped Services"
    service NetworkManager start &> /dev/null
    service wicd start &> /dev/null
    service networking start &> /dev/null
    systemctl start NetworkManager wicd networking &> /dev/null
    sleep 2
    echo "** If all is well, there should have been no errors outputed **"
    sleep 2
    Last edited by destreza; 2015-06-20 at 01:11. Reason: modified to be more likely to fix error code -7 and -22

  2. #2
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580
    Thanks des.

    like wn722 would say..
    Quote Originally Posted by wn722 View Post
    hm anyone tried this with TP Link WN722N?
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  3. #3
    Join Date
    2015-May
    Posts
    7
    Quote Originally Posted by Quest View Post
    Thanks des.

    like wn722 would say..
    np

    I could not find anything about -22 error I have been getting, but by random chance this "trick" seemed to work.

  4. #4
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  5. #5
    Join Date
    2015-May
    Posts
    7
    FCC test results[edit]
    Radiated power (with antenna): 98.72 dBuV/m peak (802.11b CH6)
    Output power (before antenna): 17.8 dBm peak (802.11b CH6) (60.26mW)

    Your chipset (AR9002U) supports modification to max tx (dbm) power but the results will only induce instability if you ask me.


    You may try but don't expect the best results.

  6. #6
    Join Date
    2014-Nov
    Posts
    1
    Quote Originally Posted by Quest View Post
    i have TP-Link Wn722N adapter and it works following this tutorial. i can set now my card to 30dbm or 1000mW

    https://forums.kali.org/showthread.p...r+Higher+30dbm

  7. #7
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580
    you're about the first human in the universe reporting success in cranking up a WN722N, Nakishus. I will give that a spin whenever Kali 1.1.1 comes out. Thanks for the info!
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

Similar Threads

  1. Unable to change region/country so i can Tx Power to 30dBm
    By BoriKing in forum NetHunter General Questions
    Replies: 0
    Last Post: 2017-09-22, 17:42
  2. Got trouble making crda in Kali
    By voice2006 in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2013-12-09, 11:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •