Hands-On Robotics Programming with C++
上QQ阅读APP看书,第一时间看更新

Handling VNC and PuTTY errors

In the VNC Viewer, sometimes, when you are selecting the IP address of the RPi, you may see the following pop-up error message instead of the RPi display:

You may also see the following message:

If you get either of these errors, click on the Wi-Fi icon on your laptop and make sure that you are connected to the same Wi-Fi network to which the RPi is connected. If this is the case, there is a chance that the IP address of your RPi has been changed inside the Wi-Fi network, which sometimes happens when a new device is connected to the Wi-Fi network.

To find the new IP address follow these steps:

  1. Open PuTTY and type raspberrypi.local inside the Hostname box. 
  2. Enter the command ifconfig wlan0 inside PuTTY's Terminal window. If your IP address has changed, you will notice the new IP address in the inet option.
  3. Enter the new IP address inside VNC Viewer to view the RPi display output. 

Sometimes, you may be unable to connect to Putty as well, and you will see the following error:

To solve the preceding error in PuTTY,  follow these steps:

  1. Connect a LAN cable to the RPi and the laptop.
  2. Power on your RPi and try connecting to putty by entering raspberrypi.local in the hostname box. With the LAN cable connected to the RPi and the laptop, you should be able to access the PuTTY Terminal window.
  3. Follow the previous steps to find the RPi's new IP address.
  4. Once you see the RPi display inside VNC Viewer, you can remove the LAN cable.