RP2040-HAT-MicroPython icon indicating copy to clipboard operation
RP2040-HAT-MicroPython copied to clipboard

Nothing is happening (HTTP Client issue)

Open MaxMyzer opened this issue 2 years ago • 5 comments
trafficstars

Hi, I got the pico EVB, and went to try the HTTP Client example. I have added a print statement inside request before the GET, and changed it to ONLY print the contents, and close. The code gets to the print before urequests.get is called, and then nothing happens. the orange activity light on the ethernet is flashing, but that is it. I tried running the same urequest on my Pi Pico W, which was able to return the contents. I also tried updating to the latest pre-release to see if it would be fixed, without luck. Any ideas as to the possible cause or a fix would be appreciated.

I get CREG and SREG dumps

MaxMyzer avatar Jan 27 '23 20:01 MaxMyzer

https://github.com/Wiznet/RP2040-HAT-MicroPython/releases (i suggest the v2.0.0 version)

i have had some issues with my w5500 pico and the current micropython build (crashes/lockup no error) (EDIT: NOT AS OF MICROPYTHON 1.23)

I have seen urequest return a bad status line when the server says a 200 code was sent using my w5500

from machine import Pin, SPI
import network
import urequest  #https://github.com/micropython/micropython-lib/blob/master/python-ecosys/urequests/urequests.py

nic=network.WIZNET5K(SPI(0,2_000_000, mosi=Pin(19),miso=Pin(16),sck=Pin(18)),Pin(17),Pin(20))
nic.active(True)
nic.ifconfig("dhcp")
while not nic.isconnected():
 print("not connected yet")
 time.sleep(1)
try:
  r=urequest.get("http://www.example.com")
  print(r.status_code) # expecting 200
except Exception as e:
  print("urequest ERROR:",e)
  print(nic.regs())

if nic.regs() is giveing all 0s the NIC is having connection issues with the SOC (i have a defect like that here)

GM-Script-Writer-62850 avatar Apr 12 '23 05:04 GM-Script-Writer-62850

I'm using W5100S-evb-pico board, and I use rp2_w5100s_20221111_v2.0.0.uf2 file. and I installed urequests not urequest via Thonny. So I changed 'urequest' to 'urequests' from your code, and it works. image image

How about reconfiguring the environment with the official home firmware and trying to install and use the library again?

simryang avatar Sep 14 '23 05:09 simryang

On my picos i saved urequests.py as urequest.py and saved it to /lib i run a patched copy so a build that includes urequests will import the copy without the patch i added

You do know i am not OP right? BTW i have switched to the current micropython build as the issue i encountered happens on both builds it just usually takes days to weeks vs. seconds to minutes to happen, since the asyncio network functions work on the current micropython builds i switched to it (the don't on that beta firmware)

i was trying to give OP some test code as i assume OP never installed urequests

GM-Script-Writer-62850 avatar Sep 14 '23 14:09 GM-Script-Writer-62850

I'm sorry but I don't know about OP. What is that?

simryang avatar Sep 20 '23 09:09 simryang

OP = original poster (the person who started the thread/report/post/topic)

GM-Script-Writer-62850 avatar Sep 20 '23 13:09 GM-Script-Writer-62850

There is not enough information here to be able to reproduce/debug the original problem that was reported. The stability of w5500 has been much improved in later MicroPython versions (current is 1.23). Proposing to close this issue.

jonnor avatar Aug 25 '24 10:08 jonnor

I don't think I even have the HAT anymore, so I am closing since I can't test.

MaxMyzer avatar Aug 25 '24 14:08 MaxMyzer