Welcome to PhantomPilots.com

Sign up for a weekly email of the latest drone news & information

Permanently increasing the FPV + RE Wifi TX Power

Discussion in 'Phantom 2 Vision + Discussion' started by Serpent, Aug 16, 2014.

  1. Serpent

    Joined:
    May 20, 2014
    Messages:
    86
    Likes Received:
    12
    UPDATED: 26-Oct-2014
    From my learning it appears the Range Extender is adaptive and finally I settled on *not* hard setting the TX Power in the Range Extender, but hard setting the TX Power at 15 in the bird only. I've had video up to 1KM away (flying down the Chao Phraya river in Bangkok with other radio and wifi signals in the viscinity).
    **********************************************************************************

    Here's sharing my steps to permanently increasing the FPV + RE Wifi TX Power.

    The root password and some of the commands are based on other's work particularly very green and his post here http://www.phantompilots.com/viewtopic.php?f=24&t=15771 and isopro and his post here http://www.phantompilots.com/viewtopic.php?f=7&t=20710 in this forum. Thanks to urgno also on this forum for pointing out the commands should be added to the startup script. I did more research and have updated this original post.

    SSH Access:
    DJI PV2+ SSH 192.168.1.1 root / 19881209
    SJI Range Extender SSH 192.168.1.2 root / 19881209



    CPU Info:


    root@Phantom:~# less /proc/cpuinfo

    system type : Atheros AR9342 rev 2
    machine : DJI TL-PHANTOM v2
    processor : 0
    cpu model : MIPS 74Kc V4.12
    BogoMIPS : 266.64
    wait instruction : yes
    microsecond timers : yes
    tlb_entries : 32
    extra interrupt vector : yes
    hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0918, 0x0268, 0x0138]
    ASEs implemented : mips16
    shadow register sets : 1
    kscratch registers : 0
    core : 0
    VCED exceptions : not available
    VCEI exceptions : not available


    It's Open-Wrt and use Trunk ar71xx for install packages. Installed wireless-tools from here as follows:
    http://downloads.openwrt.org/snapshots/ ... ages/base/

    Used SCP to copy to created /tmp1 folder:

    Installed as follows:
    root@Phantom:~# opkg install /tmp1/wireless-tools_29-5_ar71xx.ipk
    Installing wireless-tools (29-5) to root...
    Configuring wireless-tools.


    Check TX Power:
    root@Phantom:~# iwconfig
    wlan0.sta1 IEEE 802.11bgn Mode:Secondary Tx-Power=3 dBm
    RTS thr:eek:ff Fragment thr:eek:ff
    Power Management:eek:n

    lo no wireless extensions.

    wlan0 IEEE 802.11bgn Mode:Master Tx-Power=3 dBm
    RTS thr:eek:ff Fragment thr:eek:ff
    Power Management:eek:n

    eth0 no wireless extensions.

    br-lan no wireless extensions.



    Default TX Power = 3dB

    On the PV2+, to set Default TX Power to 15dB:

    View the original file, before we change it:
    cat /etc/rc.local

    For first time to add the additional line to the file that runs after the drone starts:
    sed -i 's/sh \/etc\/watchdog_wireless.sh/iw phy phy0 set txpower fixed 1500'\\n'sh \/etc\/watchdog_wireless.sh/g' /etc/rc.local

    Replace 1500 with preferred transmit power (xx00)

    Check line is added correctly:
    cat /etc/rc.local

    If changing after the line has already been added:
    sed -i 's/iw phy phy0 set txpower fixed [0-9]*/iw phy phy0 set txpower fixed 1500/g' /etc/rc.local

    Reboot:
    root@Phantom:~# reboot

    After re-join the DJI Wireless LAN and SSH in to the PV2+ again.

    Check:
    root@Phantom:~# iwconfig wlan0
    wlan0 IEEE 802.11bgn Mode:Master Tx-Power=15 dBm
    RTS thr:eek:ff Fragment thr:eek:ff
    Power Management:eek:n


    Done!


    On the RE, to set Default TX Power to 15dB:

    View the original file, before we change it:
    cat /etc/config/wireless

    Check format in the file of the line for 'option txpower'. Make a note:
    1) If there is one or two spaces between the word txpower and the number.
    2) If there is an apostrophe (') around the number of not:

    In my case on the RE I had one space before the number and then an apostrophe (') so used this command to change the TX power:

    sed -i 's/option txpower '\''[0-9]*/option txpower '\''15/g' /etc/config/wireless

    Check line is added correctly:
    cat /etc/rc.local

    You can use the same command to adjust the TX power, changing 15 to a different value:
    sed -i 's/option txpower '\''[0-9]*/option txpower '\''15/g' /etc/config/wireless

    Reboot:
    root@Phantom:~# reboot

    After re-join the DJI Wireless LAN and SSH in to the PV2+ again.

    Check with:
    root@Phantom:~# iwconfig wlan0

    Done!

    I have not experimented above 15 [1500].
    Use at your own peril! I cannot be responsible in case of any problem/failure.



    ---

    Interesting contents of ser2net.conf for defined ports:

    2001:raw:6:/dev/ttyS0:115200 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS
    #2002:raw:600:/dev/ttyS1:9600 NONE 1STOPBIT 8DATABITS XONXOFF LOCAL -RTSCTS
    2003:raw:5:/dev/ttyS2:9600
    2004:raw:5:/dev/ttyS3:115200
    2005:raw:5:/dev/ttyS4:9600
    2006:raw:5:/dev/ttyS5:9600
    2007:raw:5:/dev/ttyS6:9600 tw=tw1 tr=tr1
    3001:telnet:0:/dev/ttyS0:19200 remctl banner1
    3011:telnet:3:/dev/ttyS0:19200 banner2
    #3002:telnet:0:/dev/ttyS1:9600
    3003:telnet:0:/dev/ttyS2:9600 banner3
    3004:telnet:0:/dev/ttyS3:115200
    3005:telnet:0:/dev/ttyS4:9600
    3006:telnet:0:/dev/ttyS5:9600
    3007:telnet:0:/dev/ttyS6:9600
    5001:rawlp:10:/dev/lp0


    Disk Space on PV2+:

    root@Phantom:~# df
    Filesystem 1K-blocks Used Available Use% Mounted on
    rootfs 4096 1072 3024 26% /
    /dev/root 3072 3072 0 100% /rom
    tmpfs 14564 76 14488 1% /tmp
    tmpfs 512 0 512 0% /dev
    /dev/mtdblock3 4096 1072 3024 26% /overlay
    overlayfs:/overlay 4096 1072 3024 26% /



    Can anyone advise for the output format of the flight telemetry if accessing the ser2net defined ports? If i can figure it out i could engage a developer to create flight telemetry logging (stored on the PV2+ and then downloadable after flying or possibly save to the camera memory card).


    Regards,

    Richard (Serpent)
     
  2. srandall25

    Joined:
    Apr 17, 2014
    Messages:
    692
    Likes Received:
    4
    looks simple enough.. ;)
     
  3. DBS

    DBS

    Joined:
    Apr 6, 2014
    Messages:
    1,187
    Likes Received:
    163
    Location:
    Ft. Pierce, Florida
    Already been done by RC Taco in the Vision Plus Utility app... logs the file to your phone or tablet so don't have to download...
    Maybe give him a Holla? (Forum user name "ocatcr")

    Also ... The repeater comes from the factory with the specs showing output at 20dB... (100mW)
    Isn't your steps above showing the power going the wrong way... decreasing output?
     
  4. locoworks

    Joined:
    Jul 4, 2014
    Messages:
    471
    Likes Received:
    10

    LOL. :mrgreen:
     
  5. juangelb

    Joined:
    May 30, 2014
    Messages:
    89
    Likes Received:
    0
    Hi Serpent,

    Firtst of all tks very much for all this usefull info.
    I did the procedure and got iwinfo showing Tx-Power=15 dBm on both devices ... till cycling power.
    Original Tx-Power came back on both devices. I.E it did not saved the changes.

    What coud be wrong, please.

    TKS : Juan
     
  6. urgno

    Joined:
    Nov 18, 2013
    Messages:
    237
    Likes Received:
    1
    Location:
    near Venice - Italy
    seem the command has to be added to openwrt startup script :roll:
     
  7. Serpent

    Joined:
    May 20, 2014
    Messages:
    86
    Likes Received:
    12
    Sorry the above setting doesn't retain after reboot. As urgno points out the setting may need to be added to the startup script (/etc/rc.local i understand).
    I'm going to test this later today and report back.
     
  8. Serpent

    Joined:
    May 20, 2014
    Messages:
    86
    Likes Received:
    12
    I've edited my original post. This should now work to successfully hard set the TX power on the PV2+ and RE. I've tested it with rebooting.
     
  9. urgno

    Joined:
    Nov 18, 2013
    Messages:
    237
    Likes Received:
    1
    Location:
    near Venice - Italy
    thanks to you for your work :)
     
  10. Morgon

    Joined:
    Aug 15, 2014
    Messages:
    453
    Likes Received:
    64
    Location:
    Glen Burnie, MD
    After some tinkering today, I may have found an alternate way of permanently changing this value:
    If changes to /etc/config/wireless get clobbered during a reset, I think it's due to the 'overlay' directory copying itself to the standard root files, basically becoming a fresh instance each boot (Speculation, someone smack me if not).

    When I modified /overlay/etc/config/wireless, the changes survived a reboot.
    Obviously I wouldn't suggest using this as your go-to for every change, as that could prevent a reboot from fixing any mistakes... but this is a benign enough change that it could be a worthy alternative.
     
  11. Serpent

    Joined:
    May 20, 2014
    Messages:
    86
    Likes Received:
    12
    Great work Morgan.
    Continuing the exploration i've found my RE was at 20dB TX power without hard setting the value. I'm fairly sure it's adaptive and wondering if it's necessary to hard set set the TX power on the RE in attempt to increase the FPV range. Hard setting the TX on the PV2+ i think has more effect.
     
  12. Morgon

    Joined:
    Aug 15, 2014
    Messages:
    453
    Likes Received:
    64
    Location:
    Glen Burnie, MD
    Interestingly enough, I had the exact opposite happen. The PV2+ went back to adaptive, and my RE stayed at my set 15db strength.
     
  13. ToThePoint

    Joined:
    Jun 4, 2014
    Messages:
    618
    Likes Received:
    1
    Location:
    Antwerp, Belgium
    Yes the repeater gives 20db ( depends on what antenna you use ) but the bird gives max 3.5db out. Even the app of RC Taco states it would give 20db but it isn't. If you change the output in his app you will see a difference in DB but it maxes out on 3.5db. I have tested that yesterday and seen on the meter.