mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 19:13:49 +01:00
Fixes to getMacAddress() and to adding gcode.
This commit is contained in:
parent
3bc22c19fe
commit
eddb7f7d0d
@ -102,6 +102,9 @@ function M.getMacAddress()
|
||||
local macText = utils.readFile('/sys/class/net/' .. deviceName .. '/address')
|
||||
local out = ''
|
||||
|
||||
-- Hack to prevent failure in case the MAC address could not be obtained.
|
||||
if not macText or macText == '' then return "000000000000" end
|
||||
|
||||
for i = 0, 5 do
|
||||
local bt = string.sub(macText, i*3+1, i*3+2)
|
||||
out = out .. bt
|
||||
|
@ -72,7 +72,10 @@ local function addToGcodeFile(gcode)
|
||||
|
||||
log:debug("appending " .. gcode:len() .. " bytes of gcode to " .. GCODE_TMP_FILE)
|
||||
gcf:write(gcode)
|
||||
gcf:write("\n")
|
||||
gcf:close()
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- assumes printerPath exists, returns true if successful, false if command file already exists and is non-empty (i.e. printer busy),
|
||||
@ -210,7 +213,7 @@ function M.print_POST(request, response)
|
||||
response:addData('msg', msg)
|
||||
return
|
||||
else
|
||||
response:addData('gcode_append',gcode:len())
|
||||
response:addData('gcode_append',argGcode:len())
|
||||
end
|
||||
|
||||
if argIsLast == true then
|
||||
|
Loading…
Reference in New Issue
Block a user