o-gs / DJI_FC_Patcher

toolset for patching DJI birds 0306 modules
73 stars 32 forks source link

Reset GPS to stock #4

Closed Maxym77 closed 6 years ago

Maxym77 commented 6 years ago

Hi big man! Please, i need the parameters for restock GPS to default (example: for selling or warranty). Without this, i can't rollback to a 100% stock .

Thank you very much!

Max

Maxym77 commented 6 years ago

if i restore backup (with dumldore) from another mavic with no galileo, the gps go to default dji settings?

Matioupi commented 6 years ago

To make a full rollback of GNSS settings, modify the wmXXX_0306.y script matching your bird and :-1:

replace

newubxframes = newubxframes + ubxcfggen.genUBXCFGPMS(0x0,0,0)

with

newubxframes = newubxframes + ubxcfggen.genUBXCFGPMS(0x1,0,0)

replace

`newubxframes = newubxframes + ubxcfggen.genUBXCFGGNSS(True,8,16,True,8,14,True,8,10,False,0,2,False,8,16,True,0,3,False,0,8)`

with

`newubxframes = newubxframes + ubxcfggen.genUBXCFGGNSS(True,8,16,True,8,14,False,8,10,False,0,2,False,8,16,True,0,3,False,0,8)`

replace

`newubxframes = newubxframes + ubxcfggen.genUBXCFGNAV5(7,2,0,5,0,10.0,10.0,30,300,0.0,1.0,0,0,60)`

with

`newubxframes = newubxframes + ubxcfggen.genUBXCFGNAV5(0,3,0,5,0,25.0,25.0,100,300,0.0,1.0,0,0,60)`

Then generate a modded firmware as in readme.md and flash it. Start the bird at least once so the FC will apply the settigns to the receiver. Then flash full stock firmware to rollback the FC itself.

That said, I really doubt the 2 compass error you saw are related to the mod and GPS settings change. With my birds, it is actually the opposite, I've had far less such messages since i'm using modded settings.

Maxym77 commented 6 years ago

now don't take any sat .... :-( gps won’t work. works again after reflashing your original patch (with GAL enable)

Matioupi commented 6 years ago

retry the above without replacing

newubxframes = newubxframes + ubxcfggen.genUBXCFGPMS(0x0,0,0)

(only replace the 2 others)

also be patient for GPS acquisition after configuation change. It may take a few minutes the first time after a configuration change.

Maxym77 commented 6 years ago

for cleaning, i can remove all files .DAT from /blackbox/flyctrl ?

Matioupi commented 6 years ago

yes, but this will have no consequences on GPS behaviour. Just make easier to list / find files

Maxym77 commented 6 years ago

no gps signal with you last mod on script

This: retry the above without replacing newubxframes = newubxframes + ubxcfggen.genUBXCFGPMS(0x0,0,0) (only replace the 2 others)

Maxym77 commented 6 years ago

need dump for original GPS wm220 parameters how can i dump GPS settings?

Matioupi commented 6 years ago

Dumping original GPS settings needs openning the bird, hooking the UART to a PC with Ublox u-center software and reading the configuration from there. There is no way to do it in software only.

Maxym77 commented 6 years ago

i tested your default parameters and the mavic can’t get any satellite (i leave powered on for 15 minutes, no gps signal). This default parameters is for Spark (i have seen an your old post to get uart gps conf for spark with image attached ecc) ? Is possible is a reason ? You have in plan to get mavic default gps configuration via uart? i can’t because my mavic have the parameters changed by your script. there is another way for restore default? any old original firmare write gps setting for example?

Matioupi commented 6 years ago

I confirm that the proposal I gave above for returning to stock GNSS settings results in 0 satellites. I'm working on a fix...

Maxym77 commented 6 years ago

you are to top!!! you have a dump of original GPS settings?

Matioupi commented 6 years ago

Fixed ! Thanks to your issue I found a bug in the patcher (hopefully not a deadly one !) There was an argument missing in calls to ubxcfggen.genUBXCFGNAV5 Update the patcher to get the bug fixed. For reverting to stock GNSS setting:

replace

newubxframes = newubxframes + ubxcfggen.genUBXCFGPMS(0x0,0,0)

with

newubxframes = newubxframes + ubxcfggen.genUBXCFGPMS(0x1,0,0)

replace

`newubxframes = newubxframes + ubxcfggen.genUBXCFGGNSS(True,8,16,True,8,14,True,8,10,False,0,2,False,8,16,True,0,3,False,0,8)`

with

`newubxframes = newubxframes + ubxcfggen.genUBXCFGGNSS(True,8,16,True,8,14,False,8,10,False,0,2,False,8,16,True,0,3,False,0,8)`

replace

`newubxframes = newubxframes + ubxcfggen.genUBXCFGNAV5(7,2,0,5,0,0,10.0,10.0,30,300,0.0,1.0,0,0,60)`

with

`newubxframes = newubxframes + ubxcfggen.genUBXCFGNAV5(0,3,0,5,0,0,25.0,25.0,100,300,0.0,1.0,0,0,60)`

(note the extra 0 at 5th place in genUBXCFGNAV5 call)

Maxym77 commented 6 years ago

ok works perfect, very thanks Mat !!