diff --git a/.DS_Store b/.DS_Store index 9443e3b..e37ed2d 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/CommonResources b/CommonResources index 0e47972..43ec411 100755 --- a/CommonResources +++ b/CommonResources @@ -1,5 +1,5 @@ # CommonResources for SetupHelper -# contains a functions and variables necessare for a setup script to interface with reinstallMods +# contains a functions and variables necessary for a setup script to interface with reinstallMods # # Refer to the SetupHelper ReadMe file for details on how to use these resources. @@ -10,7 +10,7 @@ source "$setupHelperDir/EssentialResources" source "$setupHelperDir/LogHandler" source "$setupHelperDir/ServiceResources" source "$setupHelperDir/UpdateResources" -reinstallParam="reinstall" +source "$setupHelperDir/DbusSettingsResources" # what action the script should take: # NONE - do noting - signals script to prompt for user input on how to proceed @@ -36,6 +36,8 @@ runAgain=false filesUpdated=false restartGui=false + + # yesNoPrompt provides user prompting requesting a yes/no response # # $1 is the prompt displayed when pausing for user input @@ -264,44 +266,6 @@ restoreActiveFile () fi } -# sets a dbus setting -# $1 is new value -# $2 is the dbus path - -setSetting () -{ - local newValue=$1 - local dbusPath=$2 - if [ ! -z $newValue ]; then - dbus -y com.victronenergy.settings $dbusPath SetValue $newValue &> /dev/null - fi -} - -# move a setting from setup options or from previous dbus Setting -# $1 is the setup options path -# $2 is the old dbus path -# $3 is the new dbus path -# dbus paths start with /Settings -# if specified, the setup option file must include a value -# that value has priority over the old dbus parameter - -moveSetting () -{ - local setupOption="$1" - local oldDbusPath=$2 - local newDbusPath=$3 - if [ -f "$setupOption" ]; then - oldSetting=$(cat "$setupOption") - elif [ ! -z "$oldDbusPath" ]; then - oldSetting=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings\ - $oldDbusPath com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $3}') - else - oldSetting="" - fi - if [ ! -z $oldSetting ] && [ ! -z "$newDbusPath" ]; then - dbus -y com.victronenergy.settings $newDbusPath SetValue $oldSetting &> /dev/null - fi -} # checkFileSets validates the file sets used install package modifications # @@ -455,7 +419,6 @@ endScript () logMessage "adding $shortScriptName" to $(basename "$reinstallScriptsList") echo "$fullScriptName" "$reinstallParam" >> "$reinstallScriptsList" fi - if [ ! -f "$rcLocal" ]; then logMessage "creating $rcLocal" cat "$setupHelperDir/rcS.local" > "$rcLocal" @@ -463,6 +426,10 @@ endScript () elif [ $(grep -c "SetupHelper" "$rcLocal") == 0 ]; then logMessage "adding SetupHelper reinstall script to $rcLocal" sed -e '1d' "$setupHelperDir/rcS.local" >> $rcLocal + # update reinstall call to nohup background + elif [ $(grep -c "nohup /data/SetupHelper" "$rcLocal") == 0 ]; then + logMessage "updating SetupHelper reinstall script in $rcLocal" + sed -i -e 's?/data/SetupHelper?nohup /data/SetupHelper?' -e 's?reinstallMods?reinstallMods > /dev/null \&?' "$rcLocal" fi # installed flag is removed if script needs to run again @@ -474,6 +441,24 @@ endScript () touch "$installedFlag" fi + # add package to packageList if not already there and the GitHub paths have been specified + if [ ! -z $packageGitHubUser ] && [ ! -z $packageGitHubBranch ]; then + # move from previous locaiton + oldPackageListFile="$setupOptionsRoot/SetupHelper/packageList" + if [ -f "$oldPackageListFile" ]; then + mv "$oldPackageListFile" "$packageListFile" + fi + + if [ ! -f "$packageListFile" ] || [ $(grep -c "$packageName\s" "$packageListFile") == 0 ]; then + logMessage "adding $packageName to SetupHelper package list" + echo "$packageName $packageGitHubUser $packageGitHubBranch" >> "$packageListFile" + fi + fi + + # update package version for the gui - takes time so do in background + nohup "/data/SetupHelper/updatePackageVersions" > /dev/null & + + elif [ $scriptAction == 'UNINSTALL' ] ; then # remove this script from reinstallScriptsList to prevent further calls during boot if [ -f "$reinstallScriptsList" ] && [ ! $(grep -c "$fullScriptName" "$reinstallScriptsList") == 0 ]; then @@ -484,41 +469,11 @@ endScript () # clean up only - flag not used since package is being removed rm -f "$installedFlag" + + # update package version for the gui - takes time so do in background + nohup "/data/SetupHelper/updatePackageVersions" > /dev/null & fi - # create/update dbus version setting - # do only if not running as a boot-time reinstall - # dbus services won't be up if running from rcS.local - if $force || ! $reinstall ; then - if [ $scriptAction == 'INSTALL' ] ; then - # create the version setting if it doesn't exist yet - packageVersion=$(dbus-send --system --print-reply=literal\ - --dest=com.victronenergy.settings /Settings/GuiMods/PackageVersions/$packageName\ - com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $2}') - if [ -z $packageVersion ]; then - logMessage "creating $packageName version Setting" - dbus -y com.victronenergy.settings /Settings AddSettings\ - "%[ {\"path\":\"/GuiMods/PackageVersions/$packageName\", \"default\":\"unknown\"} ]" &> /dev/null - fi - fi - if [ -f "$scriptDir/version" ]; then - packageVersion=$(cat "$scriptDir/version") - # if no version, use package timestamp instead - elif [ -f "$scriptDir/timeStamp" ]; then - timeStamp=$(cat "$scriptDir/timeStamp") - packageVersion=$(date --date=@$timeStamp) - else - packageVersion="unknown" - fi - # flag verison not installed - if [ $scriptAction == 'UNINSTALL' ] ; then - packageVersion="(not installed) $packageVersion" - fi - # update version Setting - will fail silently if dbus setting doesn't exist - dbus -y com.victronenergy.settings /Settings/GuiMods/PackageVersions/$packageName SetValue "$packageVersion" &> /dev/null - fi - - # this script was called from reinstallMods # set exit code based on actual code if $runningAtBoot ; then diff --git a/DbusSettingsResources b/DbusSettingsResources new file mode 100755 index 0000000..29339bd --- /dev/null +++ b/DbusSettingsResources @@ -0,0 +1,111 @@ +# DbusSettingsResources for SetupHelper +# +# contains a functions and variables necessary to access dbus Settings parameters +# it should be sourced by scripts setting, creating and removing dbus settings +# +# dbus Settings is not operational during system boot when some setup scripts may +# need to make settings changes +# These functions check to see if the settings system is operational and defer +# the set/create/remove activity so the calling script may continue + +source "/data/SetupHelper/EssentialResources" +source "/data/SetupHelper/LogHandler" + +# dbus Settings funcitons +# These functions encapsulate an interface to dbus Settings +# NOTE: dbus Settings resources are not always active when it is necessary for +# scripts to make changes or create/remove settings +# it is up to the caller to insure dbus Settings resources are active before callling +# these functions +# a dbus exeption error will be logged if settings are not active yet + + +# updateDbusStringSetting updates a dbus setting STRING parameter with a new value +# if the setting does not exist, it is created +# +# functions for other data types have not been included but could be added +# the determining factor is the values supplied for default, max and min values +# as they determine the underlying data type for the setting +# +# $1 is the path to the setting starting with /Settings +# $2 is the new value +# +# if the setting does not yet exist, it is created, then updated to the new value + +updateDbusStringSetting () +{ + local oldValue + + oldValue=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings "$1"\ + com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $2}') + if [ -z $oldValue ]; then + logMessage "creating dbus Setting $1" + dbus -y com.victronenergy.settings / AddSettings "%[ {\"path\":\"$1\", \"default\":\"\"} ]" &> /dev/null + fi + + dbus -y com.victronenergy.settings "$1" SetValue "$2" &> /dev/null +} + + +updateDbusIntSetting () +{ + local oldValue + + oldValue=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings "$1"\ + com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $2}') + if [ -z $oldValue ]; then + logMessage "creating dbus Setting $1" + dbus -y com.victronenergy.settings / AddSettings "%[ {\"path\":\"$1\", \"default\":0} ]" &> /dev/null + fi + + dbus -y com.victronenergy.settings "$1" SetValue "$2" &> /dev/null +} + + +# removeDbusSetting removes the setting from dbus Settings +# +# $1 is the path to the setting to be removed starting with /Settings + +removeDbusSetting () +{ + logMessage "removing dbus Setting $1" + dbus -y com.victronenergy.settings / RemoveSettings "%[\"$1\" ]" &> /dev/null +} + + +# setSetting updates the dbus setting parameter +# the setting must already exist or the update will fail +# +# $1 is the new value +# $2 is the setting path + +setSetting () +{ + dbus -y com.victronenergy.settings $2 SetValue $1 &> /dev/null +} + +# move a setting from setup options or from previous dbus Setting +# $1 is the setup options path +# $2 is the old dbus path +# $3 is the new dbus path +# dbus paths start with /Settings +# if specified, the setup option file must include a value +# that value has priority over the old dbus parameter + +moveSetting () +{ + local setupOption="$1" + local oldDbusPath=$2 + local newDbusPath=$3 + if [ -f "$setupOption" ]; then + oldSetting=$(cat "$setupOption") + elif [ ! -z "$oldDbusPath" ]; then + oldSetting=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings\ + $oldDbusPath com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $3}') + else + oldSetting="" + fi + if [ ! -z $oldSetting ] && [ ! -z "$newDbusPath" ]; then + dbus -y com.victronenergy.settings $newDbusPath SetValue $oldSetting &> /dev/null + fi +} diff --git a/EssentialResources b/EssentialResources index 53650c9..70e7c22 100755 --- a/EssentialResources +++ b/EssentialResources @@ -20,10 +20,6 @@ reinstallScriptsList="/data/reinstallScriptsList" pkgFileSets="$scriptDir/FileSets" fileSet="$pkgFileSets/$venusVersion" -# GitHub account -gitHubUser="kwindrem" -gitHubBranch="current" - # rc local file that calls reinstallMods # use /data/rc.local if some scripts need resources not available at time rcS.local runs rcLocal="/data/rcS.local" @@ -32,7 +28,15 @@ rcLocal="/data/rcS.local" exitReboot=123 exitSuccess=0 +reinstallParam="reinstall" + # directory that holds script's options # options were removed from the script directory so they are preserved when the package is reinstalled setupOptionsRoot="/data/setupOptions" setupOptionsDir="$setupOptionsRoot"/$packageName + +# packages managed by SetupHelper +packageListFile="/data/packageList" + +qmlDir=/opt/victronenergy/gui/qml + diff --git a/FileSets/MbDisplayPackageVersion.qml b/FileSets/MbDisplayPackageVersion.qml new file mode 100644 index 0000000..14a11a2 --- /dev/null +++ b/FileSets/MbDisplayPackageVersion.qml @@ -0,0 +1,26 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import "utils.js" as Utils + +MbItem { + id: root +///////////// height: 30 + + property int versionIndex + property string bindPrefix + + function getBind(param) + { + return Utils.path(bindPrefix, "/", versionIndex, "/", param) + } + + VBusItem { id: packageName; bind: getBind ("PackageName") } + VBusItem { id: packageVersion; bind: getBind ("PackageVersion") } + + MbItemValue + { + description: packageName.valid ? packageName.value : "" + item.bind: getBind ("PackageVersion") + show: item.valid && packageName.valid + } +} diff --git a/FileSets/PageSettingsPackageControl.qml b/FileSets/PageSettingsPackageControl.qml new file mode 100644 index 0000000..e1c29c4 --- /dev/null +++ b/FileSets/PageSettingsPackageControl.qml @@ -0,0 +1,43 @@ +/////// new menu for package version display + +import QtQuick 1.1 +import "utils.js" as Utils +import com.victron.velib 1.0 + +MbPage { + id: root + title: qsTr("Package Versions") + property string bindPrefix: "com.victronenergy.settings/Settings/GuiMods" + VBusItem { id: checkingPackageItem; bind: Utils.path(bindPrefix, "/CheckingPackage") } + property string checkingPackage: checkingPackageItem.valid ? checkingPackageItem.value : "" + + model: VisualItemModel + { + MbSubMenu + { + description: qsTr("Package Version List") + subpage: Component { PageSettingsPackageVersions {} } + } + MbItemOptions + { + id: autoUpdate + description: qsTr ("Automatic Git Hub updates") + bind: Utils.path (bindPrefix, "/GitHubAutoUpdate") + possibleValues: + [ + MbOption { description: "Normal"; value: 1 }, + MbOption { description: "Fast one pass then Normal"; value: 2 }, + MbOption { description: "Check packages once (Fast)"; value: 3 }, + MbOption { description: "Disabled"; value: 0 } + ] + writeAccessLevel: User.AccessUser + } + MbItemText + { + text: checkingPackage + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignHCenter + show: checkingPackage != "" + } + } +} diff --git a/FileSets/PageSettingsPackageVersions.qml b/FileSets/PageSettingsPackageVersions.qml new file mode 100644 index 0000000..01b4b8a --- /dev/null +++ b/FileSets/PageSettingsPackageVersions.qml @@ -0,0 +1,22 @@ +/////// new menu for package version display + +import QtQuick 1.1 +import "utils.js" as Utils +import com.victron.velib 1.0 + +MbPage { + id: root + title: qsTr("Package Version List") + property string bindPrefix: "com.victronenergy.settings/Settings/PackageVersion" + property VBusItem count: VBusItem { bind: Utils.path(bindPrefix, "/Count") } + + model: count.valid ? count.value : 0 + delegate: Component + { + MbDisplayPackageVersion + { + bindPrefix: root.bindPrefix + versionIndex: index + } + } +} diff --git a/FileSets/fileList b/FileSets/fileList new file mode 100644 index 0000000..6d55f03 --- /dev/null +++ b/FileSets/fileList @@ -0,0 +1 @@ +/opt/victronenergy/gui/qml/PageSettings.qml diff --git a/FileSets/v2.42/PageSettings.qml b/FileSets/v2.42/PageSettings.qml new file mode 100644 index 0000000..5c5a575 --- /dev/null +++ b/FileSets/v2.42/PageSettings.qml @@ -0,0 +1,185 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp {} } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGps {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + // TODO: Find a better way to check if + // analog inputs are available on the device + property VBusItem analogIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/AnalogInput/Resistive/1/Function") + } + property VBusItem digitalIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/DigitalInput/1/Type") + } + description: qsTr("I/O") + subpage: Component { PageSettingsIo {} } + show: analogIoSettings.valid || digitalIoSettings.valid + } + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + show: user.accessLevel >= User.AccessService + } + } +} diff --git a/FileSets/v2.42/PageSettings.qml.orig b/FileSets/v2.42/PageSettings.qml.orig new file mode 100644 index 0000000..90d4b40 --- /dev/null +++ b/FileSets/v2.42/PageSettings.qml.orig @@ -0,0 +1,177 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp {} } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGps {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + // TODO: Find a better way to check if + // analog inputs are available on the device + property VBusItem analogIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/AnalogInput/Resistive/1/Function") + } + property VBusItem digitalIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/DigitalInput/1/Type") + } + description: qsTr("I/O") + subpage: Component { PageSettingsIo {} } + show: analogIoSettings.valid || digitalIoSettings.valid + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + show: user.accessLevel >= User.AccessService + } + } +} diff --git a/FileSets/v2.58/PageSettings.qml b/FileSets/v2.58/PageSettings.qml new file mode 100644 index 0000000..ddf5b63 --- /dev/null +++ b/FileSets/v2.58/PageSettings.qml @@ -0,0 +1,192 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGps {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + // TODO: Find a better way to check if + // analog inputs are available on the device + property VBusItem analogIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/AnalogInput/Resistive/1/Function") + } + property VBusItem digitalIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/DigitalInput/1/Type") + } + description: qsTr("I/O") + subpage: Component { PageSettingsIo {} } + show: analogIoSettings.valid || digitalIoSettings.valid + } + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + show: user.accessLevel >= User.AccessService + } + } +} diff --git a/FileSets/v2.58/PageSettings.qml.orig b/FileSets/v2.58/PageSettings.qml.orig new file mode 100644 index 0000000..44d16e1 --- /dev/null +++ b/FileSets/v2.58/PageSettings.qml.orig @@ -0,0 +1,184 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGps {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + // TODO: Find a better way to check if + // analog inputs are available on the device + property VBusItem analogIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/AnalogInput/Resistive/1/Function") + } + property VBusItem digitalIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/DigitalInput/1/Type") + } + description: qsTr("I/O") + subpage: Component { PageSettingsIo {} } + show: analogIoSettings.valid || digitalIoSettings.valid + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + show: user.accessLevel >= User.AccessService + } + } +} diff --git a/FileSets/v2.66/PageSettings.qml b/FileSets/v2.66/PageSettings.qml new file mode 100644 index 0000000..1541327 --- /dev/null +++ b/FileSets/v2.66/PageSettings.qml @@ -0,0 +1,197 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + // TODO: Find a better way to check if + // analog inputs are available on the device + property VBusItem analogIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/AnalogInput/Resistive/1/Function2") + } + property VBusItem digitalIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/DigitalInput/1/Type") + } + description: qsTr("I/O") + subpage: Component { PageSettingsIo {} } + show: analogIoSettings.valid || digitalIoSettings.valid + } + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + show: user.accessLevel >= User.AccessService + } + } +} diff --git a/FileSets/v2.66/PageSettings.qml.orig b/FileSets/v2.66/PageSettings.qml.orig new file mode 100644 index 0000000..01e4ebc --- /dev/null +++ b/FileSets/v2.66/PageSettings.qml.orig @@ -0,0 +1,189 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + // TODO: Find a better way to check if + // analog inputs are available on the device + property VBusItem analogIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/AnalogInput/Resistive/1/Function2") + } + property VBusItem digitalIoSettings: VBusItem { + bind: Utils.path(bindPrefix, + "/Settings/DigitalInput/1/Type") + } + description: qsTr("I/O") + subpage: Component { PageSettingsIo {} } + show: analogIoSettings.valid || digitalIoSettings.valid + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + show: user.accessLevel >= User.AccessService + } + } +} diff --git a/FileSets/v2.73/PageSettings.qml b/FileSets/v2.73/PageSettings.qml new file mode 100644 index 0000000..328b74a --- /dev/null +++ b/FileSets/v2.73/PageSettings.qml @@ -0,0 +1,188 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.numAnalogDevices || ioSettings.numDigitalDevices + PageSettingsIo { id: ioSettings } + } + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.73/PageSettings.qml.orig b/FileSets/v2.73/PageSettings.qml.orig new file mode 100644 index 0000000..e2d1fcf --- /dev/null +++ b/FileSets/v2.73/PageSettings.qml.orig @@ -0,0 +1,180 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.numAnalogDevices || ioSettings.numDigitalDevices + PageSettingsIo { id: ioSettings } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~19/PageSettings.qml b/FileSets/v2.80~19/PageSettings.qml new file mode 100644 index 0000000..cf8519e --- /dev/null +++ b/FileSets/v2.80~19/PageSettings.qml @@ -0,0 +1,193 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.numAnalogDevices || ioSettings.numDigitalDevices + PageSettingsIo { id: ioSettings } + } + + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~19/PageSettings.qml.orig b/FileSets/v2.80~19/PageSettings.qml.orig new file mode 100644 index 0000000..bf242e2 --- /dev/null +++ b/FileSets/v2.80~19/PageSettings.qml.orig @@ -0,0 +1,185 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.numAnalogDevices || ioSettings.numDigitalDevices + PageSettingsIo { id: ioSettings } + } + + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~21/PageSettings.qml b/FileSets/v2.80~21/PageSettings.qml new file mode 100644 index 0000000..1e54cd1 --- /dev/null +++ b/FileSets/v2.80~21/PageSettings.qml @@ -0,0 +1,193 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.haveSubMenus + PageSettingsIo { id: ioSettings } + } + + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~21/PageSettings.qml.orig b/FileSets/v2.80~21/PageSettings.qml.orig new file mode 100644 index 0000000..37363e6 --- /dev/null +++ b/FileSets/v2.80~21/PageSettings.qml.orig @@ -0,0 +1,185 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.haveSubMenus + PageSettingsIo { id: ioSettings } + } + + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~24/PageSettings.qml b/FileSets/v2.80~24/PageSettings.qml new file mode 100644 index 0000000..855dae2 --- /dev/null +++ b/FileSets/v2.80~24/PageSettings.qml @@ -0,0 +1,195 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.haveSubMenus + PageSettingsIo { id: ioSettings } + } + + /* + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + */ + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~24/PageSettings.qml.orig b/FileSets/v2.80~24/PageSettings.qml.orig new file mode 100644 index 0000000..381b84c --- /dev/null +++ b/FileSets/v2.80~24/PageSettings.qml.orig @@ -0,0 +1,187 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.haveSubMenus + PageSettingsIo { id: ioSettings } + } + + /* + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + */ + + MbSubMenu { + description: qsTr("Debug") + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~26/PageSettings.qml b/FileSets/v2.80~26/PageSettings.qml new file mode 100644 index 0000000..d89e7d3 --- /dev/null +++ b/FileSets/v2.80~26/PageSettings.qml @@ -0,0 +1,195 @@ +//////// modified for package version and control +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.haveSubMenus + PageSettingsIo { id: ioSettings } + } + + /* + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + */ + +//////// added for package control and version display + MbSubMenu + { + description: qsTr("Package Versions") + subpage: Component { PageSettingsPackageControl {} } + } + + MbSubMenu { + description: "Debug" + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/FileSets/v2.80~26/PageSettings.qml.orig b/FileSets/v2.80~26/PageSettings.qml.orig new file mode 100644 index 0000000..1dfe8a7 --- /dev/null +++ b/FileSets/v2.80~26/PageSettings.qml.orig @@ -0,0 +1,187 @@ +import QtQuick 1.1 +import com.victron.velib 1.0 +import net.connman 0.1 +import "utils.js" as Utils + +MbPage { + title: qsTr("Settings") + property string bindPrefix: "com.victronenergy.settings" + property VBusItem relay0Item: VBusItem {bind: "com.victronenergy.system/Relay/0/State"} + property bool hasRelay0: relay0Item.valid + + model: VisualItemModel { + MbSubMenu { + id: generalItem + description: qsTr("General") + subpage: Component { + PageSettingsGeneral { + title: generalItem.description + } + } + } + + MbSubMenu { + description: qsTr("Firmware") + subpage: Component { + PageSettingsFirmware { + title: qsTr("Firmware") + } + } + } + + MbSubMenu { + description: qsTr("Date & Time") + subpage: Component { + PageTzInfo { + title: qsTr("Date & Time") + } + } + } + + MbSubMenu { + description: qsTr("Remote Console") + subpage: Component { PageSettingsRemoteConsole {} } + } + + MbSubMenu { + id: systemSetupItem + description: qsTr("System setup") + subpage: Component { + PageSettingsSystem { + title: systemSetupItem.description + } + } + } + + MbSubMenu { + id: dvcc + description: qsTr("DVCC") + subpage: Component { + PageSettingsDVCC { + title: dvcc.description + } + } + } + + MbSubMenu { + id: displayItem + description: qsTr("Display & language") + subpage: Component { + PageSettingsDisplay { + title: displayItem.description + } + } + } + + MbSubMenu { + id: vrmLoggerItem + description: qsTr("VRM online portal") + subpage: Component { + PageSettingsLogger { + title: vrmLoggerItem.description + } + } + } + + MbSubMenu { + VBusItem { + id: systemType + bind: "com.victronenergy.system/SystemType" + } + description: systemType.value === "Hub-4" ? systemType.value : qsTr("ESS") + subpage: Component { PageSettingsHub4 {} } + } + + MbSubMenu { + description: qsTr("Energy meters") + subpage: Component { PageSettingsCGwacsOverview {} } + } + + MbSubMenu { + description: qsTr("PV inverters") + subpage: Component { PageSettingsFronius {} } + } + + MbSubMenu { + show: App.withQwacs + description: qsTr("Wireless AC sensors") + subpage: Component { PageSettingsQwacs {} } + } + + MbSubMenu { + description: qsTr("Modbus TCP devices") + subpage: Component { PageSettingsModbus {} } + } + + MbSubMenu { + id: ethernetItem + description: qsTr("Ethernet") + subpage: Component { PageSettingsTcpIp { showLinkLocal: true } } + } + + MbSubMenu { + description: qsTr("Wi-Fi") + subpage: vePlatform.hasHostAccessPoint ? wifiWithAP : wifiWithoutAP + Component { id: wifiWithoutAP; PageSettingsWifi {} } + Component { id: wifiWithAP; PageSettingsWifiWithAccessPoint {} } + } + + MbSubMenu { + description: qsTr("GSM modem") + subpage: Component { PageSettingsGsm {} } + } + + MbSubMenu { + description: qsTr("Bluetooth") + subpage: Component { PageSettingsBluetooth {} } + show: Connman.technologyList.indexOf("bluetooth") !== -1 + } + + MbSubMenu { + description: qsTr("GPS") + subpage: Component { PageSettingsGpsList {} } + } + + MbSubMenu { + description: qsTr("Generator start/stop") + subpage: Component { PageRelayGenerator {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Tank pump") + subpage: Component { PageSettingsTankPump {} } + } + + MbSubMenu { + description: qsTr("Relay") + subpage: Component { PageSettingsRelay {} } + show: hasRelay0 + } + + MbSubMenu { + description: qsTr("Services") + subpage: Component { PageSettingsServices {} } + } + + MbSubMenu { + description: qsTr("I/O") + subpage: ioSettings + show: ioSettings.haveSubMenus + PageSettingsIo { id: ioSettings } + } + + /* + MbSubMenu { + description: qsTr("Backup & Restore") + subpage: Component { PageSettingsBackup {} } + } + */ + + MbSubMenu { + description: "Debug" + subpage: Component { PageDebug {} } + showAccessLevel: User.AccessService + } + } +} diff --git a/ReadMe b/ReadMe index c414a52..153d32e 100644 --- a/ReadMe +++ b/ReadMe @@ -1,23 +1,48 @@ +New: SetupHelper now includes an automatic install using SD/USB media + without the need for command line access + + The SetupHelper package provides: a set of utilities to simplfy installing modifications to Victron Venus Os a mechanism to automatically reinstall them following a Venus OS update an automatic update mechanism to keep packages up to date from GitHub archives or USB stick a manual package installation mechanism from GitHub archives or USB stick + an automatic install from SD/USB media NOTE: Starting with v2.80~10, the root partition is mounted read only This package and those that use these resources rely on a writable /root partition so CommonResources runs the remount-rw.sh script to make it writable Supported pacages are: - SetupHelper GeneratorConnector GuiMods RpiDisplaySetup RpiGpioSetup TankRepeater + SetupHelper GeneratorConnector GuiMods GuiMods2 RpiDisplaySetup RpiGpioSetup ShutdownManager TankRepeater More information is provided below. Setup: -There are two methods to fetch a package archive. +There are three methods to fetch a package archive. + +New: You can install SetupHelper and GuiMods2 without need of command line access + 1) Download venus-data.tgz from the GitHub repo + 2) copy it to the root of a freshly formatted SD card or USB memory stick + 3) place the media in the GX device (Cerbo, CCGX, etc) + 4) reboot the Gx device TWICE + after the second reboot, you should see the GUI restart and display + the enhanced flow overview from GuiMods2 + 5) remove the media from the GX device to prevent the next reboot from + starting the process all over again + + CAUTION: This mechanism overwrites /data/rcS.local !!!! + If you are using rcS.local to perform boot-time activities, + /data/rcS.local must be recreated following this "blind" install + Note that SetupHelper and GuiMods2 also use /data/rcS.local for + reinstallation following a firmware update so use caution in + recreating rcS.local. + + Note: this process is also used by the Victron reset to factory defaults + and the 123 BMS -IF the Venus device has internet access is to run the following command: +If the Venus device has internet access is to run the following command: wget -qO - https://github.com/kwindrem/SetupHelper/archive/current.tar.gz | tar -xzf - -C /data @@ -40,12 +65,13 @@ Finally, run the setup script to complete the installation Use the manual or automatic update mechnism for future updates + Description: There are two parts to SetupHelper: 1) Install and update utilities help a user manage packages. -2) CommonResources helps in writing scripts to perform the installation. +2) Resources to help writing scripts to perform the installation. The latter is of concern only to those writing new Venus modificaitons or modifying an existing setup script. @@ -58,24 +84,17 @@ to install and update packages. packageAutoUpdater handles automatic package updates. -GitHub updates are enabled from the setup menu (g) option. - -if GuiMods is up to date, auto updates can also be controlled from - Device List / Settings / Display & language / GuiMods / Auto update packages ... - -If enabled, automatic GitHub update checks will download and install the GitHub version -if it is newer than the current version. - -Version numbers use the same syntax as Venus OS: - v.~ - v2.45 would replace v2.45~68 as test versions lead up to an eventual release - -Automatic updates can be controlled via the GuiMods menu or options in the SetupHelper setup script +Automatic updates can be controlled via the Device List / Settings / Package Versions menu + or options in the SetupHelper setup script Normal checks GitHub for a package once every 10 minutes Fast checks GitHub for a package once every 10 seconds Once checks GitHub for a package once every 10 minutes, but only once, then updates are turned off Disable disables GitHub updates +If enabled, automatic GitHub update checks will download and install the GitHub version + of all installed packages if it is newer than the current version. + + If you are experimenting with modificaitons and wish to avoid GitHub updates overriding your work, disable automatic updates. @@ -118,11 +137,6 @@ packageInstaller is called from the SetupHelper setup script by choosing the pac The packageInstaller is a shell script and can also be run manually: /data/SetupHelper/packageInstaller -When a package is updated from GitHub or a USB stick, the currently installed package is moved to a backup directory -so that the package can be returned to a previous verison should this be necessary. -Two complete backups plus the current installation are saved. -Backups are in /data and are named with -backup1 and -backup2 appended to the package name. - -backup2 is the oldest Setup script aids: @@ -308,6 +322,10 @@ The following functions manage execution of the script and interfaces to reinsta $obsoleteVersion - if the package is obsolete, it can be prevented from installation at a specified Venus OS version + $packageGitHubUser - specifies the GitHub user name to be used to fetch updates + $packageGitHubBranch - specifies the branch to pull the update from + Both of these need to be specified in the setup script to enable updates from GitHub and USB/SD media + The following functions update or restore Venus files to activate a package they are intended to simplify common tasks, generally reducing many lines to a single line that is easier to read/understand @@ -419,3 +437,50 @@ LogHandler is a logging and log display mechanism. It is sourced by CommonResour The latter must be initialized in setup script code If no package log file exists, $packageLogFile shoudl remain null "" + +Update handler + SetupHelper checks for updates to packages from GitHub or USB/SD media. + The GitHub updates can be automatic. + When a package is installed, it addes the GitHub user and branch info to a file + used by the automatic and manual updates. + The defaultPackageList file is included in the SetupHelper package. + The default is copied to the active location at /data/setupOptions/SetupHelper/packageList + if it does not already exist. + The active file can then be edited to control the updates. + Package setup scripts should add lines to this file during installation. + This is handled in endScript if the packageGitHubUser and packageGitHubBranch are defined in the script + Some packages are included in defaultPackageList + + Normally, the current or latest branch is used to check for updates, but specifying a different branch + or a specific version (of the form v2.3) can also be specified. + + A development branch should be used during package development to prevent affecting others using auto update. + + The repo version is compared with the installed version. + + If a version is specified for the branch, the package will be brought to that version + regardless of what is currently installed. + + If any other branch name is used, an update will occur if the repo verison is numerically greater than the installed version + +PackageList format + The file consists of one line per package naming the package and specifying the GitHub user and branch, e.g., + + SetupHelper kwindrem current + + Blank lines or those beginning with # are ignored + A package can be manually added to this file, or updates disabled by adding a # at the beginning of the line. + +packageVersions file + packageVersions are maintained in a file and also placed in dbus Settings for display in + the Package Versions List menu + The reason for the duplicaiton is dbus access from unix shell scripts is very slow + + Whenever a package is installed, it compares its current version to the one in + the /data/packageVersions file. If there is a difference dbus Settings are updated + + Do NOT edit this file!!! + +Version numbers use the same syntax as Venus OS: + v.~ + v2.45 would replace v2.45~68 as test versions lead up to an eventual release are considered diff --git a/UpdateResources b/UpdateResources index fa6af9d..2aac63b 100755 --- a/UpdateResources +++ b/UpdateResources @@ -5,9 +5,6 @@ # source "/data/SetupHelper/LogHandler" # source "/data/SetupHelper/UpdateResources" -# SetupHelper must be first so it updates resources used by other packages before they are updated -allPackages="SetupHelper GuiMods GuiMods2 GeneratorConnector ShutdownMonitor RpiDisplaySetup RpiGpioSetup VeCanSetup TankRepeater" - setupHelperDir="/data/SetupHelper" source "$setupHelperDir/EssentialResources" @@ -36,11 +33,42 @@ function versionStringToNumber () fi } +# the version number of the archive is compared to the installed version +# if a the branch specifies a spcific version number, the two versions must match +# for the installed package to be considered up to date +# for a branch label, the installed package is up to date if it's version +# is equal to or greater than the archive's verison +# +# function will return 1 if an update is required and 0 if no update is needed + +function checkVersions () +{ + # convert versions to numbers and compare them + versionStringToNumber $archiveVersion + archiveVersionNumber=$versionNumber + versionStringToNumber $installedVersion + # if version number specified, must match that exact value + if [[ ${gitHubBranch:0:1} == "v" ]] ; then + if (( $versionNumber == $archiveVersionNumber )); then + return 0 + else + return 1 + fi + else + if (( $versionNumber >= $archiveVersionNumber )); then + return 0 + else + return 1 + fi + fi + +} + # get the package from a USB file # The package is left in $package-$gitHubBranch for processing later # $1 is the name of the package -# returns 0 if updated should NOT occur or 1 if update is acceptable for update +# returns 0 if updates should NOT occur or 1 if update is acceptable for update getFromUsb () { @@ -81,16 +109,12 @@ getFromUsb () logMessage "WARNING: no version for $package current installation - proceeding" return 1 else - # convert versions to numbers and compare them - versionStringToNumber $archiveVersion - archiveVersionNumber=$versionNumber - versionStringToNumber $installedVersion - if (( $versionNumber >= $archiveVersionNumber )); then + checkVersions + if [ $? -eq 0 ]; then if $logToConsole ; then echo "$package is up to date" fi return 0 - # archive is newer else return 1 fi @@ -128,15 +152,14 @@ getFromGitHub () elif [ -z $installedVersion ]; then logMessage "WARNING: no version for $package current installation - proceeding" else - # convert versions to numbers and compare them - versionStringToNumber $archiveVersion - archiveVersionNumber=$versionNumber - versionStringToNumber $installedVersion - if (( $versionNumber >= $archiveVersionNumber )); then + checkVersions + if [ $? -eq 0 ]; then if $logToConsole ; then echo "$package is up to date" fi return 0 + else + return 1 fi fi # update the package and reinstall it @@ -152,9 +175,6 @@ getFromGitHub () # install the archive and run setup script # -# backup the last 2 versions in case -# it is necessary to revert to a previous verion -# # $1 is the package name # $2 is the flag to allow running the script with user interaction @@ -169,19 +189,6 @@ doUpdate () installOk=false fi - # backup last 2 versions - if [ -d "$packageDir-backup2" ]; then - rm -rf "$packageDir-backup2" - fi - if [ -d "$packageDir-backup1" ]; then - mv "$packageDir-backup1" "$packageDir-backup2" - fi - if [ -d "$packageDir" ]; then - mv "$packageDir" "$packageDir-backup1" - fi - # move new version into active position - mv "$packageDir-$gitHubBranch" "$packageDir" - if [ -f "$packageDir/setup" ]; then # if package is installed, reinstall automatically if [ -f "$installedFlagPrefix$package" ]; then diff --git a/blindInstall b/blindInstall new file mode 100755 index 0000000..82c01bb --- /dev/null +++ b/blindInstall @@ -0,0 +1,53 @@ +#!/bin/bash + +# this script is part of an autoInstall archive +# the archive makes use of the Venus OS update-data.sh script +# archives named "venus-data.tar" are unpacked during boot +# then for this archive, Venus must be rebooted, causing rcS.local to run, +# which calls blindInstall as a background task. +# +# Package install scripts will append to rcS.local, so it must be moved out of the way +# BEFORE running those scripts to force creation of a clean rcS.local +# +# GitHub automatic updates are enabled to keep packages up to date. +# +# the archive includes +# rcS.local and the packages themselves +# +# the blindInstall script is run in the background so it can wait for dbus Settings resources +# to become available before running the package install scripts. +# + +source "/data/SetupHelper/EssentialResources" +source "/data/SetupHelper/LogHandler" + +# wait until dbus settings are active +while [ $(dbus -y | grep -c "com.victronenergy.settings") == 0 ]; do + logMessage "waiting for dBus settings" + sleep 1 +done + +logMessage "starting up" + +# a package setup script normally prompts for user input +# reinstall force options insure the package is installed without user interaction +# +# currently VeCanSetup and RpiDisplaySetup require user responses during initial setup +# so can't be installed via this mechanism + +# all packages rely on SetupHelper so it must be present and installed first +if [ -f "/data/SetupHelper/setup" ]; then + # insure package reinstall doesn't get appended to the auto install rcS.local !!! + rm -f /data/rcS.local + sync + logMessage "installing SetupHelper" + /data/SetupHelper/setup reinstall force deferReboot + if [ -f "/data/GuiMods2/setup" ]; then + logMessage "installing GuiMods2" + /data/GuiMods2/setup reinstall force deferReboot + fi + + # enable GitHub automatic updates + dbus -y com.victronenergy.settings /Settings/GuiMods/GitHubAutoUpdate SetValue 1 &> /dev/null +fi + diff --git a/defaultPackageList b/defaultPackageList new file mode 100644 index 0000000..9cc43c5 --- /dev/null +++ b/defaultPackageList @@ -0,0 +1,18 @@ +# list of packages managed by SetupHelper +# lines beginning with # are ignored and can be used +# to remove a package from auto and manual updates +# or as comments +# blank lines are ignored +# incomplete lines are ignored +# SetupHelper should be first (and not commented out) +# so it updates resources used by other packages prior to their update +# packages should add themselves to this list during setup + +# Package GitHubUser Version +SetupHelper kwindrem current +GuiMods kwindrem current +GuiMods2 kwindrem current +ShutdownMonitor kwindrem current +RpiDisplaySetup kwindrem current +RpiGpioSetup kwindrem current +TankRepeater kwindrem current diff --git a/packageAutoUpdater b/packageAutoUpdater index 9e09575..1a8bcf6 100755 --- a/packageAutoUpdater +++ b/packageAutoUpdater @@ -16,22 +16,14 @@ scriptDir="$( cd "$(dirname $0)" >/dev/null 2>&1 ; /bin/pwd -P )" packageame=$(basename "$scriptDir") shortScriptName=$(basename "$scriptDir")/$(basename "$0") +source "/data/SetupHelper/EssentialResources" source "/data/SetupHelper/LogHandler" # this flag is tested by LogHandler to determine if messages should be output to the console logToConsole=false source "/data/SetupHelper/UpdateResources" - -# set dbus setting -# $1 is new value -# $2 is the dbus path -setSetting () -{ - local newValue="$1" - local dbusPath="$2" - dbus -y com.victronenergy.settings $dbusPath SetValue "$newValue" > /dev/null -} +source "/data/SetupHelper/DbusSettingsResources" # updates status message on GUI # $1 is the message identifier (not the actual message @@ -65,7 +57,7 @@ updateStatus () fi # update GUI status message if $updateDbus ; then - setSetting "$message" /Settings/GuiMods/CheckingPackage + updateDbusStringSetting "/Settings/GuiMods/CheckingPackage" "$message" fi lastMessage=$1 lastPackage=$package @@ -74,12 +66,17 @@ updateStatus () #### main code starts here +# wait until dbus settings are active +while [ $(dbus -y | grep -c "com.victronenergy.settings") == 0 ]; do + logMessage "waiting for dBus settings" + sleep 1 +done + logMessage "starting up" usbCheck=false mediaDetected=false lastUpdateTime=0 -checkingPackage=false updateSetupHelper=false @@ -89,67 +86,95 @@ gitHubSlowCheckDelay=600 gitHubFastCheckDelay=10 gitHubCheckDelay=0 -lastGitHubUpdateSetting=0 - +autoUpdateSetting=0 +lastUpdateSetting=0 # loop forever while true ; do rebootNeeded=false + checkingPackage=false + restartFromFirstPackage=false - # loop through packages, but don't look at new package until it's been checked for an update - # this loop will run every second even if waiting to access GitHub again - # this permits detection of USB media during the long wait for the next GitHub check - pkgArray=($allPackages) - i=0 - while (( i < ${#pkgArray[@]} )); do - # look for installed package - if ! $checkingPackage ; then - package=${pkgArray[i]} - packageDir="/data/$package" - setupOptionsDir="$setupOptionsRoot"/$package - if [ ! -f "$setupOptionsDir/optionsSet" ]; then - (( i++ )) - continue - # package has been installed, continue - else - checkingPackage=true - fi - fi - - doUpdate=false - - # pull Git Hub autoupdate mode from dbus - autoUpdateSetting=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/GuiMods/GitHubAutoUpdate\ - com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $3}') - if [ -z $autoUpdateSetting ]; then - autoUpdateSetting=0 - fi + # skip all processing if package list doesn't exist + # but keep checking + if [ ! -f "$packageListFile" ]; then + sleep 10 + continue + fi + # loop through packages from package list + while read -u 9 package gitHubUser gitHubBranch; do - # check for USB / SD media - mediaList=($(ls /media)) - # no media - if [ -z $mediaList ] ; then - mediaDetected=false - usbCheck=false - # media first detected, start loop over and enable USB checks - elif ! $mediaDetected ; then - mediaDetected=true - usbCheck=true - updateStatus 'USB_CHECK' - i=0 + # skip comments + if [[ ${package:0:1} == "#" ]] ; then + continue + # skip blank/incomplete lines + elif [ -z $package ] || [ -z $gitHubUser ] || [ -z $gitHubBranch ] ; then continue fi - # nothing to do - reset loop and wait - if (( $autoUpdateSetting == 0 )) && ! $usbCheck ; then - i=0 - checkingPackage=false - updateStatus 'IDLE' - sleep 1 + packageDir="/data/$package" + setupOptionsDir="$setupOptionsRoot"/$package + + # skip uninstalled packages + if [ ! -f "$installedFlagPrefix"$package ]; then continue + # package has been installed, check for updates + else + checkingPackage=true fi - if $checkingPackage ; then + # this loop permits detection of USB media during the long wait for the next GitHub check + while $checkingPackage ; do + doUpdate=false + + # pull Git Hub autoupdate mode from dbus + autoUpdateSetting=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/GuiMods/GitHubAutoUpdate\ + com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $3}') + if [ -z $autoUpdateSetting ]; then + autoUpdateSetting=0 + fi + + # look for change in autoupdate setting + if (( $autoUpdateSetting != $lastUpdateSetting)); then + # GitHub updates just activated - start package scan over + if (( $lastGitHubUpdateSetting == 0)); then + checkingPackage=false + restartFromFirstPackage=true + # if speeding up the loop, start package scan over + elif (( $autoUpdateSetting >= 2 )) && (( $lastUpdateSetting <= 1 )); then + checkingPackage=false + restartFromFirstPackage=true + fi + if $restartFromFirstPackage + + break + + fi + + # check for USB / SD media + mediaList=($(ls /media)) + # no media + if [ -z $mediaList ] ; then + mediaDetected=false + usbCheck=false + # media first detected, enable USB checks and start loop over + elif ! $mediaDetected ; then + mediaDetected=true + usbCheck=true + updateStatus 'USB_CHECK' + checkingPackage=false + restartFromFirstPackage=true + break + fi + + # nothing to do - reset loop and wait + if (( $autoUpdateSetting == 0 )) && ! $usbCheck ; then + checkingPackage=false + restartFromFirstPackage=true ############################### + updateStatus 'IDLE' + break ######################## + fi + # USB / SD updates if $usbCheck ; then for dir in ${mediaList[@]} ; do @@ -158,7 +183,7 @@ while true ; do logMessage "found $package on USB" doUpdate=true updateStatus 'CHECKING' - break; + break fi done # done checking for this package, time to move on @@ -169,9 +194,9 @@ while true ; do # if speeding up the loop, start package scan over if (( $autoUpdateSetting >= 2 )) && (( $lastGitHubUpdateSetting <= 1 )); then checkingPackage=false + restartFromFirstPackage=true lastGitHubUpdateSetting=$autoUpdateSetting - i=0 - continue + break fi # set update delay based on update mode @@ -214,24 +239,34 @@ while true ; do elif (( $autoUpdateSetting == 0 )); then rm -rf "$packageDir-$gitHubBranch" fi - fi # end if checkingPackage - # go to next package if done with this one - if ! $checkingPackage ; then - (( i++ )) - fi - if $usbCheck ; then - usleep 200000 + + # delay for inner loop + if $checkingPackage ; then + if $usbCheck ; then + usleep 200000 + else + sleep 1 + fi + fi + done # end while checkingPackage + + + if $restartFromFirstPackage ; then + break else sleep 1 fi - done - - # single pass - if (( $autoUpdateSetting == 3 )) ; then - setSetting 0 /Settings/GuiMods/GitHubAutoUpdate - # end of first pass, switch to slow updates - elif (( $autoUpdateSetting == 2 )) ; then - setSetting 1 /Settings/GuiMods/GitHubAutoUpdate + done 9< "$packageListFile" # end while read ... + +# if not restarting scan, update automatic update state + if ! $restartFromFirstPackage ; then + # single pass + if (( $autoUpdateSetting == 3 )) ; then + setSetting 0 /Settings/GuiMods/GitHubAutoUpdate + # end of first pass, switch to slow updates + elif (( $autoUpdateSetting == 2 )) ; then + setSetting 1 /Settings/GuiMods/GitHubAutoUpdate + fi fi usbCheck=false @@ -245,9 +280,8 @@ while true ; do # shutdown the service which runs this script - this will end this script svc -d "/service/SetupHelper" - # wait here for service to end the script + # wait here for service to end this script sleep 10000 fi - sleep 1 done diff --git a/packageInstaller b/packageInstaller index c8131a8..ddf16a3 100755 --- a/packageInstaller +++ b/packageInstaller @@ -1,6 +1,6 @@ #!/bin/bash -# This script prompts for manual installation of packages from the allPackages list +# This script prompts for manual installation of packages from the packageList file # it is called from SetupHelper/setup or can be run from the command line # Packages are installed either from GitHub or from a USB stick # @@ -51,20 +51,39 @@ fi autoUpdateSetting=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/GuiMods/GitHubAutoUpdate\ com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $3}') if [ -z $autoUpdateSetting ] || [ $autoUpdateSetting == 0 ]; then - reinstallOk=true + autoUpdatesEnabled=false else - reinstallOk=false + autoUpdatesEnabled=true fi rebootNeeded=false updateSetupHelper=false -for package in $allPackages; do + +# skip all processing if package list doesn't exist +if [ ! -f "$packageListFile" ]; then + echo "no packageList file found" + exit +fi + +# loop through packages from package list file +while read -u 9 package gitHubUser gitHubBranch; do + # skip comments + if [[ ${package:0:1} == "#" ]] ; then + continue + # skip blank/incomplete lines + elif [ -z $package ] || [ -z $gitHubUser ] || [ -z $gitHubBranch ] ; then + continue + fi + doUpdate=false packageDir="/data/$package" + + +########################################################## # if automatic updates are enabled, skip packages that have alreay been installed - if [ -e $packageDir ] && [ -f "$setupOptionsRoot/$package/optionsSet" ]; then - if ! $reinstallOk ; then + if [ -e $packageDir ] && [ -f "$setupOptionsRoot/$package/installOk" ]; then + if $autoUpdatesEnabled ; then echo "$package has already been installed and will be automatically updated - skipping" continue fi @@ -82,7 +101,6 @@ for package in $allPackages; do if $yesResponse ; then doUpdate=true else - echo "#### removing $packageDir" rm -rf "$packageDir-$gitHubBranch" fi break; @@ -98,7 +116,6 @@ for package in $allPackages; do if $yesResponse ; then doUpdate=true else - echo "#### removing $packageDir" rm -rf "$packageDir-$gitHubBranch" fi fi @@ -112,7 +129,7 @@ for package in $allPackages; do doUpdate $package 'prompting' fi fi -done +done 9< "$packageListFile" # end while read ... # if an update was found for SetupHelper, run it's setup script now # this prevents stepping on SetupHelper resources diff --git a/rcS.local b/rcS.local index 6cb8cc0..87bfa5c 100755 --- a/rcS.local +++ b/rcS.local @@ -1,4 +1,4 @@ #!/bin/bash # SetupHelper reinstall all Venus mods -/data/SetupHelper/reinstallMods +nohup /data/SetupHelper/reinstallMods > /dev/null & diff --git a/reinstallMods b/reinstallMods index b2e1162..55f36b0 100755 --- a/reinstallMods +++ b/reinstallMods @@ -1,16 +1,25 @@ #!/bin/sh # reinstalMods will reinstall customizations to Venus following a software update -# Refer to the ReadMe for more details # +# some setup scripts access dbus Settings which are not up early in the boot process +# therefore, this script is run as a background task and waits for dbus Settings +# +# Refer to the ReadMe for more details setupHelperDir="/data/SetupHelper" source "$setupHelperDir/EssentialResources" source "$scriptDir/LogHandler" -# disable outputting log messaged to console and package log +# disable outputting log messages to console runningAtBoot=true +# wait until dbus settings are active +while [ $(dbus -y | grep -c "com.victronenergy.settings") == 0 ]; do + logMessage "waiting for dBus settings" + sleep 2 +done + if [ ! -f "$reinstallScriptsList" ] ; then logMessage "$reinstallScriptsList file not found" @@ -20,7 +29,7 @@ fi # read lines from script list file specified above # and call each script rebootNeeded=false -while read line ; do +while read -u 9 line ; do # ignore blank and comment lines if [ ! -z "$line" ] && ! [[ "$line" == \#* ]]; then # strip command parameters to make sure the path/command exists @@ -35,7 +44,7 @@ while read line ; do logMessage "$command not found" fi fi -done < "$reinstallScriptsList" +done 9< "$reinstallScriptsList" # reboot now if any script reboots were indicated if $rebootNeeded ; then diff --git a/sampleSetupScript b/sampleSetupScript index 661c74d..ac51b54 100755 --- a/sampleSetupScript +++ b/sampleSetupScript @@ -31,6 +31,11 @@ obsoleteVersion="v2.70~12" source "/data/SetupHelper/CommonResources" +# GitHub account info - fill in as appropriate +# to include this package in SetupHelper automatic updates +packageGitHubUser="" +packageGitHubBranch="" + #### end of lines to include SetupHelper #### running manually and OK to proceed - prompt for input diff --git a/service/run b/service/run index 9d69edc..d3df77c 100755 --- a/service/run +++ b/service/run @@ -1,4 +1,4 @@ #!/bin/sh #exec 2>&1 -exec /data/SetupHelper/packageAutoUpdater 2>&1 | awk '{print "packageAutoUpdater" $0}'| tai64n >> /var/log/SetupHelper +exec /data/SetupHelper/packageAutoUpdater diff --git a/setup b/setup index c8ae7f8..9119e73 100755 --- a/setup +++ b/setup @@ -1,6 +1,6 @@ #!/bin/bash -# this script sets up the SetupHelper service +# this script sets up the SetupHelper service and other resources associated with package updates # This service provides automatic and manual updates for Venus modificaiton packages # @@ -11,6 +11,26 @@ source "/data/SetupHelper/CommonResources" #### end of lines to include SetupHelper +# remove settings no longer used + +cleanupDbusSettings () +{ + dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/GuiMods/PackageVersions/GeneratorConnector\ + com.victronenergy.BusItem.GetValue &> /dev/null + if (( $? == 0 )); then + removeDbusSetting "/Settings/GuiMods/PackageVersions/GeneratorConnector" + removeDbusSetting "/Settings/GuiMods/PackageVersions/GuiMods" + removeDbusSetting "/Settings/GuiMods/PackageVersions/GuiMods2" + removeDbusSetting "/Settings/GuiMods/PackageVersions/RpiDisplaySetup" + removeDbusSetting "/Settings/GuiMods/PackageVersions/RpiGpioSetup" + removeDbusSetting "/Settings/GuiMods/PackageVersions/RpiTemp" + removeDbusSetting "/Settings/GuiMods/PackageVersions/SetupHelper" + removeDbusSetting "/Settings/GuiMods/PackageVersions/TankRepeater" + removeDbusSetting "/Settings/GuiMods/PackageVersions/VeCanSetup" + removeDbusSetting "/Settings/GuiMods/PackageVersions/ShutdownMonitor" + fi +} + #### running manually and OK to proceed - prompt for input if [ $scriptAction == 'NONE' ] ; then # create dbus Settings if they haven't been set previously @@ -146,11 +166,34 @@ if [ $scriptAction == 'NONE' ] ; then fi if [ $scriptAction == 'INSTALL' ] ; then + if [ ! -f "$packageListFile" ]; then + logMessage "installing default packge list" + cp "$scriptDir/defaultPackageList" "$packageListFile" + fi + + updateActiveFile "$qmlDir/PageSettings.qml" + updateActiveFile "$qmlDir/PageSettingsPackageControl.qml" + updateActiveFile "$qmlDir/PageSettingsPackageVersions.qml" + updateActiveFile "$qmlDir/MbDisplayPackageVersion.qml" + installService $packageName + + cleanupDbusSettings fi if [ $scriptAction == 'UNINSTALL' ] ; then + restoreActiveFile "$qmlDir/PageSettings.qml" + restoreActiveFile "$qmlDir/PageSettingsPackageControl.qml" + restoreActiveFile "$qmlDir/PageSettingsPackageVersions.qml" + restoreActiveFile "$qmlDir/MbDisplayPackageVersion.qml" + removeService $packageName + + cleanupDbusSettings +fi + +if $filesUpdated ; then + restartGui=true fi # thats all folks - SCRIPT EXITS INSIDE THE FUNCTION diff --git a/timeStamp b/timeStamp deleted file mode 100644 index a96dc77..0000000 --- a/timeStamp +++ /dev/null @@ -1 +0,0 @@ -1635100489 diff --git a/updatePackageVersions b/updatePackageVersions new file mode 100755 index 0000000..2c46aeb --- /dev/null +++ b/updatePackageVersions @@ -0,0 +1,113 @@ +#!/bin/bash + +# This script keeps creates a list of installed package versions +# and updates dBus /Settings/PackageVersion/... +# +# this script should be called whenever a package is installed or uninstalled +# this is part of endScript () if used +# it can take time, so launch it as a background task: +# +# nohup /data/updatePackageVersions > /dev/null & +# +# dbus access is slow, so this script builds a file with the known values +# only changes are sent to dbus + +source "/data/SetupHelper/EssentialResources" +source "/data/SetupHelper/LogHandler" +source "/data/SetupHelper/DbusSettingsResources" + +versionsFile="/data/packageVersions" + +# this flag is tested by LogHandler to determine if messages should be output to the console +logToConsole=false + +# wait until dbus settings are active +while [ $(dbus -y | grep -c "com.victronenergy.settings") == 0 ]; do + logMessage "waiting for dBus settings" + sleep 1 +done + +newNames=() +newVersions=() +oldNames=() +oldVersions=() + +# read in old values +if [ -f "$versionsFile" ]; then + index=0 + while read -u 8 oldPackage oldVersion; do + oldNames[$index]=$oldPackage + oldVersions[$index]=$oldVersion + ((index++)) + done 8< "$versionsFile" +fi +oldCount=${#oldNames[@]} + +# loop through packages from package list +index=0 +rm -f "$versionsFile" +while read -u 9 package gitHubUser gitHubBranch; do + + # skip comments + if [[ ${package:0:1} == "#" ]] ; then + continue + # skip blank/incomplete lines + elif [ -z $package ] ; then + continue + fi + # skip uninstalled packages + if [ ! -f "$installedFlagPrefix"$package ]; then + continue + fi + + newNames[$index]=$package + if [ -f "/data/$package/version" ]; then + packageVersion=$(cat "/data/$package/version") + else + packageVersion="?" + fi + newVersions[$index]=$packageVersion + + # save in file for later comparison + echo $package $packageVersion >> "$versionsFile" + + ((index++)) + +done 9< "$packageListFile" +newCount=${#newNames[@]} + +if (( $oldCount > $newCount )); then + minCount=$newCount + maxCount=$oldCount +else + minCount=$oldCount + maxCount=$newCount +fi + +# compare new and old and update dbus Settings as needed +index=0 +while ((index < newCount )); do + if (( index > oldCount )); then + updateDbusStringSetting "/Settings/PackageVersion/$index/PackageName" ${newNames[$index]} + updateDbusStringSetting "/Settings/PackageVersion/$index/PackageVersion" ${newVersions[$index]} + else + if [ "${newNames[$index]}" != "${oldNames[$index]}" ]; then + updateDbusStringSetting "/Settings/PackageVersion/$index/PackageName" ${newNames[$index]} + fi + if [ "${newVersions[$index]}" != "${oldVersions[$index]}" ]; then + updateDbusStringSetting "/Settings/PackageVersion/$index/PackageVersion" ${newVersions[$index]} + fi + fi + ((index++)) +done + +index=$newCount +while (( $index < $oldCount )); do + echo "### remove setting for $index" + removeDbusSetting "/Settings/PackageVersion/$index/PackageName" + removeDbusSetting "/Settings/PackageVersion/$index/PackageVersion" + ((index++)) +done + +updateDbusIntSetting "/Settings/PackageVersion/Count" $newCount + diff --git a/venus-data.tgz b/venus-data.tgz new file mode 100644 index 0000000..5d61745 Binary files /dev/null and b/venus-data.tgz differ diff --git a/version b/version index 76015c5..8616689 100644 --- a/version +++ b/version @@ -1 +1 @@ -v2.13 +v3.1