mccdaq / daqhats

MCC DAQ HAT Library for Raspberry Pi
Other
128 stars 89 forks source link

Dash Webserver Loading #32

Closed polmdm closed 3 years ago

polmdm commented 3 years ago

I have successfully installed the mccdaq and dash. However, when launching the webserver with:

cd ~/daqhats/examples/python/mcc128/web_server ./web_server.py

and surfing to:

http://IP_ADRESS:8080

The webserver is stuck at "Loading...." and nothing shows up there.

Screenshot 2021-07-06 at 15 16 37

The ouput of the console is:

Screenshot 2021-07-06 at 15 23 38

While from terminal I got:

Screenshot 2021-07-06 at 15 24 33

What I'm doing wrong?

jeffreyg3 commented 3 years ago

I am running that example as I type this response. I can confirm it does work. I am running the latest version of daqhats software. To launch the app using the terminal from the web_server folder, I enter: python3 ./web_server.py

Please try that. Also the last line of the terminal screen shows the IP address you should used.
20210706_110924 20210706_110959

polmdm commented 3 years ago

Thank you very much for the reply, even I have all the most updated versions, or at least I think so. However, when running: python3 ./web_server.py

The RPi returns: Traceback (most recent call last): File "./web_server.py", line 25, in <module> from dash import Dash ModuleNotFoundError: No module named 'dash'

jeffreyg3 commented 3 years ago

According to the traceback, you do not have dash installed.

open a terminal and enter pip install dash

also, launching your browser and surfing to http://IP_ADRESS:8080 did not work for me, and is not in the instructions provided with the example. you are to navigate to the http://\\:8080 where you replace \\ with the IP address shown on the terminal when you launch web_server.py (for an example please see my last).

polmdm commented 3 years ago

Hi, sorry for not having answered before. Of course, before running the commands I have already installed Dash with pip install dash but running python3 ./web_server.py it returns the error reported above. While simply with ./web_server.py it does start up but nothing loads at http://:8080.

Yeah, I meant: http://:8080 the one printed in the terminal.

Maybe is that I'm surfing to it from another pc and not directly from the RPi as you? It seems weird since I would like to access to it from remote...

jeffreyg3 commented 3 years ago

Since you are using Python 3, did you install DASH with pip3: pip3 install dash

please try that.

polmdm commented 3 years ago

Thank you very much, it worked!

Have a nice day