From f50e752235e9bd3370890a6d5344e766d967c9dd Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 2 Jan 2014 16:53:59 +0100 Subject: [PATCH 01/24] Using variables in makerbot start- and endgcode --- src/conf_defaults.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index 31b1351..895858a 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -137,7 +137,7 @@ M.printer_heatedbed = { description = 'Printer has heated bed', } -local default_makerbot_startcode = '(**** CONFIGURATION MACROS ****)\n;@printer {printerType}\n;@enable progress\n(** This GCode was generated by ReplicatorG 0040 **)\n(* using Skeinforge (50) *)\n(* for a Dual headed Replicator 2 *)\n(* on 2013/10/27 15:07:27 (+0100) *)\n(**** start.gcode for Replicator 2X, single head ****)\nM103 (disable RPM)\nM73 P0 (enable build progress)\nG21 (set units to mm)\nG90 (set positioning to absolute)\nM104 S240 T0 (set extruder temperature) (temp updated by printOMatic)\n{if heatedBed}M140 S110 T0 (set HBP temperature)\n(**** begin homing ****)\nG162 X Y F2500 (home XY axes maximum)\nG161 Z F1100 (home Z axis minimum)\nG92 Z-5 (set Z to -5)\nG1 Z0.0 (move Z to "0")\nG161 Z F100 (home Z axis minimum)\nM132 X Y Z A B (Recall stored home offsets for XYZAB axis)\n(**** end homing ****)\nG1 X-141 Y-74 Z10 F3300.0 (move to waiting position)\nG130 X20 Y20 Z20 A20 B20 (Lower stepper Vrefs while heating)\nM6 T0 (wait for toolhead, and HBP to reach temperature)\nG130 X127 Y127 Z40 A127 B127 (Set Stepper motor Vref to defaults)\nM108 R3.0 T0\nG0 X-141 Y-74 (Position Nozzle)\nG0 Z0.6 (Position Height)\nM108 R5.0 (Set Extruder Speed)\nM101 (Start Extruder)\nG4 P2000 (Create Anchor)\nG92 X0 Y0\nM106\n(**** end of start.gcode ****)' +local default_makerbot_startcode = '(**** CONFIGURATION MACROS ****)\n;@printer {printerType}\n;@enable progress\n(** This GCode was generated by ReplicatorG 0040 **)\n(* using Skeinforge (50) *)\n(* for a Dual headed Replicator 2 *)\n(* on 2013/10/27 15:07:27 (+0100) *)\n(**** start.gcode for Replicator 2X, single head ****)\nM103 (disable RPM)\nM73 P0 (enable build progress)\nG21 (set units to mm)\nG90 (set positioning to absolute)\nM104 S{printingTemp} T0 (set extruder temperature) (temp updated by printOMatic)\n{if heatedBed}M140 S{printingBedTemp} T0 (set HBP temperature)\n(**** begin homing ****)\nG162 X Y F2500 (home XY axes maximum)\nG161 Z F1100 (home Z axis minimum)\nG92 Z-5 (set Z to -5)\nG1 Z0.0 (move Z to "0")\nG161 Z F100 (home Z axis minimum)\nM132 X Y Z A B (Recall stored home offsets for XYZAB axis)\n(**** end homing ****)\nG1 X-141 Y-74 Z10 F3300.0 (move to waiting position)\nG130 X20 Y20 Z20 A20 B20 (Lower stepper Vrefs while heating)\nM6 T0 (wait for toolhead, and HBP to reach temperature)\nG130 X127 Y127 Z40 A127 B127 (Set Stepper motor Vref to defaults)\nM108 R3.0 T0\nG0 X-141 Y-74 (Position Nozzle)\nG0 Z0.6 (Position Height)\nM108 R5.0 (Set Extruder Speed)\nM101 (Start Extruder)\nG4 P2000 (Create Anchor)\nG92 X0 Y0\nM106\n(**** end of start.gcode ****)' local default_deltabot_startcode = ';Generated with Doodle3D (deltabot)\nM109 S{printingTemp} ;set target temperature\n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 ; move to home\nG92 E0 ;zero the extruded length\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)' M.printer_startcode = { default = ';Generated with Doodle3D (default)\nM109 S{printingTemp} ;set target temperature \n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG92 E0 ;zero the extruded length again\nG1 F9000\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)', @@ -154,7 +154,7 @@ M.printer_startcode = { description = '' } -local default_makerbot_endcode = '(******* End.gcode*******)\nM73 P100 ( End build progress )\nG0 Z150 ( Send Z axis to bottom of machine )\nM18 ( Disable steppers )\nM104 S0 T0 ( Cool down the Right Extruder )\nG162 X Y F2500 ( Home XY endstops )\nM18 ( Disable stepper motors )\nM70 P5 ( We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\n(*********end End.gcode*******)' +local default_makerbot_endcode = '(******* End.gcode*******)\nM73 P100 ( End build progress )\nG0 Z150 ( Send Z axis to bottom of machine )\nM18 ( Disable steppers )\nM104 S{preheatTemp} T0 ( Cool down the Right Extruder )\nG162 X Y F2500 ( Home XY endstops )\nM18 ( Disable stepper motors )\nM70 P5 ( We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\n(*********end End.gcode*******)' local default_deltabot_endcode = 'M107 ;fan offG91 ;relative positioningG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressureG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even moreG28 ;move to homeM84 ;disable axes / steppersG90 ;absolute positioningM109 S0 ; hot end off{if heatedBed}M140 S{preheatBedTemp}M117 Done ;display message (20 characters to clear whole screen)' M.printer_endcode = { default = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', From cdbb608f8da456a0b9dd69de7ea55466939c7672 Mon Sep 17 00:00:00 2001 From: Wouter R Date: Thu, 2 Jan 2014 20:20:00 +0100 Subject: [PATCH 02/24] Add openwrt diffconfig files (referenced from online wiki); change eclipse project name to match repository name. --- .project | 2 +- .../openwrt-diffconfig-extramini | 39 +++++++++++++++++++ extra/openwrt-build/openwrt-diffconfig-mini | 37 ++++++++++++++++++ .../openwrt-build/openwrt-diffconfig-regular | 22 +++++++++++ 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 extra/openwrt-build/openwrt-diffconfig-extramini create mode 100644 extra/openwrt-build/openwrt-diffconfig-mini create mode 100644 extra/openwrt-build/openwrt-diffconfig-regular diff --git a/.project b/.project index 7c6d11c..d5d240b 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - d3d-box-wifi + doodle3d-firmware diff --git a/extra/openwrt-build/openwrt-diffconfig-extramini b/extra/openwrt-build/openwrt-diffconfig-extramini new file mode 100644 index 0000000..b7eba80 --- /dev/null +++ b/extra/openwrt-build/openwrt-diffconfig-extramini @@ -0,0 +1,39 @@ +CONFIG_TARGET_ar71xx=y +CONFIG_TARGET_ar71xx_generic=y +CONFIG_TARGET_ar71xx_generic_TLMR3020=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6 is not set +CONFIG_DOODLE3D_CLIENT_MINIFY_JS=y +# CONFIG_IPV6 is not set +# CONFIG_KERNEL_DEBUG_INFO is not set +# CONFIG_KERNEL_DEBUG_KERNEL is not set +# CONFIG_KERNEL_KALLSYMS is not set +# CONFIG_KERNEL_MAGIC_SYSRQ is not set +# CONFIG_PACKAGE_6relayd is not set +CONFIG_PACKAGE_doodle3d-client=y +# CONFIG_PACKAGE_kmod-ip6tables is not set +# CONFIG_PACKAGE_kmod-ipv6 is not set +# CONFIG_PACKAGE_kmod-ppp is not set +CONFIG_PACKAGE_kmod-usb-acm=y +CONFIG_PACKAGE_kmod-usb-serial=y +CONFIG_PACKAGE_kmod-usb-serial-ftdi=y +# CONFIG_PACKAGE_libip6tc is not set +CONFIG_PACKAGE_libiwinfo=y +CONFIG_PACKAGE_libiwinfo-lua=y +CONFIG_PACKAGE_liblua=y +CONFIG_PACKAGE_libuci-lua=y +CONFIG_PACKAGE_lua=y +CONFIG_PACKAGE_luafilesystem=y +# CONFIG_PACKAGE_odhcp6c is not set +# CONFIG_PACKAGE_ppp is not set +CONFIG_PACKAGE_print3d=y +CONFIG_PACKAGE_uclibcxx=y +CONFIG_PACKAGE_uhttpd=y +CONFIG_PACKAGE_uhttpd-mod-lua=y +CONFIG_PACKAGE_wifibox=y +CONFIG_STRIP_KERNEL_EXPORTS=y +# CONFIG_TARGET_ROOTFS_TARGZ is not set +CONFIG_USE_MKLIBS=y +CONFIG_WIFIBOX_AP_SSID="d3d-ap-%%MAC_TAIL%%" +CONFIG_WIFIBOX_INIT_PRIORITY=18 +CONFIG_WIFIBOX_WIRELESS_DEVICE="radio0" +CONFIG_PACKAGE_kmod-lib-crc-ccitt=y diff --git a/extra/openwrt-build/openwrt-diffconfig-mini b/extra/openwrt-build/openwrt-diffconfig-mini new file mode 100644 index 0000000..2f1a68f --- /dev/null +++ b/extra/openwrt-build/openwrt-diffconfig-mini @@ -0,0 +1,37 @@ +CONFIG_TARGET_ar71xx=y +CONFIG_TARGET_ar71xx_generic=y +CONFIG_TARGET_ar71xx_generic_TLMR3020=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6 is not set +CONFIG_DOODLE3D_CLIENT_MINIFY_JS=y +# CONFIG_IPV6 is not set +# CONFIG_KERNEL_DEBUG_INFO is not set +# CONFIG_KERNEL_DEBUG_KERNEL is not set +# CONFIG_KERNEL_KALLSYMS is not set +# CONFIG_KERNEL_MAGIC_SYSRQ is not set +# CONFIG_PACKAGE_6relayd is not set +CONFIG_PACKAGE_doodle3d-client=y +# CONFIG_PACKAGE_kmod-ip6tables is not set +# CONFIG_PACKAGE_kmod-ipv6 is not set +# CONFIG_PACKAGE_kmod-ppp is not set +CONFIG_PACKAGE_kmod-usb-acm=y +CONFIG_PACKAGE_kmod-usb-serial=y +CONFIG_PACKAGE_kmod-usb-serial-ftdi=y +# CONFIG_PACKAGE_libip6tc is not set +CONFIG_PACKAGE_libiwinfo=y +CONFIG_PACKAGE_libiwinfo-lua=y +CONFIG_PACKAGE_liblua=y +CONFIG_PACKAGE_libuci-lua=y +CONFIG_PACKAGE_lua=y +CONFIG_PACKAGE_luafilesystem=y +# CONFIG_PACKAGE_odhcp6c is not set +# CONFIG_PACKAGE_ppp is not set +CONFIG_PACKAGE_print3d=y +CONFIG_PACKAGE_uclibcxx=y +CONFIG_PACKAGE_uhttpd=y +CONFIG_PACKAGE_uhttpd-mod-lua=y +CONFIG_PACKAGE_wifibox=y +# CONFIG_TARGET_ROOTFS_TARGZ is not set +CONFIG_WIFIBOX_AP_SSID="d3d-ap-%%MAC_TAIL%%" +CONFIG_WIFIBOX_INIT_PRIORITY=18 +CONFIG_WIFIBOX_WIRELESS_DEVICE="radio0" +CONFIG_PACKAGE_kmod-lib-crc-ccitt=y diff --git a/extra/openwrt-build/openwrt-diffconfig-regular b/extra/openwrt-build/openwrt-diffconfig-regular new file mode 100644 index 0000000..adf6f65 --- /dev/null +++ b/extra/openwrt-build/openwrt-diffconfig-regular @@ -0,0 +1,22 @@ +CONFIG_TARGET_ar71xx=y +CONFIG_TARGET_ar71xx_generic=y +CONFIG_TARGET_ar71xx_generic_TLMR3020=y +CONFIG_DOODLE3D_CLIENT_MINIFY_JS=y +CONFIG_PACKAGE_doodle3d-client=y +CONFIG_PACKAGE_kmod-usb-acm=y +CONFIG_PACKAGE_kmod-usb-serial=y +CONFIG_PACKAGE_kmod-usb-serial-ftdi=y +CONFIG_PACKAGE_libiwinfo=y +CONFIG_PACKAGE_libiwinfo-lua=y +CONFIG_PACKAGE_liblua=y +CONFIG_PACKAGE_libuci-lua=y +CONFIG_PACKAGE_lua=y +CONFIG_PACKAGE_luafilesystem=y +CONFIG_PACKAGE_print3d=y +CONFIG_PACKAGE_uclibcxx=y +CONFIG_PACKAGE_uhttpd=y +CONFIG_PACKAGE_uhttpd-mod-lua=y +CONFIG_PACKAGE_wifibox=y +CONFIG_WIFIBOX_AP_SSID="d3d-ap-%%MAC_TAIL%%" +CONFIG_WIFIBOX_INIT_PRIORITY=18 +CONFIG_WIFIBOX_WIRELESS_DEVICE="radio0" From cdcd76654a7924a96aca7ca67b960a17fc10d1e8 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 2 Jan 2014 17:20:49 +0100 Subject: [PATCH 03/24] Small cleanup --- src/rest/api/api_config.lua | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/rest/api/api_config.lua b/src/rest/api/api_config.lua index 00d8be1..5db9209 100644 --- a/src/rest/api/api_config.lua +++ b/src/rest/api/api_config.lua @@ -84,14 +84,6 @@ function M._global_POST(request, response) local substitutedSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid')) response:addData("substituted_ssid",substitutedSsid) - - -- we now call signin seperately trough cgi-bin - --[[log:info("API:Network:try signing in") - if signin.signin() then - log:info("API:Network:signin successfull") - else - log:info("API:Network:signin failed") - end]]-- end function M.all_GET(request, response) From 491e6021e95349e16ba85c83adcc68bc5ca071c9 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 8 Jan 2014 14:50:44 +0100 Subject: [PATCH 04/24] Wait 1 second manually for the network association to finish --- src/network/netconfig.lua | 7 +++++++ src/util/utils.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index a3a1e8a..a0e3647 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -369,6 +369,13 @@ function M.associateSsid(ssid, passphrase, recreate) return nil,msg end + log:info(" waiting for network configuration to finish") + local waitTime = 1 + local endTime = os.time() + waitTime + while os.time() <= endTime do + -- waiting... + end + M.setStatus(M.CONNECTED,"Connected"); -- signin to connect.doodle3d.com diff --git a/src/util/utils.lua b/src/util/utils.lua index a6c3e37..f0c1020 100644 --- a/src/util/utils.lua +++ b/src/util/utils.lua @@ -145,7 +145,7 @@ end -- @treturn string Output of the command that was run. -- @todo: this function has been duplicated from rest/api/api_system.lua function M.captureCommandOutput(cmd) - local f = assert(io.popen(cmd, 'r')) + local f = assert(io.popen(cmd..' 2>&1', 'r')) local output = assert(f:read('*all')) f:close() return output From af00c176523c8782e0644d50d4587b76a37ca34d Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 8 Jan 2014 17:18:09 +0100 Subject: [PATCH 05/24] Make sure network services are started on boot, instead of just reloaded (removed wireless_reload request) --- src/main.lua | 2 +- src/network/netconfig.lua | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main.lua b/src/main.lua index c5252b2..49ddc8c 100644 --- a/src/main.lua +++ b/src/main.lua @@ -86,7 +86,7 @@ local function setupAutoWifiMode() end if connectWith then - local rv,msg = netconf.associateSsid(connectWith) + local rv,msg = netconf.associateSsid(connectWith,nil,nil,true) if rv then return true, "autowifi: associated -- client mode with ssid '" .. connectWith .. "'" else diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index a0e3647..08efd2a 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -53,10 +53,11 @@ function M.init(wifiInstance, reloadSilent) end --- Switch configuration between AP and station modes --- @param components a table with components as keys with operations as values (add or remove) +-- @param table components a table with components as keys with operations as values (add or remove) +-- @param boolean boot If true, the components have to start instead of reloaded (only needed on boot) -- Valid components (each with add and rm operation) are: apnet, staticaddr, dhcppool, wwwredir, dnsredir, wwwcaptive, natreflect. -- and additionally: wifiiface/add, network/reload -function M.switchConfiguration(components) +function M.switchConfiguration(components,boot) local dirtyList = {} -- laundry list, add config/script name as key with value c (commit), r (reload) or b (both) for k,v in pairs(components) do @@ -74,7 +75,7 @@ function M.switchConfiguration(components) if v == 'c' or v == 'b' then M.commitComponent(k) end end for k,v in pairs(dirtyList) do - if v == 'r' or v == 'b' then M.reloadComponent(k, silent) end + if v == 'r' or v == 'b' then M.reloadComponent(k, silent, boot) end end end @@ -83,15 +84,18 @@ function M.commitComponent(c) uci:commit(c) end -function M.reloadComponent(c, silent) +function M.reloadComponent(c, silent, boot) log:info("reloading component '" .. c .. "'") - local cmd = '/etc/init.d/' .. c .. ' reload' + local command = 'reload' + -- if booting, the services have to be started before they can be reloaded + if boot then command = 'start' end + local cmd = '/etc/init.d/' .. c .. ' '..command if silent ~= nil and silent then cmd = cmd .. ' &> /dev/null' os.execute(cmd) else rv = utils.captureCommandOutput(cmd) - log:info(" result reloading component '" .. c .. "': "..utils.dump(rv)) + log:info(" result reloading component '" .. c .. "' (cmd: '"..cmd.."'): \n"..utils.dump(rv)) end end @@ -327,10 +331,11 @@ end -- @tparam string ssid The SSID to associate with. -- @tparam string passphrase The passphrase (if any) to use, may be left out if a UCI configuration exists. -- @tparam boolean recreate If true, a new UCI configuration based on scan data will always be created, otherwise an attempt will be made to use an existing configuration. +-- @tparam boolean boot If true, the components have to start instead of reloaded (only needed on boot) -- @return True on success or nil+msg on error. -function M.associateSsid(ssid, passphrase, recreate) +function M.associateSsid(ssid, passphrase, recreate, boot) log:info("netconfig:associateSsid: "..(ssid or "")..", "..(recreate or "")) - + if boot then log:info(" boot mode") end M.setStatus(M.CONNECTING,"Connecting..."); -- see if previously configured network for given ssid exists @@ -359,7 +364,8 @@ function M.associateSsid(ssid, passphrase, recreate) wifi.activateConfig(ssid) --M.switchConfiguration{ wifiiface="add", apnet="rm", staticaddr="rm", dhcppool="rm", wwwredir="rm", dnsredir="rm", wwwcaptive="rm", wireless="reload" } --M.switchConfiguration{ wifiiface="add", apnet="rm", staticaddr="rm", dhcppool="rm", wwwredir="rm", dnsredir="rm", wireless="reload" } - M.switchConfiguration{ wifiiface="add", staticaddr="rm", dhcppool="rm", wwwredir="rm", dnsredir="rm", wireless="reload" } + --M.switchConfiguration{ wifiiface="add", staticaddr="rm", dhcppool="rm", wwwredir="rm", dnsredir="rm", wireless="reload" } + M.switchConfiguration({ wifiiface="add", staticaddr="rm", dhcppool="rm", wwwredir="rm", dnsredir="rm" },boot) -- check if we are actually associated local status = wifi.getDeviceState() From 8e34f338c24cea7cd7c8a32bdb4b13e68e262d08 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 8 Jan 2014 17:21:01 +0100 Subject: [PATCH 06/24] More frequent signing (1 hour > 15 min) --- src/script/signin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/signin.sh b/src/script/signin.sh index 0ef2fa8..3ec4f14 100644 --- a/src/script/signin.sh +++ b/src/script/signin.sh @@ -9,5 +9,5 @@ sleep 5s while true; do /usr/share/lua/wifibox/script/d3dapi signin > /dev/null 2> /dev/null - sleep 1h + sleep 15m done From 4d782681df4f02b3590dcac24e8cd71d724a9ede Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 9 Jan 2014 21:11:49 +0100 Subject: [PATCH 07/24] Implemented signin attempts system and signing response check --- src/main.lua | 3 +- src/network/netconfig.lua | 9 +----- src/network/signin.lua | 65 ++++++++++++++++++++++++++++---------- src/network/wlanconfig.lua | 1 + src/script/wifibox_init | 3 -- 5 files changed, 53 insertions(+), 28 deletions(-) diff --git a/src/main.lua b/src/main.lua index 49ddc8c..4cee85b 100644 --- a/src/main.lua +++ b/src/main.lua @@ -59,7 +59,7 @@ local function setupAutoWifiMode() return nil, "autowifi: could not scan wifi networks (" .. msg .. ")" end - log:info("current wifi name/mode: " .. (netName or "") .. "/" .. netMode .. ", ssid of self: " .. apSsid) + log:info("current wifi name: " .. (netName or "") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid) local visNet, knownNet = {}, {} for _,sn in ipairs(scanList) do table.insert(visNet, sn.ssid) @@ -93,6 +93,7 @@ local function setupAutoWifiMode() return nil, "autowifi: could not associate with ssid '" .. connectWith .. "' (" .. msg .. ")" end elseif netMode ~= 'ap' or netName ~= apSsid then + log:info("falling back to access point mode") local rv,msg = netconf.setupAccessPoint(apSsid) if rv then return true, "autowifi: configured as access point with ssid '" .. apSsid .. "'" diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index 08efd2a..5a1424c 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -95,7 +95,7 @@ function M.reloadComponent(c, silent, boot) os.execute(cmd) else rv = utils.captureCommandOutput(cmd) - log:info(" result reloading component '" .. c .. "' (cmd: '"..cmd.."'): \n"..utils.dump(rv)) + log:debug(" result reloading component '" .. c .. "' (cmd: '"..cmd.."'): \n"..utils.dump(rv)) end end @@ -375,13 +375,6 @@ function M.associateSsid(ssid, passphrase, recreate, boot) return nil,msg end - log:info(" waiting for network configuration to finish") - local waitTime = 1 - local endTime = os.time() + waitTime - while os.time() <= endTime do - -- waiting... - end - M.setStatus(M.CONNECTED,"Connected"); -- signin to connect.doodle3d.com diff --git a/src/network/signin.lua b/src/network/signin.lua index 0b78d4e..8d0a808 100644 --- a/src/network/signin.lua +++ b/src/network/signin.lua @@ -42,24 +42,57 @@ function M.signin() M.setStatus(SIGNING_IN_STATUS,"signing in") local baseurl = "http://connect.doodle3d.com/api/signin.php" - - local localip = wifi.getLocalIP(); - if localip == nil then - log:error("signin failed no local ip found") - M.setStatus(IDLE_STATUS,"idle") - return false + + local attemptInterval = 1 + local maxAttempts = 20 + local attempt = 0 + + local nextAttemptTime = os.time() + + local localip = "" + local signinResponse = "" + while true do + if os.time() > nextAttemptTime then + log:debug("signin attempt "..utils.dump(attempt).."/"..utils.dump(maxAttempts)) + local signedin = false + local localip = wifi.getLocalIP(); + log:debug(" localip: "..utils.dump(localip)) + if localip ~= nil then + + local wifiboxid = wifi.getSubstitutedSsid(settings.get('network.cl.wifiboxid')) + wifiboxid = urlcode.escape(wifiboxid) + + local cmd = "wget -q -T 2 -t 1 -O - "..baseurl.."?wifiboxid="..wifiboxid.."\\&localip="..localip; + signinResponse = utils.captureCommandOutput(cmd); + log:debug(" signin response: \n"..utils.dump(signinResponse)) + local success = signinResponse:match('"status":"success"') + log:debug(" success: "..utils.dump(success)) + if success ~= nil then + signedin = true + else + log:warn("signin failed request failed (response: "..utils.dump(signinResponse)..")") + end + else + log:warn("signin failed no local ip found (attempt: "..utils.dump(attempt).."/"..utils.dump(maxAttempts)..")") + end + + if signedin then + break + else + attempt = attempt+1 + if attempt >= maxAttempts then + -- still no localIP; fail + M.setStatus(IDLE_STATUS,"idle") + return false + else + nextAttemptTime = os.time() + attemptInterval + end + end + end end - - local wifiboxid = wifi.getSubstitutedSsid(settings.get('network.cl.wifiboxid')) - wifiboxid = urlcode.escape(wifiboxid) - - local cmd = "wget -q -T 2 -t 1 -O - "..baseurl.."?wifiboxid="..wifiboxid.."\\&localip="..localip; - local output = utils.captureCommandOutput(cmd); - log:info("signin: "..output) - + M.setStatus(IDLE_STATUS,"idle") - - return string.len(output) > 0, output + return string.len(signinResponse) > 0, signinResponse end function M.getStatus() diff --git a/src/network/wlanconfig.lua b/src/network/wlanconfig.lua index f93564b..ab42bcd 100644 --- a/src/network/wlanconfig.lua +++ b/src/network/wlanconfig.lua @@ -124,6 +124,7 @@ end --returns the wireless local ip address function M.getLocalIP() local ifconfig, rv = utils.captureCommandOutput("ifconfig wlan0"); + --log:debug(" ifconfig: \n"..utils.dump(ifconfig)); local localip = ifconfig:match('inet addr:([%d\.]+)') return localip; end diff --git a/src/script/wifibox_init b/src/script/wifibox_init index cde12ea..4eeac31 100644 --- a/src/script/wifibox_init +++ b/src/script/wifibox_init @@ -15,9 +15,6 @@ boot() { $LOGGER "Invoking Doodle3D WiFi box network auto-initialization..." /usr/share/lua/wifibox/script/d3dapi autowifi - - $LOGGER "Start signing in..." - /usr/share/lua/wifibox/script/signin.sh > /dev/null 2> /dev/null & } start() { From 39621b215fa3706ad7663210927eff599b0187ca Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 10 Jan 2014 11:13:26 +0100 Subject: [PATCH 08/24] Small comments and log fixes --- src/main.lua | 4 ++-- src/network/signin.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.lua b/src/main.lua index 4cee85b..36e07a2 100644 --- a/src/main.lua +++ b/src/main.lua @@ -76,9 +76,10 @@ local function setupAutoWifiMode() end -- try to find a known network which is also visible (ordered by known network definitions) + -- when it finds a access point configuration first, it will use that local connectWith = nil for _,kn in ipairs(knownSsids) do - if kn.mode == 'ap' and kn.ssid == apSsid then break end + if kn.mode == 'ap' and kn.ssid == apSsid then break end if findSsidInList(scanList, kn.ssid) then connectWith = kn.ssid break @@ -93,7 +94,6 @@ local function setupAutoWifiMode() return nil, "autowifi: could not associate with ssid '" .. connectWith .. "' (" .. msg .. ")" end elseif netMode ~= 'ap' or netName ~= apSsid then - log:info("falling back to access point mode") local rv,msg = netconf.setupAccessPoint(apSsid) if rv then return true, "autowifi: configured as access point with ssid '" .. apSsid .. "'" diff --git a/src/network/signin.lua b/src/network/signin.lua index 8d0a808..7f20f32 100644 --- a/src/network/signin.lua +++ b/src/network/signin.lua @@ -56,7 +56,7 @@ function M.signin() log:debug("signin attempt "..utils.dump(attempt).."/"..utils.dump(maxAttempts)) local signedin = false local localip = wifi.getLocalIP(); - log:debug(" localip: "..utils.dump(localip)) + --log:debug(" localip: "..utils.dump(localip)) if localip ~= nil then local wifiboxid = wifi.getSubstitutedSsid(settings.get('network.cl.wifiboxid')) From c621c618bd951f7cb5c1974b0e5fc2a5a0e74742 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 10 Jan 2014 11:14:17 +0100 Subject: [PATCH 09/24] Start access point network services on boot instead of reload --- src/main.lua | 2 +- src/network/netconfig.lua | 13 ++++++++----- src/rest/api/api_network.lua | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.lua b/src/main.lua index 36e07a2..cd456f3 100644 --- a/src/main.lua +++ b/src/main.lua @@ -94,7 +94,7 @@ local function setupAutoWifiMode() return nil, "autowifi: could not associate with ssid '" .. connectWith .. "' (" .. msg .. ")" end elseif netMode ~= 'ap' or netName ~= apSsid then - local rv,msg = netconf.setupAccessPoint(apSsid) + local rv,msg = netconf.setupAccessPoint(apSsid,true) if rv then return true, "autowifi: configured as access point with ssid '" .. apSsid .. "'" else diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index 5a1424c..95bff9b 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -275,16 +275,19 @@ end -- Note: this function might belong in the wlanconfig module but that would introduce -- a circular dependency, easiest solution is to place the function here. -- @tparam string ssid The SSID to use for the access point. +-- @tparam boolean boot If true, the components have to start instead of reloaded (only needed on boot) -- @return True on success or nil+msg on error. -function M.setupAccessPoint(ssid) - +function M.setupAccessPoint(ssid,boot) M.setStatus(M.CREATING,"Creating access point '"..ssid.."'..."); + boot = boot or false + if boot then log:info(" boot mode") end - M.switchConfiguration{apnet="add_noreload"} + -- add access point configuration + M.switchConfiguration({apnet="add_noreload"},boot) wifi.activateConfig(ssid) -- NOTE: dnsmasq must be reloaded after network or it will be unable to serve IP addresses - M.switchConfiguration{ wifiiface="add", network="reload", staticaddr="add", dhcppool="add_noreload", wwwredir="add", dnsredir="add" } - M.switchConfiguration{dhcp="reload"} + M.switchConfiguration({ wifiiface="add", network="reload", staticaddr="add", dhcppool="add_noreload", wwwredir="add", dnsredir="add" },boot) + M.switchConfiguration({dhcp="reload"},boot) M.setStatus(M.CREATED,"Access point created"); diff --git a/src/rest/api/api_network.lua b/src/rest/api/api_network.lua index e29d1d5..5fc5ba6 100644 --- a/src/rest/api/api_network.lua +++ b/src/rest/api/api_network.lua @@ -147,7 +147,7 @@ function M.associate_POST(request, response) response:setSuccess("wlan is trying to associate") - local rv,msg = netconf.associateSsid(argSsid, argPhrase, argRecreate) + local rv,msg = netconf.associateSsid(argSsid, argPhrase, argRecreate,false) if rv then log:info("associated to wifi: "..utils.dump(argSsid)) else From c0901747b3108bb08c1311197750a5650e0db3e0 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 10 Jan 2014 12:23:32 +0100 Subject: [PATCH 10/24] Don't switch to ap mode when updating --- src/rest/api/api_update.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rest/api/api_update.lua b/src/rest/api/api_update.lua index ffd378c..99d1167 100644 --- a/src/rest/api/api_update.lua +++ b/src/rest/api/api_update.lua @@ -159,8 +159,8 @@ function M.install_POST(request, response) updater.setLogger(log) updater.setState(updater.STATE.INSTALLING,"") - local ssid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid')) - local rv,msg = netconf.enableAccessPoint(ssid) + --local ssid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid')) + --local rv,msg = netconf.enableAccessPoint(ssid) if not argVersion then local success,status,msg = updater.getStatus() From 165a6a5f8a05758668757d670002154c8e12458f Mon Sep 17 00:00:00 2001 From: Wouter R Date: Fri, 10 Jan 2014 17:31:32 +0100 Subject: [PATCH 11/24] Add setting for bottom layer flow rate factor. Add setting for bottom layer speed. --- src/conf_defaults.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index 895858a..db2ad79 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -242,6 +242,18 @@ M.printer_firstLayerSlow = { description = 'Print the first layer slowly to get a more stable start' } +M.printer_bottomLayerSpeed = { + default = 35, + type = 'int', + description = 'If first layers are to be printed slowly, use this speed' +} + +M.printer_bottomFlowRate = { + default = 2, + type = 'float', + description = 'Multiplication factor for filament flow rate in first few layers' +} + M.printer_heatup_enabled = { default = true, type = 'bool', From ab900533f3421bb02251b9cc9225811c49c01b56 Mon Sep 17 00:00:00 2001 From: Wouter R Date: Fri, 10 Jan 2014 22:23:29 +0100 Subject: [PATCH 12/24] Improved makerbot gcode (based on Makerware start/end code). --- src/conf_defaults.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index db2ad79..02f906d 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -137,7 +137,7 @@ M.printer_heatedbed = { description = 'Printer has heated bed', } -local default_makerbot_startcode = '(**** CONFIGURATION MACROS ****)\n;@printer {printerType}\n;@enable progress\n(** This GCode was generated by ReplicatorG 0040 **)\n(* using Skeinforge (50) *)\n(* for a Dual headed Replicator 2 *)\n(* on 2013/10/27 15:07:27 (+0100) *)\n(**** start.gcode for Replicator 2X, single head ****)\nM103 (disable RPM)\nM73 P0 (enable build progress)\nG21 (set units to mm)\nG90 (set positioning to absolute)\nM104 S{printingTemp} T0 (set extruder temperature) (temp updated by printOMatic)\n{if heatedBed}M140 S{printingBedTemp} T0 (set HBP temperature)\n(**** begin homing ****)\nG162 X Y F2500 (home XY axes maximum)\nG161 Z F1100 (home Z axis minimum)\nG92 Z-5 (set Z to -5)\nG1 Z0.0 (move Z to "0")\nG161 Z F100 (home Z axis minimum)\nM132 X Y Z A B (Recall stored home offsets for XYZAB axis)\n(**** end homing ****)\nG1 X-141 Y-74 Z10 F3300.0 (move to waiting position)\nG130 X20 Y20 Z20 A20 B20 (Lower stepper Vrefs while heating)\nM6 T0 (wait for toolhead, and HBP to reach temperature)\nG130 X127 Y127 Z40 A127 B127 (Set Stepper motor Vref to defaults)\nM108 R3.0 T0\nG0 X-141 Y-74 (Position Nozzle)\nG0 Z0.6 (Position Height)\nM108 R5.0 (Set Extruder Speed)\nM101 (Start Extruder)\nG4 P2000 (Create Anchor)\nG92 X0 Y0\nM106\n(**** end of start.gcode ****)' +local default_makerbot_startcode = ";@printer {printerType}\nM136 (enable build)\nM73 P0\nG162 X Y F2000(home XY axes maximum)\nG161 Z F900(home Z axis minimum)\nG92 X0 Y0 Z-5 A0 B0 (set Z to -5)\nG1 Z0.0 F900(move Z to '0')\nG161 Z F100(home Z axis minimum)\nM132 X Y Z A B (Recall stored home offsets for XYZAB axis)\nG92 X152 Y72 Z0 A0 B0\nG1 X-112 Y-73 Z0.5 F3300.0 (move to front left 'zero' position)\nG92 X0 Y0 Z0.5 A0 B0\nG1 X0 Y0 Z0.5 F3300.0 (move to waiting position)\nG130 X20 Y20 A20 B20 (Lower stepper Vrefs while heating)\n{if heatedBed};M109 S{printingBedTemp} T0\n{if heatedBed}M140 S{printingBedTemp} T0\nM104 S{printingTemp} T0\n;M134 T0\nM135 T0\nM104 S{printingTemp} T0\nM133 T0\nG130 X127 Y127 A127 B127 (Set Stepper motor Vref to defaults)\nG1 F100 A10 ;extrude 10mm\nG92 A0 ;reset again\nG0 Z20" local default_deltabot_startcode = ';Generated with Doodle3D (deltabot)\nM109 S{printingTemp} ;set target temperature\n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 ; move to home\nG92 E0 ;zero the extruded length\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)' M.printer_startcode = { default = ';Generated with Doodle3D (default)\nM109 S{printingTemp} ;set target temperature \n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG92 E0 ;zero the extruded length again\nG1 F9000\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)', @@ -154,7 +154,7 @@ M.printer_startcode = { description = '' } -local default_makerbot_endcode = '(******* End.gcode*******)\nM73 P100 ( End build progress )\nG0 Z150 ( Send Z axis to bottom of machine )\nM18 ( Disable steppers )\nM104 S{preheatTemp} T0 ( Cool down the Right Extruder )\nG162 X Y F2500 ( Home XY endstops )\nM18 ( Disable stepper motors )\nM70 P5 ( We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\n(*********end End.gcode*******)' +local default_makerbot_endcode = 'M73 P100\nG92 A0 B0 ;reset extruder position to prevent retraction\nM18 A B(Turn off A and B Steppers)\nG1 Z155 F900\nG162 X Y F2000\nM18 X Y Z(Turn off steppers after a build)\n{if heatedBed}M109 S{preheatBedTemp} T0\nM104 S{preheatTemp} T0\nM73 P100 (end build progress )\nM70 P5 (We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\nM137 (build end notification)' local default_deltabot_endcode = 'M107 ;fan offG91 ;relative positioningG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressureG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even moreG28 ;move to homeM84 ;disable axes / steppersG90 ;absolute positioningM109 S0 ; hot end off{if heatedBed}M140 S{preheatBedTemp}M117 Done ;display message (20 characters to clear whole screen)' M.printer_endcode = { default = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', From 60d07c9667c1d0b83c70d1a46dfd6569213404b0 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 20 Jan 2014 15:06:41 +0100 Subject: [PATCH 13/24] Make sure it keeps signing in. --- src/script/wifibox_init | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/script/wifibox_init b/src/script/wifibox_init index 4eeac31..0140994 100644 --- a/src/script/wifibox_init +++ b/src/script/wifibox_init @@ -15,6 +15,10 @@ boot() { $LOGGER "Invoking Doodle3D WiFi box network auto-initialization..." /usr/share/lua/wifibox/script/d3dapi autowifi + + $LOGGER "Start signing in..." + /usr/share/lua/wifibox/script/signin.sh > /dev/null 2> /dev/null & + } start() { From ac46c183acf0fe483894f4dbe62da20f2264df28 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 20 Jan 2014 15:06:57 +0100 Subject: [PATCH 14/24] Disable boot mode for access point --- src/network/netconfig.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index 95bff9b..cee895f 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -280,6 +280,7 @@ end function M.setupAccessPoint(ssid,boot) M.setStatus(M.CREATING,"Creating access point '"..ssid.."'..."); boot = boot or false + --boot = false if boot then log:info(" boot mode") end -- add access point configuration From 15f96c115b748276ae75870c0b0d06b22f95e7b8 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 20 Jan 2014 15:21:04 +0100 Subject: [PATCH 15/24] Start signing in loop after 15 min --- src/script/signin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/signin.sh b/src/script/signin.sh index 3ec4f14..c4bb1a3 100644 --- a/src/script/signin.sh +++ b/src/script/signin.sh @@ -5,7 +5,7 @@ # This software is licensed under the terms of the GNU GPL v2 or later. # See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details. -sleep 5s +sleep 15m while true; do /usr/share/lua/wifibox/script/d3dapi signin > /dev/null 2> /dev/null From 71326510e6f2e7c0a2081830c84875b394ae9388 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 20 Jan 2014 15:34:46 +0100 Subject: [PATCH 16/24] Using proper set target bed temperature gcode for makerbot in endgcode --- src/conf_defaults.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index 02f906d..d5c2cb6 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -154,7 +154,7 @@ M.printer_startcode = { description = '' } -local default_makerbot_endcode = 'M73 P100\nG92 A0 B0 ;reset extruder position to prevent retraction\nM18 A B(Turn off A and B Steppers)\nG1 Z155 F900\nG162 X Y F2000\nM18 X Y Z(Turn off steppers after a build)\n{if heatedBed}M109 S{preheatBedTemp} T0\nM104 S{preheatTemp} T0\nM73 P100 (end build progress )\nM70 P5 (We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\nM137 (build end notification)' +local default_makerbot_endcode = 'M73 P100\nG92 A0 B0 ;reset extruder position to prevent retraction\nM18 A B(Turn off A and B Steppers)\nG1 Z155 F900\nG162 X Y F2000\nM18 X Y Z(Turn off steppers after a build)\n{if heatedBed}M140 S{preheatBedTemp} T0\nM104 S{preheatTemp} T0\nM73 P100 (end build progress )\nM70 P5 (We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\nM137 (build end notification)' local default_deltabot_endcode = 'M107 ;fan offG91 ;relative positioningG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressureG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even moreG28 ;move to homeM84 ;disable axes / steppersG90 ;absolute positioningM109 S0 ; hot end off{if heatedBed}M140 S{preheatBedTemp}M117 Done ;display message (20 characters to clear whole screen)' M.printer_endcode = { default = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', From 9d1f16d5896befb98fce82c9c610183eb36c568a Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 20 Jan 2014 18:27:26 +0100 Subject: [PATCH 17/24] Version and release notes --- ReleaseNotes.md | 16 ++++++++++++++++ src/FIRMWARE-VERSION | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index c8d2145..2e28f65 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,19 @@ +# 0.10.0 (20th jan 2014) +- WordArt +- Adding basic shapes +- 2D edit functionality: move, scale, rotate +- Vertical shape buttons in foldable menu (creating more vertical space to draw) +- Fixed issues connecting to networks +- Doesn't switch to access point after firmware update anymore +- Speed and flow rate settings for bottom layers +- Improved Makerbot gcode for better adhesion +- Traveling disabled in bottom layers (providing sort of a poor man's raft) +- Feedback on 'restore settings to default'-button +- Reimplemented layout, lots of improvements +- Re-enabled regular browser keyboard shortcuts +- Faster click responses on iOS +- magnifying glass on iOS is now prevented from showing up + # 0.9.13 (23th dec 2013) - Links to release notes in settings update panel, both for current version and for updateable version. - On finishing the tour the status message, thermometer and progress indicators are only hidden when appropriate diff --git a/src/FIRMWARE-VERSION b/src/FIRMWARE-VERSION index 62ea259..78bc1ab 100644 --- a/src/FIRMWARE-VERSION +++ b/src/FIRMWARE-VERSION @@ -1 +1 @@ -0.9.13 +0.10.0 From 75e0d7efd91e8a91ee06b6b26c1c965a94154e0a Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 23 Jan 2014 18:29:48 +0100 Subject: [PATCH 18/24] Removing display message from makerbot endgcode --- src/conf_defaults.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index d5c2cb6..72bdf6a 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -154,7 +154,7 @@ M.printer_startcode = { description = '' } -local default_makerbot_endcode = 'M73 P100\nG92 A0 B0 ;reset extruder position to prevent retraction\nM18 A B(Turn off A and B Steppers)\nG1 Z155 F900\nG162 X Y F2000\nM18 X Y Z(Turn off steppers after a build)\n{if heatedBed}M140 S{preheatBedTemp} T0\nM104 S{preheatTemp} T0\nM73 P100 (end build progress )\nM70 P5 (We <3 Making Things!)\nM72 P1 ( Play Ta-Da song )\nM137 (build end notification)' +local default_makerbot_endcode = 'M73 P100\nG92 A0 B0 ;reset extruder position to prevent retraction\nM18 A B(Turn off A and B Steppers)\nG1 Z155 F900\nG162 X Y F2000\nM18 X Y Z(Turn off steppers after a build)\n{if heatedBed}M140 S{preheatBedTemp} T0\nM104 S{preheatTemp} T0\nM73 P100 (end build progress )\nM72 P1 ( Play Ta-Da song )\nM137 (build end notification)' local default_deltabot_endcode = 'M107 ;fan offG91 ;relative positioningG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressureG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even moreG28 ;move to homeM84 ;disable axes / steppersG90 ;absolute positioningM109 S0 ; hot end off{if heatedBed}M140 S{preheatBedTemp}M117 Done ;display message (20 characters to clear whole screen)' M.printer_endcode = { default = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', From 175f55f8540ab923e48e63a528e5fef60beba6eb Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 27 Jan 2014 13:39:30 +0100 Subject: [PATCH 19/24] Allow floats for retraction amount setting --- src/conf_defaults.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index 72bdf6a..e467b9b 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -294,7 +294,7 @@ M.printer_retraction_minDistance = { M.printer_retraction_amount = { default = 3, - type = 'int', + type = 'float', description = '', min = 0 } From 11f8364e6e1b17a4a443e8aec2d62c25da178721 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 30 Jan 2014 13:21:21 +0100 Subject: [PATCH 20/24] miniFactory support --- src/conf_defaults.lua | 4 ++++ src/util/printer.lua | 1 + 2 files changed, 5 insertions(+) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index e467b9b..52c64b1 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -106,6 +106,7 @@ M.printer_dimensions_x = { default_delta_rostockmax = 0, default_deltamaker = 0, default_kossel = 0, + default_minifactory = 150, subSection = 'printer_type', type = 'int', description = '', @@ -116,6 +117,7 @@ M.printer_dimensions_y = { default_delta_rostockmax = 0, default_deltamaker = 0, default_kossel = 0, + default_minifactory = 150, subSection = 'printer_type', type = 'int', description = '', @@ -123,6 +125,7 @@ M.printer_dimensions_y = { } M.printer_dimensions_z = { default = 200, + default_minifactory = 155, subSection = 'printer_type', type = 'int', description = '', @@ -132,6 +135,7 @@ M.printer_heatedbed = { default = false, default_ultimaker2 = true, default_makerbot_replicator2x = true, + default_minifactory = true, subSection = 'printer_type', type = 'bool', description = 'Printer has heated bed', diff --git a/src/util/printer.lua b/src/util/printer.lua index 1c619eb..6de86c8 100644 --- a/src/util/printer.lua +++ b/src/util/printer.lua @@ -44,6 +44,7 @@ local SUPPORTED_PRINTERS = { shapercube = "ShaperCube", tantillus = "Tantillus", vision_3d_printer = "Vision 3D Printer", + minifactory = "miniFactory", marlin_generic = "Generic Marlin Printer", makerbot_generic = "Generic Makerbot Printer" } From daabffd1cadddebfeadee82f7af76e9c105bb31f Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 31 Jan 2014 15:41:53 +0100 Subject: [PATCH 21/24] Use application/json for REST API --- src/rest/response.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest/response.lua b/src/rest/response.lua index 7e0660a..869b813 100644 --- a/src/rest/response.lua +++ b/src/rest/response.lua @@ -46,7 +46,7 @@ function M.new(requestObject) local self = setmetatable({}, M) self.body = { status = nil, data = {} } self:setHttpStatus(200, 'OK') - self:setContentType('text/plain;charset=UTF-8') + self:setContentType('application/json;charset=UTF-8') --self:setContentType('application/json;charset=UTF-8') -- A queue for functions to be executed when the response has been given. From 96e0ec99dd6b0fde30034a226213d44d6c64b4b6 Mon Sep 17 00:00:00 2001 From: Wouter R Date: Fri, 31 Jan 2014 22:39:36 +0100 Subject: [PATCH 22/24] Update openwrt diffconfig to allow 802.11 driver to override regulatory domain stored in eeprom. The reg. domain is configured to 'NL', so wifi channels 12 and 13 can be used. --- NOTICE.txt | 2 ++ extra/openwrt-build/openwrt-diffconfig-extramini | 1 + extra/openwrt-build/openwrt-diffconfig-mini | 1 + extra/openwrt-build/openwrt-diffconfig-regular | 1 + post-install.sh | 5 ++++- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NOTICE.txt b/NOTICE.txt index 218ce90..295cdde 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,3 +1,5 @@ +Doodle3D overrides the 802.11 regulatory domain such that channels 12 and 13 can be used. In most countries this is desired and accepted behaviour, with the notable exception being the USA. + Doodle3D uses the following external projects: Lua - Copyright (c) 1994–2013 Lua.org, PUC-Rio. - MIT license diff --git a/extra/openwrt-build/openwrt-diffconfig-extramini b/extra/openwrt-build/openwrt-diffconfig-extramini index b7eba80..b8e8531 100644 --- a/extra/openwrt-build/openwrt-diffconfig-extramini +++ b/extra/openwrt-build/openwrt-diffconfig-extramini @@ -1,6 +1,7 @@ CONFIG_TARGET_ar71xx=y CONFIG_TARGET_ar71xx_generic=y CONFIG_TARGET_ar71xx_generic_TLMR3020=y +CONFIG_ATH_USER_REGD=y # CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6 is not set CONFIG_DOODLE3D_CLIENT_MINIFY_JS=y # CONFIG_IPV6 is not set diff --git a/extra/openwrt-build/openwrt-diffconfig-mini b/extra/openwrt-build/openwrt-diffconfig-mini index 2f1a68f..cd9460d 100644 --- a/extra/openwrt-build/openwrt-diffconfig-mini +++ b/extra/openwrt-build/openwrt-diffconfig-mini @@ -1,6 +1,7 @@ CONFIG_TARGET_ar71xx=y CONFIG_TARGET_ar71xx_generic=y CONFIG_TARGET_ar71xx_generic_TLMR3020=y +CONFIG_ATH_USER_REGD=y # CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6 is not set CONFIG_DOODLE3D_CLIENT_MINIFY_JS=y # CONFIG_IPV6 is not set diff --git a/extra/openwrt-build/openwrt-diffconfig-regular b/extra/openwrt-build/openwrt-diffconfig-regular index adf6f65..6e01360 100644 --- a/extra/openwrt-build/openwrt-diffconfig-regular +++ b/extra/openwrt-build/openwrt-diffconfig-regular @@ -1,6 +1,7 @@ CONFIG_TARGET_ar71xx=y CONFIG_TARGET_ar71xx_generic=y CONFIG_TARGET_ar71xx_generic_TLMR3020=y +CONFIG_ATH_USER_REGD=y CONFIG_DOODLE3D_CLIENT_MINIFY_JS=y CONFIG_PACKAGE_doodle3d-client=y CONFIG_PACKAGE_kmod-usb-acm=y diff --git a/post-install.sh b/post-install.sh index e4f07bb..e090572 100644 --- a/post-install.sh +++ b/post-install.sh @@ -78,7 +78,9 @@ $IPKG_INSTROOT/etc/init.d/dhcpcheck enable if [ -z "$IPKG_INSTROOT" ]; then echo "Enabling wifi device..." - uci set wireless.@wifi-device[0].disabled=0; uci commit wireless; wifi + uci set wireless.@wifi-device[0].disabled=0 + uci set wireless.radio0.country='NL' + uci commit wireless; wifi addFirewallNet @@ -97,6 +99,7 @@ else uci set uhttpd.main.lua_prefix='/d3dapi' uci set wireless.@wifi-device[0].disabled=0 + uci set wireless.radio0.country='NL' # TODO: add firewall net uci set network.wlan=interface EOM From b026ed18749a93e8fdaf25e67efff7af129489d8 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 12 Feb 2014 12:35:47 +0100 Subject: [PATCH 23/24] Make heated bed optional for Ultimaker2 --- src/conf_defaults.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index 52c64b1..dfada35 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -145,7 +145,7 @@ local default_makerbot_startcode = ";@printer {printerType}\nM136 (enable build) local default_deltabot_startcode = ';Generated with Doodle3D (deltabot)\nM109 S{printingTemp} ;set target temperature\n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 ; move to home\nG92 E0 ;zero the extruded length\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)' M.printer_startcode = { default = ';Generated with Doodle3D (default)\nM109 S{printingTemp} ;set target temperature \n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG92 E0 ;zero the extruded length again\nG1 F9000\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)', - default_ultimaker2 = ';Generated with Doodle3D (ultimaker2)\nM109 S{printingTemp} ;set target temperature \nM190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG90 ;absolute positioning\nM107 ;start with the fan off\nG28 ; home to endstops\nG1 Z15 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)\n', + default_ultimaker2 = ';Generated with Doodle3D (ultimaker2)\nM109 S{printingTemp} ;set target temperature \n{if heatedBed}M190 S{printingBedTemp} ;set target bed temperature\nG21 ;metric values\nG90 ;absolute positioning\nM107 ;start with the fan off\nG28 ; home to endstops\nG1 Z15 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)\n', default_makerbot_generic = default_makerbot_startcode, default_makerbot_replicator2 = default_makerbot_startcode, default_makerbot_replicator2x = default_makerbot_startcode, @@ -162,7 +162,7 @@ local default_makerbot_endcode = 'M73 P100\nG92 A0 B0 ;reset extruder position t local default_deltabot_endcode = 'M107 ;fan offG91 ;relative positioningG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressureG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even moreG28 ;move to homeM84 ;disable axes / steppersG90 ;absolute positioningM109 S0 ; hot end off{if heatedBed}M140 S{preheatBedTemp}M117 Done ;display message (20 characters to clear whole screen)' M.printer_endcode = { default = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', - default_ultimaker2 = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+5.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 ;home the printer\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\nM140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', + default_ultimaker2 = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+5.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 ;home the printer\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM104 S{preheatTemp}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)', default_makerbot_generic = default_makerbot_endcode, default_makerbot_replicator2 = default_makerbot_endcode, default_makerbot_replicator2x = default_makerbot_endcode, From 5a56780f8975a2524bbb8f798579d13b4286f90c Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 12 Feb 2014 17:58:34 +0100 Subject: [PATCH 24/24] Release notes and version update --- ReleaseNotes.md | 9 +++++++++ src/FIRMWARE-VERSION | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 2e28f65..f1fdff3 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,12 @@ +# 0.10.1 (12th feb 2014) +- miniFactory support +- Fixed most Makerbot display issues +- Allowing wifi channels 12 and 13 +- Allow floats for retraction amount setting +- Also preheating reconnected printer +- Fixed network interface issues +- added easter-eggs + # 0.10.0 (20th jan 2014) - WordArt - Adding basic shapes diff --git a/src/FIRMWARE-VERSION b/src/FIRMWARE-VERSION index 78bc1ab..5712157 100644 --- a/src/FIRMWARE-VERSION +++ b/src/FIRMWARE-VERSION @@ -1 +1 @@ -0.10.0 +0.10.1