Giter VIP home page Giter VIP logo

gas-sensor's Introduction

Gas sensor

To build the projects, simply run mvn clean install.

Web application

Installation

After building the projects, the web application binary will be located at:

  • gas-sensor-web\target\gas-sensor-web.exe (Windows specific)
  • gas-sensor-web\target\gas-sensor-web.jar (All OS)

Configuration

You need to create an application.yml next to the binary before running it:

ze07:
  gas-sensors: # Not required, activates the reading from the specified ports of ZE07 sensors if the jserialcomm profile is activated.
    -
      port-name: COM2 # Required
ze08:
  gas-sensors: # Not required, activates the reading from the specified ports of ZE08 sensors if the jserialcomm profile is activated.
    -
      port-name: COM3 # Required
zh03a:
  gas-sensors: # Not required, activates the reading from the specified ports of ZH03A sensors if the jserialcomm profile is activated.
    -
      port-name: COM4 # Required
zph01:
  gas-sensors: # Not required, activates the reading from the specified ports of ZPH01 sensors if the jserialcomm profile is activated.
    -
      port-name: COM5 # Required
mhz19:
  gas-sensors: # Not required, activates the reading from the specified ports of MH-Z19 sensors if the jserialcomm profile is activated.
    -
      port-name: COM6 # Required
si7021:
  gas-sensors: # Not required, activates the reading from the specified ports of Si7021 sensors if the jserialcomm profile is activated.
    -
      description: _Inside # Not required
      port-name: COM7 # Required
    -
      description: _Outside # Not required
      port-name: COM8 # Required
spring:
  profiles:
    active: jserialcomm # Profile jserialcomm activates the reading from the sensors via the serial port communication. Profile mock activates the reading from mock sensors.
  datasource: 
    url: jdbc:h2:~/gas-sensor-web;DB_CLOSE_ON_EXIT=FALSE # Not required, by default a memory H2 database is created. PostgreSQL JDBC URL are also supported.
  jpa:
    hibernate:
      ddl-auto: update # Not required, but if not added, you will have to create the tables by hand.
logging:
  file:
    name: gas-sensor-web.log # Not required, default is logging to console only.
server:
  port: 8081 # Not required, default is 8080.

Usage

To run it, you can:

  • Double click on gas-sensor-web.exe (Windows specific)
  • Run java -jar gas-sensor-web.jar (All OS)

Java clients

If you need to use the gas sensors in your own Java projects, you can use the Java clients. The only external dependency used by these clients is jSerialComm for handling the serial port communication.

If you want to use all the clients, you can add to your POM this shortcut dependency:

<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-all</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>

You can also add the clients one by one:

  • ZPH01:
<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-zph01</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>
  • ZH03A:
<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-zh03a</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>
  • ZE07:
<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-ze07</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>
  • ZE08:
<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-ze08</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>
  • MH-Z19:
<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-mhz19</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>
  • Si7021:
<dependency>
	<groupId>fr.romainmoreau.gassensor</groupId>
	<artifactId>gas-sensor-client-si7021</artifactId>
	<version>0.1.0-SNAPSHOT</version>
</dependency>

To use a client, you just need to instanciate it and close it when it's not needed anymore. You can find a way to instanciate all the existing clients here.

gas-sensor's People

Contributors

romainmoreau avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.