Debugging writting on files

When are the services executed? How can we manage to create files and save them in the internal memory of the drone?
We have tried to create a simple service with the airsdk-cli tool and adding a few simple lines for the debugging in the main.py file, to write to a file and save it to the drone’s internal memory, to write to a file and save it in the directory indicated by the environment variables MISSION_DATA and MISSION_DATA_TMP (both have been tested), as indicated by the documentation in the Storage and persistence section. And these lines have been introduced in the main and run functions. After the compilation and installation in the drone with the CLI we tried to perform a takeoff of a few seconds, enough to give time to the service to run, but we have not had any result, there is no test.log file in the internal memory, test.log file does not exist in the Drone. The code used for this is shown below:

import os
##dataRoot = os.getenv(‘MISSION_DATA’)
dataRoot = os.getenv(‘MISSION_DATA_TMP’)
if dataRoot is not None:
f = open(dataRoot+”/test.log”, “w+”)
f.write(“Testing”)
f.close()

With this we want to make sure that any facial recognition code we add is going to be executed, since it is one of the few ways we have to know it.

Thank you in advance!

Hi dani,
I found when I was writing files that neither MISSION_DATA or MISSION_DATA_TEMP were defined, but using "/mnt/user-internal/missions-data/com.parrot.missions.samples.hello" has worked for me so far.

Hi jboardman367,

Finally it worked MISSION_DATA environment variable. I had deactivate AirSDK missions logs on FreeFlight 7 app.

Thank you!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.