Skip to content

Application to control car esp from a web client using a virtual joystick

License

Notifications You must be signed in to change notification settings

mayuk24/espcar.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


logo of vue-awesome repository

EspCar.io

EspCar.io is an application that will allow you to control a car made with esp8266 and an H bridge with a virtual joystick through socket.io

Features

  • Supports multiple web clients and esp clients.
  • Distinguish between web clients and esp clients.
  • Each web client can control an esp car.
  • Each web client can see the status of each esp car.

Installation & Usage

$ git clone https://github.com/mayuk24/espcar.io

Edit config.js

Edit the config.js file located in the root directory with your host, port number and the credentials of your wifi network.

const
	host	= (process.env.HOST || 'YOUR-HOST'),
	port	= (process.env.PORT || 'YOUR-PORT'),
	ssid	= (process.env.SSID || 'YOUR-SSID'),
	pass	= (process.env.PASS || 'YOUR-PASS');

Make sure you do not use "localhost", instead use your local ip address otherwise the Esp will not be able to connect to the server websocket.

Npm Install

Go to the directory espcar.io-server and run the command: "npm install" to download the repository's dependencies

$ cd  /espcar.io/espcar.io-server
$ npm install

Update files

Go to the espcar.io-server directory and run the script: "npm run build" to update the client's app.js file and the espcar.ino file with the data you previously added in the config.js file.

$ cd  /espcar.io/espcar.io-server
$ npm run build

You will see the following confirmation message in the terminal

espcar.ino updated
app.js updated

Arduino dependencies

Use the Arduino Library Manager.

  1. Go to Sketch > Include Library > Manage Libraries.
  2. Install WebSockets by Markus Sattler
  3. Install SocketIoClient by Vincent Wyszynski

If you don't have the arduino IDE configured to work with esp8266 boards yet, this link will help you.

After completing the above just upload the Sketch to esp8266.

Run the server

Finally all that remains is to run the script : "npm start" in the espcar.io/espcar.io-server directory.

$ cd  /espcar.io/espcar.io-server
$ npm start

Now you should be ready to go.

Optional

Edit vue project

If you want to edit the Vue project just go to the directory espcar.io/espcar-vue and run the command "npm install"

cd /espcar.io/espcar.io-vue
$ npm install 

Then edit the main.js file inside the src directory with your host and port

Vue.use(new VueSocketIO({
	debug: true,
	connection: io('http://YOUR-HOST:YOUR-PORT/')
}));

Hardware requirements

The main components you need for the esp car are an esp8266 and an h-bridge with 4 inputs and 4 outputs.

In another moment I will add a more detailed guide for the assembly of the esp car and share the stl files.

License

copyright © 2020 Marco Concepcion. Licensed under the MIT license.

About

Application to control car esp from a web client using a virtual joystick

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published