Page 1 of 1

Access raspberry files from lan without Samba

Posted: Mon Nov 09, 2015 12:48 am
by PiCake3000
Hello!
I am using my Raspberry Pi model B (first one) for a university python project. In the classroom we can plug in the RJ45 into our little Pis but have to login with out university username to get internet + ip adress.

I do not want to carry USB keyboard and mouse + pi with me (+wiring it) for every lesson so I tried to setup a Samba file server to modify the python files from my MacBook. Blocked by the network.. vnc works but I really need something where I can modify python files with Sublime Text Editor live. I also tried to connect the ethernet cable to my MacBook and Share internet to the Pi: blocked by network police as well.

What else can I use to get access to the file system from network? FTP service maybe?

Thanks

Re: Access raspberry files from lan without Samba

Posted: Mon Nov 09, 2015 4:47 am
by W. H. Heydt
Find a way to discover the Pis IP address. Then you can either use ssh in some form (e.g. PuTTY) to log in to the Pi to look and and/or edit files, or use some form of scp (e.g. pscp) to transfer files to and from the Pi.

Re: Access raspberry files from lan without Samba

Posted: Mon Nov 09, 2015 4:53 am
by stderr
PiCake3000 wrote:. vnc works but I really need something where I can modify python files with Sublime Text Editor live
Thanks
Why do you have to do that? Your text editor is onthe Mac, it can save the file on the Mac and then you can automatically copy it o the pi with sftp or scp or email, whatever. On the pi, you can have it waiting for the file to change then run it automatically. Also, if you must mount the pi locally, try sshfs.

Re: Access raspberry files from lan without Samba

Posted: Mon Nov 09, 2015 1:14 pm
by PiCake3000
W. H. Heydt wrote:Find a way to discover the Pis IP address. Then you can either use ssh in some form (e.g. PuTTY) to log in to the Pi to look and and/or edit files, or use some form of scp (e.g. pscp) to transfer files to and from the Pi.
(we have the Pis IP, otherwise ssh'ing would not have worked)

yes scp is the only option right now at university to get a file to the pi but not very convenient. I have to switch to terminal everytime I want to save my code.py file. Takes so much time and you refresh your code every few seconds in the development process. I want a solution were the "upload and refresh" happens immedietly when I press CMD+S in Sublime Text Editor
stderr wrote:
PiCake3000 wrote:. vnc works but I really need something where I can modify python files with Sublime Text Editor live
Thanks
Why do you have to do that? Your text editor is onthe Mac, it can save the file on the Mac and then you can automatically copy it o the pi with sftp or scp or email, whatever. On the pi, you can have it waiting for the file to change then run it automatically. Also, if you must mount the pi locally, try sshfs.
We code a game with graphical user interface and have to test this with slow Pi hardware condition and response. Therefore we have to see it and running it with ssh does not work. Trust me we also tested on Ubuntu and it was too fast there if it even opened ;)

Re: Access raspberry files from lan without Samba

Posted: Mon Nov 09, 2015 1:39 pm
by RaTTuS
use winscp [or its equivalent on the mac [ha!]] then you can edit direct on the RPI [well locally but it auto uplaods]

Re: Access raspberry files from lan without Samba

Posted: Mon Nov 09, 2015 6:20 pm
by stderr
PiCake3000 wrote:yes scp is the only option right now at university to get a file to the pi but not very convenient. I have to switch to terminal everytime I want to save my code.py file. Takes so much time and you refresh your code every few seconds in the development process. I want a solution were the "upload and refresh" happens immedietly
What I mean by why do you need to actually edit on the pi is because you could just have the files uploaded and run whenever they change. But let's say you want to do direct editing of the file on the pi, I would just use sshfs:

mkdir fs.pi
sshfs -o reconnect -o follow_symlinks -o allow_other pi@pi_ip: fs.pi

You have to do whatever your system requires to load the files for sshfs, they are available on Debian with apt-get. Of course on the Mac, it will be different.

Now you should have fs.pi on your Mac but when you ls it, you see the pi directory. Over on the pi, you can run a script like this in a directory that you can see on your Mac from the fs.pi directory:

Code: Select all

#!/bin/sh
# loop and run the $1 program if changed:
while inotifywait -e modify . ; do
   ./$1
done
If you run this on the pi with the executable file you are working on, whenever it changes, the program you are writing will run. Obviously you can change how the files are run but in the example, I'm just making the py file executable.