This project provides a WebSocket server implementation to stream data from the ADXL345 accelerometer sensor using the ESP32 C3 32S as the microcontroller.
- Retrieves acceleration data from ADXL345 in real-time.
- Streams data to connected WebSocket clients.
- Works with the ESP32 C3 32S microcontroller.
- Displays sensor details on initialization.
- Have Arduino IDE installed.
- An ESP32 C3 32S board and an ADXL345 sensor module.
- Necessary libraries:
- ESP32Time
- ArduinoJson
- WebSockets
- Adafruit_Sensor
- Adafruit_ADXL345_U
-
Clone this repository:
git clone <your-repo-url>
-
Navigate to the project directory and open the Arduino sketch in the Arduino IDE.
-
Ensure that the required libraries mentioned above are installed.
-
WiFi Configuration:
- Copy the
config_example.h
to a new file namedconfig.h
:cp config_example.h config.h
- Edit
config.h
and provide your WiFi SSID and password.
- Copy the
-
Choose the correct board (ESP32 C3 32S) and port from the Arduino IDE.
-
Compile and upload the sketch to your ESP32 board.
-
Once the sketch is uploaded and running, the ESP32 will connect to the provided WiFi network.
-
Monitor the Serial output (using Serial Monitor in Arduino IDE) to see the IP address assigned to your ESP32.
-
WebSocket clients can connect to the WebSocket server using the provided IP on port 81.
-
When a client is connected, the server will start streaming ADXL345 sensor data to the client.
This project is open source.
Generated by ChatGPT.