- Joined
- Jun 2, 2016
- Messages
- 226
- Reaction score
- 160
Got P3S yesterday. Not happy with range. Considering I also live in dense residential area with hundreds of wifi networks around.
So I tried to hack(?) in to it to see what can be done.
I was so far successful getting inside via FTP :
IP: 192.168.1.1
User : root
Pass : Big~9China
Now I can see entire linux system,
Found an interesting bit in configuration file that loads the module with parameter if the location is 'GB'. I presume 'GB' means europe (as opposed to US and JP )
This is from one the three interesting rcS files inside /etc/config/
rcSap
#!/bin/sh
# This script runs when init it run during the boot process.
# Mounts everything in the fstab
mount -o remount +w /
mount -t tmpfs mdev /dev
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
mount -t sysfs sysfs /sys
mount -t proc proc /proc
mount -t tmpfs tmpfs /tmp
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
mknod /dev/caldata b 31 6
mount -t debugfs none /sys/kernel/debug
mkdir /var/run
mkdir /var/lock
mkdir /var/log
/sbin/klogd
/sbin/syslogd
insmod /lib/modules/3.10.49/compat.ko
insmod /lib/modules/3.10.49/crypto_blkcipher.ko
insmod /lib/modules/3.10.49/crc-ccitt.ko
insmod /lib/modules/3.10.49/arc4.ko
insmod /lib/modules/3.10.49/cfg80211.ko
insmod /lib/modules/3.10.49/mac80211.ko
insmod /lib/modules/3.10.49/ath.ko
country=`fw_printenv -n country`
if [ $country = "GB" ];then
insmod /lib/modules/3.10.49/ath9k_hw.ko cert_country=1
else
insmod /lib/modules/3.10.49/ath9k_hw.ko
fi
insmod /lib/modules/3.10.49/ath9k_common.ko
insmod /lib/modules/3.10.49/ath9k.ko
echo dji > /proc/sys/kernel/hostname
/etc/init.d/sysfixtime boot
iw dev wlan0 del
#iw phy phy0 set antenna all all
iw phy phy0 set antenna_gain 0
iw phy phy0 set distance 0
iw phy phy0 interface add wlan0 type managed
ifconfig wlan0 up
brctl addbr br-lan
ifconfig br-lan 192.168.1.1 netmask 255.255.255.0 up
dwifi ap start
apsrv &
ifconfig usb0 hw ether 60:60:1f:ff:ff:ff up
brctl addif br-lan usb0
brctl addif br-lan wlan0
ifconfig lo 127.0.0.1 up
/usr/sbin/udhcpd -S /etc/udhcpd.conf &
#telnetd -l /bin/ash &
mkdir -m 0755 -p /var/run/vsftpd
/usr/sbin/vsftpd &
djiled.sh &
iw phy phy0 set retry short 1 long 1
iw phy phy0 set rts off
iw phy phy0 set frag 256
iw dev wlan0 set noack_map 0x00c0
End of that file....
So in case you missed it or don't want to read entire file here is the interesting bit :
country=`fw_printenv -n country`
if [ $country = "GB" ];then
insmod /lib/modules/3.10.49/ath9k_hw.ko cert_country=1
else
insmod /lib/modules/3.10.49/ath9k_hw.ko
fi
For those who are not programmers, this part of script decides how to load the wifi module (driver).
If the country is GB it will append a parameter "cert_country=1" to the module.
Otherwise it will load the driver without parameter , without limiting the transmit power <---- and THIS IS EXACTLY WHAT WE ALL WANT
I have been able to modify via this FTP connection so I removed 'cert_country=1' from it hoping it will do the trick, however after the reboot the file came back to original state (overwriting my changes). Need some help to get this stay permanently.
Hopefully someone with more brains can help.
Have anyone tried connecting via TTL serial ?
Hope to get this solved soon, range is crap on stock P3S in europe mode.
I'm however extremely happy with the performance of the aircraft itself. Amazing stability, amazing quality video, I definitely do not need 4k.
Good luck. And don't forget to share your findings
Thanks.
Tom.
If you find this useful please donate any sum to help me get power meter which i need to finish the 5.8ghz side mod.
Chip in for power meter.
Thanks all.
So I tried to hack(?) in to it to see what can be done.
I was so far successful getting inside via FTP :
IP: 192.168.1.1
User : root
Pass : Big~9China
Now I can see entire linux system,
Found an interesting bit in configuration file that loads the module with parameter if the location is 'GB'. I presume 'GB' means europe (as opposed to US and JP )
This is from one the three interesting rcS files inside /etc/config/
rcSap
#!/bin/sh
# This script runs when init it run during the boot process.
# Mounts everything in the fstab
mount -o remount +w /
mount -t tmpfs mdev /dev
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
mount -t sysfs sysfs /sys
mount -t proc proc /proc
mount -t tmpfs tmpfs /tmp
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
mknod /dev/caldata b 31 6
mount -t debugfs none /sys/kernel/debug
mkdir /var/run
mkdir /var/lock
mkdir /var/log
/sbin/klogd
/sbin/syslogd
insmod /lib/modules/3.10.49/compat.ko
insmod /lib/modules/3.10.49/crypto_blkcipher.ko
insmod /lib/modules/3.10.49/crc-ccitt.ko
insmod /lib/modules/3.10.49/arc4.ko
insmod /lib/modules/3.10.49/cfg80211.ko
insmod /lib/modules/3.10.49/mac80211.ko
insmod /lib/modules/3.10.49/ath.ko
country=`fw_printenv -n country`
if [ $country = "GB" ];then
insmod /lib/modules/3.10.49/ath9k_hw.ko cert_country=1
else
insmod /lib/modules/3.10.49/ath9k_hw.ko
fi
insmod /lib/modules/3.10.49/ath9k_common.ko
insmod /lib/modules/3.10.49/ath9k.ko
echo dji > /proc/sys/kernel/hostname
/etc/init.d/sysfixtime boot
iw dev wlan0 del
#iw phy phy0 set antenna all all
iw phy phy0 set antenna_gain 0
iw phy phy0 set distance 0
iw phy phy0 interface add wlan0 type managed
ifconfig wlan0 up
brctl addbr br-lan
ifconfig br-lan 192.168.1.1 netmask 255.255.255.0 up
dwifi ap start
apsrv &
ifconfig usb0 hw ether 60:60:1f:ff:ff:ff up
brctl addif br-lan usb0
brctl addif br-lan wlan0
ifconfig lo 127.0.0.1 up
/usr/sbin/udhcpd -S /etc/udhcpd.conf &
#telnetd -l /bin/ash &
mkdir -m 0755 -p /var/run/vsftpd
/usr/sbin/vsftpd &
djiled.sh &
iw phy phy0 set retry short 1 long 1
iw phy phy0 set rts off
iw phy phy0 set frag 256
iw dev wlan0 set noack_map 0x00c0
End of that file....
So in case you missed it or don't want to read entire file here is the interesting bit :
country=`fw_printenv -n country`
if [ $country = "GB" ];then
insmod /lib/modules/3.10.49/ath9k_hw.ko cert_country=1
else
insmod /lib/modules/3.10.49/ath9k_hw.ko
fi
For those who are not programmers, this part of script decides how to load the wifi module (driver).
If the country is GB it will append a parameter "cert_country=1" to the module.
Otherwise it will load the driver without parameter , without limiting the transmit power <---- and THIS IS EXACTLY WHAT WE ALL WANT

I have been able to modify via this FTP connection so I removed 'cert_country=1' from it hoping it will do the trick, however after the reboot the file came back to original state (overwriting my changes). Need some help to get this stay permanently.
Hopefully someone with more brains can help.
Have anyone tried connecting via TTL serial ?
Hope to get this solved soon, range is crap on stock P3S in europe mode.
I'm however extremely happy with the performance of the aircraft itself. Amazing stability, amazing quality video, I definitely do not need 4k.
Good luck. And don't forget to share your findings

Thanks.
Tom.
If you find this useful please donate any sum to help me get power meter which i need to finish the 5.8ghz side mod.
Chip in for power meter.
Thanks all.
Last edited: