Week 13

Networking and Communications

Group Assignment


Send a message between two projects

We wanted to create an Access point using a Xiao ESP32C3 that would connect to a local wifi network then act as an access point for another Xiao ESP32C3 to connect to.

We wanted the client to also act as a server for Gabriellas web server project

We were able to use one Xiao ESP32C3 to connect to a wifi network and act as an access point. We were able to connect a second Xiao ESP32C3 to the access point and get an IP address but for some reason Gabriellas web server did not want to run from the client.

But since we knew we were able to connect to a wifi network, create an access point and connect to the access point from another ESP32C3 we decided to just send a message between the server and client.


Code

For the first attempt we followed the instructions on the Seeed studio wiki page for WiFi usage.

We combined the WiFi network code and the access point code into one code to use as the server code. Then we used Gabriellas code from her web server project only changing the ssid and password. The client was able to connect to the server but the client was unable to act as a web server as well.

Here is the code to connect to a wifi network and act as an access point.

Download WiFi-Access point code.


Since we did not have a lot of time we decided to just send a simple message between the server and client.

Using parts of the code we already had we asked ChatGPT for help in creating a server and client code.

The server ESP32C3 starts by connecting to a local wifi and creating an access point and wait for a client to connect. Then the client ESP32C3 connects to the server.

When the client is connected to the server both the server and client can send messages to each other.

Download WiFi-Access point Server code.

Download WiFi-Access point Client code.


Video showing messages being sent from server to client and client to server