<%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth Copyright 2008-2009 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: upgrade.htm 5458 2009-10-31 20:03:27Z jow $ -%> <%- local w = require "luci.tools.webadmin" local success, err = "" local version = 0 local firmwares = {} local node_status = {} success, err = pcall(require, 'FWDistribution') if success then success, err = pcall(FWDistribution.version) if success then version = err if luci.http.formvalue("control") == "status" then success, err = pcall(FWDistribution.status) if success then luci.http.prepare_content("application/json") local info = { node_status= err} luci.http.write_json(info) return end else success, err = pcall(FWDistribution.available) if success then firmwares = err end end end else if luci.http.formvalue("control") == "status" then luci.http.prepare_content("application/json") luci.http.write_json({}) return end end function backticks_table(cmd) local tab = {} local pipe = assert(io.popen(cmd), "backticks_table(" .. cmd .. ") failed.") local line = pipe:read("*line") while line do table.insert(tab, line) line = pipe:read("*line") end return tab end if not (luci.http.formvalue("control") == "status") then -- Get list of available coordinators from avahi coordinators = backticks_table("avahi-browse -r -p -t _jip._udp | awk ' BEGIN { FS = \";\" } ;/=/ { print $8 }' -") end -%> <%+header%> <%- selected_tab = luci.http.formvalue("tab.FW") %> <%- if not selected_tab then selected_tab = "tab.FW.Files" end %>

Firmware Tools

Tools to distribute firmware to nodes in a JenNet-IP network
Firmware Distribution Tools
  • Files
  • Start
  • Status
  • Reset
>
Add new firmware

Upload a new firmware image for distribution to the JenNet-IP wireless network.


<%:Firmware image%>:

>
Start Distribution

Start distribution of a firmware image to nodes in the JenNet-IP wireless network

Firmware Available to Download <% for _,value in pairs(firmwares) do%> <% end %>
FilenameDeviceIDChip TypeRevisionDistribute
<%write(value.Filename)%> <%write(string.format("0x%08x", value.DeviceID))%> <%write(string.format("0x%04x", value.ChipType))%> <%write(string.format("0x%04x", value.Revision))%> class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"/>

help IPv6 address of network coordinator that should download the image.

help Select this to make the firmware available to nodes in the network, but not actually start a pushed distribution. This is primarily useful for end devices that must pull a firmware image.

help Use this control to vary the speed of broadcast of an image to the network. The default is 1 second between blocks, which is ok for small networks but should be increased for larger networks.

help Nodes should reset automatically once whole image has successfully downloaded.

>
Distribution Status
<%:Coordinator%> <%:Device ID%> <%:MAC Address%> <%:Progress%>

There are no active downloads.
>
Reset Nodes

Reset devices within the JenNet-IP wireless network

Required Parameters

help All devices matching this 32bit device ID will be requested to reset. 0xFFFFFFFF can be used to specify all device IDs.

help IPv6 address of network coordinator that should send the reset request.
Optional Reset Control

help Number of milliseconds that the device should wait before resetting.

help How much extra device deeper in the network should wait before resetting (Number of milliseconds per layer in the tree).

help How many times the request to reset should be repeated.

help How many milliseconds to wait between each repeat of the request.
<% if (Status) then %>
Status <%=Status%>
<% end %>

<%:Firmware distribution daemon version%> <%=version%> <%+footer%>