not able to upload a file.py

Hello,

I’m having some difficulties to upload a python file to the digi W31-l21a
in the browser i have application>python>python files and then “Module search path:” where i put the path for the file “home/nathanforce/workspace/Digi/hello.py”

but when i hit “apply” (there’s no upload) he tells me it’s “Configuration successfully applied”
then i ssh to the digi and enter “python hello.py” and i get the error :
‘import site’ failed; use -v for traceback
‘import site’ failed; use -v for traceback
python: can’t open file ‘hello.py’: [Errno 13] ERROR

how can i know if the file is really loaded ? or is it another probleme ?

thanks in advance.

after upload the file u need to selection action

if suppose you selected as after reboot the program will run on your device after rebooting only

well first thanks for your answer
I rebooted the w31 and still get the same error “can’t open file ‘hello.py’: [Errno 13] ERROR”
i think that it’s trying to execute it directly from my pc and not uploading it.

am i doing it wrong to upload the file ?

i went to “Appication>Python>python files” and put the link to my python file in the “Module search path”.

hi
you can try same thing with Digi esp for python v2.3 tool
once. in esp for python example is also available for testing

HI

The python search path is the list of ZIP files that hold any custom librarys.

you will have to transfer the file via FTP,SFTP to the router.

if you want the python to run on reboot you have to add the command

cmd 0 autocmd “python file.py”

but runnign from the command line / serial /telnet /ssh should work for testing and you should see any errors

the transport products do not support normal directry structures and only the USER folder.

regards

James

Hi James, thanks for your answer it really helped me.

but does it mean there’s only the root directory and user directory on the routeur or am i getting it wrong?
if so upgrading the firmware would delete the uploaded lib ?

regards

If you do an upgrade of the router the only files are over writen are the image / sbios / python.zip /wizards.zip

if you use flashwriter to cary out an upgrade of the firmware this erases the flash and all files on the router are wiped

the User folder is there to install user related files and will not corrupt the flash where the system files are stored

regards

James

Ok so no normal directories just the user folder and the “root” if i can call i like that.

Thank you very much