https://github.com/alsakhaev/raspberry-pi-car
Raspberry Pi Remote Controlled Car via Browser with Node.js
https://github.com/alsakhaev/raspberry-pi-car
nodejs raspberry-pi raspicam rpi-webrtc-streamer webrtc
Last synced: 4 months ago
JSON representation
Raspberry Pi Remote Controlled Car via Browser with Node.js
- Host: GitHub
- URL: https://github.com/alsakhaev/raspberry-pi-car
- Owner: alsakhaev
- License: mit
- Created: 2020-05-02T13:07:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T17:57:13.000Z (about 3 years ago)
- Last Synced: 2023-10-30T11:42:38.402Z (over 2 years ago)
- Topics: nodejs, raspberry-pi, raspicam, rpi-webrtc-streamer, webrtc
- Language: TypeScript
- Homepage:
- Size: 748 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Raspberry Pi Car
A four-wheel drive car based on Raspberry Pi board.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
Install and run [rpi-webrtc-streamer](https://github.com/kclyu/rpi-webrtc-streamer) for camera streaming via WebRTC.
You can use deb packages from [this repository](https://github.com/kclyu/rpi-webrtc-streamer-deb).
```
sudo apt update
sudo apt full-upgrade
sudo dpkg -i rws_xxx_armhf.deb
sudo systemctl start rws
```
### Installing
Clone this repo to your Raspberry Pi
```
git clone https://github.com/alsakhaev/raspberry-pi-car.git
cd raspberry-pi-car
```
Install all NPM dependencies
```
npm install
```
The pigpio C library and therefore the pigpio Node.js package requires root/sudo privileges to access hardware peripherals.
You can find more information about it at [the page of pigpio library](https://github.com/fivdi/pigpio).
Build and run production bundle
```
sudo npm run start:prod
```
Or build and run development bundle in watching mode
```
sudo npm run start
```
### Port Forwarding
For external remote control via Internet, probably you will need to configure port forwarding in your router. The following table describes ports using and its purposes.
| Port | Description |
| ---- | ----------------------------------- |
| 8080 | Web client |
| 8081 | Node.js based API |
| 8888 | WebRTC Streaming Direct Port of RWS |
| 8889 | WebSocket signaling server of RWS |
## Project Structure
- `packages/client` - React.js based web client
- `packages/server` - Node.js based WebSocket API for car control
## Built With
### Hardware
* Raspberry Pi 3B+
* Raspberry Pi Camera Module v2
* L298N Dual H-bridge Motor Driver Board
* 4WD Car Platform with 4 Gearmotors and Wheels
* Ultrasonic Distance Sensor HC-SR04
* 150Ω and 300Ω resistors for voltage divider
* Xiamoi Mi Power Bank 2S 10000 mAh (5V/2.4A each USB port)
### Wiring Diagram

This Fritzing project is available in the documentation folder: [`docs/fritzing.fzz`](docs/fritzing.fzz)
### Software
* [TypeScript](https://www.typescriptlang.org/)
* [Node.js](https://nodejs.org/)
* [rpi-webrtc-streamer](https://github.com/kclyu/rpi-webrtc-streamer)
* [pigpio](https://github.com/fivdi/pigpio)
## Authors
* Alexander Sakhaev
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details