Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
node-software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-project
node-software
Commits
b2eb6d61
Commit
b2eb6d61
authored
Jul 5, 2023
by
Strasser, Andreas
Browse files
Options
Downloads
Patches
Plain Diff
fixed remote command execution
parent
b51e1e06
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/otaconf/gateway-node/autoexec.be
+12
-6
12 additions, 6 deletions
src/otaconf/gateway-node/autoexec.be
with
12 additions
and
6 deletions
src/otaconf/gateway-node/autoexec.be
+
12
−
6
View file @
b2eb6d61
...
@@ -72,24 +72,30 @@ end
...
@@ -72,24 +72,30 @@ end
def _execute_commands()
def _execute_commands()
while _configuration_commands.size() > 0
while _configuration_commands.size() > 0
for device_mac : _configuration_commands['macs']
var configuration_command = _configuration_commands[0]
var own_command = nil
var device_macs = configuration_command['macs']
var command = configuration_command['command']
for device_mac : device_macs
if device_mac == otaconf.get_mac()
if device_mac == otaconf.get_mac()
_own_command = command
['command']
_own_command = command
else
else
tasmota.log('OTA: remotely executing command on device: ' + device_mac, 2)
tasmota.log('OTA: remotely executing command on device: ' + device_mac, 2)
var payload = {'action': 'EXECUTE_COMMAND', 'command': command
['command']
}
var payload = {'action': 'EXECUTE_COMMAND', 'command': command}
mesh.send(otaconf.format_mac(device_mac), json.dump(payload))
mesh.send(otaconf.format_mac(device_mac), json.dump(payload))
end
end
end
end
_configuration_commands.remove(0)
end
end
_update_config_status()
_update_config_status()
end
end
def _distribute_files()
def _distribute_files()
tasmota.log('OTA: distributing files', 2)
_execute_commands()
_execute_commands()
end
end
...
@@ -143,7 +149,7 @@ def _process_config(response)
...
@@ -143,7 +149,7 @@ def _process_config(response)
end
end
end
end
if
_
configuration.contains('mesh_scan') && response['configuration']['mesh_scan']
if
response['
configuration
']
.contains('mesh_scan') && response['configuration']['mesh_scan']
_scan_mesh()
_scan_mesh()
else
else
_distribute_files()
_distribute_files()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment