Logic Machine Forum
Change the network settings of the logic machine by script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Change the network settings of the logic machine by script (/showthread.php?tid=2162)



Change the network settings of the logic machine by script - Carlos Padilla - 18.07.2019

Good friends, is it possible to change the network settings of the logic machine? . The idea is that you can change the network credentials of the LM from the visualization with the help of a script. Thank you


RE: Change the network settings of the logic machine by script - admin - 18.07.2019

Which network settings do you want to change? What is the use case for this?


RE: Change the network settings of the logic machine by script - Carlos Padilla - 18.07.2019

The network configurations that I want to change by script are the IP, the network mask, the gateway and the DNS. The above is because a client from time to time for safety issues in their network equipment, is changing the network settings of these and the idea is that the client can change them from a page of the display and thus prevent access to the mode administrator (system config and logic machine) in such a way that it can not modify by mistake fundamental aspects in the operation of the LM, script, ect. The idea is that if you can, be by means of a script since a design of icons and colors was made to the visualization and that new page has to have the same aesthetics. Thank you and I am attentive to your comments.


RE: Change the network settings of the logic machine by script - admin - 23.07.2019

You can change network configuration like this, reboot is required afterwards:
Code:
require('uci')
uci.set('network', 'lan', 'ipaddr', '192.168.1.2')
uci.commmit('network')

Other possible configuration values apart from ipaddr are gateway, dns, netmask.

This is still both a security and reliability issue. If client configures any parameters incorrectly then the device won't be reachable at all. I don't see how changing IP addresses improves security.


RE: Change the network settings of the logic machine by script - Trond Hoyem - 14.04.2023

(23.07.2019, 11:04)admin Wrote: You can change network configuration like this, reboot is required afterwards:
Code:
require('uci')
uci.set('network', 'lan', 'ipaddr', '192.168.1.2')
uci.commmit('network')

Other possible configuration values apart from ipaddr are gateway, dns, netmask.

This is still both a security and reliability issue. If client configures any parameters incorrectly then the device won't be reachable at all. I don't see how changing IP addresses improves security.

Would it be possible to change BACnet settings as well, BACnet ID, port etc?


RE: Change the network settings of the logic machine by script - admin - 14.04.2023

For BACnet ID use this:
Code:
require('uci')
uci.set('bacnet', 'server', 'devid', 123)
uci.commmit('bacnet')

You can download the system config backup and check what other fields are present in the config files.


RE: Change the network settings of the logic machine by script - Trond Hoyem - 14.04.2023

(14.04.2023, 12:04)admin Wrote: For BACnet ID use this:
Code:
require('uci')
uci.set('bacnet', 'server', 'devid', 123)
uci.commmit('bacnet')

You can download the system config backup and check what other fields are present in the config files.

Great! Thanks.