'Drake on Deepnote: ngrok error when using meshcat

Some of our undergrads are running into issues with running Drake on Deepnote. We want them to run the Kuka iiwa sims but they get an error with ngrok.

They have followed the answer supplied in the following post: Encountering a problem while using ngrok link for simulations

We've actually been working with the ngrok folks to see if we can make it easier. https://github.com/RobotLocomotion/drake/issues/16300.

But for now I'm afraid you'll need to make a ngrok account and set your token as an environment variable.

And get the following error: Deepnote ngrok error



Solution 1:[1]

The error message image says "Failed to establish connection to localhost:80".

That's weird, because Meshcat would usually be running on port 7000 or thereabouts. The function pydrake.geometry.StartMeshcat() first runs Meshcat() (which finds an open port 7000 to 7999) and then points ngrok at the listen port for Meshcat:

https://github.com/RobotLocomotion/drake/blob/v0.39.0/bindings/pydrake/_geometry_extra.py#L44-L49

It's unlikely that Meshcat would be listening on port 80. Can you share more details about the code being run, and an exact error transcript?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1