{"id":2567,"date":"2022-06-30T07:39:07","date_gmt":"2022-06-30T07:39:07","guid":{"rendered":"https:\/\/picockpit.com\/raspberry-pi\/?p=2567"},"modified":"2023-08-04T08:18:54","modified_gmt":"2023-08-04T08:18:54","slug":"everything-about-the-raspberry-pi-pico-w","status":"publish","type":"post","link":"https:\/\/picockpit.com\/raspberry-pi\/es\/todo-sobre-la-frambuesa-pi-pico-w\/","title":{"rendered":"Todo sobre la Raspberry Pi Pico W"},"content":{"rendered":"\n<p>Today, 30 June 2022 at 8.00 AM UK time Raspberry Pi released the <a href=\"https:\/\/buyzero.de\/en\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh?variant=43536400187659\">Pico W<\/a>. <\/p>\n\n\n\n<p>Here is everything (that we know) about the newest Raspberry Pi.<\/p>\n\n\n\n\n\n<p>This new variant of the beloved Pico has wireless capabilities thanks to the CYW43439 wireless chip.<br>Just like the Pico, at the heart of each <a href=\"https:\/\/buyzero.de\/en\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh?variant=43536400187659\">Pico W<\/a> is RP2040, which is Raspberry Pi&#8217;s first silicon chip.<\/p>\n\n\n\n<p>To top it off, Raspberry Pi also released the Pico H and Pico WH variants.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Note: <\/strong>if you are looking to reserve a Raspberry Pi 4 \/ 4 GB or Pi 4 \/ 8 GB or Coral USB accelerator, and are located within the EU + Switzerland, take a look at our brand new PiCockpit Feature, the <a href=\"https:\/\/picockpit.com\/tools\/raspberry-reservation\">Raspberry Pi Reservation Tool<\/a> &#8211; one per customer, and you are in a fair queue instead of needing to rush when Pis become available. If enough people ask us, we might also make the Pico W available for reservation.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Raspberry Pi Pico Variants<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Variant<\/td><td>Price <\/td><td>Headers?<\/td><td>Wireless?<\/td><td>Release (M\/YY)<\/td><\/tr><tr><td>Pico<\/td><td>$4<\/td><td>No<\/td><td>No<\/td><td>1\/21<\/td><\/tr><tr><td>Pico H<\/td><td>$5<\/td><td>Yes<\/td><td>No<\/td><td>6\/22<\/td><\/tr><tr><td>Pico W<\/td><td>$6<\/td><td>No<\/td><td>Yes<\/td><td>6\/22<\/td><\/tr><tr><td>Pico WH<\/td><td>$7<\/td><td>Yes<\/td><td>Yes<\/td><td>Sometime in 2022<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Pico H &#8211; $5 &#8211; A Raspberry Pi Pico with pre-soldered headers<\/p>\n\n\n\n<p>Pico W &#8211; $6 &#8211; A Raspberry Pi Pico with wireless<\/p>\n\n\n\n<p>Pico WH &#8211; $7 &#8211; A Raspberry Pi Pico with both wireless and pre-soldered headers.<\/p>\n\n\n\n<p>The Pico H and Pico W were released on 30 June 2022, while the <s>Pico WH will be released in August 2022<\/s>. <\/p>\n\n\n\n<p>The Pico WH has an updated release timeline that is &#8220;later this year&#8221; in 2022, according to <a href=\"https:\/\/www.raspberrypi.com\/news\/from-zero-to-doom-inside-of-an-hour\/\" rel=\"nofollow\">Raspberry Pi&#8217;s Alasdair Allen<\/a>, who said &#8220;Later this year you\u2019ll probably see the arrival of the Pico WH, and my guess is you can work out what that is yourselves.&#8221;<\/p>\n\n\n\n<p>Here&#8217;s an update on the Pico WH in October. I got an update from Alasdair Allen who said,<\/p>\n\n\n\n<p>&#8220;It\u2019s awfully close to being out [&#8230;] and it should be out &#8216;any time now.&#8217; We wanted to make sure that we had a decent volume before pushing it out the door so folks could easily buy it.&#8221;<\/p>\n\n\n\n<blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">It\u2019s not out yet, but it\u2019s awfully close to being out. There is production hardware (and it is being produced in good numbers) and it should be out \u201cany time now.\u201d We wanted to make sure that we had a decent volume before pushing it out the door so folks could easily buy it.<\/p>\u2014 Alasdair Allan (@aallan) <a href=\"https:\/\/twitter.com\/aallan\/status\/1584531692714225664?ref_src=twsrc%5Etfw\">October 24, 2022<\/a><\/blockquote> <script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n\n\n\n<p>In this post, we will explain the similarities and differences between the Pico W and the Pico. Of course we will also present some cool Pico W projects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is the Pico H just a traditional Pico with pre-soldered headers?<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"665\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image.png\" alt=\"\" class=\"wp-image-2621\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image.png 605w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-273x300.png 273w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-11x12.png 11w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><figcaption class=\"wp-element-caption\">Raspberry Pi Pico vs Pico H. The main difference is the SWD debug headers.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>In essence, yes.<\/p>\n\n\n\n<p>But there&#8217;s a slight difference at the SWD debug headers and there&#8217;s no castellation (semi-circle holes at the edge) on the pins.<\/p>\n\n\n\n<p>In order to use the SWD debug header on the Pico H, you must use these connectors: 1.0mm pitch 3-pin JST \u2018SH\u2019 connector either BM03B-SRSS-TB (top entry) or SM03B-SRSS-TB (side entry) types, or compatible alternatives.<\/p>\n\n\n\n<p>Ground pins are also distinctly square on the Pico H, rather than being a regular round hole.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where can I buy a Pico W?<\/h3>\n\n\n\n<p>Pick up your <a href=\"https:\/\/buyzero.de\/en\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh?variant=43536400187659\">Pico W<\/a> at our store.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/buyzero.de\/en\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh?variant=43536400187659\">Get your Pico W<\/a><\/div>\n<\/div>\n\n\n\n\n\n<p>For a quick overview watch <a href=\"https:\/\/www.youtube.com\/watch?v=4RL4MJ7DVNY\">this video<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" hcb-fetch-image-from=\"https:\/\/www.youtube.com\/watch?v=4RL4MJ7DVNY\" title=\"Pico W Overview - Everything you need to know about the newest Pi\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/4RL4MJ7DVNY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Pico W wireless interface (CYW43439)<\/h3>\n\n\n\n<p>The Infineon CYW43439 supports IEEE 802.11 b\/g\/n wireless LAN and Bluetooth 5.2. At launch, only the wireless LAN will be supported. <\/p>\n\n\n\n<p>As opposed to the Raspberry Pi 4, the Pico W only has single-band 2.4 GHz Wi-Fi 4. The Pi 4 has dual-band Wi-Fi 2.4\/5 GHz, but regarding the Bluetooth, the Pico W outshines Raspberry Pi&#8217;s flagship, which only has Bluetooth 5.0. The CYW43439 supports BLE and a single antenna shared between Wi-Fi and Bluetooth.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><span style=\"color:#006933\" class=\"tadv-color\">Note<\/span><\/strong> Bluetooth is not available yet. It will likely be added in a future firmware update.<\/p>\n<\/blockquote>\n\n\n\n<p>If you take a closer look at the Pico W, you will notice the triangle shaped PCB antenna similar to the Raspberry Pi 4. Raspberry Pi uses an onboard antenna licensed from ABRACON.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"288\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna-1024x288.jpg\" alt=\"PCB antenna\" class=\"wp-image-2570\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna-1024x288.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna-300x84.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna-768x216.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna-1536x432.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna-18x5.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/PCB-Antenna.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">PCB antenna<\/figcaption><\/figure>\n<\/div>\n\n\n<p>That means that no additional antenna is needed. The wireless interface is connected via SPI to the RP2040.<\/p>\n\n\n\n<p>According to the official datasheet, the Infineon CYW43439 also has the following features: <\/p>\n\n\n\n<p>\u2022 WiFi 4 (802.11n), Single-band (2.4 GHz)<br>\u2022 WPA3<br>\u2022 SoftAP (Up to 4 clients)<\/p>\n\n\n\n<p>The official datasheet also suggests that for best wireless performance, you should place the antenna in free space. <\/p>\n\n\n\n<p>Putting metal under or close to the antenna can reduce its performance in gain and bandwidth.<\/p>\n\n\n\n<p>However, adding grounded metal to the sides of the antenna can improve the antenna&#8217;s bandwidth.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can the Pico W be turned into a WiFi access point?<\/h3>\n\n\n\n<p>Yes, because its Infineon CYW43439 supports SoftAP (up to 4 clients).<\/p>\n\n\n\n<p>In fact, you can also make the Pico W into a captive portal!<\/p>\n\n\n\n<p><a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-captive-portal-hotspot-access-point-pop-up\/\">Follow the tutorial below.<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-captive-portal-hotspot-access-point-pop-up\/\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3-1024x576.jpg\" alt=\"raspberry pi pico w captive portal set up\" class=\"wp-image-3406\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3-1024x576.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3-768x432.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3-1536x864.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3-18x10.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-3.jpg 1778w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Processing hardware<\/h2>\n\n\n\n<p>Except for the wireless interface, the hardware is almost identical to the original Pico.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>RP2040 microcontroller with 2MB of flash memory<\/li>\n\n\n\n<li>On-board single-band 2.4GHz wireless interfaces (802.11n)<\/li>\n\n\n\n<li>Micro USB B port for power and data (and for reprogramming the flash)<\/li>\n\n\n\n<li>40 pin 21mmx51mm &#8216;DIP&#8217; style 1mm thick PCB with 0.1&#8243; through-hole pins also with edge castellations<\/li>\n\n\n\n<li>Exposes 26 multi-function 3.3V general purpose I\/O (GPIO)<\/li>\n\n\n\n<li>23 GPIO are digital-only, with three also being ADC capable<\/li>\n\n\n\n<li>Can be surface mounted as a module<\/li>\n\n\n\n<li>3-pin ARM serial wire debug (SWD) port<\/li>\n\n\n\n<li>Simple yet highly flexible power supply architecture<\/li>\n\n\n\n<li>Various options for easily powering the unit from micro USB, external supplies or batteries<\/li>\n\n\n\n<li>Dual-core cortex M0+ at up to 133MHz<\/li>\n\n\n\n<li>On-chip PLL allows variable core frequency<\/li>\n\n\n\n<li>264kByte multi-bank high performance SRAM<\/li>\n\n\n\n<li>External Quad-SPI Flash with eXecute In Place (XIP) and 16kByte on-chip cache<\/li>\n\n\n\n<li>High performance full-crossbar bus fabric<\/li>\n\n\n\n<li>On-board USB1.1 (device or host)<\/li>\n\n\n\n<li>30 multi-function general purpose I\/O (four can be used for ADC)<\/li>\n\n\n\n<li>1.8-3.3V I\/O voltage<\/li>\n\n\n\n<li>12-bit 500ksps analogue to digital converter (ADC)<\/li>\n\n\n\n<li>Various digital peripherals<\/li>\n\n\n\n<li>2 \u00d7 UART, 2 \u00d7 I2C, 2 \u00d7 SPI, 16 \u00d7 PWM channels<\/li>\n\n\n\n<li>1 \u00d7 timer with 4 alarms, 1 \u00d7 real time clock<\/li>\n\n\n\n<li>2 \u00d7 programmable I\/O (PIO) blocks, 8 state machines in total<\/li>\n<\/ul>\n\n\n\n<p>The external pinout nearly identical to the Raspberry Pi Pico.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"413\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-1024x413.jpg\" alt=\"Pico W Pinout\" class=\"wp-image-2575\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-1024x413.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-300x121.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-768x310.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-1536x620.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-2048x826.jpg 2048w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/Pico-W-Pinout-18x7.jpg 18w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Pico W Pinout<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The only difference is with the LED and SWD debug pins.<\/p>\n\n\n\n<p>The onboard LED is controlled via the WL_GPIO0 Pin of the Infineon 43439 chip. On the Pico, the LED was connected to GPIO Pin 25.<\/p>\n\n\n\n<p>Furthermore, the SWD debug pins were moved towards the center of the board, to create space for the PCB antenna. You can find them between the RP2040 and the CYW43439 and the order from left to right is still SWCLK, GND, SWDIO.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Software<\/h2>\n\n\n\n<p>Since the Pico W is based on the RP2040 chip, you can program it just like the Pico. That means you can program it in C\/C++ and MicroPython and that code written for the Pico (that does not use the onboard LED) should work on the Pico W.<\/p>\n\n\n\n<p>Raspberry Pi provides a <a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/connecting-to-the-internet-with-pico-w.pdf\">&#8216;Connecting to the Internet with Raspberry Pi Pico W&#8217;<\/a> guide for C\/C++ and MicroPython. To make your start with the Pico W easier, we also put together some example projects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">C\/C++ and the Pico-SDK<\/h3>\n\n\n\n<p>There is an <a href=\"https:\/\/github.com\/raspberrypi\/pico-sdk\">update to the Pico-SDK<\/a> to enable the wireless capabilities of your Pico W. The setup and usage is exactly the same as with the Pico. Watch <a href=\"https:\/\/www.youtube.com\/watch?v=TutPFyyT3P8&amp;t=268s\">our video<\/a> to get started with the Pico W and C\/C++.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" hcb-fetch-image-from=\"https:\/\/www.youtube.com\/watch?v=TutPFyyT3P8&amp;t=268s\" title=\"Pico SDK - Getting started with the Raspberry Pi Pico\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/TutPFyyT3P8?start=268&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The <a href=\"https:\/\/github.com\/raspberrypi\/pico-sdk\">updated Pico-SDK<\/a> also contains some examples for wireless use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MicroPython and Thonny<\/h3>\n\n\n\n<p>The most convenient way to use MicroPython with the Pico W is to use the Thonny IDE. Raspberry Pi released a <a href=\"https:\/\/datasheets.raspberrypi.com\/soft\/micropython-firmware-pico-w-290622.uf2\">new MicroPython port<\/a> for the Pico W.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><span style=\"color:#006933\" class=\"tadv-color\">Note<\/span><\/strong> MicroPython is board specific. Hence there are different (and incompatible) MicroPython versions for the Pico and the Pico W. Make sure to always use the correct version for your board.<\/p>\n<\/blockquote>\n\n\n\n<p>That being said, the way of programming the Pico W is exactly the same, so if you have used the Pico with MicroPython before, it should be a breeze.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pico H and Pico WH<\/h2>\n\n\n\n<p>As mentioned, Raspberry Pi also released the Pico H and Pico WH. The &#8216;H&#8217; added to the name means it comes with presoldered headers. The Pico H is just like our Pico Comfort, but for the SWD debug Pins Raspberry Pi uses a horizontal JTAG debug header. The Pico WH will likely use the same two rows of 1&#215;20 headers and some vertical header for the debug pins.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-text-align-center wp-element-button\" href=\"https:\/\/buyzero.de\/en\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh?variant=43536400187659\">Get your Pico Variant<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Getting started with the Raspberry Pi Pico W<\/h2>\n\n\n\n<p>This section will highlight simple tricks and patterns that will help you get started with your Raspberry Pi Pico W.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Raspberry Pi Pico W pinout<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"620\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-47-1024x620.png\" alt=\"\" class=\"wp-image-2803\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-47-1024x620.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-47-300x182.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-47-768x465.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-47-18x12.png 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-47.png 1223w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Raspberry Pi Pico W pinout (<a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/pico-w-datasheet.pdf\">image from official datasheet<\/a>)<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Flashing the MicroPython UF2<\/h3>\n\n\n\n<p>A fundamental setup task that you&#8217;ll need to do is to flash the MicroPython UF2 onto your Pico W.<\/p>\n\n\n\n<p>First, <a href=\"https:\/\/datasheets.raspberrypi.com\/soft\/micropython-firmware-pico-w-290622.uf2\">download the UF2 file specifically made for the Raspberry Pi Pico W here<\/a>.  Alternatively,<a href=\"https:\/\/micropython.org\/download\/rp2-pico-w\/\"> you can find the nightly builds here.<\/a><\/p>\n\n\n\n<p>Do note that you cannot use the UF2 from the original Raspberry Pi Pico.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220712_151153-1000px.jpg\" alt=\"Press and hold the BOOTSEL button, then plug in your USB into the Raspberry Pi Pico W.\" class=\"wp-image-2748\" width=\"701\" height=\"526\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220712_151153-1000px.jpg 1000w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220712_151153-1000px-300x225.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220712_151153-1000px-768x576.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220712_151153-1000px-16x12.jpg 16w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><figcaption class=\"wp-element-caption\">Press and hold the BOOTSEL button, then plug in your USB into the Raspberry Pi Pico W.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>To upload the UF2 file, you will need to press and hold the BOOTSEL button and then plugging in the USB.<\/p>\n\n\n\n<p>You will see a new volume called RPI-RP2 on your file explorer. <\/p>\n\n\n\n<p>Copy the UF2 file onto that drive.<\/p>\n\n\n\n<p>It will automatically disconnect upon upload.<\/p>\n\n\n\n<p>That&#8217;s it! Your Raspberry Pi Pico W is now ready to accept MicroPython code. <\/p>\n\n\n\n<p>Onto the next step&#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Thonny IDE<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-33-1024x593.png\" alt=\"\" class=\"wp-image-2751\" width=\"792\" height=\"458\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-33-1024x593.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-33-300x174.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-33-768x445.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-33-18x10.png 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-33.png 1301w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><figcaption class=\"wp-element-caption\">Thonny running our beginner&#8217;s project (see below)<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The easiest way to run MicroPython code and to access a shell on the Raspberry Pi Pico W is to use the Thonny IDE.<\/p>\n\n\n\n<p>Thonny comes by default on the Raspberry Pi OS. However, you might want to install it on your main computer for your convenience.<\/p>\n\n\n\n<p>Here&#8217;s how: go to <a href=\"https:\/\/thonny.org\/\">https:\/\/thonny.org\/<\/a> and you will be able to find the latest versions on the front page.<\/p>\n\n\n\n<p>You will likely be greeted by a pop-up window asking you to update. Go ahead with it.<\/p>\n\n\n\n<p>The update ran fine when I ran Thonny on my Raspberry Pi OS, however, on Windows, there was this error saying \u201cSSL: CERTIFICATE_VERIFY_FAILED\u201d.<\/p>\n\n\n\n<p>You can fix this by downloading this certificate (<a href=\"https:\/\/letsencrypt.org\/certs\/lets-encrypt-r3.der\">https:\/\/letsencrypt.org\/certs\/lets-encrypt-r3.der<\/a>), then right click on the downloaded file and \u201cInstall Certificate\u201d and you\u2019ll no longer encounter this error.<\/p>\n\n\n\n<p>Make sure you have chosen &#8220;<strong>MicroPython (Raspberry Pi Pico)<\/strong>&#8221; on the bottom right corner.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-39.png\" alt=\"\" class=\"wp-image-2770\" width=\"731\" height=\"449\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-39.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-39-300x185.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-39-768x473.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-39-18x12.png 18w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Uploading files to your Raspberry Pi Pico W<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-34-1024x593.png\" alt=\"\" class=\"wp-image-2752\" width=\"733\" height=\"424\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-34-1024x593.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-34-300x174.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-34-768x445.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-34-18x10.png 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-34.png 1297w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><figcaption class=\"wp-element-caption\">Upload files onto your Raspberry Pi Pico W by clicking on <strong>Upload to \/<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p>Here&#8217;s how you can upload your MicroPython files onto the Raspberry Pi Pico W with Thonny.<\/p>\n\n\n\n<p>Plug in your Raspberry Pi Pico W.<\/p>\n\n\n\n<p>In Thonny, go to <strong>View &gt; Files<\/strong>.<\/p>\n\n\n\n<p>You will see two sections. Files on your computer on top and files on the Raspberry Pi Pico W.<\/p>\n\n\n\n<p>Right click on the files you want to upload and select <strong>Upload to \/<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Blink onboard LED<\/h3>\n\n\n\n<p>A fundamental difference between the original Raspberry Pi Pico and the Pico W is how you would blink the onboard LED.<\/p>\n\n\n\n<p>In the past, you would control the LED by using this code:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"led = machine.Pin(25, machine.Pin.OUT)\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">25<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">Pin<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">OUT<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>However, on the Raspberry Pi Pico W, you would use <strong>&#8220;LED&#8221;<\/strong> rather than <strong>25<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"led = machine.Pin('LED', machine.Pin.OUT)\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">LED<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">Pin<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">OUT<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Hence, in order to blink the onboard LED, you will write this code:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import machine\nimport time\n\nled = machine.Pin('LED', machine.Pin.OUT)\n\nwhile (True):\n    led.on()\n    time.sleep(.2)\n    led.off()\n    time.sleep(.2)\n   \" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">time<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">led<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">LED<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">OUT<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">while<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">led<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">on<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">time<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">sleep<\/span><span style=\"color: #D8DEE9FF\">(.2)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">led<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">off<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">time<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">sleep<\/span><span style=\"color: #D8DEE9FF\">(.2)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Save this as <strong>main.py<\/strong> and it will automatically run when the Pico W is powered.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Connecting to WiFi<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-35-1024x587.png\" alt=\"\" class=\"wp-image-2760\" width=\"744\" height=\"426\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-35-1024x587.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-35-300x172.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-35-768x441.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-35-18x10.png 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-35.png 1304w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/figure>\n<\/div>\n\n\n<p>Below is simplified code that will allow you to<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect to WiFi<\/li>\n\n\n\n<li>10-second timeout<\/li>\n\n\n\n<li>Print &#8220;Waiting for connection&#8221; while connecting to the network defined in the variables <strong>ssid <\/strong>and <strong>pw<\/strong><\/li>\n\n\n\n<li>Light the onboard LED upon a successful connection<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import network\nimport time\n\nwlan = network.WLAN(network.STA_IF)\nwlan.active(True)\n\nssid = &quot;insert-your-SSID-here&quot;\npw = &quot;insert-your-pw-here&quot;\n\nwlan.connect(ssid, pw)\n\ndef light_onboard_led():\n    led = machine.Pin('LED', machine.Pin.OUT)\n    led.on();\n\ntimeout = 10\nwhile timeout &gt; 0:\n    if wlan.status() &gt;= 3:\n        light_onboard_led()\n        break\n    timeout -= 1\n    print('Waiting for connection...')\n    time.sleep(1)\n   \nwlan_status = wlan.status()\n\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">time<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">STA_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">insert-your-SSID-here<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">pw<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">insert-your-pw-here<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">connect<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">pw<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">light_onboard_led<\/span><span style=\"color: #D8DEE9FF\">():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">led<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">LED<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">OUT<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">led<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">on<\/span><span style=\"color: #D8DEE9FF\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">timeout<\/span><span style=\"color: #D8DEE9FF\"> = 10<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">timeout<\/span><span style=\"color: #D8DEE9FF\"> &gt; 0:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">status<\/span><span style=\"color: #D8DEE9FF\">() &gt;= 3:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">light_onboard_led<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">break<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">timeout<\/span><span style=\"color: #D8DEE9FF\"> -= 1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Waiting for connection...<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">time<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">sleep<\/span><span style=\"color: #D8DEE9FF\">(1)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan_status<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">status<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>In a real-world project, it would be preferable to create a separate file (for example, <strong>secrets.py)<\/strong> and store the <strong>ssid <\/strong>and <strong>pw<\/strong> there, then import it into the main file.<\/p>\n\n\n\n<p>There is also not much feedback with this code nor any error handling. If you&#8217;re successful, you get a lit LED. If you are not, you get no feedback. <\/p>\n\n\n\n<p>Hence, here&#8217;s a more elegant way to connect to a network. <\/p>\n\n\n\n<p>The following code adjusts for regional differences in the <strong>rp2.country(&#8220;DE&#8221;)<\/strong>. Change this to your country, such as &#8220;GB&#8221;, &#8220;US&#8221;, etc.<\/p>\n\n\n\n<p>When you successfully connect to a WiFi network, you will see three blinks of the onboard LED upon successful connection. Any other number of blinks will mean something else, based on the following number of blinks:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"# Handle connection error\n# Error meanings\n# 0  Link Down\n# 1  Link Join\n# 2  Link NoIp\n# 3  Link Up\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Handle<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">connection<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">error<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Error<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">meanings<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Down<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Join<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">NoIp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Up<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>main.py<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import rp2\nimport network\nimport ubinascii\nimport machine\nimport urequests as requests\nimport time\nfrom secrets import secrets\nimport socket\n\n# Set country to avoid possible errors\nrp2.country('DE')\n\nwlan = network.WLAN(network.STA_IF)\nwlan.active(True)\n# If you need to disable powersaving mode\n# wlan.config(pm = 0xa11140)\n\n# See the MAC address in the wireless chip OTP\nmac = ubinascii.hexlify(network.WLAN().config('mac'),':').decode()\nprint('mac = ' + mac)\n\n# Other things to query\n# print(wlan.config('channel'))\n# print(wlan.config('essid'))\n# print(wlan.config('txpower'))\n\n# Load login data from different file for safety reasons\nssid = secrets['ssid']\npw = secrets['pw']\n\nwlan.connect(ssid, pw)\n\n# Wait for connection with 10 second timeout\ntimeout = 10\nwhile timeout &gt; 0:\n    if wlan.status() < 0 or wlan.status() &gt;= 3:\n        break\n    timeout -= 1\n    print('Waiting for connection...')\n    time.sleep(1)\n\n# Define blinking function for onboard LED to indicate error codes    \ndef blink_onboard_led(num_blinks):\n    led = machine.Pin('LED', machine.Pin.OUT)\n    for i in range(num_blinks):\n        led.on()\n        time.sleep(.2)\n        led.off()\n        time.sleep(.2)\n    \n# Handle connection error\n# Error meanings\n# 0  Link Down\n# 1  Link Join\n# 2  Link NoIp\n# 3  Link Up\n# -1 Link Fail\n# -2 Link NoNet\n# -3 Link BadAuth\n\nwlan_status = wlan.status()\nblink_onboard_led(wlan_status)\n\nif wlan_status != 3:\n    raise RuntimeError('Wi-Fi connection failed')\nelse:\n    print('Connected')\n    status = wlan.ifconfig()\n    print('ip = ' + status[0])\n\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">rp2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">ubinascii<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">urequests<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">as<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">requests<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">time<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">secrets<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">secrets<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">socket<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">Set<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">country<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">avoid<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">possible<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">errors<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">rp2<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">country<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">DE<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">STA_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">If<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">you<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">need<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">disable<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">powersaving<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">mode<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">pm<\/span><span style=\"color: #D8DEE9FF\"> = 0<\/span><span style=\"color: #8FBCBB\">xa11140<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">See<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">MAC<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">in<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">wireless<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">chip<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">OTP<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">mac<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">ubinascii<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">hexlify<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">().<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">mac<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">:<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">).<\/span><span style=\"color: #8FBCBB\">decode<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">mac = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> + <\/span><span style=\"color: #8FBCBB\">mac<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">Other<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">things<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">query<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">channel<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">essid<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">txpower<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">))<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">Load<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">login<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">data<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">different<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">file<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">safety<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">reasons<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">ssid<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">secrets<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">ssid<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">pw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">secrets<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">pw<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">connect<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">pw<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Wait<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">connection<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">10<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">second<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timeout<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">timeout<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">10<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timeout<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">() <\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">or<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">() <\/span><span style=\"color: #81A1C1\">&gt;=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">break<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">timeout<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">-=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Waiting for connection...<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">time<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Define<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">blinking<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">onboard<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">LED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">indicate<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">error<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">codes<\/span><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">blink_onboard_led<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">num_blinks<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    led = machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">Pin(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">LED<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">Pin<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">OUT)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">i<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">range<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">num_blinks<\/span><span style=\"color: #D8DEE9FF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">on<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">time<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">.2<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">off<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">time<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">.2<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Handle<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">connection<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">error<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Error<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">meanings<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Down<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Join<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">NoIp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Up<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Fail<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">NoNet<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Link<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">BadAuth<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">wlan_status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">blink_onboard_led<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">wlan_status<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan_status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">!=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">raise<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">RuntimeError<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Wi-Fi connection failed<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">else<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connected<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">ifconfig<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">ip = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">status<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">])<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>secrets.py<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"secrets = {\n    'ssid': 'your-ssid',\n    'pw': 'your-pw',\n    }\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">secrets<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">ssid<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">your-ssid<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">pw<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">your-pw<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Serve a webpage on local IP<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-36.png\" alt=\"\" class=\"wp-image-2763\" width=\"729\" height=\"406\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-36.png 950w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-36-300x167.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-36-768x428.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-36-18x10.png 18w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/figure>\n<\/div>\n\n\n<p>In order to serve a webpage using the Raspberry Pi Pico W, you will need three files.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>main.py<\/strong> &#8211; the main bulk of the code (which automatically runs on the Pico W)<\/li>\n\n\n\n<li><strong>secrets.py<\/strong> &#8211; containing ssid and pw<\/li>\n\n\n\n<li><strong>index.html <\/strong>&#8211; containing the webpage that will be served<\/li>\n<\/ul>\n\n\n\n<p><strong>main.py <\/strong>will connect to your WiFi network, defined in <strong>secrets.py<\/strong>. Then, it will open up a socket that will listen for any connections to the Raspberry Pi Pico W.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"581\" height=\"220\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-38.png\" alt=\"\" class=\"wp-image-2765\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-38.png 581w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-38-300x114.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-38-18x7.png 18w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/figure>\n<\/div>\n\n\n<p>If someone connects, it will deliver the webpage, named <strong>index.html<\/strong>.<\/p>\n\n\n\n<p>Here&#8217;s the code for <strong>main.py <\/strong>and <strong>index.html<\/strong>. <strong>secrets.py<\/strong> can be taken from the previous example.<\/p>\n\n\n\n<p><strong>main.py<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import rp2\nimport network\nimport ubinascii\nimport machine\nimport urequests as requests\nimport time\nfrom secrets import secrets\nimport socket\n\n# Set country to avoid possible errors\nrp2.country('DE')\n\nwlan = network.WLAN(network.STA_IF)\nwlan.active(True)\n\n# See the MAC address in the wireless chip OTP\nmac = ubinascii.hexlify(network.WLAN().config('mac'),':').decode()\nprint('mac = ' + mac)\n\n# Load login data from different file for safety reasons\nssid = secrets['ssid']\npw = secrets['pw']\n\nwlan.connect(ssid, pw)\n\n# Wait for connection with 10 second timeout\ntimeout = 10\nwhile timeout &gt; 0:\n    if wlan.status() < 0 or wlan.status() &gt;= 3:\n        break\n    timeout -= 1\n    print('Waiting for connection...')\n    time.sleep(1)\n\n# Define blinking function for onboard LED to indicate error codes    \ndef blink_onboard_led(num_blinks):\n    led = machine.Pin('LED', machine.Pin.OUT)\n    for i in range(num_blinks):\n        led.on()\n        time.sleep(.2)\n        led.off()\n        time.sleep(.2)\n\nwlan_status = wlan.status()\nblink_onboard_led(wlan_status)\n\nif wlan_status != 3:\n    raise RuntimeError('Wi-Fi connection failed')\nelse:\n    print('Connected')\n    status = wlan.ifconfig()\n    print('ip = ' + status[0])\n    \n# Function to load in html page    \ndef get_html(html_name):\n    with open(html_name, 'r') as file:\n        html = file.read()\n        \n    return html\n\n# HTTP server with socket\naddr = socket.getaddrinfo('0.0.0.0', 80)[0][-1]\n\ns = socket.socket()\ns.bind(addr)\ns.listen(1)\n\nprint('Listening on', addr)\n\n# Listen for connections\nwhile True:\n    try:\n        cl, addr = s.accept()\n        print('Client connected from', addr)\n        response = get_html('index.html')\n        cl.send('HTTP\/1.0 200 OK\\r\\nContent-type: text\/html\\r\\n\\r\\n')\n        cl.send(response)\n        cl.close()\n        \n    except OSError as e:\n        cl.close()\n        print('Connection closed')\n\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">rp2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">ubinascii<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">urequests<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">as<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">requests<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">time<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">secrets<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">secrets<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">socket<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">Set<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">country<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">avoid<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">possible<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">errors<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">rp2<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">country<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">DE<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">STA_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">wlan<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">See<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">MAC<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">address<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">in<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">wireless<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">chip<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">OTP<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">mac<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">ubinascii<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">hexlify<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">().<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">mac<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">:<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">).<\/span><span style=\"color: #8FBCBB\">decode<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">mac = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> + <\/span><span style=\"color: #8FBCBB\">mac<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">Load<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">login<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">data<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">different<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">file<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">safety<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">reasons<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">ssid<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">secrets<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">ssid<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">pw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">secrets<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">pw<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">connect<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">pw<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Wait<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">connection<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">10<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">second<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timeout<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">timeout<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">10<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">timeout<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">() <\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">or<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">() <\/span><span style=\"color: #81A1C1\">&gt;=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">break<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">timeout<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">-=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Waiting for connection...<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">time<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Define<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">blinking<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">onboard<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">LED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">indicate<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">error<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">codes<\/span><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">blink_onboard_led<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">num_blinks<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    led = machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">Pin(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">LED<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">Pin<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">OUT)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">i<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">range<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">num_blinks<\/span><span style=\"color: #D8DEE9FF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">on<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">time<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">.2<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">off<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">time<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">.2<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">wlan_status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">blink_onboard_led<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">wlan_status<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan_status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">!=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">raise<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">RuntimeError<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Wi-Fi connection failed<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">else<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connected<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">wlan<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">ifconfig<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">ip = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">status<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">load<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">html<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">page<\/span><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">get_html<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">html_name<\/span><span style=\"color: #D8DEE9FF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">open<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">html_name<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">r<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #81A1C1\">as<\/span><span style=\"color: #D8DEE9FF\"> file:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">html<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">file<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">read<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">html<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">HTTP<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">server<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">socket<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">socket<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">getaddrinfo<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">0.0.0.0<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">80<\/span><span style=\"color: #D8DEE9FF\">)[<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">][<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">socket<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">socket<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">bind<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">listen<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Listening on<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Listen<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">connections<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> True<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">try<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">accept<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Client connected from<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">response<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">get_html<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">index.html<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">send<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">HTTP\/1.0 200 OK<\/span><span style=\"color: #EBCB8B\">\\r\\n<\/span><span style=\"color: #A3BE8C\">Content-type: text\/html<\/span><span style=\"color: #EBCB8B\">\\r\\n\\r\\n<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">send<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">response<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">close<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">except<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">OSError<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">as<\/span><span style=\"color: #D8DEE9FF\"> e:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">close<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connection closed<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>index.html<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"<!DOCTYPE html&gt;\n<html&gt;\n    <head&gt;\n        <title&gt;Pico W<\/title&gt;\n    <\/head&gt;\n    <body&gt;\n        <h1&gt;Pico W<\/h1&gt;\n    \n    <\/body&gt;\n<\/html&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;!<\/span><span style=\"color: #D8DEE9\">DOCTYPE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">html<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">&lt;html&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">&lt;head&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;title&gt;<\/span><span style=\"color: #D8DEE9FF\">Pico W<\/span><span style=\"color: #81A1C1\">&lt;\/title&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">&lt;\/head&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">&lt;body&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;h1&gt;<\/span><span style=\"color: #D8DEE9FF\">Pico W<\/span><span style=\"color: #81A1C1\">&lt;\/h1&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">&lt;\/body&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">&lt;\/html&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Broadcasting a WiFi network (SoftAP access point)<\/h3>\n\n\n\n<p>I&#8217;m writing this in the middle of July 2022, so things are rapidly changing.<\/p>\n\n\n\n<p>If you haven&#8217;t flashed your Raspberry Pi Pico W with the latest MicroPython UF2, then do so now as the engineers at Raspberry Pi are updating it as we speak. <a href=\"https:\/\/micropython.org\/download\/rp2-pico-w\/\">Get the latest build here.<\/a><\/p>\n\n\n\n<p>The latest nightly build, released July 15, has several updates. For one, it allows you to secure your WiFi network with a password (previously it was broken).<\/p>\n\n\n\n<p>There are some bugs. For example, I wasn&#8217;t able to change the SSID name by stopping and running the script in Thonny. I had to do a harder reset by pulling the USB from the Pico W.<\/p>\n\n\n\n<p>The crucial part to set up an access point is this segment here:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import network\nimport machine\n\nssid = '<your-ap-name&gt;'\npassword = '<your-pw&gt;'\n\nap = network.WLAN(network.AP_IF)\nap.config(essid=ssid, password=password)\nap.active(True)\n\nwhile ap.active() == False:\n  pass\n\nprint('Connection successful')\nprint(ap.ifconfig())\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">&lt;your-ap-name&gt;<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">&lt;your-pw&gt;<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">AP_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">essid<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">() == <\/span><span style=\"color: #8FBCBB\">False<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">pass<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connection successful<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">ifconfig<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"233\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-40.png\" alt=\"\" class=\"wp-image-2784\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-40.png 353w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-40-300x198.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-40-18x12.png 18w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><figcaption class=\"wp-element-caption\">Access point broadcasted by the Raspberry Pico W. If you can&#8217;t see your AP as you named it, try pulling the USB plug and repowering the Pico W.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Here&#8217;s<a href=\"https:\/\/gist.github.com\/aallan\/447c3bf43faf2c82e8bd4afdea9eb63e\"> a complete gist from Raspberry Pi&#8217;s head of documentation, Alasdair Allen<\/a>, which makes your Pico W an access point with SSID <strong>MicroPython-AP<\/strong>, password <strong>123456789<\/strong>.<\/p>\n\n\n\n<p>When you connect to it, it will send a web page with &#8220;Hello from Pico W&#8221;<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import socket\nimport network\nimport machine\n\nssid = 'MicroPython-AP'\npassword = '123456789'\n\nled = machine.Pin(&quot;LED&quot;,machine.Pin.OUT)\n\nap = network.WLAN(network.AP_IF)\nap.config(essid=ssid, password=password)\nap.active(True)\n\nwhile ap.active() == False:\n  pass\n\nprint('Connection successful')\nprint(ap.ifconfig())\n\nhtml = &quot;&quot;&quot;<!DOCTYPE html&gt;\n<html&gt;\n    <head&gt; <title&gt;Pico W<\/title&gt; <\/head&gt;\n    <body&gt; <h1&gt;Pico W<\/h1&gt;\n        <p&gt;Hello from Pico W.<\/p&gt;\n    <\/body&gt;\n<\/html&gt;\n&quot;&quot;&quot;\n\naddr = socket.getaddrinfo('0.0.0.0', 80)[0][-1]\ns = socket.socket()\ns.bind(addr)\ns.listen(1)\n\nprint('listening on', addr)\nled.off()\n\n# Listen for connections\nwhile True:\n    try:\n        cl, addr = s.accept()\n        print('client connected from', addr)\n        request = cl.recv(1024)\n        led.on()\n        print(request)\n\n        cl.send('HTTP\/1.0 200 OK\\r\\nContent-type: text\/html\\r\\n\\r\\n')\n        cl.send(html)\n        cl.close()\n        led.off()\n\n    except OSError as e:\n        cl.close()\n        print('connection closed')\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">socket<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">MicroPython-AP<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">123456789<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">led<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">LED<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">OUT<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">AP_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">essid<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">() == <\/span><span style=\"color: #8FBCBB\">False<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">pass<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connection successful<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">ifconfig<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">html<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&quot;&quot;&quot;<\/span><span style=\"color: #A3BE8C\">&lt;!DOCTYPE html<\/span><span style=\"color: #D8DEE9\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">&lt;<\/span><span style=\"color: #8FBCBB\">html<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    &lt;<\/span><span style=\"color: #8FBCBB\">head<\/span><span style=\"color: #D8DEE9FF\">&gt; &lt;<\/span><span style=\"color: #8FBCBB\">title<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><span style=\"color: #8FBCBB\">Pico<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">W<\/span><span style=\"color: #D8DEE9FF\">&lt;\/<\/span><span style=\"color: #8FBCBB\">title<\/span><span style=\"color: #D8DEE9FF\">&gt; &lt;\/<\/span><span style=\"color: #8FBCBB\">head<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    &lt;<\/span><span style=\"color: #8FBCBB\">body<\/span><span style=\"color: #D8DEE9FF\">&gt; &lt;<\/span><span style=\"color: #8FBCBB\">h1<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><span style=\"color: #8FBCBB\">Pico<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">W<\/span><span style=\"color: #D8DEE9FF\">&lt;\/<\/span><span style=\"color: #8FBCBB\">h1<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        &lt;<\/span><span style=\"color: #8FBCBB\">p<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><span style=\"color: #8FBCBB\">Hello<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">Pico<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">W<\/span><span style=\"color: #D8DEE9FF\">.&lt;\/<\/span><span style=\"color: #8FBCBB\">p<\/span><span style=\"color: #D8DEE9FF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">&lt;\/<\/span><span style=\"color: #D8DEE9\">body<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">&lt;\/<\/span><span style=\"color: #D8DEE9\">html<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">&quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #A3BE8C\">addr = socket.getaddrinfo(&#39;0.0.0.0&#39;, 80)[0][-1<\/span><span style=\"color: #D8DEE9\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">socket<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">socket<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">bind<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">listen<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">listening on<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">off<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Listen<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">connections<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> True<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">try<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">s<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">accept<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">client connected from<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">addr<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">recv<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">on<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">send<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">HTTP\/1.0 200 OK<\/span><span style=\"color: #EBCB8B\">\\r\\n<\/span><span style=\"color: #A3BE8C\">Content-type: text\/html<\/span><span style=\"color: #EBCB8B\">\\r\\n\\r\\n<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">send<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">html<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">close<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">led<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">off<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">except<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">OSError<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">as<\/span><span style=\"color: #D8DEE9FF\"> e:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">cl<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">close<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">connection closed<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Raspberry Pi Pico W beginner tutorials<\/h2>\n\n\n\n<p>We have compiled a few beginner tutorials to help you learn about the Raspberry Pi Pico W.<\/p>\n\n\n\n<p><strong>Raspberry Pi Pico W mega tutorial<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-beginners-components-tutorial\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2-1024x576.jpg\" alt=\"raspberry pi pico w components tutorial\" class=\"wp-image-3374\" width=\"737\" height=\"414\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2-1024x576.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2-768x432.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2-1536x864.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2-18x10.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/11\/featured-image-2.jpg 1778w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>For absolute beginners with a kit of components, this tutorial will walk you through interacting with your components wirelessly.<\/p>\n\n\n\n<p>This tutorial is specifically focused on the Pico W, which means it attempts to use the WiFi module as much as possible. So, instead of buttons, we&#8217;ll use a web browser with virtual buttons to control LEDs, buzzers. We&#8217;ll use a browser to view temperature and distance data instead of an LCD.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CLICK HERE: <a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-beginners-components-tutorial\/\">Raspberry Pi Pico W beginner&#8217;s components tutorial<\/a><\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Control Pico W onboard LED with a web server<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/picockpit.com\/raspberry-pi\/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1.jpg\" alt=\"Raspberry Pi Pico W control onboard LED with web server\" class=\"wp-image-2695\" width=\"710\" height=\"399\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1.jpg 1000w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1-768x432.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1-18x10.jpg 18w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>This is the most basic tutorial that will help you understand how to connect your Raspberry Pi Pico W to WiFi, launch a web server and control the onboard LED with the web server.<\/p>\n\n\n\n<p>A web page will be served with an &#8220;on\/off&#8221; button that can be used to control the onboard LED.<\/p>\n\n\n\n<p>This tutorial forms the basis for many further projects that require remote control over WiFi.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CLICK HERE: <a href=\"https:\/\/picockpit.com\/raspberry-pi\/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w\/\">Control Pico W onboard LED with a web serve<\/a>r<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Stream sensor data via web server on the Raspberry Pi Pico W<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/picockpit.com\/raspberry-pi\/stream-sensor-data-over-wifi-with-raspberry-pi-pico-w\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image.jpg\" alt=\"Raspberry Pi Pico W tutorial stream sensor data\" class=\"wp-image-2687\" width=\"703\" height=\"395\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image.jpg 1000w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-768x432.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-18x10.jpg 18w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Using the accelerometer ADXL343, this tutorial will show you how to dynamically update the readings on a web page that&#8217;s served by your Raspberry Pi Pico W.<\/p>\n\n\n\n<p>The web page updates every second when a client visits the Pico W&#8217;s IP address. There&#8217;s also a digital web dice function that&#8217;s activated when the ADXL343 is tapped.<\/p>\n\n\n\n<p>You will learn how to use libraries, set up WiFi, serve a web page and how to display the sensor&#8217;s values on the web page.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CLICK HERE: <a href=\"https:\/\/picockpit.com\/raspberry-pi\/stream-sensor-data-over-wifi-with-raspberry-pi-pico-w\/\">Stream sensor data over WiFi with Raspberry Pi Pico W<\/a><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Raspberry Pi Pico W Wi-Fi Doorbell tutorial (HTTP requests &amp; IFTTT)<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3-1024x576.jpg\" alt=\"Raspberry Pi Pico W projects WiFi doorbell and notification\" class=\"wp-image-2742\" width=\"733\" height=\"412\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3-1024x576.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3-768x432.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3-1536x864.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3-18x10.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-3.jpg 1778w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/figure>\n<\/div>\n\n\n<p>This tutorial will teach you how to use the Raspberry Pi Pico W to shoot a HTTP request.<\/p>\n\n\n\n<p>We will use a button to simulate a doorbell. When pressed, the button will trigger the Pico W to hit IFTTT&#8217;s endpoint, which will then trigger an email notification or app notification.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CLICK HERE: <a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-wi-fi-doorbell-tutorial-http-requests-ifttt\/\">Raspberry Pi Pico W Wi-Fi Doorbell tutorial (HTTP requests &amp; IFTTT)<\/a><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Raspberry Pi Pico W remote weather station (solar powered and SoftAP)<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1024x576.png\" alt=\"Raspberry Pi Pico W softap weather station\" class=\"wp-image-2820\" width=\"717\" height=\"403\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1024x576.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-300x169.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-768x432.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-1536x864.png 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-2048x1152.png 2048w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-18x10.png 18w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/figure>\n<\/div>\n\n\n<p>In this tutorial, learn to broadcast a SoftAP access point that transmit weather station data wirelessly and power it with solar power!<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CLICK HERE: <a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-remote-weather-station-solar-powered-and-softap\/\">Raspberry Pi Pico W remote weather station (solar powered and SoftAP)<\/a><\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">Control your Pico W wirelessly with PiCockpit!<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/picockpit.com\/raspberry-pi\/picockpit-v2-6-5-support-for-the-pico-w-part-2\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/four.png\" alt=\"\" class=\"wp-image-3610\" width=\"755\" height=\"142\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/four.png 895w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/four-300x57.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/four-768x145.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/four-18x3.png 18w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>You can control and get data from your Pico W wirelessly by using PiCockpit.<\/p>\n\n\n\n<p>PiCockpit allows you to get values, control and use PWM through a GUI via its GPIO applet.<\/p>\n\n\n\n<p>You can also see your Pico W&#8217;s stats through the PiStats applet.<\/p>\n\n\n\n<p>Integrating PiCockpit into your Pico W is super easy.<\/p>\n\n\n\n<p><a href=\"https:\/\/picockpit.com\/raspberry-pi\/picockpit-v2-6-5-support-for-the-pico-w-part-2\/\">Follow this tutorial.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Write even less code with PiCockpit and the Pico W<\/h2>\n\n\n\n<p>PiCockpit makes it easy for you to control your GPIO pins without having to write any code.<\/p>\n\n\n\n<p>If you look at <a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-pico-w-beginners-components-tutorial\/#Code_to_control_LED_on_Pico_W\">tutorial number 2<\/a>, notice how much code is necessary just to toggle an LED.<\/p>\n\n\n\n<p>With our new Pico W integration, PiCockpit makes it so much easier as you don&#8217;t have to program anything at all. Not even the WiFi configuration &#8212; that&#8217;s done with our setup wizard.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. Simple LED control with PiCockpit and Pico W<\/h2>\n\n\n\n<p>If you have your LED configured exactly the way I&#8217;ve done it in tutorial no. 2, then all that&#8217;s left is to set it up on PiCockpit.<\/p>\n\n\n\n<p>If you&#8217;re coding it out, you&#8217;ll declare which pin your LED is on using <code>led = machine.Pin(2, machine.Pin.OUT)<\/code><\/p>\n\n\n\n<p>On PiCockpit, you&#8217;ll go to your GPIO applet, and the scroll to &#8220;GPIO Output (On\/Off)&#8221;.<\/p>\n\n\n\n<p>Choose BCM02 from the dropdown menu because your LED is on GPIO 2.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-38.png\" alt=\"\" class=\"wp-image-3664\" width=\"752\" height=\"427\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-38.png 906w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-38-300x171.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-38-768x437.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-38-18x10.png 18w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/figure>\n<\/div>\n\n\n<p>Then, on the &#8220;Control&#8221; column, toggle the switch to turn the LED on.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"105\" height=\"125\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-39.png\" alt=\"\" class=\"wp-image-3665\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-39.png 105w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-39-10x12.png 10w\" sizes=\"auto, (max-width: 105px) 100vw, 105px\" \/><\/figure>\n<\/div>\n\n\n<p>You can also easily use the Software PWM section below to control the brightness of your LED.<\/p>\n\n\n\n<p>Note that you will need to remove the previous setting because you cannot have two outputs on the same GPIO.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-40.png\" alt=\"\" class=\"wp-image-3666\" width=\"716\" height=\"261\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-40.png 908w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-40-300x109.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-40-768x280.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-40-18x7.png 18w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/figure>\n<\/div>\n\n\n<p>As you toggle the &#8220;Control&#8221; slider, you&#8217;ll notice the brightness of the LED changing.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"203\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/picockpit-gpio-pwm.gif\" alt=\"picockpit gpio pwm remote control\" class=\"wp-image-2285\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">11. Pico W, 5V fan and a transistor, controlled by PiCockpit<\/h2>\n\n\n\n<p>Let&#8217;s try something a little bit more comprehensive but using the same GPIO Output toggle.<\/p>\n\n\n\n<p>To illustrate some real-world use cases, I will power a 5V fan using PiCockpit.<\/p>\n\n\n\n<p>This is a low-power 5V fan taken from my Raspberry Pi 4, so it&#8217;s well within the output capabilities of the Raspberry Pi Pico W.<\/p>\n\n\n\n<p>That said, because it&#8217;s a 5V fan, I can&#8217;t use a GPIO pin. In less power-intensive components, like an LED, you can have the GPIO do double duty of supplying power to the component and being the &#8220;switch&#8221; that turns it on and off.<\/p>\n\n\n\n<p>But the 5V fan would require too high a voltage. So, the next best way is to put a transistor in the middle.<\/p>\n\n\n\n<p>This allows me to supply 5V to the fan, while ensuring that I can turn it on and off.<\/p>\n\n\n\n<p>Once again, because of PiCockpit, I did zero programming. I only did the hardware, which is wired as follows:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/pico-w-transistor-and-picockpit_bb-1024x813.jpg\" alt=\"\" class=\"wp-image-3668\" width=\"627\" height=\"497\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/pico-w-transistor-and-picockpit_bb-1024x813.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/pico-w-transistor-and-picockpit_bb-300x238.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/pico-w-transistor-and-picockpit_bb-768x610.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/pico-w-transistor-and-picockpit_bb-15x12.jpg 15w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/pico-w-transistor-and-picockpit_bb.jpg 1192w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/figure>\n<\/div>\n\n\n<p>The fan is a 5V\/0.12A fan, connected to 5V on the positive end (red wire), and the negative wire goes to the emitter leg of the transistor.<\/p>\n\n\n\n<p>The transistor is a PN2222 (NPN) transistor, which means that it switches ON when it receives a high signal.<\/p>\n\n\n\n<p>From left to right, with the semi-circled part facing away from you, the legs are the Emitter, Base and Collector.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"282\" height=\"267\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-41.png\" alt=\"\" class=\"wp-image-3670\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-41.png 282w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-41-13x12.png 13w\" sizes=\"auto, (max-width: 282px) 100vw, 282px\" \/><figcaption class=\"wp-element-caption\">PN2222 diagram from <a href=\"https:\/\/alltransistors.com\/adv\/pdfdatasheet_fairchild_semi\/pn2222.pdf\">Fairchild Semiconductor&#8217;s datasheet.<\/a><\/figcaption><\/figure>\n<\/div>\n\n\n<p>The Base leg is connected to a 1K resistor, then connected to GPIO 15.<\/p>\n\n\n\n<p>The Collector leg is connected to ground.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring PiCockpit to work with transistor<\/h3>\n\n\n\n<p>Once again, super easy.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-42.png\" alt=\"\" class=\"wp-image-3671\" width=\"695\" height=\"431\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-42.png 906w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-42-300x186.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-42-768x477.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-42-18x12.png 18w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/figure>\n<\/div>\n\n\n<p>Go to the dropdown menu in the GPIO Output section and add BCM15.<\/p>\n\n\n\n<p>Once it&#8217;s in, you can click the downward arrow and change the State Names to &#8220;fan off&#8221; and &#8220;fan on&#8221;.<\/p>\n\n\n\n<p>Toggle the control switch and you should see the fan turning on.<\/p>\n\n\n\n<p>You can also use PiStats to see the drop in temperatures on your board.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-43.png\" alt=\"\" class=\"wp-image-3673\" width=\"704\" height=\"472\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-43.png 877w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-43-300x201.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-43-768x515.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/12\/image-43-18x12.png 18w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/figure>\n<\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Pico W projects<\/h2>\n\n\n\n<p>With the Raspberry Pi Pico W you can do everything that you can do with the Pico. But you can make it better by adding wireless control or output.<\/p>\n\n\n\n<p>Most projects require some additional hardware, hence we got you covered with our <a href=\"https:\/\/buyzero.de\/en\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh?_pos=1&amp;_sid=34040de7a&amp;_ss=r&amp;variant=43536399433995\">Pico Kits<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Burgerbot: upgraded from a regular Pico<\/h2>\n\n\n\n<iframe loading=\"lazy\" width=\"894\" height=\"503\" src=\"https:\/\/www.youtube.com\/embed\/jnPR6XAuJ2U\" title=\"Raspberry Pi Pico W Robot - Burgerbot gets an upgrade\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\n\n\n\n<p>Kevin McAleer built a Burgerbot with the regular Pico and when the Pico W came out, he took the chance to upgrade it.<\/p>\n\n\n\n<p>In his YouTube video, he covers how he uses the Pico W, Node-Red and updated his code in order to connect the Pico W to the Burgerbot via MQTT.<\/p>\n\n\n\n<p>Kevin chose Node-Red to build a dashboard and program his MQTT messages because it makes the process easier.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/kevin-mcaleer-burgerbot.jpg\" alt=\"pico w robot kevin mcaleer burgerbot\" class=\"wp-image-2663\" width=\"750\" height=\"422\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/kevin-mcaleer-burgerbot.jpg 1000w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/kevin-mcaleer-burgerbot-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/kevin-mcaleer-burgerbot-768x433.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/kevin-mcaleer-burgerbot-18x10.jpg 18w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption class=\"wp-element-caption\">Kevin McAleer&#8217;s Burgerbot (screenshot from YouTube).<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">e-paper kitten image randomizer<\/h2>\n\n\n\n<blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">Assemble in quiet reverence at the power of wireless! <a href=\"https:\/\/twitter.com\/Raspberry_Pi?ref_src=twsrc%5Etfw\">@Raspberry_Pi<\/a> Pico W Placekitten randomiser! <a href=\"https:\/\/t.co\/U5jxbeWUwx\">pic.twitter.com\/U5jxbeWUwx<\/a><\/p>\u2014 Phil Howard (@Gadgetoid) <a href=\"https:\/\/twitter.com\/Gadgetoid\/status\/1542427866306170883?ref_src=twsrc%5Etfw\">June 30, 2022<\/a><\/blockquote> <script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n\n\n\n<p>Placekitten is a website that hosts cute cat pictures for use as a placeholder for web designers.<\/p>\n\n\n\n<p>What Phil Howard did was to get the Pico W to ping Placekitten&#8217;s website and load a random photo of a cat onto his e-ink display.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-7.png\" alt=\"\" class=\"wp-image-2664\" width=\"755\" height=\"567\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-7.png 878w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-7-300x226.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-7-768x577.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-7-16x12.png 16w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><figcaption class=\"wp-element-caption\">Screenshot of Placekitten, where you can get cat photos by pinging a URL.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Pimoroni makes the Pico Inky Pack which is a 2.9&#8243; e-ink display which fits perfectly with a Pico W (with headers soldered on).<\/p>\n\n\n\n<p>Once connected to WiFi, Phil pinged a URL in order to get an image to display on the e-ink display. The Pico Inky has a 296x128px display, which means that if you used the url <a href=\"https:\/\/placekitten.com\/296\/128\">http:\/\/placekitten.com\/296\/128<\/a>, you will get an image that fits perfectly into the display.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get your plants to text you<\/h2>\n\n\n\n<blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">The <a href=\"https:\/\/twitter.com\/Raspberry_Pi?ref_src=twsrc%5Etfw\">@Raspberry_Pi<\/a> Pico W is perfect for smart home devices, including smart plants!\ud83e\udeb4<br><br>Yep, you read that right.<a href=\"https:\/\/twitter.com\/sandeepmistry?ref_src=twsrc%5Etfw\">@sandeepmistry<\/a> details how to get plants texting you using the Pico W alongside tech from <a href=\"https:\/\/twitter.com\/pimoroni?ref_src=twsrc%5Etfw\">@pimoroni<\/a>, <a href=\"https:\/\/twitter.com\/micropython?ref_src=twsrc%5Etfw\">@micropython<\/a> and <a href=\"https:\/\/twitter.com\/twilio?ref_src=twsrc%5Etfw\">@twilio<\/a> on <a href=\"https:\/\/twitter.com\/Hacksterio?ref_src=twsrc%5Etfw\">@Hacksterio<\/a>: <a href=\"https:\/\/t.co\/5oyu9W81S8\">https:\/\/t.co\/5oyu9W81S8<\/a> <a href=\"https:\/\/t.co\/7xbxGvmYey\">pic.twitter.com\/7xbxGvmYey<\/a><\/p>\u2014 Arm (@Arm) <a href=\"https:\/\/twitter.com\/Arm\/status\/1542478470890012674?ref_src=twsrc%5Etfw\">June 30, 2022<\/a><\/blockquote> <script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n\n\n\n<p>When your friends are thirsty, they&#8217;ll text you to ask if you want to go for a drink.<\/p>\n\n\n\n<p>Why not get the same experience with your house plants?<\/p>\n\n\n\n<p>Sandeep Mistry has done exactly that with the Raspberry Pi Pico W, Pimoroni Grow Kit and the Twilio SMS API.<\/p>\n\n\n\n<p>Most fundamentally, the plant will tell you when it needed water. The sensor outputs a digital pulse signal with a frequency between 1 Hz and 30 Hz. If it&#8217;s dry, it will have a high frequency, and this triggers the Pico W to ping the Twilio SMS API to send a message.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.hackster.io\/sandeep-mistry\/give-a-plant-a-personality-using-the-raspberry-pi-pico-w-23f701\" rel=\"nofollow\">See the full guide here.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Raspberry Pi Pico W vs Espressif ESP32<\/h2>\n\n\n\n<p>What a game changer the Raspberry Pi Pico W is.<\/p>\n\n\n\n<p>When we compared the Raspberry Pi Pico to the ESP32, we picked the PICO-KIT because it had the most similar form factor to the Pico.<\/p>\n\n\n\n<p>The big advantage the ESP32 had over the Pico W is WiFi and Bluetooth.<\/p>\n\n\n\n<p>But that&#8217;s no longer the case. The Pico W has WiFi now and while the WLAN chip can do Bluetooth, as of early July, it&#8217;s not yet enabled.<\/p>\n\n\n\n<p>So, if you need Bluetooth capability now, then you will do better with the ESP32.<\/p>\n\n\n\n<p>That said, the ESP32 does have other advantages including varying CPU frequencies, including two faster speeds versus the Pico W.<\/p>\n\n\n\n<p>The ESP32 has been on the market for much longer too, leading there to be many more projects that are built on it. Its documentation, experimentation and add-ons are miles ahead of the Raspberry Pi Pico range.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td>Raspberry Pi Pico W<\/td><td>Espressif ESP32-PICO-KIT<\/td><\/tr><tr><td>CPU Frequency<\/td><td>133MHz<\/td><td>80\/160\/240MHz<\/td><\/tr><tr><td>Microcontroller<\/td><td>RP2040<\/td><td>Xtensa LX6<\/td><\/tr><tr><td>Cores<\/td><td>2<\/td><td>2<\/td><\/tr><tr><td>Flash memory<\/td><td>2MB<\/td><td>4MB<\/td><\/tr><tr><td>RAM<\/td><td>264KB<\/td><td>520KB<\/td><\/tr><tr><td>GPIO<\/td><td>26 (user-usable)<\/td><td>36<\/td><\/tr><tr><td>Has USB?<\/td><td>microUSB<\/td><td>microUSB<\/td><\/tr><tr><td>WiFi and\/or BT?<\/td><td>Yes, both, BT not enabled at launch<\/td><td>Yes, both<\/td><\/tr><tr><td>Voltage<\/td><td>1.8 &#8211; 5.5V&nbsp;or 5V USB<\/td><td>3.3V (via pins) or 5V via USB or 5V-12V (via voltage regulator)<\/td><\/tr><tr><td>Size<\/td><td>51x21mm<\/td><td>52x20mm<\/td><\/tr><tr><td>Languages<\/td><td>MicroPython \/ C<\/td><td>MicroPython \/ C<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Community thoughts on Pico W vs ESP32<\/h3>\n\n\n\n<p>We started a thread on the Raspberry Pi forum about this exact topic and here are some great thoughts from the community:<\/p>\n\n\n\n<p><a href=\"https:\/\/forums.raspberrypi.com\/viewtopic.php?p=2015861&amp;sid=4fb44ec7a73df615a0346f018fd671ba#p2015861\">Raspberry Pi forum user scruss<\/a> said that the ESP32 has more processing power with the 160MHz variant, quoting 1639 pystones\/second vs 1243 on the Pico W. The 240MHz is even faster.<\/p>\n\n\n\n<p>He also listed out the following reasons why the ESP32 would triumph over the Pico W. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>hardware timers<\/em><\/li>\n\n\n\n<li><em>really nice ADC, with range tuning and direct voltage reading<\/em><\/li>\n\n\n\n<li><em>2-channel DAC<\/em><\/li>\n\n\n\n<li><em>capacitive touch<\/em><\/li>\n\n\n\n<li><em>Hall effect magnetic sensor (wave a magnet at it, and it can tell you you&#8217;re waving a magnet at it)<\/em><\/li>\n\n\n\n<li><em>RMT channels for rather clever PWM<\/em><\/li>\n<\/ul>\n\n\n\n<p>On the other hand, user <a href=\"https:\/\/forums.raspberrypi.com\/viewtopic.php?p=2015862&amp;sid=4fb44ec7a73df615a0346f018fd671ba#p2015862\">scotty101<\/a> has this to say about the Pico W&#8217;s advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Development environment<\/li>\n\n\n\n<li>Supporting Raspberry Pi and its educational aims<\/li>\n\n\n\n<li>Prevalence and the size of the community.<\/li>\n\n\n\n<li>Ease of putting a new binary on to the Pico <\/li>\n<\/ul>\n\n\n\n<p>&#8220;I like ESP32 but I hate having to download the esptool each time I restart an abandoned project. I have so little time that MicroPython on the Pico is quick and easy for me to get going with,&#8221; scotty101 said.<\/p>\n\n\n\n<p>Finally, <a href=\"https:\/\/forums.raspberrypi.com\/viewtopic.php?p=2015766#p2015766\">cleverca22<\/a> gave a balanced view of what he saw in both boards. Beyond the arguments made above, here are the additional points:<\/p>\n\n\n\n<p>The Raspberry Pi Pico W has Programmable IO (PIO).<\/p>\n\n\n\n<p>cleverca22 says he believes the ESP platform has a special memory management unit between the XIP and flash, so you can store multiple apps at once and this allows for rollbacks.<\/p>\n\n\n\n<p>And the ESP platform controls the WiFi and Bluetooth directly from the CPU, which allows non-standard RF actions whereas the Pico W&#8217;s is likely to be managed using a closed-source blob, hence only allowing approved RF actions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pico W vs Zero 2 W<\/h2>\n\n\n\n<p>You might be rolling your eyes because you think we\u2019re comparing apples to oranges.<\/p>\n\n\n\n<p>But are we, really?<\/p>\n\n\n\n<p>Let\u2019s talk about the fundamental difference here. The Raspberry Pi Pico W is a microcontroller while the Raspberry Pi Zero 2 W is a microcomputer.<\/p>\n\n\n\n<p>Put simply, the Raspberry Pi Pico W is designed to run one thing. The Zero 2 W is meant to be more dynamic \u2013 it can run multiple tasks, different OSes and you can program it in multiple languages.<\/p>\n\n\n\n<p>Here\u2019s a table explaining the differences:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Can it\u2026<\/td><td>Microcontroller (e.g. Raspberry Pi Pico W)<\/td><td>Microcomputer (e.g. Raspberry Pi Zero 2 W)<\/td><\/tr><tr><td>Run a server?<\/td><td>No<\/td><td>Yes<\/td><\/tr><tr><td>Blink a LED?<\/td><td>Much faster from start to end<\/td><td>Much slower; many more processes to go through<\/td><\/tr><tr><td>Auto-restart program on power failure?<\/td><td>Yes<\/td><td>Not by default<\/td><\/tr><tr><td>Play video games<\/td><td>Not without a lot of effort<\/td><td>Yes<\/td><\/tr><tr><td>Runs on battery?<\/td><td>Yes, much likely to last longer on average<\/td><td>Yes, does not last as long on average<\/td><\/tr><tr><td>Heat management?<\/td><td>None required usually<\/td><td>Heatsinks, fans, thermally conductive cases<\/td><\/tr><tr><td>Costs?<\/td><td>Lower<\/td><td>Higher<\/td><\/tr><tr><td>Size?<\/td><td>Smaller<\/td><td>Larger<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">WiFi now no longer the Pi Zero W\u2019s advantage<\/h3>\n\n\n\n<p>Now, one of the things that really attracted some users to the Pi Zero series is the integrated wireless.<\/p>\n\n\n\n<p>In the past, you had to buy an accessory to give the original Pico wireless capability. It was pretty much the point that pushed people to use the Zero as a substitute for their projects.<\/p>\n\n\n\n<p>That said, with the Pico W having wireless now, the advantage that the Zero W had no longer exists.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Bluetooth remains a Pi Zero W advantage\u2026 for now<\/h3>\n\n\n\n<p>At the time of release, the Pico W does have a Bluetooth chip in it but has not been enabled.<\/p>\n\n\n\n<p>Raspberry Pi has said they will enable it in the future. Whenever that is.<\/p>\n\n\n\n<p>So, as of now, if you need Bluetooth, the Pi Zero W is the better option.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Raspberry Pi Zero 2 W shortages = Pico W advantage<\/h3>\n\n\n\n<p>Another element that gives the Pico W such an advantage over the Zero 2 W is its availability.<\/p>\n\n\n\n<p>In the first two weeks of its release,<a href=\"https:\/\/buyzero.de\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh\"> stock was still available in many stores, including ours.<\/a> This certainly doesn\u2019t reflect the situation for the Pi Zero 2, <a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-stock-update-2022-with-delivery-timelines\/\">which is slated for low supply for the rest of 2022.<\/a><\/p>\n\n\n\n<p>Of course, if you have a PiCockpit account, EU\/Swiss users <a href=\"https:\/\/picockpit.com\/\">can also use our Reservation Tool to reserve your next Raspberry Pi<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to decide?<\/h3>\n\n\n\n<p>Here\u2019s the logic which I use to decide which to use:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Scenario<\/td><td>What to get<\/td><\/tr><tr><td>I am better at a language other than C\/Python<\/td><td>Zero<\/td><\/tr><tr><td>I have \u201cunlimited\u201d power (i.e. non-solar or battery use case)<\/td><td>Zero<\/td><\/tr><tr><td>I need to save data (such as temperature logs)<\/td><td>Zero<\/td><\/tr><tr><td>I need to use a camera<\/td><td>Zero<\/td><\/tr><tr><td>I want a GUI\/video output<\/td><td>Zero<\/td><\/tr><tr><td>I need WiFi<\/td><td>Either<\/td><\/tr><tr><td>I need Bluetooth<\/td><td>Zero (as of July 2022)<\/td><\/tr><tr><td>I need the most compact setup<\/td><td>Pico W<\/td><\/tr><tr><td>I need quick restart on crash\/power failure<\/td><td>Pico W<\/td><\/tr><tr><td>I don\u2019t want to set up an OS<\/td><td>Pico W<\/td><\/tr><tr><td>I want the cheaper option<\/td><td>Pico W<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Under the microscope<\/h2>\n\n\n\n<p>Peter Mount filmed this video of the Pico W&#8230;<\/p>\n\n\n\n<blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">As usual <a href=\"https:\/\/twitter.com\/pimoroni?ref_src=twsrc%5Etfw\">@pimoroni<\/a> delivered quickly&#8230; so I put the new <a href=\"https:\/\/twitter.com\/Raspberry_Pi?ref_src=twsrc%5Etfw\">@Raspberry_Pi<\/a> PicoW under the microscope&#8230; <a href=\"https:\/\/twitter.com\/hashtag\/ebenana?src=hash&amp;ref_src=twsrc%5Etfw\">#ebenana<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/RaspberryPi?src=hash&amp;ref_src=twsrc%5Etfw\">#RaspberryPi<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/RaspberryPicoW?src=hash&amp;ref_src=twsrc%5Etfw\">#RaspberryPicoW<\/a> <a href=\"https:\/\/t.co\/MvJHfENvKF\">pic.twitter.com\/MvJHfENvKF<\/a><\/p>\u2014 Peter Mount (@peter_mount) <a href=\"https:\/\/twitter.com\/peter_mount\/status\/1542804977814577154?ref_src=twsrc%5Etfw\">July 1, 2022<\/a><\/blockquote> <script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">How did Raspberry Pi tease the Pico W&#8217;s release?<\/h2>\n\n\n\n<p>According to Raspberry Pi, nobody got the teaser which was a cow with Raspberry Pi graphics all over it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-1.png\" alt=\"\" class=\"wp-image-2636\" width=\"747\" height=\"498\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-1.png 800w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-1-300x200.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-1-768x512.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-1-18x12.png 18w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><figcaption class=\"wp-element-caption\">Raspberry Pi&#8217;s teaser for the Pico W<\/figcaption><\/figure>\n<\/div>\n\n\n<p>They said, &#8220;We still can\u2019t believe not one of you got the very abstract teaser we dropped on Twitter the night before Pico W launched. It\u2019s a cow. Get it?&#8221;<\/p>\n\n\n\n<p>Raspberry Pi Cow rearranged is Raspberry Pico W.<\/p>\n\n\n\n<p>I guess now that the cat is out of the bag, talking about it is pretty <strong>moo<\/strong>t.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">More information<\/h2>\n\n\n\n<p>We have <a href=\"https:\/\/picockpit.com\/raspberry-pi\/everything-about-the-raspberry-pi-pico-w\/\">an encyclopedia of information for the regular Raspberry Pi Pico<\/a> that will help you get started with the Raspberry Pi Pico W. <a href=\"https:\/\/picockpit.com\/raspberry-pi\/everything-about-the-raspberry-pi-pico\/\">Here&#8217;s where you can start learning about the Raspberry Pi Pico<\/a>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CLICK HERE: <a href=\"https:\/\/picockpit.com\/raspberry-pi\/everything-about-the-raspberry-pi-pico\/\">Everything you need to know about the Raspberry Pi Pico<\/a><\/p>\n<\/blockquote>\n\n\n\n<p>There&#8217;s also general and specific documentation available straight from Raspberry Pi:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/pico-w-product-brief.pdf\">Raspberry Pi Pico W product brief<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/pico-w-datasheet.pdf\">Raspberry Pi Pico W datasheet<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/connecting-to-the-internet-with-pico-w.pdf\">Connecting to the internet with Raspberry Pi Pico W<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/RPi-PicoW-PUBLIC-20220607.zip\">Raspberry Pi Pico W design files (Cadence Allegro)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/picow\/PicoW-step.zip\">Raspberry Pi Pico W STEP file<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/debug\/debug-connector-specification.pdf\">Debug connector specification<\/a><\/li>\n<\/ul>\n<div class=\"shariff shariff-align-center shariff-widget-align-left shariff-buttonstretch\"><ul class=\"shariff-buttons theme-white orientation-horizontal buttonsize-medium\"><li class=\"shariff-button twitter shariff-nocustomcolor\" style=\"background-color:#595959\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Ftodo-sobre-la-frambuesa-pi-pico-w%2F&text=Everything%20about%20the%20Raspberry%20Pi%20Pico%20W\" title=\"Compartir en X\" aria-label=\"Compartir en X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#000; color:#000\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#000\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#000\">compartir<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button facebook shariff-nocustomcolor\" style=\"background-color:#4273c8\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Ftodo-sobre-la-frambuesa-pi-pico-w%2F\" title=\"Compartir en Facebook\" aria-label=\"Compartir en Facebook\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#3b5998; color:#3b5998\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#3b5998\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#3b5998\">compartir<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button telegram shariff-nocustomcolor\" style=\"background-color:#4084A6\"><a href=\"https:\/\/telegram.me\/share\/url?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Ftodo-sobre-la-frambuesa-pi-pico-w%2F&text=Everything%20about%20the%20Raspberry%20Pi%20Pico%20W\" title=\"Compartir en Telegram\" aria-label=\"Compartir en Telegram\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#0088cc; color:#0088cc\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#0088cc\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#0088cc\" d=\"M30.8 6.5l-4.5 21.4c-.3 1.5-1.2 1.9-2.5 1.2L16.9 24l-3.3 3.2c-.4.4-.7.7-1.4.7l.5-7L25.5 9.2c.6-.5-.1-.8-.9-.3l-15.8 10L2 16.7c-1.5-.5-1.5-1.5.3-2.2L28.9 4.3c1.3-.5 2.3.3 1.9 2.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#0088cc\">compartir<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button reddit shariff-nocustomcolor\" style=\"background-color:#ff5700\"><a href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fes%2Ftodo-sobre-la-frambuesa-pi-pico-w%2F\" title=\"Compartir en Reddit\" aria-label=\"Compartir en Reddit\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#ff4500; color:#ff4500\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#ff4500\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path fill=\"#ff4500\" d=\"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#ff4500\">compartir<\/span>&nbsp;<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>Hoy, 30 de junio de 2022, a las 8.00 AM hora del Reino Unido, Raspberry Pi ha lanzado el Pico W. Aqu\u00ed est\u00e1 todo (lo que sabemos) sobre el nuevo Raspberry Pi. Esta nueva variante de la querida Pico tiene capacidades inal\u00e1mbricas gracias al chip inal\u00e1mbrico CYW43439.Al igual que la Pico, en el coraz\u00f3n de cada Pico W est\u00e1 el RP2040, que...<\/p>","protected":false},"author":2,"featured_media":2606,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[223,189,11,221,188,187,222],"class_list":["post-2567","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi-pico","tag-micro-controller","tag-pi","tag-pico","tag-pico-w","tag-raspberry","tag-raspberry-pi","tag-raspi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Everything about the Raspberry Pi Pico W | PiCockpit<\/title>\n<meta name=\"description\" content=\"Today, 30 June 2022 at 8.00 AM UK time Raspberry Pi realeased the Pico W. Here is everything (that we know) about the newest Raspberry Pi.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/picockpit.com\/raspberry-pi\/es\/todo-sobre-la-frambuesa-pi-pico-w\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Everything about the Raspberry Pi Pico W | PiCockpit\" \/>\n<meta property=\"og:description\" content=\"Today, 30 June 2022 at 8.00 AM UK time Raspberry Pi realeased the Pico W. Here is everything (that we know) about the newest Raspberry Pi.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/picockpit.com\/raspberry-pi\/es\/todo-sobre-la-frambuesa-pi-pico-w\/\" \/>\n<meta property=\"og:site_name\" content=\"PiCockpit\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pi3gshop\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-30T07:39:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-04T08:18:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/featured-image-4.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"raspi berry\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pi3g\" \/>\n<meta name=\"twitter:site\" content=\"@pi3g\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"raspi berry\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"25 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/\"},\"author\":{\"name\":\"raspi berry\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\"},\"headline\":\"Everything about the Raspberry Pi Pico W\",\"datePublished\":\"2022-06-30T07:39:07+00:00\",\"dateModified\":\"2023-08-04T08:18:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/\"},\"wordCount\":4621,\"commentCount\":11,\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/featured-image-4.jpg\",\"keywords\":[\"Micro controller\",\"Pi\",\"Pico\",\"Pico W\",\"Raspberry\",\"Raspberry Pi\",\"Raspi\"],\"articleSection\":[\"Raspberry Pi Pico\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/\",\"name\":\"Everything about the Raspberry Pi Pico W | PiCockpit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/featured-image-4.jpg\",\"datePublished\":\"2022-06-30T07:39:07+00:00\",\"dateModified\":\"2023-08-04T08:18:54+00:00\",\"description\":\"Today, 30 June 2022 at 8.00 AM UK time Raspberry Pi realeased the Pico W. Here is everything (that we know) about the newest Raspberry Pi.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#primaryimage\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/featured-image-4.jpg\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/featured-image-4.jpg\",\"width\":1000,\"height\":563,\"caption\":\"raspberry pi pico w\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ru\\\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Raspberry Pi Pico\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/category\\\/raspberry-pi-pico\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Everything about the Raspberry Pi Pico W\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"name\":\"PiCockpit\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\",\"name\":\"PiCockpit.com\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"width\":1165,\"height\":283,\"caption\":\"PiCockpit.com\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/pi3gshop\",\"https:\\\/\\\/x.com\\\/pi3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\",\"name\":\"raspi berry\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"caption\":\"raspi berry\"},\"description\":\"I'm here to help you with all your Raspberry Pi related questions &amp; love to share about new project ideas for the Raspberry Pi, and give quick tips. Of course I'll also help you with PiCockpit and how to make your Raspberry Pi even easier to use with this raspberry pi monitoring solution :-)\",\"sameAs\":[\"https:\\\/\\\/picockpit.com\"],\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/es\\\/author\\\/raspi-berry\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Todo sobre la Raspberry Pi Pico W | PiCockpit","description":"Hoy, 30 de junio de 2022 a las 8.00 AM hora del Reino Unido, Raspberry Pi ha lanzado el Pico W. Aqu\u00ed est\u00e1 todo (lo que sabemos) sobre el nuevo Raspberry Pi.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/picockpit.com\/raspberry-pi\/es\/todo-sobre-la-frambuesa-pi-pico-w\/","og_locale":"es_ES","og_type":"article","og_title":"Everything about the Raspberry Pi Pico W | PiCockpit","og_description":"Today, 30 June 2022 at 8.00 AM UK time Raspberry Pi realeased the Pico W. Here is everything (that we know) about the newest Raspberry Pi.","og_url":"https:\/\/picockpit.com\/raspberry-pi\/es\/todo-sobre-la-frambuesa-pi-pico-w\/","og_site_name":"PiCockpit","article_publisher":"https:\/\/www.facebook.com\/pi3gshop","article_published_time":"2022-06-30T07:39:07+00:00","article_modified_time":"2023-08-04T08:18:54+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/featured-image-4.jpg","type":"image\/jpeg"}],"author":"raspi berry","twitter_card":"summary_large_image","twitter_creator":"@pi3g","twitter_site":"@pi3g","twitter_misc":{"Escrito por":"raspi berry","Tiempo de lectura":"25 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#article","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/"},"author":{"name":"raspi berry","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee"},"headline":"Everything about the Raspberry Pi Pico W","datePublished":"2022-06-30T07:39:07+00:00","dateModified":"2023-08-04T08:18:54+00:00","mainEntityOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/"},"wordCount":4621,"commentCount":11,"publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/featured-image-4.jpg","keywords":["Micro controller","Pi","Pico","Pico W","Raspberry","Raspberry Pi","Raspi"],"articleSection":["Raspberry Pi Pico"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/","url":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/","name":"Todo sobre la Raspberry Pi Pico W | PiCockpit","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#website"},"primaryImageOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#primaryimage"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/featured-image-4.jpg","datePublished":"2022-06-30T07:39:07+00:00","dateModified":"2023-08-04T08:18:54+00:00","description":"Hoy, 30 de junio de 2022 a las 8.00 AM hora del Reino Unido, Raspberry Pi ha lanzado el Pico W. Aqu\u00ed est\u00e1 todo (lo que sabemos) sobre el nuevo Raspberry Pi.","breadcrumb":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#primaryimage","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/featured-image-4.jpg","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/06\/featured-image-4.jpg","width":1000,"height":563,"caption":"raspberry pi pico w"},{"@type":"BreadcrumbList","@id":"https:\/\/picockpit.com\/raspberry-pi\/ru\/%d0%b2%d1%81%d0%b5-%d0%be-%d0%bc%d0%b0%d0%bb%d0%b8%d0%bd%d0%b5-raspberry-pi-pico-w\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/picockpit.com\/raspberry-pi\/"},{"@type":"ListItem","position":2,"name":"Raspberry Pi Pico","item":"https:\/\/picockpit.com\/raspberry-pi\/category\/raspberry-pi-pico\/"},{"@type":"ListItem","position":3,"name":"Everything about the Raspberry Pi Pico W"}]},{"@type":"WebSite","@id":"https:\/\/picockpit.com\/raspberry-pi\/#website","url":"https:\/\/picockpit.com\/raspberry-pi\/","name":"PiCockpit","description":"","publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/picockpit.com\/raspberry-pi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization","name":"PiCockpit.com","url":"https:\/\/picockpit.com\/raspberry-pi\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","width":1165,"height":283,"caption":"PiCockpit.com"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pi3gshop","https:\/\/x.com\/pi3g"]},{"@type":"Person","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee","name":"baya raspada","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","caption":"raspi berry"},"description":"Estoy aqu\u00ed para ayudarte con todas tus preguntas relacionadas con la Raspberry Pi y me encanta compartir sobre nuevas ideas de proyectos para la Raspberry Pi, y dar consejos r\u00e1pidos. Por supuesto, tambi\u00e9n te ayudar\u00e9 con PiCockpit y c\u00f3mo hacer que tu Raspberry Pi sea a\u00fan m\u00e1s f\u00e1cil de usar con esta soluci\u00f3n de monitoreo de la frambuesa Pi :-)","sameAs":["https:\/\/picockpit.com"],"url":"https:\/\/picockpit.com\/raspberry-pi\/es\/author\/raspi-berry\/"}]}},"_links":{"self":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts\/2567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/comments?post=2567"}],"version-history":[{"count":83,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts\/2567\/revisions"}],"predecessor-version":[{"id":4599,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/posts\/2567\/revisions\/4599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/media\/2606"}],"wp:attachment":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/media?parent=2567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/categories?post=2567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/es\/wp-json\/wp\/v2\/tags?post=2567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}