JW

Forum Replies Created

Viewing 15 posts - 106 through 120 (of 147 total)
  • Author
    Posts
  • in reply to: HTTPS on Linux #8143
    JW
    Participant

    Continuing from previous reply. Assuming a Linux system with SCADA installed using all default setting, no other websites.

    STEP 1 – Prepare ssl certification
    put them in the path you like, make sure their permission allows read

    /path/to/ssl.crt
    /path/to/ssl.key

    STEP 2 – Change apache2 default ports
    Edit file
    sudo nano /etc/apache2/ports.conf
    Change content to

    Listen 8080
    
    <IfModule ssl_module>
            Listen 8081
    </IfModule>
    
    <IfModule mod_gnutls.c>
            Listen 8081
    </IfModule>

    Also edit this file
    sudo nano /etc/apache2/sites-enabled/000-default.conf
    change port number only, keep other things

    <VirtualHost *:8080>
    # keep the content in this file
    </VirtualHost>

    ssl is not enbled on apache by defualt, but if ssl is already on apache, then also edit this file.
    sudo nano /etc/apache2/sites-enabled/000-default-ssl.conf
    change port number only, keep other things

    <VirtualHost *:8081>
    # keep the content in this file
    </VirtualHost>

    restart apache
    sudo systemctl restart apache2.service

    in reply to: Silent server crash #8124
    JW
    Participant

    I had experienced similar things before when:

    Using Auto Control Module to send commands to one external modbus device.

    The cause I suspect:
    1 trigger send multiple commands;
    or several triggers send commands at the same time;

    It happens quite frequently when doing stress test, e.g. toggling the trigger every a few second.

    as I remember in detail log, it’s similar to the issue I mentioned in another post. (Modbus Comm Bug)
    it looks like scada mis-align the reply from the modbus slave software.
    https://drive.google.com/file/d/11y8e6zyzzKWXJovF0uj8TM22hCG9TJkH/view?usp=sharing

    I am going to find my records, as see if I can make a minimum project that reproduce this problem.

    in reply to: HTTPS on Linux #8115
    JW
    Participant

    Architecture of my latest approach is listed below, which seems working. the configuration should be less complicated than the approach mentioned in previous replies.

    ---Nginx:80
         |
    ---Nginx:443---apache2-scada:8080

    Note: because embedding http content in iframe (such as External URL on Interface, or Dashboard) of https site will not work, so I redirect all http request to https. the site becomes https only. The content being embedded need to be changed to https too.

    I only tested demo project will a few different External URL on interface at the moment.

    I will make a procedure in detail and update here later. (Friday night or weekend)

    in reply to: HTTPS on Linux #8105
    JW
    Participant

    by enabling ssl of apache2 itself, the https site show error msg of
    error updating current/hourly data
    Is it the Mono-WCF bug stopping scada with apache2 https?

    Why would we need Nginx + Mono FastCGI?

    Apache2:80--->apache2-scada:80
    |
    Apache2:443--->Nignx:8008---fastcgi:9000-----apache2-scada:80

    I am thinking about the following method, is there any obstacle or bug stopping it from working? I will have a try and update my result here.

    Nginx:80--->apache2-scada:8080
    |
    Nginx:443--->apache2-scada:8080
    in reply to: behavior of lower / upper alarm limit #8104
    JW
    Participant

    Case 5 : -20,None,None,20
    when val is -1, the channel stat will become 12 and color will turn light blue.
    no event (correct, as it should)

    In future version, if some limit is not set, not just the related event not appear, the related stat should not appear, considering other channel may use, is it?

    case like this, there should be only stat of 11,13,15.

    in reply to: HTTPS on Linux #8098
    JW
    Participant

    using kumajaya’s nginx fastcgi method, the demo project works well.
    I am testing more complicated projects currently.
    The first issue I encounter URL in Interface table not working properly. (something like the grafana integration)

    I tested 2 URL format:
    – scadaserverip:5000/example (other web running on the same scada server)
    – other.example.com

    they can be loaded correctly when I open browser on server. but when i open browser on other clients, the content frame can’t load the URL page.

    Is it because of the scadasweb or fastcgi or just the proxy setting?

    in reply to: ScadaAdmin on Linux #8072
    JW
    Participant

    Usually I need to provide a server machine and a GUI client machine to the customer. The customer will run the webpage of scada 24*7 on the client I provided, and occasionally on their own computer.

    For some project, I used a server with GUI to simplify hardware setup and save cost.

    It did cause some problems. Lesson learned. I think I will switch back to separated server + GUI Client setup for upcoming projects.

    For GUI client, Windows pc maybe better option at the moment. When upload project can be done from Linux client, then I can switch to Linux GUI client.

    in reply to: Modbus Comm Bug #8071
    JW
    Participant

    Thanks Mikhail, the problem is solved. the formula below can keep the result until n consecutive errors.

    public Dictionary<int, int> ChannelErrors = new Dictionary<int, int>();
    
    double NStepVal(int n)
    {
    if (!(ChannelErrors.ContainsKey(CnlNum))) {ChannelErrors[CnlNum] = 0;}
    if (CnlStat == 0) 
    {
    if (ChannelErrors[CnlNum] >= n) {return double.NaN;}
    else {return Val();}
    }
    else {return CnlVal;}
    }
    
    int NStepStat(int n)
    {
    if (!(ChannelErrors.ContainsKey(CnlNum))) {ChannelErrors[CnlNum] = 0;}
    if (CnlStat == 0) 
    {
    if (ChannelErrors[CnlNum] >= n) {ChannelErrors[CnlNum] = 0;  return 0;}
    else {ChannelErrors[CnlNum] = ChannelErrors[CnlNum] +1; return 1;}
    }
    else {ChannelErrors[CnlNum] = 0;  return CnlStat;}
    }
    in reply to: sec data save #8067
    JW
    Participant

    In administrator – Instances – Server – Saving parameters, you can choose the save interval for minute data.

    The options available options can be as low as per 30s.

    in the project folder, you edit the following file,
    Instances/Default/ScadaServer/Config/ScadaServerSvcConfig.xml
    change the following line

    <Param name=”WriteMinPer” value=”60″ descr=”Minute data writing period, sec” />

    fill in value=”1″.

    It will save data in ArchiveDAT/Min folder per 1 second on my test.
    But be very careful, I am not sure if there will be any negative impact.
    I suspect it can slow down or even crash the server when you download minute report or plot chars.

    in reply to: ScadaAdmin on Linux #8062
    JW
    Participant

    You can easily start and stop services by *.sh files that are already in the scada directory and subdirectories.
    Talking about download and upload, do you mean performing this actions locally on the target server or remotely?

    Adding a CLI command/scripts that can upload project locally would be very helpful. then I can make a local GUI/CLI utilizing those scripts.

    I suppose, it’s possible to develop a web plugin to do all of these functions. Especially for start, stop and upload.

    This would be even better.

    For some project that server and sensor are in a LAN without public WAN IP / NAT, end user can monitor SCADA in LAN, but I will need to use TeamViewer remote desktop to provide support if needed. The operation on TeamViewer is more like local operation instead of remote operation.

    (at some extreme case, the customer doesn’t not allow physical access nor remote access. I have to send they the project file and instruct them how to upload it. Uploading via mono ScadaAdmin.exe is usable, but can be success / fail very randomly. which may look very weird to the customer.)

    in reply to: ScadaAdmin on Linux #8060
    JW
    Participant

    Thanks manjey73 for your help. I actually did similar things on one project a while ago with pi 3. So the image is not needed. When the server has public IP, things are simpler.

    But when the server has no public IP, e.g. on 4G or inside Lan but not NAT, it become not convenient, unless I set another VNP server on cloud.

    in reply to: Modbus Comm Bug #8059
    JW
    Participant

    Hi Mikhail,

    I did 3 tests listed below.

    Currently, when lower/upper alarm limit is set, no matter what previous stat it was (including unreliable and undefine state), as long as it goes into normal stat, it will trigger a normal event.

    I though there were 2 set of separated alarm logic, but don’t know where does unreliable falls into.
    – Event on limit: stat 11/12/13/14/15
    – Event on undefine: 0/1 / (5?)

    But seems actually they are somewhat related.

    1.
    Write Event + Event on Undefined + Lower + Upper Alarm Limit
    normal status, unreliable status, undefined status, normal status
    there are:
    – Undefined event when changed from unreliable to undefined;
    – Normal event when changed from undefined to normal
    https://drive.google.com/file/d/1DaZV7JnzTr0qfDgxGLfRBrs5YH25rmlz/view?usp=sharing

    2.
    Write Event + Event on Undefined + Lower + Upper Alarm Limit
    normal status, unreliable status, normal status
    there is:
    – Normal event when changed from unreliable to normal
    https://drive.google.com/file/d/1kYIYr07C0QjAZkhsf3iOQbPMWJaSlyD5/view?usp=sharing

    3.
    Write Event + Event on Undefined
    normal status, unreliable status, normal status
    there is:
    – No event
    https://drive.google.com/file/d/1pm_0ebgHjRSWiU_L25jLD2YnuQCaECiz/view?usp=sharing

    in reply to: Modbus Comm Bug #8035
    JW
    Participant

    Hi Mikhail,

    I made a formula using your approach, which worked for reducing the chance of false Undefined Event.

    But it has a Normal Event when from “Unreliable” to “Normal”. is there any way not to trigger the normal event?

    One way I can think of is to
    1. set one channel n1 using 2step value and stat
    2. set another channel n2 using Val(n1)
    but it’s not convenient to do this if I have lot’s of sensor

    double TwoStepVal()
    {
    if (CnlStat == 0)
    {
    if (Stat() == 5 || Stat() == 0) { return double.NaN;}
    else {return Val();}
    }
    else {return CnlVal;}
    }

    int TwoStepStat()
    {
    if (CnlStat == 0)
    {
    if (Stat() == 5 || Stat() == 0) { return 0;}
    else {return 5;}
    }
    else {return CnlStat;}
    }

    in reply to: ScadaAdmin on Linux #8002
    JW
    Participant

    This question is originated from the challenge of remote support for some project. Here are some of my experience and consideration. Hope it can provide some info for you to consider what to do with the ScadaAdmin on Linux in the future development.

    For project installation, we usually need to provide HMI/GUI hardware (client pc, monitor…). For some project, we provide remote support with 4G mobile network + Teamviewer (because normal 4g sim doesn’t provide fixed public IP).

    For the server setup and remote support, I tried the following options. Each of them have pros and corns, I haven’t decide which one to use for future projects.

    Linux server with GUI
    This will save cost and simplified installation. Linux server is easier to manger than windows server.
    But when I need to remote update the project, I have to connect with teamviewer, send the updated project file, then use the not full functioning ScadaAdmin on linux.
    User GUI operation may affect the server.

    Window server
    This solve the no problem updating scada.
    But sometimes the windows server is not as convenient to manage, if I need to run other service along with SCADA.
    User GUI operation may affect the server.

    Linux server + Windows Client
    Easy to manage server and no problem updating scada.
    User GUI operation will not affect the server.
    More hardware and higher cost.

    Recently, I tried 4G simcard with fixed public IP, which enables me to upload scada project to the server directly from my PC from any where (and other benefits such as SSH/VNH…), no matter what server setup I am using.
    The fixed public IP plan can be very expensive.
    At some remote locations, maybe only 1 ISP have good mobile signal, but that ISP doesn’t provide fixed public IP plan.

    In summary,
    Editing projects on Linux is not necessary and should be avoided.
    While Start/Stop of server/communicator and Download/Upload project file, via command line / GUI would be useful.

    in reply to: Modbus Comm Bug #7999
    JW
    Participant

    Have you thought about splitting the template? It would make a polling session shorter. Short template is better in case of communication errors, because it’s don’t needed to request 49 groups again if the 50th group is failed.

    requesting 30 groups (50 signal/group) works fine most of the time and takes less than 0.1s, since the communication is from localhost(scada) to localhost(another software on same server).

    The main issue I am facing is that, if I enabled Event on Undefined for those sensors, there will be Events / Alarms of undefined channel (disconnected sensor), and Event of resumed normal within next request.

Viewing 15 posts - 106 through 120 (of 147 total)