but it shouldn’t be too hard. Since the data packet size is
small, you can just send periodic datagrams that include
temperature, moisture, and an identifier for the specific
sensor, so you know who sent it.
Solar power adds to the fun. You’ll need an adequate
solar panel, charge controller, and a battery to keep
the Arduino powered through the day under various
conditions. It will be important to measure the power
consumed and the size of the solar system so that it
can continue to work during a good portion of the day.
I suspect that having it run during the dark hours will
be difficult without a larger system; namely, the XBee
transmitter will consume a significant amount of energy.
This whole system is a fun project, but the detailed
design is beyond the scope of this column. If you do build
it, though, please let us know and write it up for N&V!
IDE Madness
QI recently switched from the Arduino to a Raspberry Pi 3, and I miss the IDE running on my PC. I don’t want to tie up a computer monitor, keyboard, and mouse on the Pi. Is
there an open source or even commercial IDE solution for
my PC?
Mike Winburn
El Paso, TX
AFor those who aren’t familiar with the term IDE, it stands for Integrated Development Environment. There is a significant difference between the development model on the
Arduino vs. the Raspberry Pi. The Arduino doesn’t typically
have an operating system running on it, and has very
limited memory and CPU resources. So, development is
done on a host computer. That’s where the IDE runs.
For the Raspberry Pi — given that it typically runs
some version of Linux — development is often done on
the board itself. All the necessary compilers, interpreters,
and virtual machines are on the device. This changes how
development is done. It’s possible to develop on a host
computer using a couple of different techniques, though.
First, let’s explore the development tools that can run on
the Pi.
To some degree, your choice of IDE will depend on
what languages it supports and how well it integrates
with them. Some are sophisticated language-sensitive
editors, while others give you source-level debugging,
documentation in-line, and UI development assistance. The
unfortunate part is that installing these IDEs is rarely trivial.
I’m kind of old school. I use Emacs, which gives me
the ability to do source-level debugging in most languages
through its “GUD” subsystem. There is a steep learning
curve, though. I’ve used Emacs for many decades, so the
key sequences are just burned into my fingers.
Given the learning required to be effective, I don’t
necessarily recommend this approach, but it is available.
My son — who doesn’t have the patience to learn Emacs
thoroughly (though I’m working on him!) — uses vim: a
clone/upgrade of vi. I guess he’s old school too.
Then, there’s Eclipse. Eclipse is an open-source IDE that
has modules for many different languages, though it was
originally designed for Java. It’s big and heavy (memory
and CPU). Some have gotten it to run successfully, but I
find the UI to be needlessly complex and confusing. It’s
great once it’s up and running properly, but getting it to
that point can be harrowing.
Let’s instead look at something that might work. If
you’re programming in Python — which many folks new to
the Pi use — there is a nice-looking IDE called Wing. It uses
the development model of running on a host computer
and debugging remotely. Full support for that feature
comes only in a paid version, but it sure looks neat. It runs
on Windows, Linux, and macOS. Check it out at https://
wingware.com/doc/howtos/raspberry.
If you’re programming in C or C++ (or even Fortran),
Code::Blocks appears to be pretty good. This one runs
right on the Pi and is open source. It’s also available for
other platforms. It doesn’t appear as though they publish
binaries for ARM, but you can compile it from source
if you’re adventurous. Maybe there are binaries out
there somewhere. Here’s where the project lives: www.
codeblocks.org.
Geany is another cross-platform IDE that has plug-ins
for multiple languages from C to Pascal. It requires the GTK
libraries, which are easily installed on a Raspberry Pi. Get
more details at https://www.geany.org.
Another Python specific IDE is called Ninja-IDE. It
seems to have many good error-finding tools and some
nice UI ( http://ninja-ide.org).
For IDEs that run on the Pi, you can run them remotely
using X Windows. If you have an X server on your PC or
Mac, you can use the SSH command with the -X option
to log into the Pi while simultaneously setting up a tunnel
for the X Windows protocol. Then, when you run the IDE
through that shell window, the IDE should pop up on your
local machine.
I could go on and on, but I think I’ve covered a few
nice ones that can get you started. There are more out
there if you look around. Like I said earlier, even though I’m
an Emacs devotee, I really like IDEs for their ability to help
you find and fix bugs, as well as better understand code
structure. I use Xcode whenever practical on my Mac.
Look around for something that really gets you to
QUESTIONS and ANSWERS
Post comments on this article and find any associated files and/or downloads at
www.nutsvolts.com/magazine/issue/2018/05.
May/June 2018 15