JosiahMendes / Autonomous-Rover

The Design and Implementation of an Autonomous Mars Rover that has full mapping, remote control and power management capabilities.
10 stars 3 forks source link

Resources + Ideas Thread for Command #4

Open HyunjoonJeon opened 3 years ago

HyunjoonJeon commented 3 years ago

The command subsystem, which is connected to the control subsystem, allows users to control the rover remotely through a web browser or an app. This thread is used for recording the process of the command subsystem.

Useful Links:

Functional Requirements

To be updated as time goes

HyunjoonJeon commented 3 years ago

Project Log 14/5

Spent around 2 hours reading about the HTTP protocol which allows communication between the web server and the web browser: Clients connect to the server, make a request and wait for a response from the server. The HTTP protocol is a stateless protocol, meaning that the server does not store any state or data between requests. HTTP requires reliable connection where data does not get randomly lost so usually TCP/IP is used as the transport layer protocol.

HTTP request methods

https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods

HTTP response status codes

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

HyunjoonJeon commented 3 years ago

Project log 17/5

Spent an hour reading on how a web server can be created with ESP32 and a website using HTML and CSS: https://electropeak.com/learn/create-a-web-server-w-esp32/ 1-2 hours on getting familiarised with the HTML commands. The commands are well organised in this sheet: https://web.stanford.edu/group/csp/cs21/htmlcheatsheet.pdf A meeting with the group has led to the conclusion that ESP32 has a lot to handle on its own so having a separate web server which can communicate with ESP32 over the HTTP protocol would be a better idea.

HyunjoonJeon commented 3 years ago

Project log 18/5

Spent 1-2 hours to create and understand a basic web server written in Node.js which communicates with the website i.e. respond to an HTTP request. The server has two main objects: req and res. The req object is used when someone makes a request from the website and the res object is used to send data back to the website. The web server sets the HTTP response status code (200 means that the request succeeded) and sends data back to the web browser. It is important to note that the data has to be in string so JSON.stringify() function is used to convert the object data format into string.

Spent 1-2 hours looking at the React app code given by Georgios to check the structure of a web application written in nodejs and react. The website has components as an object with a state. A detailed API reference for the React component class can be found here: https://reactjs.org/docs/react-component.html