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

In the setup you will initialize Wi-Fi connection.

Descriptimage

In the loop, send and get the data established in the network connection.

Descriptimage

You can also set your web page:

Descriptimage

After downloading the code, we get the IP address of the web page:

Descriptimage

This is the resulting web page:

Descriptimage

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

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

Step 2: Go to Projects and add a new project.

Descriptimage

Step 3: Create your Project.

Descriptimage

After clicking in Submit the project will be added successfully.

Descriptimage

Step 4: In your code define the network parameters:

Descriptimage

Step 5: Create an account on twilio and login.

Descriptimage

Step 6: Go to “View all accounts”.

Descriptimage

Step 7: Create a new account.

Descriptimage

Step 8: Give your account a name and verify it.

Descriptimage

Step 9: Enter your phone number to get a verification code.

Descriptimage

Step 10: Enter the verification code you received in your phone.

Descriptimage

Step 11: Select Whatsapp as the Twilio product to use.

Descriptimage

Step 12: Go to Messaging > Try it out > Send a WhatsApp message.

Descriptimage

Step 13: Activate your sandbox.

Descriptimage

Step 14: Go back to THINGESP and copy the Endpoint URL for Twilio WhatsApp from your project.

Descriptimage

Step 15: In Twilio go to Sandbox settings.

Descriptimage

Step 16: Paste the previously copied URL in the sandbox configuration “When a message comes in”.

Descriptimage

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

Step 18: The connection is done, now you can process the messages in your circuit!

Descriptimage

Step 19: This a sample of my code to move a servo when the message received is “finger1”.

Descriptimage

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

The programs:

Descriptimage

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

The programs:

Descriptimage

Results:


Here, you can download the :

Network and communication files