Week 11
Networking and Communications
Week Outline
- Wednesday: Global Class on Networking and Communications.
- Thursday: Local classes on Networking and Communications, Wired Networking, and Wireless Networking.
Global Class
This week, Neil started the global class by talking about the assignments and upcoming deadlines. Then he explained why we network and the importance of it. Then, he ran us through the types of wired networks. Then he explained the ISO layers in which different networks are classified as.
Local Classes
Assignments
Send a message between two projects from your group.
The documentation of the work we did can be found here.
Design, build and connect wired or wireless node(s) with network or bus addresses and a local input and/or output devices
I connected my final project's motherboard to the Barduino via I2C. The RP2040 microcontroller on the motherboard was the master writer and the ESP32S3 microcontroller on the Barduino was the slave reader. You can see the pinouts for both boards and the wiring below.



For the master writer RP2040, I used the following code (based on this example):
#include
void setup() {
Wire.begin(); // initialize I2C bus
}
byte x = 0;
void loop() {
Wire.beginTransmission(0x55); // Address of the I2C slave device
Wire.write("Byte X is "); // Write data
Wire.write(x);
Wire.endTransmission(); // End transmission
x++;
delay(1000); // Wait a second
}
For the slave reader ESP32S3, I used the following code (from the "WireSlave" Example file available for the ESP32S3 Dev Module on the Arduino IDE):
#include "Wire.h"
#define I2C_DEV_ADDR 0x55
uint32_t i = 0;
void onRequest() {
Wire.print(i++);
Wire.print(" Packets.");
Serial.println("onRequest");
}
void onReceive(int len) {
Serial.printf("onReceive[%d]: ", len);
while (Wire.available()) {
Serial.write(Wire.read());
}
Serial.println();
}
void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
Wire.onReceive(onReceive);
Wire.onRequest(onRequest);
Wire.begin((uint8_t)I2C_DEV_ADDR);
#if CONFIG_IDF_TARGET_ESP32
char message[64];
snprintf(message, 64, "%lu Packets.", i++);
Wire.slaveWrite((uint8_t *)message, strlen(message));
#endif
}
void loop() {}
