Version on the app to run on laptop/computer screen
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 [email protected]:mandarini/wsserver.git
cd wsserver
node app.js
git clone [email protected]: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 ifconfig
or ipconfig
(according to your OS) and copy your inet address.
go to line 16 in the websocket.service.ts
file and change
this.socket = io('wss://psybercity.herokuapp.com/');
to this.socket = io('http://xx.xx.xx.xx:5000')
where xx.xx.xx.xx
your local address and 5000
the port that our server is listening to
(see the app.js
file 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.
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 the websocket.service.ts
file and change
this.socket = io('wss://psybercity.herokuapp.com/');
to this.socket = io('http://xx.xx.xx.xx:5000')
where xx.xx.xx.xx
your local address and 5000
the port that our server is listening to
(see the app.js
file in the wsserver project).
Run the app
ng serve
http://localhost:4200
You made it!