Hardware Reference
In-Depth Information
The device we want to focus on is eth0 (or wlan0 if you are using WiFi). Within
the information for that device, the IP address is indicated after inet addr: .
In the case of my Galileo, it's 10.0.1.119. If I want to connect to my Galileo from
another device on my network, I'll use that address. I could even have my
router expose that IP to the Internet if I want to access it from wherever I have
an Internet connection (after taking some security precautions of course).
See “Connecting to Galileo from the Internet” on page 124 for more information
on that.
Connecting to Servers
When you browse the Web with your web browser, you're seeing a human-
readable display of information, hopefully laid out in a way to make it easy to
consume the content you want. When machines need to get content from
the web, however, they don't necessarily need all the layout and design in-
formation—just the data.
Many sites that provide services such as weather, social networking, com-
munication, and file storage also offer an application programming inter-
face , or API. It's the way that information is communicated to or from a par-
ticular service.
For instance, if you wanted your site or device to post a photo to your Face-
book profile, you'd use Facebook's Graph API . You can also use the Graph API
to download a list of your friends. These APIs are Facebook's way of saying,
“here's how to have your devices and services communicate with our
servers.”
However, these services can be complex to use (for example, just authenti-
cating yourself to the service can take a lot of programming), so we're going
to stick to a very simple example of an API to start off.
How Many Days Until MAKE Comes Out?
I've created a simple website called How Many Days Until MAKE Comes
Out? , which serves one simple purpose: it tells you how many days until the
next issue of MAKE Magazine is expected to hit newsstands. The data is en-
tered into a database by me based on the production calendars I receive as
a MAKE contributing editor. It's served by a free tier of Google App Engine,
and the source code for the site is available on GitHub if you want to take a
look at how I made it.
When you go to http://nextmakemagazine.appspot.com/ in your web brows-
er, you'll see that the information is formatted to be viewed and understood
by a human, but the server is also configured to speak directly to simple
microcontrollers by stripping away all the extra style and language and only
returning the number of hours until the next issue is released. You can see
this if you go to http://nextmakemagazine.appspot.com/simple .
Search WWH ::




Custom Search