Skip to content

swat121/Karen-API-Integration

Repository files navigation

Karen

This repository contain the source code of the message broker, that is able to help you get connect to other home mircoservice.

Desciption


Karen - is a service, that creates a connection between apps (telegram bots, website, android app) and smart things (ESP8266, Arduino UNO). Karen have a standard array of commands that control microcontrollers:

  • help
  • status
  • setting
    • relay1
    • relay2
    • relay3
    • backlight
  • sensor
    • temperature
    • light
  • bot
    • message

This array of commands must be in the source code of every service running microcontrollers, in order to ensure normal communication.

For cluster management of microcontrollers in Karen used application.yaml file with local ip address every microcontroller.

Example:

service:
  resource:
    garry: "http://192.168.0.100:80/"
    patric: "http://192.168.0.101:80/"

Requirements


  • java 17.0.3
  • maven 3.8.4

Instalation and running (git)


Clone repository:

git clone https://github.com/swat121/Karen-Api.git
cd Karen-Api

Build project:

mvn clean compile
mvn clean package [or mvn package -DskipTests] 

Launch jar file:

java -jar Karen-Api-0.0.1-SNAPSHOT.jar

Instalation and running (docker)


Clone image:

docker pull swat121/karen:tagname

Create container, you can use docker-compose or command line for environment variable

command line

docker run -p 8080:8080 -e TOKEN=yourToken -e ID=yourID -e CHAT=yourChat --restart=always -d swat121/karen:tagname

docker-compose

version: "3"

services:
  karen:
    image: swat121/karen:tagname
    restart: always
    container_name: karen
    environment:
      token: "yourToken"
      id: "yourId"
      chat: yourChat
    ports:
      - 8080:8080

Reference


About

API for connection to NodeMCU microcontrollers

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published