Files
Drone-FabAcademy-2025/docs/Assignments/week_11_Networking/networking.md
2025-04-04 13:41:48 +02:00

2.0 KiB

Networking

For this week I am planning on securing the connection between my drone and the controller since I already have ESPNow running on both and have a stable connection. I wanna make the connection secure so no one can suddenly hijack the drone.

Group assignment

We used Irja's ESP and my ESP to communicate to each other using the I2C protocol. Henk also gave us his logic analyzer and told us to visualize the I2C and the SPI protocol. We first hooked up the I2C lanes to each other SDA - SDA, SCL-SCL. We used my old board for this. alt text

After testing and getting no signal for some reason I realized that I desoldered the components and all the bridge resistors to re-use them in another board. So there where no connections running anymore to the mcu. After that we directly hooked it up to the MCU using jumpers. alt text

After that we searched for code to communicate I2C between 2 esp's and found this site with exactly what we were looking for.

https://randomnerdtutorials.com/esp32-i2c-master-slave-arduino/

In there were 2 plug and play program to get communication running between the 2 ESP's.

When we had the correct wiring the code instantly worked as expected. My side. Secondary/child alt text

Irja's side. Main/parent alt text

Next up was SPI. For SPI we first tried to make the ESP act as a secondary SPI device but we couldn't figure out how to do that and online I also couldn't find anything. After a while Irja found a site that did have some code and documentation on how it worked.

https://circuits4you.com/2019/01/03/arduino-spi-communication-example/

When compiling the main side it worked fine but when compiling the secondary side it had errors that was out of my knowledge on how to fix. So I wen't rummaging through the SPI library in arduino but there wasn't much documentation on how it worked. And the official arduino documentation page gave an error 403.

alt text