Phantom 3 Standard range mod , let's do it together...

EEPROM - Wikipedia, the free encyclopedia
I propose to change the region of 1 per minute. DGI Go sets the region every time you start!


p.s. You should study .....

Hope wikipedia also teaches you how to solder when it dies.
How do you know what data gets written and where ?
Do you know the physical memory type it is being stored in ?
Have you ever had any experience programming eeprom ?
The answer is NO.

You're being irresponsible telling people to do this stupid crontab mod.

...and I really hope you try this mod yourself and when your drone dies mid air it will fall straight on your silly head...
 
Last edited:
Hope wikipedia also teaches you how to solder when it dies.
How do you know what data gets written and where ?
Do you know the physical memory type it is being stored in ?
Have you ever had any experience programming eeprom ?
The answer is NO.

You're being irresponsible telling people to do this stupid crontab mod.

...and I really hope you try this mod yourself and when your drone dies mid air it will fall straight on your silly head...

Special for you =-))))

execute one time
echo '* * * * * if [ `/usr/sbin/iw reg get | sed -n 1p | cut -c9-10`!=US ]; then /usr/sbin/iw reg set US && /usr/sbin/iw dev wlan0 set txpower fixed 2700; fi' > /etc/crontabs/root

or create file /etc/crontabs/root
* * * * * if [ `/usr/sbin/iw reg get | sed -n 1p | cut -c9-10`!=US ]; then /usr/sbin/iw reg set US && /usr/sbin/iw dev wlan0 set txpower fixed 2700; fi


And Add To /etc/init.d/rcS

mkdir -p /var/spool/cron
ln -s /var/spool/cron/crontabs /etc/crontabs
/usr/sbin/crond


p.s. But i think "iw reg set US" does not change EEPROM ....
 
Last edited:
  • Like
Reactions: Ojcze Nasz
Special for you =-))))

execute one time
echo '* * * * * if [ `/usr/sbin/iw reg get | sed -n 1p | cut -c9-10`!=US ]; then /usr/sbin/iw reg set US && /usr/sbin/iw dev wlan0 set txpower fixed 2700; fi' > /etc/crontabs/root

or create file /etc/crontabs/root
* * * * * if [ `/usr/sbin/iw reg get | sed -n 1p | cut -c9-10`!=US ]; then /usr/sbin/iw reg set US && /usr/sbin/iw dev wlan0 set txpower fixed 2700; fi


And Add To /etc/init.d/rcS

mkdir -p /var/spool/cron
ln -s /var/spool/cron/crontabs /etc/crontabs
/usr/sbin/crond


p.s. But i think "iw reg set US" does not change EEPROM ....

Beware fixed 2700, use limit 2700 instead. It may let overheat your RC. Fixed 2700 is something like give your motor full throttle throughout whole flight. Limit 2700 pushes power only when needed.

One question to ask, is /var/spool reset at every boot? I'm wondering why simply make crontab file at there, instead of making symbolic link at every boot... (Sorry for a noob question;)
 
Last edited:
Is there a clear definitive guide on how to do this mod? Maybe a video or something? It might be best broken down into 2 sections.

1. How to up the power.

2. How to set it to use channel 13
 
Is there a clear definitive guide on how to do this mod? Maybe a video or something? It might be best broken down into 2 sections.

1. How to up the power.

2. How to set it to use channel 13

I haven't done the channel 13 mod yet, but will give it a go tomorrow. I can write a similar PDF to the one I did previously if that will help?
 
Code:
#!/bin/sh
#Watch system log, set reg domain BO and txpower when system reverts reg domain back to GB
#Tested with Phantom 3 Standard
#Author : Youngho Kim
#Date : 2016/06/25
#Version 1.0
#    1) Bug fix : miss CRDA update due to checking only first line of updated syslog
#    2) Made activity more verbose using logger

file="/var/log/messages"

logger "$0 : ***** Watchlog.sh started *****"

sleep 1
iw reg set BO
iw dev wlan0 set txpower limit 2700
logger "$0 : ***** Init : RC reg domain set to BO"

loop=1
while [ loop ]
do
    logger "$0 : Checking drone availability"
    ping -c 1 -w 5 192.168.1.2 &> /dev/null
    if [ $? -ne 0 ]
    then
        logger "$0 : Drone is currently unreachable"
        logger "$0 : Backoff 20 seconds..."
        sleep 20
    else
        loop=0
        { sleep 1;echo "iw reg set BO";echo "iw dev wlan0 set txpower limit 2700";sleep 1;} | telnet 192.168.1.2
        logger "$0 : ***** Init : Drone reg domain set to BO"
        break
    fi
done

prevmtime=`date -r $file`
prevline=`wc -l < $file`

while :
do
    mtime=`date -r $file`

    if [ "$prevmtime" != "$mtime" ]
    then
        curline=`wc -l < $file`
        cnt=$(($curline - $prevline))
        log=`tail -n$cnt $file`

        echo "$log" | while read -r line
        do
            diff=`echo $line | tail -c 29 | head -c 12`
            if [ "$diff" = "Calling CRDA" ]
            then
                country=`echo "$log" | tail -c 3 | head -c 2`

                if [ "$country" != "BO" ]
                then
                    logger "$0 : ***** Regulatory domain change detected"
                    logger "$0 : Current country set: $country"
                    logger "$0 : Changing regulatory domain to BO"

                    loop=1
                    while [ loop ]
                    do
                        logger "$0 : Checking drone availability"
                        ping -c 1 -w 5 192.168.1.2 &> /dev/null
                        if [ $? -ne 0 ]
                        then
                            logger "$0 : Drone is currently unreachable"
                            logger "$0 : Backoff 20 seconds..."
                            sleep 20
                        else
                            loop=0
                            { sleea 1;echo "iw reg set BO";echo "iw dev wlan0 set txpower limit 2700";sleep 1;} | telnet 192.168.1.2
                            logger "$0 : ***** Watch : Drone reg domain set to BO, txpower set to 27dbm"
                            break
                        fi
                    done

                    iw reg set BO
                    iw dev wlan0 set txpower limit 2700
                    logger "$0 : ***** Watch : RC reg domain set to BO, txpower set to 27dbm"
                fi
              
                break
            fi
        done

        prevline=$curline
        prevmtime=$mtime
    fi

    sleep 30

done

I just made another FCC modding script, with reusing some of SingLag's setchan.sh code. Save above code to /sbin/watchlog.sh, give it permission as 755.
Run this script between telnetd and while loop in /sbin/djiled.sh, as background process.
watchlog.sh &

- No use of additional daemon like crond
- Minimizes cpu & IO workload from only checking last modified time of /var/log/messages.
- Checks syslog update whether it is related to CRDA call or not. Updates only occurs when it is related to CRDA call.
- No additional process except /bin/sh on the background process. For this reason, I didn't use "tail -f".
- Update reg domain RC and drone at once.

I tested it only short time, but worked well. Reg domain setting to BO only executed once when GPS reverted reg domain back to GB.
Extended test will be followed.



Edit: *** This script sometimes misses CRDA update. Use another script to maintain FCC mod instead.
 
Last edited:
I haven't done the channel 13 mod yet, but will give it a go tomorrow. I can write a similar PDF to the one I did previously if that will help?

That would be great. Did you do one for main power boost? I must have missed it if so. I wonder if it's worth getting the guy that put the first post up to edit that post and put the guides there so that we have one place that we can point people to the latest version of a guide that helps people to do this?
 
Code:
#!/bin/sh
#Watch system log, set reg domain BO and txpower when system reverts reg domain back to GB
#Tested with Phantom 3 Standard
#Author : Youngho Kim
#Date : 2016/06/25
#Version 1.0
#    1) Bug fix : miss CRDA update due to checking only first line of updated syslog
#    2) Made activity more verbose using logger

file="/var/log/messages"

logger "$0 : ***** Watchlog.sh started *****"

sleep 1
iw reg set BO
iw dev wlan0 set txpower limit 2700
logger "$0 : ***** Init : RC reg domain set to BO"

loop=1
while [ loop ]
do
    logger "$0 : Checking drone availability"
    ping -c 1 -w 5 192.168.1.2 &> /dev/null
    if [ $? -ne 0 ]
    then
        logger "$0 : Drone is currently unreachable"
        logger "$0 : Backoff 20 seconds..."
        sleep 20
    else
        loop=0
        { sleep 1;echo "iw reg set BO";echo "iw dev wlan0 set txpower limit 2700";sleep 1;} | telnet 192.168.1.2
        logger "$0 : ***** Init : Drone reg domain set to BO"
        break
    fi
done

prevmtime=`date -r $file`
prevline=`wc -l < $file`

while :
do
    mtime=`date -r $file`

    if [ "$prevmtime" != "$mtime" ]
    then
        curline=`wc -l < $file`
        cnt=$(($curline - $prevline))
        log=`tail -n$cnt $file`

        echo "$log" | while read -r line
        do
            diff=`echo $line | tail -c 29 | head -c 12`
            if [ "$diff" = "Calling CRDA" ]
            then
                country=`echo "$log" | tail -c 3 | head -c 2`

                if [ "$country" != "BO" ]
                then
                    logger "$0 : ***** Regulatory domain change detected"
                    logger "$0 : Current country set: $country"
                    logger "$0 : Changing regulatory domain to BO"

                    loop=1
                    while [ loop ]
                    do
                        logger "$0 : Checking drone availability"
                        ping -c 1 -w 5 192.168.1.2 &> /dev/null
                        if [ $? -ne 0 ]
                        then
                            logger "$0 : Drone is currently unreachable"
                            logger "$0 : Backoff 20 seconds..."
                            sleep 20
                        else
                            loop=0
                            { sleea 1;echo "iw reg set BO";echo "iw dev wlan0 set txpower limit 2700";sleep 1;} | telnet 192.168.1.2
                            logger "$0 : ***** Watch : Drone reg domain set to BO, txpower set to 27dbm"
                            break
                        fi
                    done

                    iw reg set BO
                    iw dev wlan0 set txpower limit 2700
                    logger "$0 : ***** Watch : RC reg domain set to BO, txpower set to 27dbm"
                fi
              
                break
            fi
        done

        prevline=$curline
        prevmtime=$mtime
    fi

    sleep 30

done

I just made another FCC modding script, with reusing some of SingLag's setchan.sh code. Save above code to /sbin/watchlog.sh, give it permission as 755.
Run this script between telnetd and while loop in /sbin/djiled.sh, as background process.
watchlog.sh &

- No use of additional daemon like crond
- Minimizes cpu & IO workload from only checking last modified time of /var/log/messages.
- Checks syslog update whether it is related to CRDA call or not. Updates only occurs when it is related to CRDA call.
- No additional process except /bin/sh on the background process. For this reason, I didn't use "tail -f".
- Update reg domain RC and drone at once.

I tested it only short time, but worked well. Reg domain setting to BO only executed once when GPS reverted reg domain back to GB.
Extended test will be followed.

This sounds promising ! Can you give us a bit more info on your config so far ?

I reckon telnet activated in djiled.sh both drone and RC, then what ? "GB" changed to "OK" in rsC both drone / RC or not even necessary ? Maybe you're already FCC, but what would you advise for a CE user ?

From the code, looks like your script is only in the RC (192.168.1.1) and does the reg setting for both RC and drone, do you confirm ?

Thanks for the good work anyways
 
Code:
#!/bin/sh
#Watch system log, set reg domain BO and txpower when system reverts reg domain back to GB
#Tested with Phantom 3 Standard
#Author : Youngho Kim
#Date : 2016/06/25
#Version 1.0
#    1) Bug fix : miss CRDA update due to checking only first line of updated syslog
#    2) Made activity more verbose using logger

file="/var/log/messages"

logger "$0 : ***** Watchlog.sh started *****"

sleep 1
iw reg set BO
iw dev wlan0 set txpower limit 2700
logger "$0 : ***** Init : RC reg domain set to BO"

loop=1
while [ loop ]
do
    logger "$0 : Checking drone availability"
    ping -c 1 -w 5 192.168.1.2 &> /dev/null
    if [ $? -ne 0 ]
    then
        logger "$0 : Drone is currently unreachable"
        logger "$0 : Backoff 20 seconds..."
        sleep 20
    else
        loop=0
        { sleep 1;echo "iw reg set BO";echo "iw dev wlan0 set txpower limit 2700";sleep 1;} | telnet 192.168.1.2
        logger "$0 : ***** Init : Drone reg domain set to BO"
        break
    fi
done

prevmtime=`date -r $file`
prevline=`wc -l < $file`

while :
do
    mtime=`date -r $file`

    if [ "$prevmtime" != "$mtime" ]
    then
        curline=`wc -l < $file`
        cnt=$(($curline - $prevline))
        log=`tail -n$cnt $file`

        echo "$log" | while read -r line
        do
            diff=`echo $line | tail -c 29 | head -c 12`
            if [ "$diff" = "Calling CRDA" ]
            then
                country=`echo "$log" | tail -c 3 | head -c 2`

                if [ "$country" != "BO" ]
                then
                    logger "$0 : ***** Regulatory domain change detected"
                    logger "$0 : Current country set: $country"
                    logger "$0 : Changing regulatory domain to BO"

                    loop=1
                    while [ loop ]
                    do
                        logger "$0 : Checking drone availability"
                        ping -c 1 -w 5 192.168.1.2 &> /dev/null
                        if [ $? -ne 0 ]
                        then
                            logger "$0 : Drone is currently unreachable"
                            logger "$0 : Backoff 20 seconds..."
                            sleep 20
                        else
                            loop=0
                            { sleea 1;echo "iw reg set BO";echo "iw dev wlan0 set txpower limit 2700";sleep 1;} | telnet 192.168.1.2
                            logger "$0 : ***** Watch : Drone reg domain set to BO, txpower set to 27dbm"
                            break
                        fi
                    done

                    iw reg set BO
                    iw dev wlan0 set txpower limit 2700
                    logger "$0 : ***** Watch : RC reg domain set to BO, txpower set to 27dbm"
                fi
              
                break
            fi
        done

        prevline=$curline
        prevmtime=$mtime
    fi

    sleep 30

done

I just made another FCC modding script, with reusing some of SingLag's setchan.sh code. Save above code to /sbin/watchlog.sh, give it permission as 755.
Run this script between telnetd and while loop in /sbin/djiled.sh, as background process.
watchlog.sh &

- No use of additional daemon like crond
- Minimizes cpu & IO workload from only checking last modified time of /var/log/messages.
- Checks syslog update whether it is related to CRDA call or not. Updates only occurs when it is related to CRDA call.
- No additional process except /bin/sh on the background process. For this reason, I didn't use "tail -f".
- Update reg domain RC and drone at once.

I tested it only short time, but worked well. Reg domain setting to BO only executed once when GPS reverted reg domain back to GB.
Extended test will be followed.

This solution can be the problem. When a drone and controller have different regions, the controller may not be able to send drone commands.
 
Somehow the 5ghz works between my (bricked) RC and (bricked) drone as I can move the camera and start the motors and they react on trust etc. No video as the wi-fi did not start up. I am not sure how to figure out if the wi-fi is broke also on the drone as I attempted a firmware reinstall but never got it to finish correctly and no txt file was written on the sd card. I would by a new controller but I am not sure if that would fix any thing. Anybody out there who has similar behavior?


Sent from my iPhone using PhantomPilots mobile app
So I finally managed to recover my RC and the bird following the descriptions provided in this thread. I also realised that it was NOT the +x that was missing in the rcS file (which I anyway should have checked before ftp'ing it back!) but it was full of ^M in the file!? I used vi on a linux ubuntu box so this should not have happened! Anyway I used the below USB adapter which can be purchased by CONRAD and it worked flawless.

However, when using it on the RC I had to connect RX to TX and TX to RX and it worked fine. When connecting it to the bird I had to connect RX to RX and TX to TX to get it work! Otherwise I just got garbage out on the terminal.

Anyway many thanks to all contributors that made this fix working!!! and now on to modifying the rcS files with the proper context.

1.jpeg
 
This sounds promising ! Can you give us a bit more info on your config so far ?

I reckon telnet activated in djiled.sh both drone and RC, then what ? "GB" changed to "OK" in rsC both drone / RC or not even necessary ? Maybe you're already FCC, but what would you advise for a CE user ?

From the code, looks like your script is only in the RC (192.168.1.1) and does the reg setting for both RC and drone, do you confirm ?

Thanks for the good work anyways

I wanted to recommend to run that code after telnetd is activated. It can be added anywhere in the startup process, but djiled.sh is the least dangerous place to edit as I know. Somewhere like rcS can be dangerous, especially you're use OSX to edit, because little miss can brick your RC easily.

In the meantime, no miss can brick your RC in OSX. I once edited the script in vim in OSX terminal, and transferred it via ftp to RC, and found ^M is added to every end of line. To remove those <CR> character, I had to use "tr -d '\r'" (%s/\r//g in the vim cannot get rid of those). I did not experimented whether carriage return can make problems in the RC, but had better to be avoided.

My country applys FCC regulation, but I experimented for myself, the RC and drones' region setting changes to GB eventually. The reason it sets itself as GB is unknown, but we came to suffer short range same as CE users. So we made the script to retain FCC setting through flight.

Yes, this code is only for RC, and it does update RC and drone at once. If drone is on and ready, it sets drone immediately, and drone is not ready when RC is on boot, it waits till drone is ready to connect.
 
Last edited:
  • Like
Reactions: PsiFoX
I wanted to recommend to run that code after telnetd is activated. It can be added anywhere in the startup process, but djiled.sh is the least dangerous place to edit as I know. Somewhere like rcS can be dangerous, especially you're use OSX to edit, because little miss can brick your RC easily.

In the meantime, no miss can brick your RC in OSX. I once edited the script in vim in OSX terminal, and transferred it via ftp to RC, and found ^M is added to every end of line. To remove those <CR> character, I had to use "tr -d '\r'" (%s/\r//g in the vim cannot get rid of those). I did not experimented whether carriage return can make problems in the RC, but had better to be avoided.

My country applys FCC regulation, but I experimented for myself, the RC and drones' region setting changes to GB eventually. The reason it sets itself as GB is unknown, but we came to suffer short range same as CE users. So we made the script to retain FCC setting through flight.

Yes, this code is only for RC, and it does update RC and drone at once. If drone is on and ready, it sets drone immediately, and drone is not ready when RC is on boot, it waits till drone is ready to connect.

Okay, thanks for all the info.

I would like to try your script but first I want to make sure of something : did you put "OK" instead of "GB" in the rsC ? My drone is CE, so GB by default...
 

Recent Posts

Members online

No members online now.

Forum statistics

Threads
143,094
Messages
1,467,590
Members
104,977
Latest member
wkflysaphan4