I have tried using scp to copy the files directly to the rasbperry pi /Astrobox/Uploads directory. The files uploaded by scp are never detected in the gui.
Thanks for the suggestion. I find that I get error ‘No file included’ regardless of how I upload it
curl -X POST --header 'X-Api-Key:xxxxxxxx' -H 'Content-Type: application/json' --data '@Grid_Fin5.gcode' http://astrobox1.local/api/files/local
No file included
curl -X POST --header 'X-Api-Key: xxxxxxx' --data-binary "@Grid_Fin5.gcode" http://astrobox1.local/api/files/local
No file included
** Update **
looking at the source, it appears that you must include the file name in the url
curl -X POST --header 'X-Api-Key: xxxxxxx' --data-binary "@Grid_Fin5.gcode" http://astrobox1.local/api/files/local/Grid_Fin5.gcode
however this still results in a different error
File not found on ‘local’: Grid_Fin_PLA_ULTRADETAIL1.gcode
Which originates here:
Unfortunately I don’t understand what the _verifyFileExists function is checking, or what it is erroring on
I suspect there may be a bug in the api POST function, since it always returns File not found on local
Looking at the logs, the file uploads successfully,
< HTTP/1.1 100 (Continue)
* We are completely uploaded and fine
but then returns a 404.
< HTTP/1.1 404 NOT FOUND
Full output
curl -X POST --header "X-Api-Key: ${ASTRO_API_KEY}" --data-binary "@${ASTRO_FOLDER_PATH}/${ASTRO_FILE_NAME}" "${ASTRO_SERVER}/api/files/local/${ASTRO_FILE_NAME}" --verbose
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 192.168.1.46...
* TCP_NODELAY set
* Connected to astrobox1.local (192.168.1.46) port 80 (#0)
> POST /api/files/local/Falcon_9_Second_Stage_1_PLA_OPTIMAL.gcode HTTP/1.1
> Host: astrobox1.local
> User-Agent: curl/7.54.0
> Accept: */*
> X-Api-Key: xxxxxxxxxxxx
> Content-Length: 24275440
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 (Continue)
* We are completely uploaded and fine
< HTTP/1.1 404 NOT FOUND
< Content-Length: 68
< Content-Type: text/html; charset=utf-8
< Server: TornadoServer/4.4.2
<
* Connection #0 to host astrobox1.local left intact
File not found on 'local': Falcon_9_Second_Stage_1_PLA_OPTIMAL.gcode
This is for uploading gcode, not stl. Meaning you are uploading pre-sliced files with all the print settings already applied. (This is for peeps using desktop slicers.)
It could be modified for stl I’m sure, but someone would need to dig into the POST format for that…
@Filip, We don’t allow upload of STL at the moment because the box won’t know what to do with it. You would need to create an AstroPrint App and use the cloud APIs