calebolson123 / BabySleepCoach

DIY Baby Sleep Tracking
https://calebolson.com
Other
201 stars 35 forks source link

bodyFound is undefined error on Docker on ubuntu server VM #33

Open kamms opened 8 months ago

kamms commented 8 months ago

Hi! I'm trying to get this running on a brand new ubuntu server virtual machine. I've managed to solve some errors that I run into (didn't document that unfortunately), but I can't figure out a way around this one. Am I doing something dumb to produce this error somehow?

Full error message:

bodyFound is undefined ./src/VideoFeed.tsx/VideoFeed/</intervalId<@http://192.168.1.93/static/js/bundle.js:1616:20

image

Things I've done so far:

I guess I could have skipped the start& -> start modification and not changed the start_docker.sh file at all, but I reached the point of just throwing everything at the problem.

docker-compose.yml:

services:
  baby-sleep-coach:
    build:
      dockerfile: ./Dockerfile
      context: .
    ports:
      - "0.0.0.0:${PORT}:80"
      - "0.0.0.0:8000:8000"
      - "0.0.0.0:8001:8001"
    env_file:
      - .env
    volumes:
      - type: bind
        source: /home/kamms/babysleepcoach
        target: "${APP_DIR}"

.env:

CAM_URL=rtsp://user:pw@192.168.1.9:554/h264Preview_01_sub # full url of the baby camera
APP_DIR=/usr/app/babysleepcoach # location of app root, primarily used for docker
DEBUG=False
OWL=False # lol
VIDEO_PATH=/usr/app/babysleepcoach # for debugging & testing
#HATCH_IP=192.168.HATCH.IP # optional
REACT_APP_BACKEND_IP=192.168.1.93:8001#.0.206:8001 # ip of flask server. This is the ip of "this" machine running the system
REACT_APP_RESOURCE_SERVER_IP=192.168.1.93:8000#0.206:8000 # ip of resource server (TODO: align to 1 server). This is the ip of "this" machine running the system
PORT=80 # port web app serves assets from

Docker logs:

babysleepcoach-baby-sleep-coach-1  | yarn run v1.22.19
babysleepcoach-baby-sleep-coach-1  | $ react-scripts start
babysleepcoach-baby-sleep-coach-1  | WARNING: No module named 'pexpect'
babysleepcoach-baby-sleep-coach-1  | reading focusRegionArr:  ['']
babysleepcoach-baby-sleep-coach-1  | Initializing...
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Initialization complete.
babysleepcoach-baby-sleep-coach-1  | Start receiving frames.
babysleepcoach-baby-sleep-coach-1  | Connecting to camera at: rtsp://user:pw@192.168.1.9:554/h264Preview_01_sub
babysleepcoach-baby-sleep-coach-1  |  * Serving Flask app 'main'
babysleepcoach-baby-sleep-coach-1  |  * Debug mode: on
babysleepcoach-baby-sleep-coach-1  | INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
babysleepcoach-baby-sleep-coach-1  | (node:48) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
babysleepcoach-baby-sleep-coach-1  | (Use `node --trace-deprecation ...` to show where the warning was created)
babysleepcoach-baby-sleep-coach-1  | (node:48) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
babysleepcoach-baby-sleep-coach-1  | Starting the development server...
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Compiled successfully!
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | You can now view baby-sleep-tracker in the browser.
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  |   Local:            http://localhost:80
babysleepcoach-baby-sleep-coach-1  |   On Your Network:  http://172.18.0.2:80
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Note that the development build is not optimized.
babysleepcoach-baby-sleep-coach-1  | To create a production build, use yarn build.
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | webpack compiled successfully
babysleepcoach-baby-sleep-coach-1  | Files successfully emitted, waiting for typecheck results...
babysleepcoach-baby-sleep-coach-1  | Issues checking in progress...
babysleepcoach-baby-sleep-coach-1  | No issues found.
babysleepcoach-baby-sleep-coach-1  | 192.168.1.46 - - [02/Jan/2024 13:55:04] "GET / HTTP/1.1" 200 -

Ports seem to be fine at least. Netstat -tuln in the container:

root@6941ba7bce4d:/usr/app/babysleepcoach# netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.11:41407        0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
udp        0      0 127.0.0.11:45988        0.0.0.0:*                   
rtxco commented 6 months ago

Did you ever figure this out

kamms commented 6 months ago

Nope

rtxco commented 6 months ago

Were you even getting a video feed of your camera on the website? Mine isn't throwing up these errors but I have no video feed.