chunkysteveo / OctoPrintAPI

Library for use with Arduino compatible micro controllers (web enabled) to access the Octoprint API on Raspberry Pi's running the Octoprint 3D printer web server by the brilliant Gina Häußge, aka @foosel.
GNU General Public License v2.0
42 stars 24 forks source link

Update arduinojson depends #19

Closed tablatronix closed 4 years ago

tablatronix commented 4 years ago

It seems this requires old 5.x

tablatronix commented 4 years ago

https://arduinojson.org/v6/doc/upgrade/

tablatronix commented 4 years ago
tablatronix commented 4 years ago

https://github.com/chunkysteveo/OctoPrintAPI/pull/20

tablatronix commented 4 years ago

Compiling, I cannot test until tomorrow because I have a print going and CORS requires a restart!! booooo

Looking good Chunkystevo!

tablatronix commented 4 years ago

It works

Code can be reworked to be more compatible with aj 6.x, some things are easier now etc. This just gets it "working"

OctoprintApi::sendGetToOctoprint() CALLED
OctoprintApi::sendRequestToOctoprint() CALLED
.... connected to server
HTTP/1.1 200 OK
Content-Length: 466
X-Robots-Tag: noindex, nofollow, noimageindex
X-Content-Type-Options: nosniff
Cache-Control: max-age=0
X-Clacks-Overhead: GNU Terry Pratchett
Content-Type: application/json
X-Frame-Options: sameorigin

{"job":{"averagePrintTime":9221.544792934,"estimatedPrintTime":7436.001779999472,"filament":{"tool0":{"length":8429.214769999957,"volume":0.0}},"file":{"date":1588386706,"display":"CE3_Single.gcode","name":"CE3_Single.gcode","origin":"local","path":"CE3_Single.gcode","size":5422521},"lastPrintTime":9221.544792934,"user":"_admin"},"progress":{"completion":null,"filepos":null,"printTime":null,"printTimeLeft":null,"printTimeLeftOrigin":null},"state":"Operational"}

Status code to extract: HTTP/1.1 200 OK

httpCode:200
--------------getPrintJob()-------------
Printer current state string:..Operational

----------Job (File information)--------
jobFileDate (Epoch) long:..1588386706
jobFileName String:...CE3_Single.gcode
jobFileOrigin String:...local
jobFileSize (bytes) long:..5422521
jobFilamentTool0Length (mm) long:.0
jobFilamentTool0Volume (cm.) float:.0.00
jobFilamentTool1Length (mm) long:.0
jobFilamentTool1Volume (cm.) float:.0.00
estimatedPrintTime (sec) long:..7436
----------------------------------------

-------Job (Progress information)-------
progressCompletion (%) float:..0.00
progressFilepos (bytes) long:..0
progressPrintTime (sec) long:..0
progressPrintTimeLeft (sec) long:.0
----------------------------------------

---------------Example Use--------------
File:...CE3_Single.gcode
File size:..5.17MB
Uploaded:..2020-05-02 02:31:46
Print time estimate:.02:03:56
Percentage complete:.0.00%
Print time left:.00:00:00
----------------------------------------
chunkysteveo commented 4 years ago

Hiya. Thanks for looking into this. I need to give my library some love and getit upto speed. Not needed to use it in ages, so it's been left to rot 😭. Will block out some time to get it upto date with aj 6 and add new features too!! Thanks for your help and efforts!

chunkysteveo commented 4 years ago

Now in new PR merge.