Networking and Communications
Week 13 - Documentation
This week we are working with networks and communications. The idea is to connect our projects to the rest of the world, one step forward to robot domination! Although, a very super tiny step, because in here we are just turning a led with Wi-Fi… jajaja but it is still progress.
Individual Assignment
“Design, build, and connect wired or wireless node(s) with network or bus addresses.”
My microcontroller to go through this Fab Academy has been the esp32, and given its specifications, its logical to use Wi-Fi as the communication protocol, and that's exactly what I'm going to do.
My warmup program will be the inevitable turn on-off led, but with a spicy variation, we will use Wi-Fi!
Next, we will discuss a bit of the code use to turn on and off a led by creating a web server. You need to include the Wi-Fi library and set the network name and password.
![Descriptimage](../images/week 13/Imagen1.jpg)
In the setup you will initialize Wi-Fi connection.
![Descriptimage](../images/week 13/Imagen2.jpg)
In the loop, send and get the data established in the network connection.
![Descriptimage](../images/week 13/Imagen3.jpg)
You can also set your web page:
![Descriptimage](../images/week 13/Imagen4.jpg)
After downloading the code, we get the IP address of the web page:
![Descriptimage](../images/week 13/Imagen5.jpg)
This is the resulting web page:
![Descriptimage](../images/week 13/Imagen6.jpg)
And here we have the network working:
Group Assignment
“Send a message between two projects.”
Ok… we have a problem here. I'm in Honduras and my classmates are in México. So, I can't connect with them. So that's it for this week folks…
I wish it was like this, but Fab Academy won't have me have a relaxed week, right? No!
![Descriptimage](../images/week 13/Imagen7.jpg)
Well, I can't connect with my classmates' projects, so I will connect with the world (evil laughter) and give Terminator the power of a finger. Literally…
My group assignment will consist of being able to move a finger of the pianonator through Whatsapp, so that anyone around the world can connect with it.
Steps
Here we have the step-by-step to run the Whatsapp reading code in my circuit.
Step 1: Create an account on ThingESP and login.
![Descriptimage](../images/week 13/Imagen8.jpg)
Step 2: Go to Projects and add a new project.
![Descriptimage](../images/week 13/Imagen9.jpg)
Step 3: Create your Project.
![Descriptimage](../images/week 13/Imagen10.jpg)
After clicking in Submit the project will be added successfully.
![Descriptimage](../images/week 13/Imagen11.jpg)
Step 4: In your code define the network parameters:
![Descriptimage](../images/week 13/Imagen12.jpg)
Step 5: Create an account on twilio and login.
![Descriptimage](../images/week 13/Imagen13.jpg)
Step 6: Go to “View all accounts”.
![Descriptimage](../images/week 13/Imagen14.jpg)
Step 7: Create a new account.
![Descriptimage](../images/week 13/Imagen15.jpg)
Step 8: Give your account a name and verify it.
![Descriptimage](../images/week 13/Imagen16.jpg)
Step 9: Enter your phone number to get a verification code.
![Descriptimage](../images/week 13/Imagen17.jpg)
Step 10: Enter the verification code you received in your phone.
![Descriptimage](../images/week 13/Imagen18.jpg)
Step 11: Select Whatsapp as the Twilio product to use.
![Descriptimage](../images/week 13/Imagen19.jpg)
Step 12: Go to Messaging > Try it out > Send a WhatsApp message.
![Descriptimage](../images/week 13/Imagen20.jpg)
Step 13: Activate your sandbox.
![Descriptimage](../images/week 13/Imagen21.jpg)
Step 14: Go back to THINGESP and copy the Endpoint URL for Twilio WhatsApp from your project.
![Descriptimage](../images/week 13/Imagen22.jpg)
Step 15: In Twilio go to Sandbox settings.
![Descriptimage](../images/week 13/Imagen23.jpg)
Step 16: Paste the previously copied URL in the sandbox configuration “When a message comes in”.
![Descriptimage](../images/week 13/Imagen24.jpg)
Step 17: In Sandbox you can get the contact number to text in WhatsApp. The first message you need to send is the code.
![Descriptimage](../images/week 13/Imagen25.jpg)
Step 18: The connection is done, now you can process the messages in your circuit!
![Descriptimage](../images/week 13/Imagen26.jpg)
Step 19: This a sample of my code to move a servo when the message received is “finger1”.
![Descriptimage](../images/week 13/Imagen27.jpg)
This is a video of the modern connected pianonator:
Connecting two boards
First, I'm going to connect two Arduino uno and use ad potentiometer in one of them two change the fade of a led in the second one all through UART communication.
![Descriptimage](../images/week 13/im1.jpg)
The programs:
![Descriptimage](../images/week 13/Im2.jpg)
Results:
Now, I'm connecting two xiao RP2040 (one of them is my circuit board). One of them sends a message to turn on and off a led in the second board, all through UART communication.
![Descriptimage](../images/week 13/Im3.jpg)
The programs:
![Descriptimage](../images/week 13/Im4.png)
Results:
Here, you can download the :