heuels / briskhome-irrigation Goto Github PK
View Code? Open in Web Editor NEWExternal component that implements support for custom Arduino-based irrigation controllers.
External component that implements support for custom Arduino-based irrigation controllers.
On several occasions irrigation of a circuit halted without logging the fact of stop. The criteria (moisture, time or lever) were fullfilled. This bug appears only when irrigation should be stopped via a parameter.
Originally reported by: Egor Zaitsev (Bitbucket: ezaitsev, GitHub: ezaitsev)
Необходимо добавить возможность передачи в методы Controller.start() и Controller.stop() функции обратного вызова. Дополнительно, нужно отправлять сообщения:
irrigationWillStart
- перед началом полива контура;irrigationDidStart
- после начала полива контура;irrigationWillStop
- перед остановкой полива контура;irrigationDidStop
- после остановки полива контура.This is the 2nd part of issue #2, which at that time was not possible to implement. Need to consider options for implementing it, including changes that need to be made to briskhome-core.
The way I see it is other components associating irrigaation circuits with some of it internal properties and listening to Bus#IrrigationWillStart
event. If they hvae something to say, they call the function that is passed with the event and prevent irrigation from happening.
This, of course, should be logged as "The component xxx prevented irrigation from starting. Reason: yyy".
По постановке пользователя системы необходимо предложить алгоритмы расчета продолжительности полива для различных контуров в зависимости от набора характеристик, показаний сенсоров и т.д.
Так, например:
Необходимо проработать вопрос, возможно сделать синхронную функцию, которая будет возвращать продолжительность на основе входных данных (история датчиков, время, тип контура, пожелания пользователя и т.д.).
Current legacy (PHP) version of the interface should support setting irrigation such parameters as timeout and moisture limit. The new UI has to have support of this accordingly.
Ethernet Shield 2 can be pinged but does not respond to HTTP requests. Reboot fixes the problem.
PING 192.168.0.27 (192.168.0.27) 56(84) bytes of data.
64 bytes from 192.168.0.27: icmp_req=1 ttl=128 time=3.43 ms
64 bytes from 192.168.0.27: icmp_req=2 ttl=128 time=3.43 ms
^C
--- 192.168.0.27 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 3.431/3.431/3.432/0.058 ms
[2016-05-09 15:27:42] WARN: Контроллер недоступен (/opt/briskhome/node_modules/briskhome-irrigation/irrigation.js:91)
Код: 2
Ошибка: Не удалось установить соединение с контроллером
Подробная информация:
{
"Исключение": {
"code": "EHOSTUNREACH",
"errno": "EHOSTUNREACH",
"syscall": "connect",
"address": "192.168.0.27",
"port": 80
}
}
Irrigation controller sketch should include information about free memory and other applicable controller stats in response body in JSON format:
client.print("{\"status\": {\"code\": 200, \"message\": \"OK\", \"freemem\": " + String(freeRam()) + "}, \"data\": [");
...
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
Also, as stated here, function Ethernet.begin(mac)
should be moved to loop()
for the controller to recreate web server instance on every loop iteration thus decreasing chances of losing connection.
Version [email protected] should allow preventing several circuits of the same controller to be started simultaneously.
Circuit.find({ controller: circuit.controller._id, isActive: true }, (activeFindErr, activeCircuits) => {
if (activeCircuts.length > 0) {
log.warn('...');
return cb(new Error('...'));
}
});
Originally reported by: Egor Zaitsev (Bitbucket: ezaitsev, GitHub: ezaitsev)
По запросу пользователя необходимо реализовать отправку СМС-уведомления о превышении предельно допустимых параметров любым из сенсоров контура, в частности, температурным датчиком.
Схема реализации:
Номера телефонов для отправки уведомлений должны храниться в LDAP. До момента реализации модуля core.ldap номера телефонов могут храниться в файле в составе модуля core.sms, однако файл не должен находиться под контролем версий!
Originally reported by: Egor Zaitsev (Bitbucket: ezaitsev, GitHub: ezaitsev)
[2016-04-30 16:14:12] WARN: Работа модуля была завершена некорректно (/opt/briskhome-plugins/briskhome-irrigation/irrigation.js:276)
Код: 6
Ошибка: При инициализации обнаружен включенный полив контура
Подробная информация:
{
"Контур": "greenhouse"
}
[2016-04-30 16:14:12] TRACE: Обработка запроса на выключение полива контура (/opt/briskhome-plugins/briskhome-irrigation/irrigation.js:506)
Контур: greenhouse
[2016-04-30 16:14:12] INFO: Полив контура выключен (/opt/briskhome-plugins/briskhome-irrigation/irrigation.js:535)
Контур: greenhouse
При работе приложения произошло необработанное исключение
/opt/briskhome/briskhome.js:36
throw(err);
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at IncomingMessage.<anonymous> (/opt/briskhome-plugins/briskhome-irrigation/irrigation.js:528:37)
at emitOne (events.js:78:13)
at IncomingMessage.emit (events.js:170:7)
at readableAddChunk (_stream_readable.js:147:16)
at IncomingMessage.Readable.push (_stream_readable.js:111:10)
at HTTPParser.parserOnBody (_http_common.js:110:22)
at Socket.socketOnData (_http_client.js:312:20)
at emitOne (events.js:78:13)
at Socket.emit (events.js:170:7)
at readableAddChunk (_stream_readable.js:147:16)
at Socket.Readable.push (_stream_readable.js:111:10)
at TCP.onread (net.js:524:20)
@briskhome/[email protected]
version introduced breaking changes in the Log and Config APIs, and some other changes that are as critical. The current version does not fully support the latest system version.
Tests for commit 0e685f2 run successfully on BitBucket Pipelines but fail for the same commit on Travis CI & locally.
Linked to briskhome-core#6.
When a task is scheduled via core.planner component it is vital to define a source of the task, be it a user (e.g. via API Token or scheduling via web interface) or a component (e.g. via core.bus).
Originally reported by: Egor Zaitsev (Bitbucket: ezaitsev, GitHub: ezaitsev)
Модуль неоднократно аварийно завершал работу из-за ошибки при парсинге JSON, полученного от контроллера. Необходимо настроить вывод полученных сообщений в log.trace
и устранить ошибку.
[2016-05-03 19:51:20] INFO: Получен запрос с маркером аутентификации '12345abc' (/opt/briskhome/lib/core.api/index.js:56)
{ name: 'garden', status: false }
[2016-05-03 19:51:20] INFO: Полив контура выключен (/opt/briskhome/node_modules/briskhome-irrigation/irrigation.js:546)
Контур: garden
При работе приложения произошло необработанное исключение
SyntaxError: Unexpected token a
at Object.parse (native)
at IncomingMessage.<anonymous> (/opt/briskhome/node_modules/briskhome-irrigation/irrigation.js:60:35)
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
<-- Приложение аварийно завершило работу
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.