Ezequiel Santos
iOS Developer & Creative Technologist

⚡️ Tech: Configuring Intel Galileo (or Edison) on Networks with Fixed IP, Gateway, and DNS

Intel Galileo

I like the Galileo (Gen 2) :)

Recently, I did a small demo using the Intel Galileo board (although I have the Edison, Galileo is my favorite), and when I arrived to present it, I found out that the local network was not using DHCP, and I had to configure everything manually.

So, I happily changed the sketch to include these configurations. Everything was modified, and then it was just a matter of running it.

Basically, add all the necessary parameters:

system("telnetd -l /bin/sh"); // Start the telnet service on Galileo (which I needed)
// The ifconfig sets the IP for Eth0 network interface and also the network mask
system("ifconfig eth0 10.1.102.33 netmask 255.255.255.0 up");
// The route sets the default gateway for Eth0 network interface
system("route add default gw 10.1.102.254 eth0");
// This modifies the DNS in our /etc/resolv.conf. If you want to add only, use two >>, if you want to overwrite, use only >
system("echo 'nameserver 192.168.60.81' > /etc/resolv.conf");

Problem solved. But not really!!

It's worth remembering that the Galileo or Edison, despite running Arduino sketches, are embedded computers, and this type of configuration would have to be done at the operating system level.

And how do you do that? For that, we need to use a special function system(). With it, we can run bash scripts/commands directly on the Linux of our board. Fortunately, I had an expert in Linux next to me who gave me some help with the necessary commands.

I knew the system() command, but I had never used it to configure anything related to the network. Everything worked. If you are going to do some kind of project to use on networks with similar settings, the idea is basically the same. In addition, what we passed in system(), can be abstracted for any other embedded board with Linux when configuring.

That's it for now. :)

Check out the code used in class: https://github.com/ezefranca/facebook-bot-and-arduino