-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does this work with fake requests still? #58
Comments
I don't think it ever did. @makermelissa initial commit stores the output of Fake_Requests, which is string. The rest of the library expects response to be an object. Should Fake_Requests return an object or should PortalBase construct one when Fake_Requests is used? FWIW, I made it here because the PyPortal library calls PortalBase |
I think it should return an object. Fake Requests was stripped out of the old PyPortal library and I don't think is actually used much, so likely things have changed without Fake Requests being updated properly. |
The Though I think it would be interesting for debugging purposes to be able to test headers too, maybe with local_headers.txt being a key/value table of headers (and maybe status code or other). |
I just got a PyPortal and it seems like this is still an issue. I have been trying to work through adafruit-pyportal/parsing-json and the code fails when trying to use local.txt due to the headers issue regarding fake requests. I've spent all day trying to debug or fix it on my own without luck. I am clearly missing something basic though as I can't get a working update to network.py. I've tried passing hardcoded headers as well as simply adding print statements to make sure my hardcoded headers match what would be returned by quotes.php but when I compile network.py with mpy-cross and replace the existing network.mpy on my PyPortal with the self-compiled version the updated version never executes. |
@dbradmit are you putting the modified network.py into If so I think the reason your modified version isn't executing is that adafruit_portalbase is frozen in to the PyPortal build: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/pyportal/mpconfigboard.mk#L15 So the frozen in version takes precedent over the one inside of If you put your modified one at the root of CIRCUITPY it should take precedence over the frozen one. i.e. your device files would be like:
Also during development it's probably easier and more convenient to just skip the mpy-cross step unless you absolutely need it for storage or RAM reasons. The code should function the same in it's .py format which you can then more quickly make edits to during development iterations. |
From a user on the forum:
The text was updated successfully, but these errors were encountered: