From fe5b2ec30608bfc98e6a9002af06f62ce0a00830 Mon Sep 17 00:00:00 2001 From: Simon Voordouw Date: Tue, 11 Apr 2017 12:50:49 +0200 Subject: [PATCH] get gcode-server url from config --- src/rest/api/api_printer.lua | 3 ++- src/script/print-fetch.lua | 2 +- src/script/wifibox.uci.config | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rest/api/api_printer.lua b/src/rest/api/api_printer.lua index 2048dd8..1f3b8c0 100644 --- a/src/rest/api/api_printer.lua +++ b/src/rest/api/api_printer.lua @@ -190,7 +190,8 @@ function M.fetch_POST(request, response) if not printer or not printer:hasSocket() then return end local socket = printer:getId() - io.popen("print-fetch.lua " .. socket) + local remote = settings.get('gcode_server') + io.popen("print-fetch.lua " .. socket .. " " .. remote) end --requires: gcode(string) (the gcode to be appended) diff --git a/src/script/print-fetch.lua b/src/script/print-fetch.lua index 577639e..bba863a 100755 --- a/src/script/print-fetch.lua +++ b/src/script/print-fetch.lua @@ -6,7 +6,7 @@ local p3d = require("print3d") local printer = p3d.getPrinter(arg[1]) -local remote = "10.0.0.212:8080" +local remote = arg[2] local finished = false diff --git a/src/script/wifibox.uci.config b/src/script/wifibox.uci.config index dd8146e..e2f8fe1 100644 --- a/src/script/wifibox.uci.config +++ b/src/script/wifibox.uci.config @@ -10,3 +10,4 @@ config settings 'system' config settings 'general' option printer_type 'ultimaker' + option gcode_server 'tranquil-meadow-94621.herokuapp.com'