Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SFTP connection with esp32??
#1
Hi there! I need an example or documentation about how to make a connection with SFTP. Hope you can help me Smile
Reply
#2
Use SSH module.
Reply
#3
(11-29-2018, 09:32 PM)lobo Wrote: Use SSH module.


ty so much! Big Grin  
just an observation, the code in "ssh.put(url, user, password, key, file, port)" is not shown, i'm gonna use the get method as a guide, I suppose it is simmilar.
Reply
#4
Yes, the usage is similar.
Also note that the explanation of user, password, key and port arguments is given only for ssh.list() function, usage in other function is the same.
Reply
#5
(11-29-2018, 10:22 PM)lobo Wrote: Yes, the usage is similar.
Also note that the explanation of user, password, key and port arguments is given only for ssh.list() function, usage in other function is the same.

Hi there! I tried to use the function ssh.get(url, user, password, key, file, port), but I have a doubt. Can use IP direction instead domain in URL parameter? for example:
res = ssh.get('18.888.88.88/.../.../fileToRead.txt' , '...' , '...' )
Reply
#6
You can use IP address or domain name in url, in all functions that have url argument.
Reply
#7
(12-04-2018, 07:03 PM)lobo Wrote: You can use IP address or domain name in url, in all functions that have url argument.

Ok, but im gettin this response (-3, '* DNS lookup succeeded. IP=18.xxx.xx.xxx\n* Connected\n* Failed to create session!\n', '') what is the meaning of -3??

Thanks for your patience
Reply
#8
As stated in item 2 of the result, the cause of the failure is "Failed to create session!".
It probably means that there is not enough space on the heap to allocate all needed ssh session structures.
This should only happen if you are using MicroPython built without psRAM support. See the Note about it in the Wiki.
Reply
#9
(12-04-2018, 08:06 PM)lobo Wrote: As stated in item 2 of the result, the cause of the failure is "Failed to create session!".
It probably means that there is not enough space on the heap to allocate all needed ssh session structures.
This should only happen if you are using MicroPython built without psRAM support. See the Note about it in the Wiki.

Oh yeah I was using the wrong firmware, sorry! but now I get a "-4" in res[0] and "Unable to open a session: -28". Do you think is memory problem again?
Reply
#10
Well... after trying very hard I can't get the connection with the server, reducing the TLS maximum message content length in menuconfig doesn't work. I don't know what im doing wrong...

I tried to load the key in several forms and only get this error: (-5, '* Error opening private key file\n', ''). What's the right form to declare the Path and what format have to use?

then use a variable "a", this will contain the whole Key code using read file method:

import os
a = open('Key_name.ppk')
a.read()
res = ssh.get('18.xxx.xx.xxx/xxxx/test.txt','user','pass',key=a)

and still getting the same error: (-4, '* DNS lookup succeeded. IP=xxx.xxxx.xxx\n* Connected\n* SSH session created\n* SSH session established\n* Fingerprint (SHA256): [. . . . . ]\n* Authentication by password succeed.\n* Unable to open a session: -28\n', '')

I really don't know what to do,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)