Download script into Pythonista
I am a real neophyte regarding networking so this may sound like a stupid question. I copied the PythonistaFTP file to my iPad and it appears to work correctly. But when I try to connect as guest to my macbook pro the connection attempt times out without actually connecting. Does something in the wireless router need to be changed to enable the connection to go through? I have previously successfully made connections between my computer and portable devices on port 8080 without needing to configure the router, but perhaps port 2121 is different.
dgelessus last edited by
Try connecting to your device by IP address (192.168.x.x), not the name (my-device-name.local). You can find your device's IP address in the wi-fi settings by tapping on the network that you're currently connected to.
That did the trick. Thanks for the suggestion. Perhaps Ole could add this suggestion to the instructions that are printed to the console when the server starts to aid other neophytes such as myself.
I have a general question about PythonistaFTP. I used finder on the mac to start an ftp session to verify that dgelessus' suggestion worked. After closing the link I noticed that a log of the communication was printed to the console and that a new session was started and, after each file retrieved from Pythonista on the iPad, that session was then closed. I also noticed that at the start of the connection it seemed like there were two identical sessions opened that were not closed until the end of the communication. Is this the way that PythonistaFTP is supposed to work? My limited knowledge is many years old, but in years gone by when I would manually use ftp, I would log in to the remote machine and keep the session open until I had moved all the files that I wanted. Only then would I log out of the session.
farf last edited by
I am also trying to use the FTP server to manually sync scripts between my iPhone and iPad. I downloaded the script on both devices and had difficulty connecting from my Mac until I used the IP addresses instead of the device names. Not a big problem.
I was then able to drag scripts from each device to a folder on my Mac. The problem is that I can't upload any of those scripts to the other device to complete the manual sync.
It seems to be a permissions issue because the FTP "drive" is read only to me.
I don't really have an answer to help you with uploading from a Mac to your mobile device, but I had the same problem. Uploads from the Mac are blocked for some reason. My solution was to send the file I wanted to upload to a Linux machine (Ubuntu 14.04 running Gnome). On the Linux machine the upload action to the iPad was essentially the same as used on the Mac. On the "Places" menu that opens a file manager menu there is a "Connect to Server" menu item. Because this worked on the Linux machine the problem is apparently due to some security restrictions in place on the Mac. I, too, would be interested in a solution for the Mac if someone has one. Although I haven't verified that it works, I think that you can also do the transfer via the Windows 7 or greater file manager.
farf last edited by
Hopefully someone will be able to shed some more light on this. Thanks for showing that it's not a general problem but specific to the mac platform or some mac configuration that I'm not familiar with.
ManuelU last edited by
@farf Hi, do you refer to the IP Address In the iOS devices?. In your Mac what do you use as User and Password?. The Mac OS X you use is Yosemite. Thanks in advance for your Help
omz last edited by
@ManuelU You can find the IP address of your iOS device in the WiFi settings (tap the "(i)" next to your connected WiFi network in the Settings app).
The local IP address of my iPad is 10.0.1.5, so I connect to
Select "Guest/Anonymous" when you're asked for authorization.
ManuelU last edited by
@omz,@farf thanks. It worked at an incredible speed
ovrCaffeinatd last edited by
Anyone try this with iOS 9? Guest/Anonymous is logging: USER 'guest' failed login (twice, fwiw).
JonB last edited by
you might try adding
before the lines that start the server. Then, check the console in pythonista to see if there are any errors logged server side.
smath last edited by
If you have the workflow app, here's another solution for bringing in files that are open in other apps.
Sean last edited by
using third party client on mac will works. Some how using finder ftp will crash pythonista.
zzgus last edited by zzgus
Is there an "idiot proof guide" ?
When I follow the GitHub link inside iphone's safari... is supposed that I must try to copy the code (with iphone built in option to copy text) and then paste inside pythonista?
If I do that, and try to run the code, it starts to show errors, like "()" after print, etc.
I have also tried another thread with workflow involved without luck.
Any help will be greatly appreciated.
brumm last edited by brumm
An easy way is to open the raw view of the code and then insert the url in this script. All the code is printed to the console and is easy to select.
import urllib2 url = 'https://raw.githubusercontent.com/humberry/PhoneManager/master/PhoneManager.py' print urllib2.urlopen(url).read()
if you use Pythonista3:
import urllib.request url = 'https://raw.githubusercontent.com/humberry/PhoneManager/master/PhoneManager.py' req = urllib.request.urlopen(url) print(req.read().decode('utf-8'))
cvp last edited by cvp
@zzgus it's because you download a code for Python 2 and you run it in Python 3.
Either you convert the code to Python 3 (see tools button at top of script) or you force the code to run in Python 2 by inserting a first line #!python2
ccc last edited by
import requests url = 'https://raw.githubusercontent.com/humberry/PhoneManager/master/PhoneManager.py' print(requests.get(url).text)
Works in all versions of Pythonista.
zzgus last edited by
Finally converted code from v2 to v3, thankyou @cvp for the trick. I see I have a new pyftpd.tar.gz file and a new folder:
Where is the ftp server?
zzgus last edited by
Any help please?
I don't know what I'm doing wrong but unable to get the ftp running.