Programatically updating config.txt

I need to upload a new config.txt to ~175 Flexys. GETHTTP and REQUESTHTTPX sent via the M2Web API or run in remote.bas will copy the new config to the usr folder, but I can’t seem to get the new config.txt file to save to the root folder.

This is what my Event Log shows:

14/03/2023 14:12:23 32603 httpc-http request error unact
14/03/2023 14:12:23 -20205 muting (pattern of 1 event) unact
14/03/2023 14:12:23 28607 secu-Operation failed unact
14/03/2023 14:12:23 28607 secu-Operation failed unact
14/03/2023 14:12:23 23301 varld-Internal error unact

I’m going to hazard a guess that the Ewon OS won’t let the BASIC script (or even Remote.bas) overwrite the config.txt file? If not, is there a way to automate eBuddy so I can create a VPN tunnel from the automaton server? If not, any suggestions for programmatically updating ~175 config.txt files?

Hi Tim,

You can use the M2Web API to send a script that uses GETFTP to copy the file from the USR folder to the Root folder. The USR folder is the source and the destination FTP server is the Flexy’s own IP address.

Here is an example:

// Use FTP to copy comcfg.txt from USR folder to the root folder of the Flexy
SETSYS COM, “Load”
LANIP$ = GETSYS COM, “EthIP” // Get LAN IP Address
GETFTP “/usr/comcfg.txt”, “/comcfg.txt”, “adm:adm@” + LANIP$ + “:21, 1” // The FTP server is the Flexy itself
PRINT “Tags Created…”
END

1 Like