This project was generated with Angular CLI version 6.0.0.
This app receives mobile phone sensor data from a websocket server.
Use the other app to send data from your phone here.
Accessible at
Download and run the nodejs websocket server:
git clone git@github.com:mandarini/wsserver.git
cd wsserver
node app.js
git clone git@github.com:mandarini/m.git
In the m/ app folder, you have to change the server address on websocket.service.ts to be the one of your local server,
the one you started on the previous step.
-
you need the IP of your machine on your local network. Run
ifconfigoripconfig(according to your OS) and copy your inet address. -
go to line 16 in the
websocket.service.tsfile and changethis.socket = io('wss://psybercity.herokuapp.com/');tothis.socket = io('http://xx.xx.xx.xx:5000')wherexx.xx.xx.xxyour local address and5000the port that our server is listening to (see theapp.jsfile in the wsserver project)
In the m/ app directory run the following command:
ng serve --host 0.0.0.0 --port 4201
It is important to specify the host with the --host flag, because this will expose your application to other machines in the same network, and you will be able to access it via your mobile phone (which is what you need to do basically), once it is connected to the same network as your computer!
Here we are also specifying a port, because we will be also running the laptop application later, and it will take up port 4200 by default.
Open a browser on your mobile phone (preferably chrome of firefox for more sensors) and navigate to your locally IP
address (the one we found before, running ifconfig), on port 4200.
- Navigate to the app folder
cd im/
-
Connect it to the local websocket server, like we did with the mobile web app. Go to line 16 in the
im/folder in thewebsocket.service.tsfile and changethis.socket = io('wss://psybercity.herokuapp.com/');tothis.socket = io('http://xx.xx.xx.xx:5000')wherexx.xx.xx.xxyour local address and5000the port that our server is listening to (see theapp.jsfile in the wsserver project). -
Run the app
ng serve
- Open a browser and navigate to
http://localhost:4200
You made it!