@RobertLucian
Looking into this issue further today and I’ve identified the problem.
When I type dex.local
into the address bar of Chrome, I get this page:
When I click on the Launch VNC
icon, I get this page (I have opened the Developer Tools in Chrome so you can see the error console):
It’s a bit difficult to read the error console, here’s an expanded view:
As you can see, it’s trying to connect to //dex:8001
and it can’t resolve that host name.
If I change the URL in the address bar from:
http://dex.local:8001/vnc.html?host=dex&port=8001&autoconnect=true&password=robots1234
to:
http://dex.local:8001/vnc.html?host=dex.local&port=8001&autoconnect=true&password=robots1234
It connects immediately and I get this screen:
The file that loads when you go to dex.local
is /var/www/novnc/index.php
If you change line 54 of this file from:
<a href=" http://<?php echo $dexhost; ?>:8001/vnc.html?host=dex&port=8001&autoconnect=true&password=robots1234">
to:
<a href=" http://<?php echo $dexhost; ?>:8001/vnc.html?host=<?php echo $dexhost; ?>&port=8001&autoconnect=true&password=robots1234">
It will correct this problem.
Here is my edited version of /var/www/novnc/index.php
:
<?php
// Get host name and IP address
$ethernetIP = $_SERVER['SERVER_ADDR'];
$dexhost = $_SERVER['HTTP_HOST'];
?>
<html>
<head>
<title>Dexter Industries Raspbian for Robots</title>
<link rel="stylesheet" href="css/main.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body>
<div class="main-container">
<div class="main wrapper clearfix">
<header>
<a href="http://www.dexterindustries.com/" target="_blank">
<img src="img/dexter-logo-sm.png" class="standard logo" alt="Dexter Industries!" >
<img src="img/dexter-logo-retina.png" class="retina logo" alt="Dexter Industries!" >
</a>
<h1>Raspbian for Robots.</h1>
</header>
<article>
<section>
<p>
Welcome to Raspbian for Robots, our custom software for your Dexter Industries robots! There are two ways to view and program your robot.
</p>
<p>
The easiest and most user friendly way for beginners is to go in through VNC (virtual network connections), which will show you a little desktop in your browser with icons and folders.
</p>
<p>
If you are more advanced and want to work in the command line, choose Terminal and have fun!
</p>
</section>
<section class="vnc">
<a href=" http://<?php echo $dexhost; ?>:8001/vnc.html?host=<?php echo $dexhost; ?>&port=8001&autoconnect=true&password=robots1234">
<img src="img/vnc.svg" onerror="this.src='img/vnc.png'; this.onerror=null;"style="height:128px;">
<span class="button">Launch VNC</span>
</a>
<em>Password: <strong>robots1234</strong></em>
</section>
<section class="bash">
<a href="http://<?php echo $dexhost; ?>:4200">
<img src="img/bash.svg" onerror="this.src='img/bash.png'; this.onerror=null;"style="height:128px;">
<span class="button">Launch Terminal</span>
</a>
<em>
Username: <strong>pi</strong>
<br/>
Password: <strong>robots1234</strong>
</em>
</section>
<section class="IP">
<ul>
<li>Your Host is: <?php echo $dexhost; ?> </li>
<li>Your IP is: <?php echo $ethernetIP; ?> </li>
</ul>
</section>
<footer>
<h3>Need more help?</h3>
<ul>
<li>See more about the <a href="http://www.dexterindustries.com/brickpi-tutorials-documentation/?raspbian_for_robots" target="_blank" class="product brickpi">BrickPi.</a></li>
<li>See more about the <a href="http://www.dexterindustries.com/gopigo-tutorials-documentation/?raspbian_for_robots" target="_blank" class="product gopigo">GoPiGo.</a></li>
<li>See more about the <a href="http://www.dexterindustries.com/grovepi-tutorials-documentation/?raspbian_for_robots" target="_blank" class="product grovepi">GrovePi.</a></li>
<li>See more about the <a href="http://www.dexterindustries.com/pivotpi-tutorials-documentation/" target="_blank" class="product pivotpi">PivotPi</a></li>
<li>Ask a question on our <a href="http://www.dexterindustries.com/forum?raspbian_for_robots" target="_blank" class="product">forums.</a></li>
</ul>
</footer>
</article>
</div> <!-- #main -->
</div> <!-- #main-container -->
</body>
</html>
- This corrects the problem as explained above.
- Connects to
dex.local
instead of trying to connect to dex
(this also works if you connect to a machine that does not have bonjour installed by using the IP address instead of the host name)
- I made the changes to the php code in the first 5 lines to correctly retreive the host IP address.
- I modified the
<section class="IP">
to display the name and IP address of the host connected to.
Here’s what I get when I go to http://dex.local
with the changes above:
Clicking the Launch VNC
icon now connects immediately as expected.
@RobertLucian I don’t see how you are able to connect as shown in your screen capture above with the parameter host=dex
in the URL.
Sorry for the long post, but I’m trying to explain fully.
-Kevin