{"id":159877,"date":"2024-09-10T07:48:47","date_gmt":"2024-09-10T07:48:47","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=159877"},"modified":"2024-09-10T07:48:50","modified_gmt":"2024-09-10T07:48:50","slug":"raspberry-pi-pico-w-whatsapp-micropython","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-w-whatsapp-micropython\/","title":{"rendered":"Raspberry Pi Pico W: Send Messages to WhatsApp (MicroPython)"},"content":{"rendered":"\n<p>In this guide, you\u2019ll learn how to send messages to WhatsApp with the Raspberry Pi Pico using a free API CallMeBot. This can be useful to receive notifications from your board with sensor readings, and alert messages when a sensor reading is above or below a certain threshold, when motion is detected, and many other applications.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico W Send Messages to WhatsApp MicroPython\" class=\"wp-image-159883\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?w=1920&amp;quality=100&amp;strip=all&amp;ssl=1 1920w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?resize=1536%2C864&amp;quality=100&amp;strip=all&amp;ssl=1 1536w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclgreen\"><strong>New to the Raspberry Pi Pico?<\/strong>&nbsp;Read the following guide:&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/\">Getting Started with Raspberry Pi Pico (and Pico W)<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Table of Contents<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#whatsapp\" title=\"\">Introducing WhatsApp<\/a><\/li>\n\n\n\n<li><a href=\"#callmebot-api\" title=\"\">CallMeBot WhatsApp API<\/a><\/li>\n\n\n\n<li><a href=\"#get-callmebot-api-key\" title=\"\">Getting the CallMeBot API Key<\/a><\/li>\n\n\n\n<li><a href=\"#send-messages-whatsapp-micropython-code\" title=\"\">Send Messages to WhatsApp &#8211; MicroPython Code<\/a><\/li>\n\n\n\n<li><a href=\"#demonstration\" title=\"\">Demonstration<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before proceeding, make sure you check the following prerequisites:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MicroPython Firmware<\/h3>\n\n\n\n<p>To follow this tutorial you need MicroPython firmware installed in your Raspberry Pi Pico board. You also need an IDE to write and upload the code to your board.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"250\" height=\"250\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/micropython-logo.png?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1\" alt=\"micorpython logo\" class=\"wp-image-148797\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/micropython-logo.png?w=250&amp;quality=100&amp;strip=all&amp;ssl=1 250w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/micropython-logo.png?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w\" sizes=\"(max-width: 250px) 100vw, 250px\" \/><\/figure><\/div>\n\n\n<p>The recommended MicroPython IDE for the Raspberry Pi Pico is Thonny IDE. Follow the next tutorial to learn how to install Thonny IDE, flash MicroPython firmware, and upload code to the board.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/#install-thonny-ide\">Programming Raspberry Pi Pico using MicroPython<\/a><\/li>\n<\/ul>\n\n\n\n<p>Alternatively, if you like programming using VS Code, you can start with the following tutorial:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-vs-code-micropython\/\">Programming Raspberry Pi Pico with VS Code and MicroPython<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"whatsapp\">Introducing WhatsApp<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"200\" height=\"200\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/09\/Whatsapp-logo.png?resize=200%2C200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"WhatsApp logo\" class=\"wp-image-116773\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/09\/Whatsapp-logo.png?w=200&amp;quality=100&amp;strip=all&amp;ssl=1 200w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/09\/Whatsapp-logo.png?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/><\/figure><\/div>\n\n\n<p>\u201cWhatsApp Messenger, or simply WhatsApp, is an internationally available American freeware, cross-platform centralized instant messaging and voice-over-IP service owned by Meta Platforms.\u201d It allows you to send messages using your phone\u2019s internet connection, so you can avoid SMS fees.<\/p>\n\n\n\n<p>WhatsApp is free and is available for Android and iOS. Install WhatsApp on your smartphone if you don\u2019t have it already.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"callmebot-api\">CallMeBot WhatsApp API<\/h1>\n\n\n\n<p>To send messages to your WhatsApp account with the Raspberry Pi Pico, we\u2019ll use a free API service called CallMeBot. You can learn more about CallMeBot at the following link:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.callmebot.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">https:\/\/www.callmebot.com\/<\/a><\/li>\n<\/ul>\n\n\n\n<p>Basically, it works as a gateway that allows you to send a message to yourself. All the information about how to send messages using the API can be found&nbsp;<a href=\"https:\/\/www.callmebot.com\/blog\/free-api-whatsapp-messages\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"get-callmebot-api-key\">Getting the CallMeBot API Key<\/h2>\n\n\n\n<p>Before starting to use the API, you need to get the CallMeBot WhatsApp API key. Follow the next instructions (<a href=\"https:\/\/www.callmebot.com\/blog\/free-api-whatsapp-messages\/\" target=\"_blank\" rel=\"noreferrer noopener\">check this link<\/a>&nbsp;for the instructions on the official website).<\/p>\n\n\n\n<p><strong>1)<\/strong> Add the phone number +34 611 01 16 37 to your Phone Contacts (name it as you wish);<\/p>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> <strong>Please check the official instructions because the number might change without further notice.<\/strong><\/p>\n\n\n\n<p><strong>2)<\/strong> Send the following message: \u201c<em>I allow callmebot to send me messages<\/em>\u201d&nbsp;to the new Contact created (using WhatsApp of course);<\/p>\n\n\n\n<p><strong>3)<\/strong> Wait until you receive the message \u201cAPI Activated for your phone number. Your APIKEY is XXXXXX\u201d from the bot.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"458\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/09\/Get-CallMeBot-API-Key.png?resize=350%2C458&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Get CallMeBot API key\" class=\"wp-image-116707\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/09\/Get-CallMeBot-API-Key.png?w=350&amp;quality=100&amp;strip=all&amp;ssl=1 350w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/09\/Get-CallMeBot-API-Key.png?resize=229%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 229w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><\/figure><\/div>\n\n\n<p><strong>Note:<\/strong>&nbsp;if you don\u2019t receive the API key in 2 minutes, please try again after 24hs. The WhatsApp message from the bot will contain the API key needed to send messages using the API. Additionally, double-check that you&#8217;re sending the message to the right number (check the number on the <a href=\"https:\/\/www.callmebot.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">official page here<\/a>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"callmebot-api\">CallMeBot API<\/h2>\n\n\n\n<p>To send a message using the CallMeBot API you need to make a request to the following URL (but using your information):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/api.callmebot.com\/whatsapp.php?phone=<strong>&#091;phone_number]<\/strong>&amp;text=<strong>&#091;message]<\/strong>&amp;apikey=<strong>&#091;your_apikey]<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[phone_number]: phone number associated with your WhatsApp account in international format;<\/li>\n\n\n\n<li>[message]: the message to be sent, should be URL encoded.<\/li>\n\n\n\n<li>[your_apikey]: the API key you received during the activation process in the previous section.<\/li>\n<\/ul>\n\n\n\n<p>For the official documentation, you can check the following link:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.callmebot.com\/blog\/free-api-whatsapp-messages\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.callmebot.com\/blog\/free-api-whatsapp-messages\/<\/a><\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"send-messages-whatsapp-micropython-code\">Send Messages to WhatsApp &#8211; MicroPython Code<\/h1>\n\n\n\n<p>To send messages to your WhatsApp account, the Raspberry Pi Pico needs to send a request to the URL we\u2019ve seen previously.<\/p>\n\n\n\n<p>The following code sends a test message to your account when you run the code.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-python\"># Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n# Complete project details at https:\/\/RandomNerdTutorials.com\/raspberry-pi-pico-w-whatsapp-micropython\/\n\nimport network\nimport requests\nfrom time import sleep\n\n# Wi-Fi credentials\nssid = 'REPLACE_WITH_YOUR_SSID'\npassword = 'REPLACE_WITH_YOUR_PASSWORD'\n\n# Your phone number in international format (including the + sign)\nphone_number = 'YOUR_PHONE_NUMER_INTERNATIONAL_FORMAT'\n# Example: phone_number = '+351912345678'\n\n# Your callmebot API key\napi_key = 'CALLMEBOT_API_KEY'\n\n# Init Wi-Fi Interface\ndef init_wifi(ssid, password):\n    wlan = network.WLAN(network.STA_IF)\n    wlan.active(True)\n    # Connect to your network\n    wlan.connect(ssid, password)\n    # Wait for Wi-Fi connection\n    connection_timeout = 10\n    while connection_timeout &gt; 0:\n        if wlan.status() &gt;= 3:\n            break\n        connection_timeout -= 1\n        print('Waiting for Wi-Fi connection...')\n        sleep(1)\n    # Check if connection is successful\n    if wlan.status() != 3:\n        return False\n    else:\n        print('Connection successful!')\n        network_info = wlan.ifconfig()\n        print('IP address:', network_info[0])\n        return True\n\ndef send_message(phone_number, api_key, message):\n    # Set the URL\n    url = f'https:\/\/api.callmebot.com\/whatsapp.php?phone={phone_number}&amp;text={message}&amp;apikey={api_key}'\n\n    # Make the request\n    response = requests.get(url)\n    # check if it was successful\n    if (response.status_code == 200):\n        print('Success!')\n    else:\n        print('Error')\n        print(response.text)\ntry: \n    # Connect to WiFi\n    if init_wifi(ssid, password):\n        # Send message to WhatsApp &quot;Hello&quot;\n        # ENTER YOUR MESSAGE BELOW (URL ENCODED) https:\/\/www.urlencoder.io\/\n        message = 'Hello%20from%20the%20Raspberry%20Pi%20Pico%21' \n        send_message(phone_number, api_key, message)\nexcept Exception as e:\n    print('Error:', e)\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Raspberry-Pi-Pico\/MicroPython\/Whatsapp_callmebot.py\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>You need to insert your network credentials, phone number, and CallMeBot API key to make it work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How the Code Works<\/h2>\n\n\n\n<p>Let&#8217;s take a quick look at how the code works. Alternatively, you can skip to the <a href=\"#demonstration\" title=\"\">demonstration <\/a>section.<\/p>\n\n\n\n<p>We start by including the required libraries.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import network\nimport requests\nfrom time import sleep<\/code><\/pre>\n\n\n\n<p>Insert your network credentials in the following variables so that the Pico can connect to your local network to access the internet.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code># Wi-Fi credentials\nssid = 'REPLACE_WITH_YOUR_SSID'\npassword = 'REPLACE_WITH_YOUR_PASSWORD'<\/code><\/pre>\n\n\n\n<p>Insert your phone number in international format (<strong>including the&nbsp;+&nbsp;sign<\/strong>) in the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>phone_number = 'YOUR_PHONE_NUMER_INTERNATIONAL_FORMAT'<\/code><\/pre>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>phone_number = '+351912345678'<\/code><\/pre>\n\n\n\n<p>Then, insert the&nbsp;CallMeBot API key&nbsp;you\u2019ve got previously.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>api_key = 'CALLMEBOT_API_KEY'<\/code><\/pre>\n\n\n\n<p>We create a function called <span class=\"rnthl rntliteral\">init_wifi()<\/span> to connect the Pi to your local network.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>def init_wifi(ssid, password):\n&nbsp; &nbsp; wlan = network.WLAN(network.STA_IF)\n&nbsp; &nbsp; wlan.active(True)\n&nbsp; &nbsp; # Connect to your network\n&nbsp; &nbsp; wlan.connect(ssid, password)\n&nbsp; &nbsp; # Wait for Wi-Fi connection\n&nbsp; &nbsp; connection_timeout = 10\n&nbsp; &nbsp; while connection_timeout &gt; 0:\n&nbsp; &nbsp; &nbsp; &nbsp; if wlan.status() &gt;= 3:\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break\n&nbsp; &nbsp; &nbsp; &nbsp; connection_timeout -= 1\n&nbsp; &nbsp; &nbsp; &nbsp; print('Waiting for Wi-Fi connection...')\n&nbsp; &nbsp; &nbsp; &nbsp; sleep(1)\n&nbsp; &nbsp; # Check if connection is successful\n&nbsp; &nbsp; if wlan.status() != 3:\n&nbsp; &nbsp; &nbsp; &nbsp; return False\n&nbsp; &nbsp; else:\n&nbsp; &nbsp; &nbsp; &nbsp; print('Connection successful!')\n&nbsp; &nbsp; &nbsp; &nbsp; network_info = wlan.ifconfig()\n&nbsp; &nbsp; &nbsp; &nbsp; print('IP address:', network_info&#091;0])\n&nbsp; &nbsp; &nbsp; &nbsp; return True<\/code><\/pre>\n\n\n\n<p>To make it easier to adapt the code for future projects, we created a function called&nbsp;<span class=\"rnthl rntliteral\">send_message()<\/span>&nbsp;that contains all the necessary instructions to send messages to WhatsApp. This function accepts as arguments the phone number, CallMeBot API key, and the message you want to send. You just need to call this function with the required arguments when you want to send a message.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>def send_message(phone_number, api_key, message):\n&nbsp; # Set the URL\n&nbsp; url = f'https:\/\/api.callmebot.com\/whatsapp.php?phone={phone_number}&amp;text={message}&amp;apikey={api_key}'\n&nbsp; # Make the request\n&nbsp; response = requests.get(url)\n&nbsp; # check if it was successful\n&nbsp; if (response.status_code == 400):\n&nbsp; &nbsp; print('Success!')\n&nbsp; else:\n&nbsp; &nbsp; print('Error')\n&nbsp; &nbsp; print(response.text)<\/code><\/pre>\n\n\n\n<p>Now that we\u2019ve created all the necessary functions, call the <span class=\"rnthl rntliteral\">init_wifi()<\/span> function to connect the Pico to your local network.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>if init_wifi(ssid, password):<\/code><\/pre>\n\n\n\n<p>We created a variable called <span class=\"rnthl rntliteral\">message<\/span> that contains the text that we want to send. The message should be in URL-encoded format. You can use&nbsp;<a href=\"https:\/\/www.urlencoder.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">this tool<\/a>&nbsp;to convert your text to URL-encoded format.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>message = 'Hello%20from%20the%20Raspberry%20Pi%20Pico%21'<\/code><\/pre>\n\n\n\n<p>Finally, call the <span class=\"rnthl rntliteral\">send_message()<\/span> function to send the message.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>send_message(phone_number, api_key, message)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"demonstration\">Demonstration<\/h2>\n\n\n\n<p>After inserting your network credentials, WhatsApp number, and CallMeBot API key, run the previous code on your Raspberry Pi Pico.<\/p>\n\n\n\n<p>If everything goes as expected, it should connect to the internet and make a successful request.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"740\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-connect-to-callmebot-success.png?resize=777%2C740&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico connect to callmebot success\" class=\"wp-image-159878\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-connect-to-callmebot-success.png?w=777&amp;quality=100&amp;strip=all&amp;ssl=1 777w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-connect-to-callmebot-success.png?resize=300%2C286&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-connect-to-callmebot-success.png?resize=768%2C731&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 777px) 100vw, 777px\" \/><\/figure><\/div>\n\n\n<p>After a few seconds, you should receive a new message on your WhatsApp account.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"758\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-Send-messages-to-whatsapp.png?resize=350%2C758&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico send messages to whatsapp\" class=\"wp-image-159879\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-Send-messages-to-whatsapp.png?w=350&amp;quality=100&amp;strip=all&amp;ssl=1 350w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-Send-messages-to-whatsapp.png?resize=139%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 139w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, you learned how to send messages to your WhatsApp account by making a request to the callmebot API. We&#8217;ve shown you how to send a simple text message.<\/p>\n\n\n\n<p>You can easily modify this example to send sensor readings or alert messages, for example. We have several getting started tutorials for basic sensors that you may find useful:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-bme280-micropython\/\">Raspberry Pi Pico: <strong>BME280 <\/strong>Get Temperature, Humidity, and Pressure (MicroPython)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-rcwl-0516-micropython\/\">Raspberry Pi Pico: <strong>RCWL-0516 Microwave Radar Proximity Sensor<\/strong> (MicroPython)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-ds18b20-micropython\/\">Raspberry Pi Pico: <strong>DS18B20 <\/strong>Temperature Sensor (MicroPython) \u2013 Single and Multiple<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-motion-pir-micropython\/\">Raspberry Pi Pico: Detect <strong>Motion <\/strong>using a <strong>PIR Sensor<\/strong> (MicroPython)<\/a><\/li>\n<\/ul>\n\n\n\n<p>If you would like to learn more about the Raspberry Pi Pico, make sure to take a look at our resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-w-micropython-ebook\/\" title=\"\"><strong>Learn Raspberry Pi Pico\/PicoW with MicroPython (eBook)<\/strong><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-raspberry-pi-pico\/\" title=\"\">Free Raspberry Pi Pico projects and tutorials<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you\u2019ll learn how to send messages to WhatsApp with the Raspberry Pi Pico using a free API CallMeBot. This can be useful to receive notifications from your &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Raspberry Pi Pico W: Send Messages to WhatsApp (MicroPython)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-w-whatsapp-micropython\/#more-159877\" aria-label=\"Read more about Raspberry Pi Pico W: Send Messages to WhatsApp (MicroPython)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":159883,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324,326],"tags":[],"class_list":["post-159877","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi-pico","category-raspberry-pi-pico-micropython"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/07\/Raspberry-Pi-Pico-WhatsApp-MicroPython.jpg?fit=1920%2C1080&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/159877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=159877"}],"version-history":[{"count":8,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/159877\/revisions"}],"predecessor-version":[{"id":162398,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/159877\/revisions\/162398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/159883"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=159877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=159877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=159877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}