Page 1 of 1

How are you writing your more complex code ?

Posted: Tue Sep 02, 2014 10:45 pm
by OmuBobo
Hy,

I just want to know what you guys use to write your GPIO pytho scripts ? IDE? code on another machine then just transfer to raspberry, or code in nano text editor ?
I'm writing my small programs, GPIO scripts with the help of nano at the moment. But would be great to use a IDE on a faster machine, and debug and run on the raspberry without needing to copy files, libraries etc.

Thanks!

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 2:33 am
by elatllat
Pressing the git/rsync,run-tests button is the same number of clicks as pressing the run-tests button.
Alternately there is network file systems (sshfs,smb,nfs,etc) if you want to edit remote files in place.

vim
eclipse

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 9:10 am
by WebPi
I have a monitor, mouse and keyboard attached to my Pi so that I can use it like a desktop PC, and edit code in Leafpad. It's a pretty basic way of writing code, but it works for me. I've written a Python CMS this way - it's grown to about 4000 lines of code.

I've used a wide variety of development tools in the past, and they're ok, but I find I can get just as much done with a simple text editor. Some tools are so big and complex they get in the way of writing code (Eclipse is a good example of this).

I'm doing most of my debugging by printing messages to stdout. Sometimes I miss having access to a decent debugger, but I don't think it's a massive problem.

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 10:10 am
by elParaguayo
I tend to write my code on my laptop using SublimeText 3. If the code involves GPIO, and it's not fundamental to the code I'm testing, then I will include a fake GPIO module so that the GPIO lines don't throw errors. Alternatively, I use samba on the pi and mount the folder so I can then edit code on the laptop but run on the Pi via ssh.

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 10:16 am
by DougieLawson
Who needs an IDE? Just start two PuTTY sessions. One for running the code, one for editing it with vi (aka vim).

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 11:27 am
by simplesi
I install X11VNC and Samba on my Pi.

I edit my Python code (using notepad++) across the network on my PC/Laptop and then test it using LXTerminal on the Pi

Simon

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 12:25 pm
by TrevorAppleton
I have a blog post which explains how you can remotely modify code on your Raspberry Pi. I did some research on this subject after having the same thought as you!

http://trevorappleton.blogspot.co.uk/20 ... -your.html

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 8:50 pm
by OmuBobo
Thanks for all the suggestions guys, some good tips !! TrevorAppleton the guide on your blog is very good. I think you gave me the solution i was looking for. I've installed TextWrangler, configured it for remote access to the pi and opened a ssh in witch i will test my program !

Re: How are you writing your more complex code ?

Posted: Wed Sep 03, 2014 11:58 pm
by riklaunim
SFTP/SSH is a quick way to copy and execute code from workstation PC to RPi. I've also experimented with SSHFS where the workstation had a folder from Raspbian on Pi mounted and the PyCharm IDE was editing code there and using remote Raspbian Python environment to execute it on Pi from within Pycharm interface (no copy/paste etc.).

Re: How are you writing your more complex code ?

Posted: Thu Sep 04, 2014 7:00 am
by simplesi
@trevor
Excellent find (Notepad++ using NPPFtp) :)

Simon

Re: How are you writing your more complex code ?

Posted: Thu Sep 04, 2014 3:59 pm
by TrevorAppleton
Glad you like the blog post!

Re: How are you writing your more complex code ?

Posted: Thu Sep 04, 2014 6:02 pm
by OmuBobo
riklaunim wrote:SFTP/SSH is a quick way to copy and execute code from workstation PC to RPi. I've also experimented with SSHFS where the workstation had a folder from Raspbian on Pi mounted and the PyCharm IDE was editing code there and using remote Raspbian Python environment to execute it on Pi from within Pycharm interface (no copy/paste etc.).
I have tried that as well, just i can't manage to get write permission to mounted folder on the workstation, any suggestions ? I am on Mac. Thanks

Re: How are you writing your more complex code ?

Posted: Mon Sep 08, 2014 9:57 am
by Massi
DougieLawson wrote:Who needs an IDE? Just start two PuTTY sessions. One for running the code, one for editing it with vi (aka vim).
i've been using notepad++ with ftp plugin from the beginning of time (with a putty session to test), but i'd really really like to see dougie using vi or vim :)
i already hate nano when i have to use it, but vi.. lol..

Re: How are you writing your more complex code ?

Posted: Mon Sep 08, 2014 10:04 am
by joan
On the laptop I'll generally use gedit. I use vim on the Pi. I use vim on the laptop when it is quicker than gedit (vim has better support for macros and regular expressions).

Re: How are you writing your more complex code ?

Posted: Mon Sep 08, 2014 10:25 am
by PeterO
My PIs mount /opt/RPI/from my desktop Linux machine. I edit source with emacs on the desktop and build locally on the PIs.

The PIs I use for development all have 500Gb USB external disks with the root file system on them. SDcard is only used for /boot patition for booting.

PeterO

Re: How are you writing your more complex code ?

Posted: Tue Sep 09, 2014 10:25 am
by harvy
Im using mobaxterm

http://mobaxterm.mobatek.net/

Got SFTP, and a text editor built in, along with ssh.

So i make an ssh connection,
on the browser side i open the file in the editor, make changes, save (but dont close)
On the command line i run the code.
Make changes in the editor, save
rerun etc..