Giter VIP home page Giter VIP logo

ftp2mqtt's Introduction

ftp2mqtt

This microservice acts as a bridge between IP cameras (with FTP support for motion detected events) and an MQTT broker.

It should run on a private network only, it is not recommend to expose it to the internet.

How to build

You need the Java Development Kit (JDK) 10 installed on your system.

  1. Clone this repository:

    git clone https://github.com/1element/ftp2mqtt.git .
    
  2. Run Gradle build:

    ./gradlew build
    

You will end up with an artifact (ftp2mqtt-<VERSION>.jar) in the build/libs/ directory.

You can start the application by executing:

java -jar ftp2mqtt-<VERSION>.jar

If you want to use Docker there is a Gradle task to build a Docker image:

./gradlew build docker

This can also be done manually by passing the artifact as an argument to the Docker build command:

docker build -t ftp2mqtt --build-arg JAR_FILE=build/libs/ftp2mqtt-<VERSION>.jar .

Configuration

If you start the application Spring Boot expects a configuration file application.properties in the same directory where your JAR file is located. If you use Docker there is a volume /config for this.

Example configuration application.properties:

# FTP server
ftp.port=2121
ftp.password=secret

# MQTT
mqtt.broker-connection=ssl://localhost:1883
mqtt.username=username
mqtt.password=password
mqtt.topic-prefix=ipcamera/

You can specify the port and the password for the built-in FTP server. Connections are accepted for any username. The FTP username will be prefixed with the configured mqtt.topic-prefix and used as the MQTT topic to publish to.

So if your IP camera uploads motion detected images to the FTP server using the username "backyard", the image will be published to the MQTT brokers topic ipcamera/backyard (assuming "ipcamera/" is configured as the prefix).

You also need to configure your MQTT broker connection (host and port) as well as the username and password.

Contributions

This application was written for my own purpose, therefore it may lack in features and configuration abilities. In case it might be useful for someone I decided to share it. However, pull requests are welcome.

License

This project is licensed under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

For more information, see LICENSE.md.

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.