CIAO

NULL if any errors

Home / portfolio / Networking and Communications

Networking and Communications

WEEK 11

INDIVIDUAL PROJECTS

What is a Websocket?

Individually, we were assigned to design, build, and connect wired or wireless node(s) with network or bus addresses.

My goal was to build a websocket and use the ESP32 to serve the website for the connection to external devices. I found this page which described how to build websockets for the ESP32.

Espressif ESP32 websocket example codes

I also found this example code which was a great template for writing a website to server a websocket from the ESP32 through the Arduino IDE. It functioned with a toggle button which would talk to the ESP32 board, completing anyt binary function.

Random Nerd Tutorials

As can see on the previous site, WebSockets use TCP connection which Neil described was not as optimal as UDP for real time data connection because of time latency. Although, my goal for the final project does use real time wireless data transfer, I thought it would be benificial to develop TCP first to see the connection upload rates. I will also attmept to build a UDP connection to compare which protocal will be the best option for my final project. This video is an incredibly easy way to understand the difference between the two data transfer methods.

TCP vs UDP Comparison

Connecting Devices

I was able to use the Arduino IDE to build a basic website servered by my ESP32 board. It was fun to see the connection of multiple computers to my one ESP32.



What comes next?!

Lastly, I needed to install and burn Openocd onto my finished PCBs. This required a PCB already programmed with OCD, which I found in the lab. Next, I connected the two boards through the two 2x5 pin head connectors with a cord and attached them both to a power source (which was my computer). Once attached, I ran Openocd on my computer, and possibly out of pure luck, they both worked! I ran the Arduino bootloader to program them, then Free-dap to burn that program onto the boards. Since I use a PC and assisted others with Macbooks, I learned how to execute the process on both OS (Macs need Homebrew). But luckily, this was the only challenge I encountered in the programming process of the electronics production section.