• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

OSError: -2 on PicoW

Q&A Forum › Category: Questions › OSError: -2 on PicoW
0 Vote Up Vote Down
mikec asked 1 year ago

Hello Sara and Rui
I am running examples from the Micropython and Pico W book.
All has worked well until section 9.2 when a request is made to “http://www.google.com”
I get the following output – 

MPY: soft reboot
Traceback (most recent call last):
File “<stdin>”, line 48, in <module>
File “requests/__init__.py”, line 180, in get
File “requests/__init__.py”, line 76, in request
OSError: -2
I have checked that I have access to my wifi and have successfully connected using the previous example.
Can you offer any suggestions ie what is OSError: -2 ?
Many thanks, I am really enjoying the book.
Mike

Question Tags: OSError: -2
2 Answers
0 Vote Up Vote Down
mikec answered 1 year ago

After 4 hours of looking for error codes and trying to find the modules to see what was failing I finally found the solution.
I am running a mesh network using 3 EERO 6 devices and the solution was using ipconfig to see what the internal IP addresses were. I changed the Pico IP address from 192.168.1.100 to 192.168.4.100 and it ran correctly. What puzzles me is that I then turned off the power and ran the basic Google request and now it worked fine where previously the same program failed!

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
I’m glad the issue is solved now.
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.