-
• #2
Ok, that should be fixed now. The HTTP server was using
close
internally to decide if it should close the HTTP socket, and the pipe tried to call it when the file was empty.Just a note though: you didn't hit this on an official board did you, it's ESP32 and a linux build?
I know you've done a bunch of work on Espruino's source, and this does apply to other boards so I don't mind fixing this for you. However people posting on the 'Official board' forum because they want me to fix their problems on non-official boards is exactly the kind of thing I'm trying to avoid.
It's also why I moved the JS forum into the Official Boards section - because it was becoming a dumping ground for 'this doesn't work on my non-official board' posts.
-
• #3
Hi Gordon,
Linux wasn't in the list of official boards - so I wasn't sure where to post. I'm happy to put it anywhere in the forum you want.I built the image since you did the patch for jumjum, and the error message above still occurs with the code above. I have no idea what is generating the error - it appears to be the return of the function call? I'm happy to look at it if you point me in the right direction.
-
• #4
No problem...
Are you sure you're up to date (there should be a note in the ChangeLog about my fix) and
make clean
ed?I just compiled from git master here and ran your code as-is and it works perfectly.
For debugging I'd say compile with
DEBUG=1
, run it undergdb
and breakpointjsExceptionHere
- you can then look at the backtrace and see what really caused the error. -
• #5
Thanks. I'll re-pull and check.
-
• #6
Sorry - I didn't have the latest...
I see both now:
Change name of socket close internal variable so it doesn't conflict with Pipe's close call
Stop pipe from causing errors if fields of the requested names exist but aren't functionswill merge and recheck.
-
• #7
I'll test also on the ESP8266 and report back, as it was definitely on that board that I first encountered the problem, as opposed to the ESP32.
-
• #8
Hi everyone, I've posted my results in GitHub. Thanks :)
-
• #9
Something appears to up with the pipe not ending as expected.
https://github.com/espruino/Espruino/issues/1116
I would be interesting if someone with an Espruino with an SD card could check this to see if the same issue exists.
Raised here:
https://github.com/espruino/Espruino/issues/1116#issuecomment-291659546
Following the snippet from here:
http://www.espruino.com/Internet#transferring-files
Testing on linux ( which has a side issue of the path not working due to it not being at the root of an SD card)
upload:
And in browser:
http://192.168.69.16:8080/tmp/www/index.htm
at the debug point in the browser, when you hit c to continue we get:
Uncaught Error: Expecting a function to call, got Number
This does not occur for the not found case..
Not sure what is causing this error or if the example needs to be updated?