Hello Kevin
This works perfect! Thank you.
One more thing I don’t quite know how to fix:
I am changing my main and fallback connection with the following code in the init section in BASIC:
GET_EWON_INTERFACES:
SETSYS INF, "load"
FallbackActive@ = VAL GETSYS INF, "IsWANFallbackUsed"
Setsys COM,"load"
WANCnx$ = GETSYS COM,“WANCnx” //0 None 1 GSM 2 Ethernet 4 Wi-Fi
WANCnx@ = FCNV WANCnx$, 30, 0, "%d"
WANFbckCnx$ = GETSYS COM,“WANFbckCnx” //0 None 1 GSM 2 Ethernet 4 Wi-Fi
WANFbckCnx@ = FCNV WANFbckCnx$, 30, 0, "%d"
VPNCnxType$ = GETSYS COM,"VPNCnxType"
VPNCnxType@ = FCNV VPNCnxType$, 30, 0, “%d” //0 = disabled, 1 = Incoming VPN, 2 = VPN to Server
WANIP@ = GETSYS PRG,"WANIP"
VPNIP@ = GETSYS PRG,"VPNIP"
GET_EWON_INTERFACES@ = 0
Print "[GET_EWON_INTERFACES] executed"
END
SET_EWON_INTERFACES:
//Stop current connection
Setsys COM,"load"
Setsys COM,“WANCnx”,"0"
Setsys COM,“WANFbckCnx”,"0"
Setsys COM,“WANPermCnx”,"0"
Setsys COM,"save"
//Reset Connection
Setsys COM,"load"
Setsys COM,“WANFbckCnx”, WANFbckCnx@ //0 None 1 GSM 2 Ethernet 4 Wi-Fi
Setsys COM,“WANCnx”, WANCnx@ //0 None 1 GSM 2 Ethernet 4 Wi-Fi
Setsys COM,“WANPermCnx”,"1"
Setsys COM,"save"
Print "[SET_EWON_INTERFACES] executed"
SET_EWON_INTERFACES@ = 0
END
This works perfectly fine as the connection builds up with the new selected interface.
Also when i check comcfg.txt the parameters are set.
Now i tested 3 reboot options:
- Reboot via Reboot button in the Web Interface
- Reboot via REBOOT in BASIC
- Turn off the Ewon’s power supply (in order to simulate a user turning off the machine)
With option 1) the newly set connection is saved
With option 2) and 3) the connection is reset to a previous state.
Now when a plant has a power failure, my connection setup will be reset.
The weird thing is that comcfg.txt has been changed but still after rebooting the old config is back.
How can i solve this problem?
Cheers,
pstark