Skip to content
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

What causes 400 error? #15

Open
PropGit opened this issue Mar 28, 2016 · 4 comments
Open

What causes 400 error? #15

PropGit opened this issue Mar 28, 2016 · 4 comments

Comments

@PropGit
Copy link
Contributor

PropGit commented Mar 28, 2016

What causes the load returned 400 error?

When it happens, it happens very swiftly (fast response; no perceptible delay between loading second-stage loader message and the load returned 400 message. Also, it happens many time in a row during successive attempts.

Loading 'LargeSpinCodePABWX.binary'
Loading second-stage loader
error: load returned 400
error: load failed: -1
@dbetz
Copy link
Collaborator

dbetz commented Mar 28, 2016

I need to figure out the right error codes to use. I think pretty much any error returns the HTTP code 400 at present. Looking at the sources for the load command, this can be the result of:

  1. The infamous "Transfer already in progress".
  2. A load request with no data to load.
  3. A load request where not all of the data came in the same packet.

Of these, I would guess that the first is most likely. You can figure this out by using the -v option with proploader. That will give you the gory details of the HTTP interactions.

@PropGit
Copy link
Contributor Author

PropGit commented Mar 28, 2016

Thanks! Yes, it's the "Transfer already in progress" issue. This is a state it gets in where there's no recover short of physically power-cycling the Wi-Fi Module:

Loading 'LargeSpinCodePABWX.binary'
Loading second-stage loader
REQ: 59
POST /propeller/set-baud-rate?baud-rate=115200 HTTP/1.1

RES: 138
HTTP/1.0 200 OK
Server: esp-link
Connection: close
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

REQ: 476
POST /propeller/load?reset-pin=12&baud-rate=115200 HTTP/1.1
Content-Length: 392

RES: 185
HTTP/1.0 400 ERROR
Server: esp-link
Connection: close
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

Transfer already in progress: state Reset2
54 72 61 6e 73 66 65 72 20 61 6c 72 65 61 64 79
20 69 6e 20 70 72 6f 67 72 65 73 73 3a 20 73 74
61 74 65 20 52 65 73 65 74 32 0d 0a
error: load returned 400
error: load failed: -1

@PropGit
Copy link
Contributor Author

PropGit commented Dec 16, 2016

I'm not sure, but I think this issue has been resolved.

@dbetz
Copy link
Collaborator

dbetz commented Dec 16, 2016

Unfortunately, I think the firmware uses a HTTP 400 error for everything. I should make a pass through and try to map these to more sensible error codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants