I have a Siemens LOGO hosting a webserver for my project, if I'm connected directly into the switch I can access the LOGO webserver and login all good however...
I have now set this up in m2web and added the IP address of the logo and made it visible in m2web using HTTP on port 8080, when I acess m2web and click the newly added link it does take me to the logos webserver however now when I try to log in I get the following error:
kjv8xzw8ymys5dv9wuxwmealzyn3l9.proxy-eu-1.m2web.talk2m.com say
log on fail: 0
that response is coming from the ewon and not the logo and I have proved the password to be correct as I can log in locally. is there a solution to this I would really like to log in via m2web as this is how we remotely access out other HMI's etc
I'm running Win11 and have Talk2m VPN to a fleet of Flexy 205s running 14.5 through 15.0 firmwares. I am trying to use the eWON Tag Generator Rev6, which was the only XLSM that I could find to download. I am able to connect and RECEIVE the tag list from v15.0 firmware, but when I edit and try to upload, it fails with an FTP failure. I've tracked it down to an issue with the FTP call within wininet.dll that is being, I believe, but I don't know how to fix that. I see there are some references to a Tag Generator v9, but alas, I cannot find anywhere in the land of eWON, a place to download it. Is there are more modern version that one of you gurus can share with me that might work better for the management of these devices.
Posted by: pem199 - 22-10-2025, 09:39 AM
- Replies (1)
Hello all,
Recently our ewon flexy got automatically resetted to factory settings after a critical error.
The log shows:
System rebooting
Reboot reason: Crictical error 36504
Mount volume failed 36504
I've searched on the internet but couldn't find anything.
Does anyone have an idea what could have caused this?
I have an EWON Flexy205 and I am looking for a way to query an SQL-database every 30 seconds to retrieve a value and then store this value in an EWON-tag.
The database exists on the LAN-side of the EWON.
Is there a way to achieve this?, and if so, is there an example script for me to use as a basis?
Thanks for your support on this.
I have written a MQTT project for my Ewon Flexy 205, which appears to connect to my broker successfully, however i an gelling LOTS of messages in my error log
Sorry but i'm going pasting my class here in the hope someone can identify what is my issue:
I recognise i have some loops in here that repeatedly try and connect to the broker in my void "EstablishConnection"
When the " mqtt-Cannot start connection" messages appear, i dont have any entries in the log for "EstablishConnection: Retrying connection..." which leads me to believe that its not my code generating the errors, but something within
the "com.ewon.ewonitf.MqttClient" library
Now, is there any way i can use the SysControlBlock to check if my internet connection is established before i do any kind of connection to my broker?
/**
* MQTT_Thread
*
* Handles MQTT communication for an Ewon device.
* Periodically reads tag values, detects changes, and publishes data as JSON.
*/
public class MQTT_Thread implements Runnable {
// int mqtt_STATE_EXISTS = 0;
// int mqtt_STATE_HAS_SEM = 1;
// int mqtt_STATE_HAS_LOCK = 2;
final int mqtt_STATE_LOOP_STARTED = 3;
// int mqtt_STATE_DISCONNECTED = 4;
final int mqtt_STATE_CONNECTED = 5;
/**
* Start the MQTT thread if enabled in configuration.
*/
public void start() throws Exception {
// Read the configuration file
config = new MQTTConfig();
if (config.isValid()) {
enable = config.enable();
// Store the JSON
try { IOManager.writeTag("Config_MQTT_Text", config.toString()); }
catch (Exception e) { System.out.println("Error Writing JSON To Tag: " + e.getLocalizedMessage()); }
if (enable) {
WriteComment("Creating MQTT Thread");
// Create a new thread if enabled
if (thread == null) {
thread = new Thread(this);
thread.start();
}
} else { WriteComment("MQTT Threads Disabled in Configuration"); }
} else { WriteComment("MQTT JSON Not Valid"); }
}
/**
* Main loop for reading and publishing MQTT data.
*/
public void run() {
try {
WriteHeading("JAVA Started");
// Create the System Control Block
SysControlBlock Sys = new SysControlBlock(SysControlBlock.INF);
// Save the Serial Number
eWonSN = Sys.getItem("SerNum");
String topicPath = config.topicPath() + eWonSN;
int defaultTime = config.defaultTime();
int sleepTime = config.sleepTime();
int QOS = config.QOS();
String tagGroup = config.tagGroup();
ArrayList topics = config.topics();
// Establish a new connection
while (!connected) {
// Establish a new connection
Mqtt_c = EstablishConnection(Mqtt_c);
connected = isClientConnected(Mqtt_c);
}
// Check a valid client exists
if (Mqtt_c != null ) {
// Are we connected?
connected = isClientConnected(Mqtt_c);
// Subscribe to all configured topics
for (int i = 0; i < topics.size(); ++i) {
WriteComment("MQTT: Subscribing to " + topics.get(i).toString());
Mqtt_c.subscribe(topics.get(i).toString(), 0);
WriteComment("MQTT: Subscription getStatus: " + Mqtt_c.getStatus());
}
// Define variables
int elapsedTime = 0;
boolean valuesChanged = true; // Monitor changes in value
String ewonTag = "";
// Convert default time to milliseconds
defaultTime = defaultTime * 1000;
// Create new Tags Handler
EwonTags myTags = new EwonTags();
// Generate a list from the configured tag group
ArrayList tagList = myTags.GetGroupTags(tagGroup);
// Default the Array to 1000 Tags to allow adding/removing during runtime
float[][] values = new float[1000][3];
WriteHeading("MQTT Publish: Starting Tag monitoring Loop");
// Main loop to read tag values
while (true) {
// Get the connected Status
connected = isClientConnected(Mqtt_c);
// Loop until we can connect
while (!connected) {
// Establish a new connection
Mqtt_c = EstablishConnection(Mqtt_c);
connected = isClientConnected(Mqtt_c);
}
// Record current time in milliseconds (Epoch)
long epoch = System.currentTimeMillis();
try {
// Get the number of tags
int tagCount = tagList.size();
for (int i = 0; i < tagCount; i++) {
if (i < tagCount) {
// Update previous value
values[i][1] = values[i][0];
ewonTag = (String) tagList.get(i);
try {
// Skip if tag previously had an error
if (values[i][2] != -1) {
// Read current tag value
values[i][0] = com.ewon.ewonitf.IOManager.readTagAsFloat(ewonTag);
values[i][2] = 0; // Error = False
// If time or values changed, publish messages
if ((elapsedTime >= (defaultTime - sleepTime)) || valuesChanged) {
// For each tag, publish message
for (int i = 0; i < tagCount; i++) {
if (values[i][2] == 0) { // Read OK
ewonTag = (String) tagList.get(i);
String topic = topicPath;
// Get the connected Status
connected = isClientConnected(Mqtt_c);
if (connected) {
// Publish new message (no retain)
Mqtt_c.publish(new MqttMessage(topic, payload.toString()), QOS, false);
WriteComment("MQTT : value published: " + payload);
} else { WriteComment("MQTT : value NOT published: Mqtt_c.GetStatus: " + Mqtt_c.getStatus()); }
}
catch (EWException ex) { handleError(ex, "EWException in loop:"); }
catch (Exception ex) { handleError(ex, "Exception in loop:"); }
}
// Reset error flag
values[i][2] = 0;
}
// Rebuild the tag list in case tags have changed dynamically
tagList = myTags.GetGroupTags(tagGroup);
}
// Reset timer if needed
if (elapsedTime >= (defaultTime - sleepTime)) { elapsedTime = 0; }
} catch (Exception ex) { handleError(ex, "Error in loop:");}
// Calculate when to run again
long deltaTime = sleepTime - (System.currentTimeMillis() - epoch);
deltaTime = Math.max(deltaTime, 1000); // Prevent negative sleep times
/**
* Handle a Throwable Error with a comment
* @param ex
* @param comment
*/
public void handleError(Throwable ex, String error) {
if (error != null && !error.equals("")) { WriteError(error + ' ' + ex.getLocalizedMessage());}
ex.printStackTrace(System.err); // ensures it prints to stderr
}
/**
* Handle a Throwable Error
* @param ex
*/
public void handleError(Throwable ex) {
handleError(ex, null);
}
/**
* Establish new connection
* @param existingClient the current MQTT client, may be null
* @return a connected MQTTClient instance, or null if connection fails
*/
public MQTTClient EstablishConnection(MQTTClient existingClient) {
int maxRetries = 50; // Limit the number of retries
int retryDelayMs = 5000; // Set a reconnection delay
// Create MQTT Client Object
client = new MQTTClient(eWonSN, brokerHost);
// Set Broker Port and options
client.setOption("port", brokerPort);
// Set the Username and Password if provided
if (brokerUsername != null && !brokerUsername.equals("")) {
client.setOption("Username", brokerUsername);
client.setOption("Password", brokerPassword);
}
// Set the logging value
client.setOption("log", brokerLog);
// Assign the Certificates to the device
try {
WriteComment("Broker Settings: Loading Certificates:", true);
client.setOption("cafile", "/usr/isrgrootx1.pem");
if (brokerUseCert) {
client.setOption("certfile", "/usr/plc.cert.pem");
client.setOption("keyfile", "/usr/plc.key.pem");
}
} catch (Exception ex) { handleError(ex, "Error occurred:"); }
/**
* Establish new connection
* @param existingClient the current MQTT client, may be null
* @return a connected MQTTClient instance, or null if connection fails
*/
public boolean isClientConnected(MQTTClient existingClient) {
int status = 0;
boolean connected = false;
try {
if (existingClient != null ) {
// Get the connected Status
status = existingClient.getStatus();
connected =(status == mqtt_STATE_CONNECTED || status == mqtt_STATE_LOOP_STARTED);
}
}
catch (EWException ex) { handleError(ex, "isClientConnected: EWException:"); }
return connected;
}
/**
* Write a comment to the Log
* @param comment
* @param includePrefix
*/
public void WriteComment(String comment, boolean includePrefix) {
if (includePrefix) { comment = commentPrefix + comment;}
System.out.println(comment);
}
/**
* Write a comment to the Log
* @param comment
*/
public void WriteComment(String comment) {
WriteComment(comment, false);
}
/**
* Write a Heading to the Log
* @param comment
*/
public void WriteHeading(String comment) {
System.out.println(commentPrefix + comment + commentSuffix);
}
/**
* Write an error to the Log
* @param error
*/
public void WriteError(String error) {
System.out.println(error);
}
}