Week 13 - Networking and communication

Trying wired communication

To begin this week, I tried to make the boards communicate using the arduino IDE, using the UART communication protocol. I planned on going between the seeed xiao RP2040 and the RP2040 Pico. WIthin arduino I tried a multitude of different online web tutorials, but they all proved useless whenever I tried to do them. I couldn't even get the two boards to make a single instance of communication with each other. I tried this with more tutorials and with the arduino IDE, but I couldn't get anything to work, so I gave up on that and tried to do it in MicroPython/Thonny. Mr. Dubick provided us with a tutorial that would initially help to create the networking communication. Within the tutorial I followed, it provided a library which I used to network the boards together. Now that the two boards communicated with each other via wired UART communication I could move onto the wireless portion we were told to accomplish.

Next I wanted to get my connection to work with the accelerometer I used in week 11, I simply mashed the 2 codes together, and removed the unnecessary parts, which resulted in the other sensor receiving the same value that the sensor gave. This worked very well, and translates well into my final project. Now that I can network and have the sensor working, the only portion of the final project I need to focus on is the outputs, and the input from the TOF sensor I use.

Trying wireless communication

To do the wireless communication Dylan found a link that would help show how it could be done. Within the tutorial I learned how to setup a server with one of the Pico W's, and then have the other be a client that would receive information from the server. To set this up you have to first login to some sort of WIFI network, for this I just logged onto a hot spot. You need to create a new program called secret.py with the name of the network and the password, I will leave this file off of the files for this week for Dylan's privacy, because I used his hot spot. Then you upload a program to the board and it will try to connect to the device, and once it does you record the IP that it spit out. Then you change another program that you would be uploading to the client board to include that IP so that it can properly connect. Once you run the code the board should start to connect, and if it does the client will start receiving values, and the server will beigin sending them. This worked!!!

Undertanding of how this works

My understanding of how this works is that the one board functions as a "server", which is even referenced in the code. The board is connected to the internet and has a specific IP, and can only be connected with (to my knowledge) with other boards on the same network. When the other board is being started, the IP is required to locate and connect to the board. When the board connects to the server, it sees this action, and begins to send out rgb color values. The other board then reads out these values and displays them. In the future, I don't plan on using this functionality in my final project, becuase having access to wifi is unlikely in a remote area, and it is best to not depend on it, when a simple wired connection will suffice.

Group Work

Here is a link to my group site for this week

Files for this week

Files