ojohnsen
Posts: 8
Joined: Sat Oct 24, 2015 7:14 am

Developing programs for the Raspberry Pi

Sat Oct 24, 2015 7:28 am

Hi there.

I'm new at Raspberry Pi, and struggling a bit with how to best set up a development platform for my Raspberry Pi.

Earlier I've worked a lot on microcontroller boards, but developing and running programs on embedded environments with Linux is new to me.

I want to set up a little system for transmitting data and logging it in files on my NAS. My plan is to have a Raspberry Pi as a "hub", connecting it to my LAN network via Ethernet, and storing files on the NAS. Eventually connecting a wireless interface to the Raspberry Pi, to either receive data or transmit commands to nodes around my house.

But my initial problem is finding a good way to program the Raspberry Pi (C/C++). I wish to avoid having to connect a screen and keyboard to the Raspberry Pi, and wish to program it remotely. Is it possible to use an IDE on my Windows computer, and sending the programs to the Raspberry Pi using an SSH shell? Or is a different approach better?

Thanks for any help!

Regards,
Øystein.

User avatar
buja
Posts: 498
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: Developing programs for the Raspberry Pi

Sat Oct 24, 2015 2:52 pm

Yes, it is possible to work remotely on the Pi.
A good place to start is here: https://www.raspberrypi.org/documentati ... te-access/

User avatar
DougieLawson
Posts: 35542
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Developing programs for the Raspberry Pi

Sat Oct 24, 2015 3:01 pm

Run OpenVPN on your RPi and it can appear as part of your local network anywhere in the World (with an OpenVPN client on your Windows machine).

There's a video tutorial at: http://www.bbc.co.uk/news/technology-33548728
There's lots of written words (by me) on it at: https://www.ibm.com/developerworks/comm ... v6?lang=en
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ojohnsen
Posts: 8
Joined: Sat Oct 24, 2015 7:14 am

Re: Developing programs for the Raspberry Pi

Sun Oct 25, 2015 6:33 am

Thanks for your replies.
I've set up an SSH connection from my computer to my RPi, and made some small attempts at writing code on the RPi (just a small Hello World program). It seems to work fine.

But I'm still a bit unsure on how to have a decent development environment for the RPi, and whether the environment should be on my computer (writing and compiling the code locally and sending it to the RPi afterwards) or on my RPi.

I've looked a bit at using Emacs for writing code on the RPi, though. I found some tutorials on how to set up Emacs for C/C++ coding, in regards to auto-completion etc. (https://truongtx.me/2013/03/10/emacs-se ... ogramming/).

Still thankfull for any thoughs you might have on this.

User avatar
yasriady
Posts: 27
Joined: Wed Apr 08, 2015 2:37 am
Location: Indonesia
Contact: Website

Re: Developing programs for the Raspberry Pi

Sun Oct 25, 2015 7:25 am

Hi,

I hope my brief reply here viewtopic.php?f=33&t=124119 will answer your question and will become your milestone to work on pi programming.
MyRaspberryPi : Cross Compile, wxWidgets/C++ and Linux Journal at http://yasriady.blogspot.com

ojohnsen
Posts: 8
Joined: Sat Oct 24, 2015 7:14 am

Re: Developing programs for the Raspberry Pi

Tue Oct 27, 2015 6:54 pm

Thanks for your tips, yasriady! :-)

Regards,
Øystein.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Developing programs for the Raspberry Pi

Wed Oct 28, 2015 7:46 pm

ojohnsen wrote:But I'm still a bit unsure on how to have a decent development environment for the RPi, and whether the environment should be on my computer (writing and compiling the code locally and sending it to the RPi afterwards) or on my RPi.
Your main system is likely 64bit Intel/Amd and not Arm. So if you go compiled language like C++, you'll need to cross compile if you do it off the pi. In my opinion, you won't be hurt at all if you set yourself up with a working Python installation on all your systems. It doesn't have to be Python, just something high enough level to abstract away from the differences that your various machines have, at least to the extent that is possible.

If your main system is Linux, that's a good thing, because your applications are likely to have more code in common to justWork in both environments, but even if it is Windows, much can work right anywhere.
I've looked a bit at using Emacs for writing code on the RPi, though. I found some tutorials on how to set up Emacs for C/C++ coding, in regards to auto-completion etc.
You can use Emacs, vi or something more memory hungry like IntelliJ IDEA or the other big IDEs. There are free editions for most things now. I suspect though that running the big pigs on the petite pies is pretty unlikely.

ojohnsen
Posts: 8
Joined: Sat Oct 24, 2015 7:14 am

Re: Developing programs for the Raspberry Pi

Thu Nov 05, 2015 10:01 am

To be honest, I felt setting up a local IDE with crosscompiler became a bit to cumbersome right now. An easier approach was to just use Gnome in Raspbian, set up a tightvnc server, and use Geany directly on the RPi. I've tested it for a while now, and it works perfectly for my needs, allowing me to get ahead with my project. Perhaps I'll pick up again developing on my main computer later, if I need new challenges. :-)

Thanks for your help, though!

Regards,
Øystein.

Return to “C/C++”