Switch to desktop version  

Ewon TechForum
Providing technical solutions to technical requests


  m2Web VNC Idle
Posted by: vjeff - 18-11-2025, 05:31 PM - Replies (1)

Hello All,

I'm trying to configure the M2Web control to take over our remote SCADA PC using VNC viewer.

Directly connected using ecatcher the VNC viewer works, but using the m2web it keeps on showing me the message "Idle."

Sometimes it loads the screen on the background, but the message "Idle" is always shown.

On the PC Tight VNC server is installed, password protected.

I hope someone can help me out with this.

Thanks in advance.



Attached Files Thumbnail(s)
   
Continue reading..

  Siemens LOGO Webserver Via m2web
Posted by: tomwarrilow - 13-11-2025, 06:44 PM - Replies (2)

Im hoping someone can help me,

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

Continue reading..

  Tags from Red Lion Data Station
Posted by: vlarue - 07-11-2025, 07:04 PM - No Replies

What is the best way to pull tag values from a Red Lion Data Station?
Most of the tags will be of a String Data Type.

Continue reading..

  Export bloc descriptor firmware not respond: $dtFW$ftB
Posted by: mickaa - 06-11-2025, 03:29 PM - No Replies

Hello,

I am currently using firmware 14.9 and 15.1, when i test this address: http://192.168.0.11/rcgi.bin/ParamForm?AST_Param=$dtFW$ftB 
the address appears to be inaccessible.

- I have no problems with the other EBDs
- I don't know if it was ever functional, but I realize that it is no longer functional today.

Continue reading..

  eWON TAG GENERATOR REV X?
Posted by: chrissos - 29-10-2025, 04:00 AM - Replies (2)

Hi,

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.

Thanks,
Chris

Continue reading..

  Critical fault 36504 caused a factory reset
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?

Thanks in advance.



Attached Files Thumbnail(s)
   
Continue reading..

  Cosy 131 Evenlog
Posted by: Jelmer Kaptein - 17-10-2025, 01:44 PM - Replies (1)

Goodday,

Can someone please help and assist with the errors in attached eventlog.
Our customer has issues with his remote session.

Many thanks in advance.

Jelmer Kaptein
Duranmatic B.V. ( distributor )



Attached Files Thumbnail(s)
   
Continue reading..

  Read SQL into EWON-tag
Posted by: rob.swartjes@nutreco.com - 16-10-2025, 02:56 PM - Replies (1)

Hello,

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.

Regards,
Rob

Continue reading..

  Natural logarithm in basic on ewon
Posted by: Maxime.Charlier - 13-10-2025, 01:42 PM - Replies (1)

Hello everyone

Has anyone ever used calculations involving natural logarithms?

I would like to calculate the dew point temperature from measurements taken by humidity and temperature sensors, using a mathematical formula.

Thanks in advance.
Max.

Continue reading..

  Validating Wifi or internet connection
Posted by: james.taylor@malonegroup.com - 09-10-2025, 05:48 PM - Replies (2)

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

Time                        | Event  | Description                           | Originator                
09/10/2025 13:40:12 | 38003 | mqtt-Cannot start connection | jvmasync
09/10/2025 13:40:12 | 38004 | mqtt-Connect failed               | jvmasync

these are repeated alot and eventually, my Ewon reboots its self  (has just done it while writing this  )

Time                        | Event   | Description                                                                                | Originator    
09/10/2025 09:32:27 | -22602 | System Booting, FWR: 14.9s4 (14.9), SN: 2210-0019-24 [EF0000]  | elog


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?


Thanks in advance.

Code:
import java.util.ArrayList;
import com.ewon.ewonitf.MqttMessage;
import com.ewon.ewonitf.EWException;
import com.ewon.ewonitf.IOManager;
//import com.ewon.ewonitf.MqttClient;
import com.ewon.ewonitf.SysControlBlock;

/**
* 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 {

    private Thread thread = null;
    private MQTTConfig config;
    private boolean enable;
    private String eWonSN = "";
    private String commentPrefix = "********** ";
    private String commentSuffix = " **********";
   
    //  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();
           
            WriteHeading("MQTT Publush Settings");
            WriteComment("MQTT Publush Settings: Topic: " + topicPath, true);
            WriteComment("MQTT Publush Settings: Sleep Time: " + sleepTime + "ms", true);
            WriteComment("MQTT Publush Settings: Sample Time: " + defaultTime + "s", true);
            WriteComment("MQTT Publush Settings: QOS: " + QOS , true);
            WriteComment("MQTT Publush Settings: tagGroup: " + tagGroup, true);
            WriteHeading("MQTT Publush Settings");
           
            // MQTT Connected Status
            boolean connected = false;
           
            // Create MQTT Client Object
            MQTTClient Mqtt_c = null;
    
            // 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
    
                                        // Detect change
                                        if (values[i][0] != values[i][1]) { valuesChanged = true; }
                                    }
                                } catch (Exception ex) {
                                    handleError(ex, "Error with Tag: \"" + ewonTag + "\" msg:");
                                    values[i][0] = 0;
                                    values[i][1] = 0;
                                    values[i][2] = -1; // Set Reading Error = True
                                }
                            } else {
                                // Reset unused values
                                values[i][0] = 0;
                                values[i][1] = 0;
                                values[i][2] = -1;
                            }
                        }
    
                        // 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;
    
                                    // Build JSON payload
                                    JSONObject payload = new JSONObject();
                                    payload.put("time", String.valueOf(epoch));
                                    payload.put("id", ewonTag);
                                    payload.put("pv", String.valueOf(values[i][0]));
                                        
                                    try {
                                        
                                        // 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
    
                    // Add asleep between checking values
                    try { Thread.sleep(deltaTime); }
                    catch (InterruptedException e) { e.printStackTrace();}               
                   
                    // Reset changed flag
                    valuesChanged = false;
                    elapsedTime += deltaTime;
                }               
            }
        } catch (Exception ex) { handleError(ex, "Error occurred:"); }       
    }
   
    /**
     * 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
       
        boolean connected = false;
        MQTTClient client = existingClient;

        // Read configuration parameters
        String brokerHost = config.brokerHost();
        String brokerPort = config.brokerPort();
        String brokerUsername = config.brokerUsername();
        String brokerPassword = config.brokerPassword();
        String brokerLog = config.brokerLog();
        boolean brokerUseCert = config.brokerUseCert();

        try {
            if (client == null) {

                WriteHeading("EstablishConnection: Initilise Connection");
                WriteComment("Broker Settings: JAVA Script Starting", true);
                WriteComment("Broker Settings: ClientID: " + eWonSN + " (Ewon Serial Number)", true);
                WriteComment("Broker Settings: Host: " + brokerHost + ", Port: " + brokerPort, true);
                if (brokerUsername != null && !brokerUsername.equals("")) {
                    WriteComment("Broker Settings: Username: " + brokerUsername, true);
                    WriteComment("Broker Settings: Password: " + brokerPassword, true);
                }
                WriteComment("Broker Settings: Logging: " + brokerLog, true);     
                WriteComment("Broker Settings: Use Certificates: " + brokerUseCert, true);               

                // 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:"); }
               
                WriteHeading("EstablishConnection: Client Configured");               
            }

            // Check if client is connected
            connected = isClientConnected(client);
           
            for (int attempt = 1; attempt <= maxRetries; attempt++) {
            //while (!connected) {
                // Attempt to connect
                WriteComment("EstablishConnection: Attempting to Connect...");
                client.connect();
    
                int status = client.getStatus();
                connected = isClientConnected(client);               
                if (connected) {
                    WriteComment("Mqtt_c.GetStatus: " + status);
                    WriteComment("EstablishConnection: Connected to: " + brokerHost + ":" + brokerPort);
                    WriteHeading("EstablishConnection: Client Connected");
                    return client; // success
                } else {
                    WriteComment("EstablishConnection: Retrying connection...");
                    try {
                        Thread.sleep(retryDelayMs);
                    } catch (InterruptedException ie) {
                        Thread.currentThread().interrupt();
                        WriteError("EstablishConnection: Thread interupted");
                        break; // stop retrying if thread interrupted
                    }
                }
            }
           
            WriteError("Failed to connect after " + maxRetries + " attempts");
            return client; // success
        }
        catch (EWException ex) { handleError(ex, "EstablishConnection: EWException:"); }
        catch (Exception ex) { handleError(ex, "EstablishConnection: Exception:"); }
       
        return null; // failed connection
    }

    /**
     * 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);
    }
}

Continue reading..

Forum Statistics
Members: 6.251,   Forum threads: 2.529,   Forum posts: 9.136,   Latest member: Miroslav,   Full Statistics

Latest Threads
2x Flexy - direct connection
Last post published by mnieuzyla
05-03-2026, 06:48 PM 0

How to read a file
Last post published by mickaa
20-02-2026, 01:51 PM 4

Change value from Ewon tag
Last post published by ziozetti
19-02-2026, 11:37 PM 4

Guide: Flexy using OpenVPN via CloudConnexa instead of Talk2M
Last post published by steverb32
18-02-2026, 08:14 PM 2

how sharing DATA between two Cosy
Last post published by ProAuto
17-02-2026, 09:50 PM 0

SYS or COM parameters for activate SD CARD
Last post published by mickaa
12-02-2026, 06:32 PM 0

Using a user's saved password without writing it in plain text into the program?
Last post published by mickaa
12-02-2026, 02:58 PM 0

Java 1.4 update
Last post published by cracksalad
06-02-2026, 09:29 PM 13

Every Java program ends in "ZipException: bad header in central file directory"
Last post published by cracksalad
06-02-2026, 07:20 PM 0

Ewon Cosy port forward for SQL Server
Last post published by FimoHub
29-01-2026, 05:15 PM 2


Search Forums

Advanced Search



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy