Hardware Reference
In-Depth Information
Figure 6-7. The response from Galileo displayed in a web browser
Connecting to Galileo from the Internet
Depending on your network setup, this IP address is probably only accessible
by computers that are on the same network. If you'd like to make Galileo
accessible over the Internet, you'll need to adjust your router's settings so
that it assigns your Galileo the same IP every time it powers on (look for
something called MAC address reservations in your router's settings) and
you'll also need to have connections from the Internet passed through your
router's firewall to the Galileo (look for a setting called port forwarding ).
Example 6-10 shows how Arduino code can respond to requests from your
web browser to show information from a button, but it could also show sensor
information from around your house. Using Arduino code to create a server
can be an acceptable solution for some simple things.
Example 6-10. A basic web server
#include <Ethernet.h>
int buttonPin = 2 ;
byte mac [] = { 0xDE , 0xAD , 0xBE , 0xEF , 0xFE , 0xED };
 
Search WWH ::




Custom Search