NTX-McGill / NeuroTechX-McGill-2021

Other
16 stars 5 forks source link

Software: Stuck on "Checking for BCI device..." #70

Closed michellewang closed 3 years ago

michellewang commented 3 years ago

When I try to run the app on the main branch (with LSL stream running), the webapp is stuck on this page:

Screen Shot 2021-08-05 at 8 51 46 PM

The console shows a 404 error. It looks to me like there might be something wrong with the API endpoint. Here's the output when I run backend.sh (error shows up when I refresh localhost:3000):

Applying database migrations
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Populating video table with videos from Data Team Google Sheet
Successfully wrote 0 videos from https://docs.google.com/spreadsheets/d/14f6uBw0FRok1X4-EnSj-A5HVW1AGEZDWvIRnwCLnOh8/export?format=csv to the video table.
 * Serving Flask app 'dcp' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://192.168.2.14:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [05/Aug/2021 20:54:53] "OPTIONS /api/openbci/start HTTP/1.1" 200 -
127.0.0.1 - - [05/Aug/2021 20:54:53] "POST /api/openbci/start HTTP/1.1" 201 -
127.0.0.1 - - [05/Aug/2021 20:54:53] "OPTIONS /api/openbci/[object%20Object]/ready HTTP/1.1" 404 -
2021-08-05 20:54:53.949 (   0.528s) [           E6E92]             common.cpp:50    INFO| git:e762b9e10ad0d77651923c0afa7f435af38e8a9b/branch:refs/tags/v1.14.0/build:Release/compiler:AppleClang-12.0.0.12000032/link:shared

Not sure if this is related, but I also get a new warning when I start the frontend. Here's the output of npm start:

Compiled with warnings.

src/components/DataCollectionPage/index.tsx
  Line 112:6:  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

Steps to reproduce:

I'm on macOS Catalina (10.15.4) with Python version 3.7.10, and my main branch is up to date (latest commit is 5d5983d0de9a9887f8e727e505fcc7b5e7ef90cd). The app was working when I was on the backend/start-scripts branch.

@CherryMan Michael asked me to tag you. Please let me know if you need more information.

cherryman commented 3 years ago

Oh yeah, likely due to 448cd2c4f3fac27da8287598e7f876b79921e426, see: https://github.com/NTX-McGill/NeuroTechX-McGill-2021/blob/5d5983d0de9a9887f8e727e505fcc7b5e7ef90cd/software/data_collection_platform/frontend/src/api.ts#L52

Forgot to update api.ts, fix should be up soon.