ajout des recettes et fichiers de configuration du meta
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,406 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
||||
"$id": "https://git.nas.benserv.fr/vincent/Kine-backend/src/branch/master/db.json",
|
||||
"type": "object",
|
||||
"title": "KineIntercom database",
|
||||
"description": "This document records the parameters of KineIntercom process",
|
||||
"required": [
|
||||
"CODE_PIN",
|
||||
"DTMF_CODE",
|
||||
"DTMF_DURATION",
|
||||
"HORAIRES",
|
||||
"INFOS",
|
||||
"NUM_AUTORISE",
|
||||
"OPERATION",
|
||||
"PIN_ACTIF",
|
||||
"TONE_DURATION",
|
||||
"utilisateur"
|
||||
],
|
||||
"properties": {
|
||||
"CODE_PIN": {
|
||||
"type": "string",
|
||||
"title": "Le code pin de la carte SIM",
|
||||
"examples": [
|
||||
"1234"
|
||||
]
|
||||
},
|
||||
"DTMF_CODE": {
|
||||
"type": "string",
|
||||
"title": "Le code DTMF a envoyer par le module GSM",
|
||||
"examples": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
"DTMF_DURATION": {
|
||||
"type": "integer",
|
||||
"title": "La duree du code DTMF a envoyer par le module GSM",
|
||||
"examples": [
|
||||
10
|
||||
]
|
||||
},
|
||||
"HORAIRES": {
|
||||
"type": "object",
|
||||
"title": "Les horaires d'ouverture et de fermeture du module GSM",
|
||||
"required": [
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday",
|
||||
"Sunday"
|
||||
],
|
||||
"properties": {
|
||||
"Monday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Vendredi",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Tuesday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Lundi",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Wednesday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Samedi",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Thursday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Dimanche",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Friday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Jeudi",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Saturday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Mardi",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Sunday": {
|
||||
"type": "array",
|
||||
"title": "Les horaires pour le jour de la semaine: Mercredi",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"title": "A Schema",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "Les tranches horaires par pas de 1/2 heure"
|
||||
},
|
||||
"state": {
|
||||
"type": "integer",
|
||||
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
|
||||
"examples": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"INFOS": {
|
||||
"type": "object",
|
||||
"title": "Les infos du module GSM",
|
||||
"required": [
|
||||
"control",
|
||||
"manufacturer"
|
||||
],
|
||||
"properties": {
|
||||
"control": {
|
||||
"type": "object",
|
||||
"title": "The control Schema",
|
||||
"required": [
|
||||
"call_ready",
|
||||
"operator",
|
||||
"service_provider",
|
||||
"signal_dbm",
|
||||
"signal_qos",
|
||||
"sim_inserted"
|
||||
],
|
||||
"properties": {
|
||||
"call_ready": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"title": "The call_ready Schema",
|
||||
"examples": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"title": "The operator Schema",
|
||||
"examples": [
|
||||
"SFR"
|
||||
]
|
||||
},
|
||||
"service_provider": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"title": "The service_provider Schema",
|
||||
"examples": [
|
||||
"La poste mobile"
|
||||
]
|
||||
},
|
||||
"signal_dbm": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"title": "The signal_dbm Schema",
|
||||
"examples": [
|
||||
"-75"
|
||||
]
|
||||
},
|
||||
"signal_qos": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"title": "The signal_qos Schema",
|
||||
"examples": [
|
||||
"excellent"
|
||||
]
|
||||
},
|
||||
"sim_inserted": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"title": "The sim_inserted Schema",
|
||||
"examples": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"manufacturer": {
|
||||
"type": "object",
|
||||
"title": "The manufacturer Schema",
|
||||
"required": [
|
||||
"hardware_rev",
|
||||
"identification",
|
||||
"model",
|
||||
"serial_number"
|
||||
],
|
||||
"properties": {
|
||||
"hardware_rev": {
|
||||
"type": "string",
|
||||
"title": "The hardware_rev Schema",
|
||||
"examples": [
|
||||
"1418B02SIM868M32_BT_EAT"
|
||||
]
|
||||
},
|
||||
"identification": {
|
||||
"type": "string",
|
||||
"title": "The identification Schema",
|
||||
"examples": [
|
||||
"SIMCOM_Ltd"
|
||||
]
|
||||
},
|
||||
"model": {
|
||||
"type": "string",
|
||||
"title": "The model Schema",
|
||||
"examples": [
|
||||
"SIMCOM_SIM868"
|
||||
]
|
||||
},
|
||||
"serial_number": {
|
||||
"type": "string",
|
||||
"title": "The serial_number Schema",
|
||||
"examples": [
|
||||
"864866057705260"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"NUM_AUTORISE": {
|
||||
"type": "string",
|
||||
"title": "The NUM_AUTORISE Schema",
|
||||
"examples": [
|
||||
"670100036"
|
||||
]
|
||||
},
|
||||
"OPERATION": {
|
||||
"type": "string",
|
||||
"title": "The OPERATION Schema",
|
||||
"examples": [
|
||||
"Horaires"
|
||||
]
|
||||
},
|
||||
"PIN_ACTIF": {
|
||||
"type": "boolean",
|
||||
"title": "The PIN_ACTIF Schema",
|
||||
"examples": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"TONE_DURATION": {
|
||||
"type": "integer",
|
||||
"title": "The TONE_DURATION Schema",
|
||||
"examples": [
|
||||
2
|
||||
]
|
||||
},
|
||||
"utilisateur": {
|
||||
"type": "object",
|
||||
"title": "L'utilisateur du configurateur",
|
||||
"required": [
|
||||
"id",
|
||||
"password"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"title": "The id Schema",
|
||||
"examples": [
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"title": "The password Schema",
|
||||
"examples": [
|
||||
"9ac564e9a29c952a3ddeffd8635adb0c252dbd1d58f3efde265e028f7f808aa9"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Démarrage du processus KineIntercom
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=5
|
||||
After=getty.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pi
|
||||
Group=pi
|
||||
ExecStart=/usr/bin/python3 /usr/local/lib/python3.9/dist-packages/kineintercom/intercom.py
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# Copyright (C) 2022 Vincent BENOIT <vincent.benoit@benserv.fr>
|
||||
# Release under the MIT license (see COPYING.MIT for the terms)
|
||||
|
||||
HOMEPAGE = "https://git.nas.benserv.fr/vincent/KineIntercom.git"
|
||||
SUMMARY = "KineIntercom Process"
|
||||
MAINTAINER = "Vincent BENOIT <vincent.benoit@benserv.fr>"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=7dda4e90ded66ab88b86f76169f28663"
|
||||
LICENSE = "MIT"
|
||||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
|
||||
|
||||
SRC_URI = "git://git.nas.benserv.fr/vincent/KineIntercom.git;protocol=https;branch=master"
|
||||
SRC_URI[sha256sum] = "573c6bf06324577d4007c9167eeaca7825927c5a396534ae1d86905db53e0386"
|
||||
|
||||
SRCREV = "fd79a53348416bf844e412eb6442773661b35aa0"
|
||||
PV = "1.0.0"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
DEPENDS = "python3-setuptools-scm-native kine-users"
|
||||
RDEPENDS:${PN} = "python3-apscheduler python3-jsonschema python3-pyserial rpi-gpio kine-users"
|
||||
|
||||
inherit setuptools3 systemd
|
||||
|
||||
SRC_URI += " file://database_origin.json \
|
||||
file://db.json.schema \
|
||||
file://kineintercom.service"
|
||||
|
||||
FILES:${PN} += " ${datadir}/kineintercom/database_origin.json \
|
||||
${datadir}/kineintercom/db.json.schema \
|
||||
${systemd_unitdir}/system/kineintercom.service"
|
||||
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
SYSTEMD_SERVICE:${PN} = "kineintercom.service"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${datadir}/kineintercom
|
||||
install -m 0644 ${WORKDIR}/database_origin.json ${D}${datadir}/kineintercom/
|
||||
install -m 0644 ${WORKDIR}/db.json.schema ${D}${datadir}/kineintercom/
|
||||
install -d ${D}${sysconfdir}/kineintercom
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/kineintercom.service ${D}${systemd_unitdir}/system/
|
||||
}
|
||||
Reference in New Issue
Block a user