Getting Started with Python for the Internet of Things
上QQ阅读APP看书,第一时间看更新

Getting ready

You will need Raspberry Pi with power and a standard network cable.

Raspberry Pi Model B LAN chip includes Auto-MDIX ( Automatic Medium-Dependent Interface Crossover). Removing the need to use a special crossover cable (a special network cable wired so that the transmit lines connect to receive lines for direct network links), the chip will decide and change the setup as required automatically.

It may also be helpful to have a keyboard and monitor available to perform additional testing, particularly if this is the first time you have tried this.

To ensure that you can restore your network settings to their original values, you should check whether it has a fixed IP address or the network is configured automatically.

To check the network settings on Windows 10, perform these steps:

  1. Open Settings from the start menu, then select Network and Internet, then Ethernet, and click on Change adapter options from the list of Related Settings.

To check the network settings on Windows 7 and Vista, perform the following steps:

  1. Open Network and Sharing Center from the Control Panel and click on Change adapter settings on the left-hand side.
  2. To check the network settings on Windows XP, open Network Connections from the Control Panel.
  3. Find the item that relates to your wired network adapter (by default, this is usually called Ethernet or Local Area Connection, as shown in the following screenshot):
Locating your wired network connection
  1. Right-click on its icon and click on Properties. A dialog box will appear, as shown in this screenshot:
Selecting the TCP/IP properties and checking the settings
  1. Select the item called Internet Protocol (TCP/IP) or Internet Protocol Version 4 (TCP/IPv4) if there are two versions (the other is Version 6), and click on the Properties button.
  2. You can confirm that your network is set by using automatic settings or a specific IP address (if so, take note of this address and the remaining details as you may want to revert the settings at a later point).

To check the network settings on Linux, perform the following steps:

  1. Open the Network Settings dialog box and select Configure Interface. Refer to the following screenshot:
Linux Network Settings dialog box
  1. If any settings are manually set, ensure you take note of them so that you can restore them later if you want.

To check the network settings on macOS X, perform the following steps:

  1. Open System Preferences and click on Networks. You can then confirm whether the IP address is allocated automatically (using DHCP) or not.

 

  1. Ensure that if any settings are manually set you take note of them so you can restore them later if you want to. Refer to the following screenshot:
OS X Network Settings dialog box

If you just need to access or control Raspberry Pi without an internet connection, refer to the Direct network link section in the There's more...section.