Merge branch 'develop'

This commit is contained in:
peteruithoven 2015-06-17 14:28:25 +02:00
commit 09a6c6a928
10 changed files with 135 additions and 82 deletions

View File

@ -1,5 +1,38 @@
Changelog
# 0.10.6 (17 jun 2015)
# 0.10.6-rc3 (17 jun 2015)
# 0.10.6-rc2 (16 jun 2015)
# 0.10.6-rc1 (16 jun 2015)
This release sees several connectivity bugs resolved as we continue to look to
create the most stable experience we can offer for Doodle3D users. A new
addition that has been realized in that the filament thickness is now
printer dependent. This is important for printers that use 1,75mm filament.
When changing the printer type it switches automatically. Please contact us for
better filament thickness defaults. For more details please review the notes below:
General:
- Updated OpenWRT (the operating system) to 14.07.
- Fixed several big issues around connecting to printers.
- Big files for Marlin based printers are processed faster.
- Target temperature retrieval is improved.
- Changed the Accesspoint's settings to the default because of startup issues (country: NL to US, channel: 11 to 1).
- Improved 404 page.
Additions
- Filament thickness is now printer type dependent and automatically change when selecting a printer. (Please contact us for better filament thickness defaults.)
Support for more 3D printers:
- DoodleDream
- 3Dison
- LulzBot TAZ 4
- Wanhao Duplicator 4
- Ultimaker 2 Go
Improvements for Makerbot based printers (like the Wanhao printer):
- Prevent that the nozzle bumps into the bed when starting a new print.
- Prevent that the nozzle moves though a print after printing.
# 0.10.5-a (2 Feb 2015)
- Removed gray lines where printer needs to 'travel' (move without printing)
- Enabled traveling also for first couple of layers. This prevents straight lines crossing your print

View File

@ -13,6 +13,7 @@
-- setenv LUA_CPATH /opt/local/share/luarocks/lib/lua/5.2/?.so
-- setenv LUA_PATH /opt/local/share/luarocks/share/lua/5.2/?.lua
-- Reboot
-- Also see: https://github.com/keplerproject/luarocks/wiki/Using-LuaRocks#rocks-trees-and-the-lua-libraries-path
--
-- This script will automatically locate the Doodle3D repo's.
-- Index files are fetched from the online repository.
@ -66,8 +67,11 @@ end
pl = pl()
local um --- update manager module, will be loaded later through @{loadUpdateManager}
local lfs = require('lfs') -- assume this exists since it's required by penlight as well
local ok, lfs = pcall(require, 'lfs')
if not ok then
ERR('This script requires the LuaFileSystem library')
os.exit(2)
end
-----------------------------
-- CONSTANTS AND VARIABLES --
@ -148,13 +152,17 @@ local function findInFile(needle, file)
return not not t:find(needle, 1, true)
end
local function detectOpenWrtRoot()
local f = io.open('Makefile', 'r')
local line = f and f:read('*line')
local rv = (line and line:find('# Makefile for OpenWrt') == 1) and true or false
local function fileExists(path)
local attr = lfs.attributes (path)
return attr ~= nil
end
if f then f:close() end
return rv
local function detectBuildroot()
if not fileExists("customfeeds") or not fileExists("bin") then
return false
else
return true
end
end
-- returns uri (file path) of the wifibox feed, nil if not found or nil+msg on error
@ -244,24 +252,15 @@ end
local function prepare()
local msg = nil
io.write("* Checking if working directory is the OpenWrt root... ")
local isOpenWrtRoot = detectOpenWrtRoot()
if isOpenWrtRoot then
paths.wrt = pl.path.currentdir()
print("found " .. paths.wrt)
else
print("unrecognized directory, try changing directories or using -wrt-root")
return nil
end
io.write("* Looking for Doodle3D feed path... ")
local d3dFeed,msg = getWifiboxFeedRoot('feeds.conf')
if d3dFeed then
print("found " .. d3dFeed)
else
if msg then print("not found: " .. msg) else print("not found.") end
return nil
end
-- local d3dFeed,msg = getWifiboxFeedRoot('feeds.conf')
-- if d3dFeed then
-- print("found " .. d3dFeed)
-- else
-- if msg then print("not found: " .. msg) else print("not found.") end
-- return nil
-- end
local d3dFeed = "customfeeds"
paths.firmware = pl.path.join(d3dFeed, D3D_REPO_FIRMWARE_NAME)
paths.client = pl.path.join(d3dFeed, D3D_REPO_CLIENT_NAME)
@ -315,8 +314,8 @@ local function collectLocalInfo()
local info = {}
-- temporary fields required for copying image files
info.factoryImgPath = pl.path.join(paths.wrt, 'bin/ar71xx/openwrt-ar71xx-generic-' .. deviceType .. '-v1-squashfs-factory.bin')
info.sysupgradeImgPath = pl.path.join(paths.wrt, 'bin/ar71xx/openwrt-ar71xx-generic-' .. deviceType .. '-v1-squashfs-sysupgrade.bin')
info.factoryImgPath = pl.path.join(paths.root, 'bin/ar71xx/openwrt-ar71xx-generic-' .. deviceType .. '-v1-squashfs-factory.bin')
info.sysupgradeImgPath = pl.path.join(paths.root, 'bin/ar71xx/openwrt-ar71xx-generic-' .. deviceType .. '-v1-squashfs-sysupgrade.bin')
info.version = um.parseVersion(pl.file.read(pl.path.join(paths.firmware, 'src/FIRMWARE-VERSION')))
if not info.version then return nil,"could not determine current firmware version" end
@ -410,7 +409,7 @@ end
-- TODO: the packages are not really used and the openwrt script to generate the
-- package index requires all packages to be present so this has been skipped for now
local function buildFeedDir()
local scriptPath = pl.path.join(paths.wrt, 'scripts/ipkg-make-index.sh')
local scriptPath = pl.path.join(paths.root, 'scripts/ipkg-make-index.sh')
return nil
end
@ -424,26 +423,6 @@ local function uploadFiles()
return rv and true or nil,("rsync failed, exit status: " .. ev)
end
local function checkWrtConfig()
local goodConfigPath = pl.path.join(paths.firmware, "extra/openwrt-build/openwrt-diffconfig-extramini")
local wrtConfigPath = pl.path.tmpname()
--print("diffonfig output file: " .. wrtConfigPath)
local rv,ev = pl.utils.execute('./scripts/diffconfig.sh > "' .. wrtConfigPath .. '" 2> /dev/null')
if not rv then return nil,"could not run diffconfig script (exit status: " .. ev .. ")" end
local _,rv,output = pl.utils.executeex('diff "' .. wrtConfigPath .. '" "' .. goodConfigPath .. '"')
if rv == 0 then
return true
elseif rv == 1 then
print("configurations differ:\n-----------------------\n" .. output .. "\n-----------------------")
--ask for confirmation?
else
return nil,"unexpected exit status from diff (" .. rv .. ")"
end
end
local function main()
print("\nDoodle3D release script")
if detectRootPrivileges() then
@ -457,6 +436,16 @@ local function main()
-- if opts['cache-dir'] then paths.cache = opts['cache-dir'] end
-- more options: clear cache, rebuild (download all and generate index from actual files), dry-run, force
io.write("* Checking if working directory is the Buildroot... ")
local isBuildroot = detectBuildroot()
if isBuildroot then
paths.root = pl.path.currentdir()
print("found " .. paths.root)
else
print("unrecognized directory, try changing directories or using -wrt-root")
return nil
end
if not prepare() then quit(1) end
@ -465,7 +454,7 @@ local function main()
print("Error: could not collect local version information (" .. msg .. ")")
quit(3)
end
local stables,betas = fetchVersionInfo()
if not stables then
print("Error: could not get version information (" .. betas .. ")")
@ -474,7 +463,6 @@ local function main()
--TODO: if requested, fetch images and packages (i.e., mirror whole directory)
-- pl.pretty.dump(newVersion)
-- print("stables: "); pl.pretty.dump(stables)
-- print("===========================");
@ -488,8 +476,6 @@ local function main()
return not (um.findVersion(newVersion.version, nil, stables) or um.findVersion(newVersion.version, nil, betas)) and true or nil
end)
runAction("Checking OpenWrt config", "failed", 3, checkWrtConfig)
--TODO: check git repos (`git log -n 1 --pretty=format:%ct` gives commit date of last commit (not author date))
local isStable = (newVersion.version.suffix == nil)
@ -516,8 +502,7 @@ local function main()
print("skipped - not implemented")
-- runAction("Building package feed directory", "failed", 5, buildFeedDir)
local answer = getYesNo("? Local updates cache will be synced to remote server, proceed? (y/n) ")
local answer = getYesNo("? Are you SURE you want to publish? (y/n) ")
if answer ~= true then
print("Did not get green light, quitting.")
quit(5)
@ -525,7 +510,7 @@ local function main()
runAction("About to sync files to server", "could not upload files", 6, uploadFiles)
print("Done.")
print("Released version " .. um.formatVersion(newVersion.version) .. "!")
quit()
end

View File

@ -79,7 +79,7 @@ $IPKG_INSTROOT/etc/init.d/dhcpcheck enable
if [ -z "$IPKG_INSTROOT" ]; then
echo "Enabling and configuring wifi device..."
uci set wireless.@wifi-device[0].disabled=0
uci set wireless.radio0.country='NL'
uci delete wireless.radio0.channel
uci commit wireless; wifi
echo "Disabling default route and DNS server for lan network interface..."
@ -104,7 +104,7 @@ else
uci set uhttpd.main.lua_prefix='/d3dapi'
uci set wireless.@wifi-device[0].disabled=0
uci set wireless.radio0.country='NL'
uci delete wireless.radio0.channel
# TODO: add firewall net
uci set network.wlan=interface

View File

@ -1 +1 @@
0.10.5-a
0.10.6

View File

@ -109,7 +109,9 @@ M.printer_dimensions_x = {
default_kossel = 0,
default_minifactory = 150,
default_lulzbot_taz_4 = 298,
default_ultimaker2go = 120,
default_doodle_dream = 120,
default_wanhao_duplicator4 = 210,
subSection = 'printer_type',
type = 'int',
description = '',
@ -123,7 +125,9 @@ M.printer_dimensions_y = {
default_kossel = 0,
default_minifactory = 150,
default_lulzbot_taz_4 = 275,
default_ultimaker2go = 120,
default_doodle_dream = 120,
default_wanhao_duplicator4 = 140,
subSection = 'printer_type',
type = 'int',
description = '',
@ -134,7 +138,9 @@ M.printer_dimensions_z = {
default_minifactory = 155,
default__3Dison_plus = 150,
default_lulzbot_taz_4 = 250,
default_ultimaker2go = 112,
default_doodle_dream = 80,
default_wanhao_duplicator4 = 140,
subSection = 'printer_type',
type = 'int',
description = '',
@ -146,21 +152,34 @@ M.printer_heatedbed = {
default_makerbot_replicator2x = true,
default_minifactory = true,
default_lulzbot_taz_4 = true,
default_wanhao_duplicator4 = true,
subSection = 'printer_type',
type = 'bool',
description = 'Printer has heated bed',
}
M.printer_filamentThickness = {
default = 2.89,
default_doodle_dream = 1.75,
default_wanhao_duplicator4 = 1.75,
type = 'float',
description = '',
min = 0.0,
subSection = 'printer_type'
}
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_makerbot_startcode = ';@printer {printerType}\nM136 (enable build)\nM73 P0 (Set build percentage to 0)\nG162 X Y F2000 (home XY axes to maximum)\nG161 Z F900 (home Z axis to minimum quick)\nG92 X0 Y0 Z0 A0 B0 (set axis positions to 0)\nG1 Z5.0 F900 (move Z axis down)\nG161 Z F100 (home Z axis to minimum more precise)\nG92 X0 Y0 Z0 A0 B0 (set axis positions to 0)\nG1 Z2.0 F900 (move Z axis to safety height)\nG1 X-264 Y-145 Z0 F3300.0 (move XY to start position)\nG92 X0 Y0 Z0 A0 B0 (set axis position to 0)\nG130 X20 Y20 A20 B20 (Lower stepper Vrefs while heating)\n{if heatedBed}M140 S{printingBedTemp} T0 (Set bed temp)\nM135 T0 (use first extruder)\nM104 S{printingTemp} T0 (set extruder temp)\nM133 T0 (Wait for extruder)\nG130 X127 Y127 A127 B127 (Set Stepper motor Vref to defaults)\nG1 F100 A10 (extrude 10mm)\nG92 A0 (reset extruder)\nG0 Z20 (move up, to lose filament)'
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)'
local default_ultimaker2_startcode = ';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'
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 \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_ultimaker2 = default_ultimaker2_startcode,
default_ultimaker2go = default_ultimaker2_startcode,
default__3Dison_plus = ';@printer {printerType}\nM136 (enable build)\nM73 P0\nG21\nG90\nM103\n;M109 S50 T0\nM140 S50 T0\nM104 S{printingTemp} T0\n;M134 T0\nM135 T0\nM104 S{printingTemp} T0\nG162 X Y F2000(home XY axes maximum)\nG161 Z F900(home Z axis minimum)\nG92 X113.5 Y74 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)\nG1 Z50 F3300\nG130 X20 Y20 A20 B20 (Lower stepper Vrefs while heating)\nM133 T0\nM6 T0\nG130 X127 Y127 A127 B127 (Set Stepper motor Vref to defaults)\nG0 Z0.2 F3000\nG1 Z0 F100 A10 ;extrude 10mm\nG92 X227 Y148 Z0 A0 ;reset again\nG1 X227 Y148 Z0',
default_makerbot_generic = default_makerbot_startcode,
default_makerbot_replicator2 = default_makerbot_startcode,
default_makerbot_replicator2x = default_makerbot_startcode,
default_makerbot_thingomatic = default_makerbot_startcode,
default_wanhao_duplicator4 = default_makerbot_startcode,
default_delta_rostockmax = default_deltabot_startcode,
default_deltamaker = default_deltabot_startcode,
default_kossel = default_deltabot_startcode,
@ -169,16 +188,19 @@ 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 )\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)\nG162 Z 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)'
local default_ultimaker2_endcode = '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)'
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}\n{if heatedBed}M140 S{preheatBedTemp}\nM117 Done ;display message (20 characters to clear whole screen)',
default_ultimaker2 = default_ultimaker2_endcode,
default_ultimaker2go = default_ultimaker2_endcode,
default__3Dison_plus = '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)\nM140 S35 T0\nM104 S180 T0\nM73 P100 (end build progress )\nM72 P1 ( Play Ta-Da song )\nM137 (build end notification)\n',
default_makerbot_generic = default_makerbot_endcode,
default_makerbot_replicator2 = default_makerbot_endcode,
default_makerbot_replicator2x = default_makerbot_endcode,
default_makerbot_thingomatic = default_makerbot_endcode,
default_wanhao_duplicator4 = default_makerbot_endcode,
default_delta_rostockmax = default_deltabot_endcode,
default_deltamaker = default_deltabot_endcode,
default_kossel = default_deltabot_endcode,
@ -239,14 +261,6 @@ M.printer_travelSpeed = {
min = 0
}
M.printer_filamentThickness = {
default = 2.89,
default_doodle_dream = 1.75,
type = 'float',
description = '',
min = 0.0
}
M.printer_useSubLayers = {
default = true,
type = 'bool',

View File

@ -48,18 +48,19 @@ local function setupAutoWifiMode()
local wifiState = wifi.getDeviceState()
local netName, netMode = wifiState.ssid, wifiState.mode
log:info("current wifi name: " .. (netName or "<nil>") .. ", mode: " .. netMode)
local apSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
local apMode = (apSsid == netName) and (netMode == 'ap')
log:info("ssid of self: " .. apSsid)
local scanList,msg = wifi.getScanInfo()
local knownSsids = wifi.getConfigs()
if not scanList then
return nil, "autowifi: could not scan wifi networks (" .. msg .. ")"
end
log:info("current wifi name: " .. (netName or "<nil>") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid)
local knownSsids = wifi.getConfigs()
-- log:info("current wifi name: " .. (netName or "<nil>") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid)
local visNet, knownNet = {}, {}
for _,sn in ipairs(scanList) do
table.insert(visNet, sn.ssid)
@ -72,6 +73,15 @@ local function setupAutoWifiMode()
-- if the currently active network is client mode and is also visible, do nothing since it will connect automatically further along the boot process
if netMode == 'sta' and netName ~= nil and netName ~= "" and findSsidInList(scanList, netName) then
-- signin to connect.doodle3d.com
local success, output = Signin.signin()
if success then
log:info("Signed in")
else
log:info("Signing in failed")
end
-- report we are connected after signin attempt
netconf.setStatus(netconf.CONNECTED,"Connected");
return true, "autowifi: no action - existing configuration found for currently wifi visible network (" .. netName .. ")"
end
@ -101,6 +111,7 @@ local function setupAutoWifiMode()
return nil, "autowifi: failed to configure as access point with ssid '" .. apSsid .. "' (" .. msg .. ")"
end
else
netconf.setStatus(netconf.CREATED,"Access point created");
return true, "autowifi: no action - no known networks found, already in access point mode"
end

View File

@ -25,14 +25,14 @@ local deviceName, deviceApi
local cachedApSsid, baseApSsid = nil, nil
function M.getSubstitutedSsid(unformattedSsid)
log:debug("getSubstitutedSsid unformattedSsid:'" .. (unformattedSsid or "nil") .. "' baseApSsid:'" .. (baseApSsid or "nil") .. "' cachedApSsid:'" .. (cachedApSsid or "nil"))
if unformattedSsid == baseApSsid and cachedApSsid ~= nil then return cachedApSsid end
if not unformattedSsid or type(unformattedSsid) ~= 'string' then return nil end
local macTail = M.getMacAddress():sub(7)
log:debug(" macTail:'" .. macTail)
baseApSsid = unformattedSsid
cachedApSsid = unformattedSsid:gsub('%%%%MAC_ADDR_TAIL%%%%', macTail)
return cachedApSsid
end
@ -107,7 +107,9 @@ end
--returns the wireless device's MAC address (as string, without colons)
--(lua numbers on openWrt seem to be 32bit so they cannot represent a MAC address as one number)
function M.getMacAddress()
log:debug("getMacAddress")
local macText = utils.readFile('/sys/class/net/' .. deviceName .. '/address')
log:debug(" macText: '" .. (macText or "nil") .. "'")
local out = ''
-- Hack to prevent failure in case the MAC address could not be obtained.
@ -137,9 +139,10 @@ end
-- @param ssid return data for given SSID or for all networks if SSID not given
-- @return data for all or requested network; false+error on failure or nil when requested network not found
function M.getScanInfo(ssid)
local iw = iwinfo[deviceApi]
log:info("start wifi scan")
local sr = iw.scanlist(deviceName)
log:info("wifi scan done")
local si, se
if ssid == nil then

View File

@ -12,7 +12,7 @@ START=61
LOGGER="logger -t autowifi -p 6"
boot() {
sleep 1
sleep 5
$LOGGER "Invoking Doodle3D WiFi box network auto-initialization..."
/usr/share/lua/wifibox/script/d3dapi autowifi

View File

@ -13,10 +13,12 @@ local printDriver = require('print3d')
local SUPPORTED_PRINTERS = {
rigidbot = "Rigidbot",
ultimaker = "Ultimaker",
ultimaker2 = "Ultimaker2",
ultimaker2 = "Ultimaker 2",
ultimaker2go = "Ultimaker 2 Go",
makerbot_replicator2 = "MakerBot Replicator2",
makerbot_replicator2x = "MakerBot Replicator2x",
makerbot_thingomatic = "MakerBot Thing-o-matic",
wanhao_duplicator4 = "Wanhao Duplicator 4",
printrbot = "Printrbot",
bukobot = "Bukobot",
cartesio = "Cartesio",
@ -51,7 +53,7 @@ local SUPPORTED_PRINTERS = {
mamba3d = "Mamba3D",
_3Dison_plus = "3Dison plus",
marlin_generic = "Generic Marlin Printer",
makerbot_generic = "Generic Makerbot Printer",
makerbot_generic = "Generic Makerbot Printer",
doodle_dream = "Doodle Dream"
}
local SUPPORTED_BAUDRATES = {

View File

@ -161,22 +161,27 @@ end]]--
function M.get(key)
--log:info("settings:get: "..utils.dump(key))
key = replaceDots(key)
-- retrieve settings's base settings from conf_defaults.lua
local base = getBaseKeyTable(key)
if not base then return nil,ERR_NO_SUCH_KEY end
-- check which uci section to read.
-- By default it will read from the general section, but if a base setting contains a subSection it will check that subSection
local section = UCI_CONFIG_SECTION;
if base.subSection ~= nil then
section = M.get(base.subSection)
end
-- get setting from uci
local uciV,msg = uci:get(UCI_CONFIG_NAME, section, key)
if not uciV and msg ~= nil then
local errorMSG = "Issue reading setting '"..utils.dump(key).."': "..utils.dump(msg);
log:info(errorMSG)
return nil, errorMSG;
end
-- convert uci value into proper lua value
local uciV = fromUciValue(uciV, base.type)
if uciV ~= nil then
-- returning value from uci