[BUILD-STABLE]: Job 'PLC4X/PLC4X/develop [develop] [8]'

2020-07-27 Thread Apache Jenkins Server
BUILD-STABLE: Job 'PLC4X/PLC4X/develop [develop] [8]':

Is back to normal.

[BUILD-FAILURE]: Job 'PLC4X/PLC4X/develop [develop] [7]'

2020-07-27 Thread Apache Jenkins Server
BUILD-FAILURE: Job 'PLC4X/PLC4X/develop [develop] [7]':

Check console output at "https://ci-builds.apache.org/job/PLC4X/job/PLC4X/job/develop/7/;>PLC4X/PLC4X/develop
 [develop] [7]"

[GitHub] [plc4x] hutcheb opened a new pull request #174: Feature/extended register read

2020-07-27 Thread GitBox


hutcheb opened a new pull request #174:
URL: https://github.com/apache/plc4x/pull/174


   Add extended register/file record  read only support, function code 20.
   
   This allows you to query data within the 60 memory range.
   
   The 60 memory range starts at file 1 address 0 (60). Each file has a 
length of 1 so 61 would be the first address in file 2.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [plc4x] ottlinger opened a new pull request #173: Update README.md

2020-07-27 Thread GitBox


ottlinger opened a new pull request #173:
URL: https://github.com/apache/plc4x/pull/173


   Fix typo in name and make link TLS and proper markdown.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




Re: Connection died after disconnection

2020-07-27 Thread Stefano Bossi
Hi Chris,

I follow your suggestion and I have opened a Jira ticket with a couple
of capture.

Here is the link:
https://issues.apache.org/jira/browse/PLC4X-220

Regards,
Steafano Bossi


On 25/07/2020 10:33, Christofer Dutz wrote:
> Hi Stefano, 
>
> Connection reset looks like the remote hung up. 
> In general the code looks good. One thing you could do would be to do
> a wireshark recording. Then we can identify what's going wrong. 
>
> In that case ideally create a jira issue and attach that pcapng file
> to that. 
>
> Chris
> 
> *Von:* Stefano Bossi 
> *Gesendet:* Samstag, 25. Juli 2020 09:06
> *An:* dev@plc4x.apache.org 
> *Betreff:* Re: Connection died after disconnection
>  
>
> Dear Chris,
>
> I tried to follow your suggestions but I still have some problem.
>
> I wrote a test application to show you the problem and ask suggestions.
> Basically my app fire a couple of thread which read a field in a DB
> continuously; the problem is that after some seconds one of the two
> thread fire an untrappable exception and the software dies.
> Here is my code:
>
> |package it.fox; import org.apache.logging.log4j.LogManager; import
> org.apache.logging.log4j.Logger; import
> org.apache.plc4x.java.api.PlcConnection; import
> org.apache.plc4x.java.utils.connectionpool.PooledPlcDriverManager;
> public class App { private static final Logger logger =
> LogManager.getLogger(App.class); public static void main(String[]
> args) { try { PlcConnection plcConnection = new
> PooledPlcDriverManager().getConnection("s7://192.168.1.192?controller-type=S7_1200");
> if (plcConnection.getMetadata().canRead() ) { Poller01 poller01 = new
> Poller01(); poller01.start(plcConnection); Poller02 poller02 = new
> Poller02(); poller02.start(plcConnection); } else { logger.error("This
> connection doesn't support reading."); Thread.sleep(5000); } } catch
> (Exception exception) { logger.error("Error connecting to the PLC",
> exception); } } } |
> |package it.fox; import java.util.concurrent.TimeUnit; import
> org.apache.logging.log4j.LogManager; import
> org.apache.logging.log4j.Logger; import
> org.apache.plc4x.java.api.PlcConnection; import
> org.apache.plc4x.java.api.messages.PlcReadRequest; import
> org.apache.plc4x.java.api.messages.PlcReadResponse; public class
> Poller01 implements Runnable { private static final Logger logger =
> LogManager.getLogger(Poller01.class); private Thread thread; private
> PlcConnection plcConnection; @Override public void run() {
> PlcReadRequest.Builder requestBuilder =
> plcConnection.readRequestBuilder(); requestBuilder.addItem("data",
> "%DB1:262.0:INT"); PlcReadRequest readRequest =
> requestBuilder.build(); while(true){ try { PlcReadResponse response =
> readRequest.execute().get(5000, TimeUnit.MILLISECONDS); if (response
> != null){ logger.info("poller01 = {}", response.getPlcValue("data") );
> Thread.sleep( (int) Math.floor(Math.random() * 100) ); } else {
> logger.error("No response from PLC in reading polling variable");
> break; } } catch (Exception e) { logger.error("Poller01 Exception",
> e); } } } /** * Start the thread */ public void start(PlcConnection
> plcConnection) { this.plcConnection = plcConnection;
> logger.info("Starting poller01 thread"); if (thread == null) { thread
> = new Thread(this, "poller01"); thread.start(); } } } |
> |package it.fox; import java.util.concurrent.TimeUnit; import
> org.apache.logging.log4j.LogManager; import
> org.apache.logging.log4j.Logger; import
> org.apache.plc4x.java.api.PlcConnection; import
> org.apache.plc4x.java.api.messages.PlcReadRequest; import
> org.apache.plc4x.java.api.messages.PlcReadResponse; public class
> Poller02 implements Runnable{ private static final Logger logger =
> LogManager.getLogger(Poller02.class); private Thread thread; private
> PlcConnection plcConnection; @Override public void run() {
> PlcReadRequest.Builder requestBuilder =
> plcConnection.readRequestBuilder(); requestBuilder.addItem("data",
> "%DB1:0.0:DINT"); PlcReadRequest readRequest = requestBuilder.build();
> while(true){ try { PlcReadResponse response =
> readRequest.execute().get(5000, TimeUnit.MILLISECONDS); if (response
> != null){ logger.info("poller02 = {}", response.getPlcValue("data") );
> Thread.sleep( (int) Math.floor(Math.random() * 500) ); } else {
> logger.error("No response from PLC in reading polling variable");
> break; } } catch (Exception e) { logger.error("Poller01 Exception",
> e); } } } /** * Start the thread */ public void start(PlcConnection
> plcConnection) { this.plcConnection = plcConnection;
> logger.info("Starting poller02 thread"); if (thread == null) { thread
> = new Thread(this, "poller02"); thread.start(); } } } |
>
> The exception the code throw is:
>
> |[INFO ] 22:59:19.767 org.apache.plc4x.java.PlcDriverManager.()
> - Instantiating new PLC Driver Manager with class loader
> jdk.internal.loader.ClassLoaders$AppClassLoader@55054057 [INFO ]
> 22:59:19.770 

[jira] [Created] (PLC4X-220) Connection die in multithreading

2020-07-27 Thread Stefano Bossi (Jira)
Stefano Bossi created PLC4X-220:
---

 Summary: Connection die in multithreading
 Key: PLC4X-220
 URL: https://issues.apache.org/jira/browse/PLC4X-220
 Project: Apache PLC4X
  Issue Type: Bug
  Components: Driver-S7
Affects Versions: 0.7.0
Reporter: Stefano Bossi
 Attachments: capture01.pcapng, capture02.pcapng

Dear developers,

I wrote a test application to show you the problem as requested.
The test app fire a couple of thread which read a field in a DB (Siemens 1200 
S7) continuously; the problem is that after some seconds one of the two thread 
fire an untrappable exception and the software dies.
Here is my code:
```java
package it.fox;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.utils.connectionpool.PooledPlcDriverManager;

public class App {

private static final Logger logger = LogManager.getLogger(App.class);
public static void main(String[] args) {

try {
PlcConnection plcConnection = new 
PooledPlcDriverManager().getConnection("s7://192.168.1.192?controller-type=S7_1200");
if (plcConnection.getMetadata().canRead() ) {
Poller01 poller01 = new Poller01();
poller01.start(plcConnection);
Poller02 poller02 = new Poller02();
poller02.start(plcConnection);

} else {
logger.error("This connection doesn't support reading.");
Thread.sleep(5000);
}
} catch (Exception exception) {
logger.error("Error connecting to the PLC", exception);
}
}
}
```
```java
package it.fox;

import java.util.concurrent.TimeUnit;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcReadResponse;

public class Poller01 implements Runnable {

private static final Logger logger = LogManager.getLogger(Poller01.class);
private Thread thread;
private PlcConnection plcConnection;

@Override
public void run() {
PlcReadRequest.Builder requestBuilder = 
plcConnection.readRequestBuilder();
requestBuilder.addItem("data", "%DB1:262.0:INT");
PlcReadRequest readRequest = requestBuilder.build();
while(true){
try {
PlcReadResponse response = readRequest.execute().get(5000, 
TimeUnit.MILLISECONDS);
if (response != null){
logger.info("poller01 = {}", response.getPlcValue("data") );
Thread.sleep( (int) Math.floor(Math.random() * 100) );
} else {
logger.error("No response from PLC in reading polling 
variable");
break;
}
} catch (Exception e) {
logger.error("Poller01 Exception", e);
}
}
}

/**
 * Start the thread
 */
public void start(PlcConnection plcConnection) {
this.plcConnection = plcConnection;
logger.info("Starting poller01 thread");
if (thread == null) {
thread = new Thread(this, "poller01");
thread.start();
}
}

}
```
```java
package it.fox;

import java.util.concurrent.TimeUnit;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcReadResponse;

public class Poller02 implements Runnable{

private static final Logger logger = LogManager.getLogger(Poller02.class);
private Thread thread;
private PlcConnection plcConnection;

@Override
public void run() {
PlcReadRequest.Builder requestBuilder = 
plcConnection.readRequestBuilder();
requestBuilder.addItem("data", "%DB1:0.0:DINT");
PlcReadRequest readRequest = requestBuilder.build();
while(true){
try {
PlcReadResponse response = readRequest.execute().get(5000, 
TimeUnit.MILLISECONDS);
if (response != null){
logger.info("poller02 = {}", response.getPlcValue("data") );
Thread.sleep( (int) Math.floor(Math.random() * 500) );
} else {
logger.error("No response from PLC in reading polling 
variable");
break;
}
} catch (Exception e) {
logger.error("Poller01 Exception", e);
}
}
}

/**
 * Start the thread
 */
public void start(PlcConnection plcConnection) {
this.plcConnection = plcConnection;
 

[BUILD-STABLE]: Job 'PLC4X/PLC4X Build-Tools/develop [develop] [2]'

2020-07-27 Thread Apache Jenkins Server
BUILD-STABLE: Job 'PLC4X/PLC4X Build-Tools/develop [develop] [2]':

Is back to normal.

Re: Build Server changed ... working on it ...

2020-07-27 Thread Christofer Dutz
Well the main issue was that our builds were relying on some tagged nodes that 
weren't moved to the new server yet. 
I had to re-configure my sonarcloud token as that wasn't moved and without it 
the build failed.
Nothing too complicated, but had to be done.

Chris


Am 27.07.20, 03:21 schrieb "Xiangdong Huang" :

Hi Chris,

> I’ll keep on working on setting up everything on the new CI system

Thanks for notifying us. Could you briefly guide us on what may need to be
set?

Best,
---
Xiangdong Huang
School of Software, Tsinghua University


Christofer Dutz  于2020年7月27日周一 上午3:55写道:

> Hi folks,
>
> so today I managed to get the configuration on the new CI server running
> and I think we're back in business.
>
> Chris
>
> Am 25.07.20, 15:25 schrieb "Christofer Dutz" :
>
> Hi all,
>
> I just noticed, that infra moved our build agent from the old
> build.apache.org to the new ci-build.apache.org … so we will never be
> able to build on the old server again (Just before reaching build 1000 ☹ )
> … just wanted to tell you about this.
>
> I’ll keep on working on setting up everything on the new CI system …
> but for now it might be, that we won’t have SNAPSHOTs for a few days.
>
> Chris
>
>
>