192.168.11.85 (Web Server) 192.168.11.18 (Sensor)
You need change ip address(in source code) dependent on your "network environment"
$ pip3 install websockets
$ sudo apt-get update
$ sudo apt-get install apache2
move "plot_3gAcc_from_websocket.html" to "/var/www/html/"
move "plot_3gAcc_from_websocket_xyz.html" to "/var/www/html/"
$ python3 ws_server.py
$ python3 socket_server.py
ref: https://www.instructables.com/id/how-to-use-the-ADXL345-on-Raspberry-pi/
- 4 connections:
| ADXL | RPI |
|---|---|
| GND | GND |
| 3V | 3V3 |
| SDA | SDA |
| SCL | SCL |
- sudo nano /etc/modules & add
- i2c-bcm2708
- i2c-dev
- sudo raspi-config & enable I2C
- sudo reboot
- sudo apt-get install python-smbus i2c-tools git-core
- sudo i2cdetect -y 1
- you should not get any errors and see a device at address 53
and then
$ python3 socket_server_adxl345.py
- https://docs.google.com/presentation/d/17gcLdMVilcXN4QGtei15g-6nFRCPQJV9zVY96pl77yE/edit?usp=sharing
- http://www.whatimade.today/realtime-graphs-using-ploty-and-websockets/
- https://github.com/dannyvai/plotly_websocket_example
- https://github.com/google/pywebsocket
- https://websockets.readthedocs.io/en/stable/intro.html
- https://realpython.com/python-sockets/
- https://canvasjs.com/docs/charts/basics-of-creating-html5-chart/
- https://canvasjs.com/html5-javascript-dynamic-chart/
- https://www.instructables.com/id/how-to-use-the-ADXL345-on-Raspberry-pi/
- https://github.com/pimoroni/adxl345-python