openthread / ot-ns

OpenThread Network Simulator, a discrete event simulator and visualization tool for Thread networks.
https://openthread.io
BSD 3-Clause "New" or "Revised" License
57 stars 23 forks source link

otns web page not updating #336

Closed mt-26 closed 1 year ago

mt-26 commented 2 years ago

Hello, I am working through the Simulate Thread Networks using OTNS walkthrough.

I've gone through some of the headaches already documented here. (e.g. I'm using Go v1.19 and had to do this, but I also tried using Go v1.17 with the same results as described below.)

The other oddity is that I'm running OpenThread and OTNS in WSL/Ubuntu 20.044 LTS on a Win10 computer.

Everything seems ok. When I run OTNS I am able to open the OTNS web page using the address: http://localhost:8997/visualize?addr=localhost:8998 From within a Windows-based browser. (WSL on Win10 supports command-line only.)

I am getting the OTNS web page, but it is stuck at Time=0.

If I add a node via the CLI, the CLI acts as if the node is there, but the web page doesn't add the node.

The toolbar at the bottom of the web page doesn't show the "pause" icon on the "1X" button like is shown in the tutorial (except for about a second when I push the "Show Log" button, then it reloads and the button goes right back to just "1X").

None of the other buttons appear to do anything.

If I change the speed via the CLI to something other than 1, I'd expect the web page to reflect this - but it does not.

Any ideas what may be going on?

Thanks!

mt-26 commented 2 years ago

Update: "New Router" on the web page does add a node that can be seen via the CLI, but nothing is updated on the web page.

mt-26 commented 2 years ago

Update #2: I've tried a few different versions of Go. Currently at 1.13.15. Still no joy.

I have found that if I add a router node to the simulation and then quit the OTNS CLI, sometimes the web page finally updates and shows the node. This is true of other parameters as well (e.g. changing speed). So, something seems pretty wrong with OTNS.

When it is idle, watching the web page console output, it is reporting that the idle timer fired and the page is reloaded.

simonlingoogle commented 2 years ago

This might be caused by the VIRTUAL_TIME_UART=0 issue.

Could you clone my repo and build openthread differently to verify if the issue is resolved:

git clone https://github.com/simonlingoogle/ot-ns.git
cd ot-ns
./script/install
./script/test build-openthread
otns -ot-cli openthread/build/otns/examples/apps/cli/ot-cli-ftd
mt-26 commented 2 years ago

Simon, thank you for the message. I had tried compiling with VIRTUAL_TIME_UART=1 based on this and that didn't make any difference.

Your repo acts the same, still no good.

Happy to try anything else...

simonlingoogle commented 2 years ago

@mt-26 Is the OTNS itself working in CLI without web?

I am trying to figure out if it's a web UI only issue.

simonlingoogle commented 2 years ago

The other oddity is that I'm running OpenThread and OTNS in WSL/Ubuntu 20.044 LTS on a Win10 computer.

Everything seems ok. When I run OTNS I am able to open the OTNS web page using the address: http://localhost:8997/visualize?addr=localhost:8998 From within a Windows-based browser. (WSL on Win10 supports command-line only.)

Normally, OTNS and web should run on the same host. I am not sure if WSL works that way.

mt-26 commented 2 years ago

@mt-26 Is the OTNS itself working in CLI without web?

I am trying to figure out if it's a web UI only issue.

Yes, the CLI appears to work just fine. In fact, updates from the web are reflected in the CLI.

mt-26 commented 2 years ago

Normally, OTNS and web should run on the same host. I am not sure if WSL works that way.

It kind of does. The network ports in WSL are forwarded to the Win10 host such that localhost on Win10 is the same as localhost in WSL/Ubuntu. But they are ultimately logically distinct Ethernet adapters with unique IPs.

Vinggui commented 1 year ago

The other oddity is that I'm running OpenThread and OTNS in WSL/Ubuntu 20.044 LTS on a Win10 computer. Everything seems ok. When I run OTNS I am able to open the OTNS web page using the address: http://localhost:8997/visualize?addr=localhost:8998 From within a Windows-based browser. (WSL on Win10 supports command-line only.)

Normally, OTNS and web should run on the same host. I am not sure if WSL works that way.

WSL works just fine with OTNS and web. Browsing out of windows. That's my setup

jwhui commented 1 year ago

Closing stale issue.