Skip to content

Commit

Permalink
Merge branch 'develop' into feature/LstmModel
Browse files Browse the repository at this point in the history
  • Loading branch information
pooran-c committed Oct 29, 2024
2 parents cb1dd44 + d58852d commit 9881037
Show file tree
Hide file tree
Showing 886 changed files with 24,289 additions and 12,791 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ updates:
patterns:
- "org.dhatim:fastexcel"
- "org.dhatim:fastexcel-reader"
bouncycastle:
patterns:
- "org.bouncycastle:*"

- package-ecosystem: npm
directory: "/ui"
Expand Down
2 changes: 1 addition & 1 deletion .gradle-wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ subprojects {
}

checkstyle {
toolVersion = '10.11.0'
toolVersion = '10.18.2'
configFile = file("${rootDir}/cnf/checkstyle.xml")
maxWarnings = 0
ignoreFailures = false
Expand Down
1 change: 1 addition & 0 deletions cnf/build.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ buildpath: \
org.osgi.service.metatype.annotations;version='1.4.1',\
org.osgi.util.promise;version='1.2.0',\
com.google.guava;version='33.3.1.jre',\
com.google.guava.failureaccess;version='1.0.2',\
com.google.gson;version='2.11.0',\

testpath: \
Expand Down
18 changes: 8 additions & 10 deletions cnf/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="AvoidStarImport"/>
Expand All @@ -47,9 +47,9 @@
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
Expand Down Expand Up @@ -107,8 +107,8 @@
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-zA-Z0-9]*)?$"/>
<property name="accessModifiers" value="public"/>
<property name="format" value="^[a-z]([a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
Expand Down Expand Up @@ -144,9 +144,9 @@
</module>
<module name="Indentation">
<property name="severity" value="ignore"/>
<property name="arrayInitIndent" value="2"/>
<property name="basicOffset" value="2"/>
<property name="caseIndent" value="2"/>
<property name="arrayInitIndent" value="2"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="AbbreviationAsWordInName">
Expand Down Expand Up @@ -179,12 +179,10 @@
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph">
<property name="allowNewlineParagraph" value="false"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z_][a-zA-Z0-9_]*$"/>
Expand All @@ -206,15 +204,15 @@
<property name="tokens" value="ANNOTATION_DEF,ANNOTATION_FIELD_DEF,CLASS_DEF,CTOR_DEF,ENUM_CONSTANT_DEF,ENUM_DEF,INTERFACE_DEF,METHOD_DEF,VARIABLE_DEF"/>
</module>
<module name="MissingJavadocMethod">
<property name="allowedAnnotations" value="Before,Test,After,Override"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="allowedAnnotations" value="Before,Test,After,Override"/>
<property name="ignoreMethodNamesRegex" value="doc|set.+|build"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
<property name="allowPublicFinalFields" value="true"/>
<property name="allowPublicImmutableFields" value="true"/>
<property name="protectedAllowed" value="true"/>
</module>
</module>
<module name="LineLength">
Expand Down
44 changes: 40 additions & 4 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,34 @@
<version>1.5</version>
</dependency>
<!-- io -->
<dependency>
<!-- Miscellaneous JNA utilities for Linux -->
<!-- Used by io.openems.edge.io.i2c -->
<groupId>io.helins</groupId>
<artifactId>linux-common</artifactId>
<version>0.1.4</version>
</dependency>
<dependency>
<!-- Use the standard Linux I2C API from JVM -->
<!-- Used by io.openems.edge.io.i2c -->
<groupId>io.helins</groupId>
<artifactId>linux-i2c</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<!-- Basic Linux IO utilities for java through JNA -->
<!-- Used by io.openems.edge.io.i2c -->
<groupId>io.helins</groupId>
<artifactId>linux-io</artifactId>
<version>0.0.4</version>
</dependency>
<dependency>
<!-- Java utilities for errno -->
<!-- Used by io.openems.edge.io.i2c -->
<groupId>io.helins</groupId>
<artifactId>linux-errno</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxjava</artifactId>
Expand Down Expand Up @@ -253,9 +281,17 @@
</dependency>
<dependency>
<!-- Bouncycastle for Eclipse Paho MQTTv5 Client -->
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on -->
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.78.1</version>
</dependency>
<dependency>
<!-- Bouncycastle for Eclipse Paho MQTTv5 Client -->
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on -->
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.78.1</version>
</dependency>
<dependency>
<groupId>org.dhatim</groupId>
Expand Down Expand Up @@ -301,7 +337,7 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-osgi-bundle</artifactId>
<version>2.0.20</version>
<version>2.0.21</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
Expand Down Expand Up @@ -414,4 +450,4 @@
<version>3.9</version>
</dependency>
</dependencies>
</project>
</project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 85 additions & 4 deletions doc/modules/ROOT/pages/backend/deploy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@
:icons: font
:imagesdir: ../../assets/images

== Debian Linux

This chapter explains how OpenEMS Backend can be deployed on a Debian Linux server. Similar techniques will work for other operating systems as well.

== Prepare operating system environment
=== Prepare operating system environment

NOTE: It is recommended to run every service on a server with limited permissions. This example runs OpenEMS Backend with user "root" which is a bad idea for a production server!

=== Create an application directory
==== Create an application directory

Create the directory */opt/openems-backend*. This is going to be the place, where we put the JAR file.

Execute `mkdir /opt/openems-backend`.

=== Create a config directory
==== Create a config directory

Create the directory */opt/openems-backend/config.d*. This is going to be the place, where all the bundle configurations are held.

Execute `mkdir /opt/openems-backend/config.d`.

=== Create a systemd service definition
==== Create a systemd service definition

The systemd 'Service Manager' manages system processes in a Debian Linux. We will create a systemd service definition file, so that systemd takes care of managing (starting/restarting/...) the OpenEMS Backend service.

Expand Down Expand Up @@ -78,3 +80,82 @@ To update the OpenEMS JAR file at the target device, it is required to copy the
Execute `systemctl restart openems-backend --no-block; journalctl -lfu openems-backend`
+
The command restarts the service (_systemctl restart openems-backend_) while not waiting for the OpenEMS startup notification (_--no-block_). Then it directly prints the OpenEMS system log (_journalctl -lfu openems-backend_).

== Docker

This chapter explains how OpenEMS Backend can be deployed using our official https://hub.docker.com/r/openems/backend[Docker image].

=== Prepare system

==== Connect to the server

image::deploy-docker-ssh.png[SSH into device]

==== Check docker installation

image::deploy-docker-backend-check-version.png[Check docker installation]

__if not already installed, follow <<Setup docker>>__

==== Setup docker

To setup docker follow the instuctions from https://docs.docker.com/engine/install/[docs.docker.com].

=== Create a Docker compose

Paste content into a `docker-compose.yml`
----
services:
openems_backend:
image: openems/backend:latest
container_name: openems_backend
hostname: openems_backend
restart: unless-stopped
volumes:
- openems-backend-conf:/var/opt/openems/config:rw
- openems-backend-data:/var/opt/openems/data:rw
ports:
- 8079:8079 # Apache-Felix
- 8081:8081 # Edge-Websocket
- 8082:8082 # UI-Websocket
openems-ui:
image: openems/ui-backend:latest
container_name: openems_ui
hostname: openems_ui
restart: unless-stopped
volumes:
- openems-ui-conf:/etc/nginx:rw
- openems-ui-log:/var/log/nginx:rw
environment:
- UI_WEBSOCKET=ws://<hostname>:8082 # Change to your actual hostname or ip
ports:
- 80:80
- 443:443
volumes:
openems-backend-conf:
openems-backend-data:
openems-ui-conf:
openems-ui-log:
----

=== Run compose file

To start the previously created `docker-compose.yml` run the command:
----
docker compose up -d
----

=== Check logs

To check if the container is up and running, check `docker ps`:

image::deploy-docker-backend.png[docker ps]

or read its logs with:
----
docker logs openems_backend
----

NOTE: If you want to run the backand with an InfluxDB instance as well, see: https://github.com/OpenEMS/openems/tree/develop/tools/docker/backend.
75 changes: 74 additions & 1 deletion doc/modules/ROOT/pages/edge/deploy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
:icons: font
:imagesdir: ../../assets/images

== Debian Linux

This chapter explains how OpenEMS can be deployed on a Debian Linux Internet-of-Things Gateway. Similar techniques will work for other operating systems as well.

This guide covers a simple, manual approach. For productive systems it is required to automate deployment to IoT devices. Good approaches include a Debian package repository that provides *.deb-files and third-party tools like http://www.eclipse.org/hawkbit/[Eclipse Hawkbit]. This is out-of-scope for this small guide.
Expand All @@ -19,7 +21,7 @@ Prerequisites:
* Setup an SSH client to connect to the Linux console, e.g. http://www.9bis.net/kitty/[KiTTY]
* Setup an SCP client to copy the JAR file via SSH, e.g. https://winscp.net/eng/docs/lang:de[WinSCP]

== Connect via SSH and SCP
=== Connect via SSH and SCP

. Connect via SSH using KiTTY
.. Open KiTTY and connect to the target device.
Expand Down Expand Up @@ -132,3 +134,74 @@ The command restarts the service (_systemctl restart openems_) while not waiting
+
.OpenEMS Edge start-up
image::deploy-openems-start.png[OpenEMS Edge start-up]


== Docker

This chapter explains how OpenEMS can be deployed using our official https://hub.docker.com/r/openems/edge[Docker image].

Prerequisites:

* A amd64 or arm64 device running Linux. You need the IP address and SSH access.
* A working docker environment. To setup follow instruction from https://docs.docker.com/engine/install/[docs.docker.com].

=== Prepare system

==== Connect to the device

image::deploy-docker-ssh.png[SSH into device]

==== Check docker installation

image::deploy-docker-edge-check-version.png[Check docker installation]

__if not already installed, follow <<Setup docker>>__

==== Setup docker

To setup docker follow the instuctions from https://docs.docker.com/engine/install/[docs.docker.com].

=== Start Container

==== Create a Docker compose

Paste content into a `docker-compose.yml`
----
services:
openems-edge:
image: openems/edge:latest
container_name: openems_edge
hostname: openems_edge
restart: unless-stopped
volumes:
- openems-edge-conf:/var/opt/openems/config:rw
- openems-edge-data:/var/opt/openems/data:rw
ports:
- 8080:8080 # Apache-Felix
volumes:
openems-edge-conf:
openems-edge-data:
----

==== Run compose file

To start the previously created `docker-compose.yml` run the command:
----
docker compose up -d
----

==== Check logs

To check if the container is up and running, check `docker ps`:

image::deploy-docker-edge.png[docker ps]

or read its logs with:
----
docker logs openems_edge
----

---

NOTE: If you want to start a UI instance as well, see: https://github.com/OpenEMS/openems/tree/develop/tools/docker/edge.
2 changes: 1 addition & 1 deletion io.openems.backend.application/BackendApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
org.apache.felix.scr;version='[2.2.12,2.2.13)',\
org.apache.felix.webconsole;version='[5.0.8,5.0.9)',\
org.apache.felix.webconsole.plugins.ds;version='[2.3.0,2.3.1)',\
org.jetbrains.kotlin.osgi-bundle;version='[2.0.20,2.0.21)',\
org.jetbrains.kotlin.osgi-bundle;version='[2.0.21,2.0.22)',\
org.jsr-305;version='[3.0.2,3.0.3)',\
org.ops4j.pax.logging.pax-logging-api;version='[2.2.1,2.2.2)',\
org.ops4j.pax.logging.pax-logging-log4j2;version='[2.2.1,2.2.2)',\
Expand Down
Loading

0 comments on commit 9881037

Please sign in to comment.