Code Monkey home page Code Monkey logo

briskhome-irrigation's Introduction

heuels io_en_

briskhome-irrigation's People

Contributors

heuels avatar

Watchers

 avatar  avatar

Forkers

albaniac

briskhome-irrigation's Issues

Callbacks and events

Originally reported by: Egor Zaitsev (Bitbucket: ezaitsev, GitHub: ezaitsev)


Необходимо добавить возможность передачи в методы Controller.start() и Controller.stop() функции обратного вызова. Дополнительно, нужно отправлять сообщения:

  • irrigationWillStart - перед началом полива контура;
  • irrigationDidStart - после начала полива контура;
  • irrigationWillStop - перед остановкой полива контура;
  • irrigationDidStop - после остановки полива контура.

Coordinate irrigation with other components

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".

Calculate optimal watering duration

По постановке пользователя системы необходимо предложить алгоритмы расчета продолжительности полива для различных контуров в зависимости от набора характеристик, показаний сенсоров и т.д.
Так, например:

  • В случае, если температура в теплице меньше 17 градусов, поливать не нужно, по крайней мере, несколько дней.
  • В случае, если на улице тепло, но не жарко, теплицу можно поливать и два часа.

Необходимо проработать вопрос, возможно сделать синхронную функцию, которая будет возвращать продолжительность на основе входных данных (история датчиков, время, тип контура, пожелания пользователя и т.д.).


No response from the controller: EHOSTUNREACH

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
                }
            }

Add system stats to controller firmware

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.


Notifications about reaching safety boundaries by a circuit

Originally reported by: Egor Zaitsev (Bitbucket: ezaitsev, GitHub: ezaitsev)


По запросу пользователя необходимо реализовать отправку СМС-уведомления о превышении предельно допустимых параметров любым из сенсоров контура, в частности, температурным датчиком.

Схема реализации:

  • В модель базы данных для сенсора необходимо добавить поддержку предельных значений,
  • При осуществлении регулярной проверки необходимо проверять не превышает ли текущее показание предельное,
  • Если превышает, то необходимо проверить, не превышает ли предыдущее показание предельное,
  • Если не превышает, то отправить СМС-уведомление.

Номера телефонов для отправки уведомлений должны храниться в LDAP. До момента реализации модуля core.ldap номера телефонов могут храниться в файле в составе модуля core.sms, однако файл не должен находиться под контролем версий!


Crash on irrigation stop

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)

Failing tests

Tests for commit 0e685f2 run successfully on BitBucket Pipelines but fail for the same commit on Travis CI & locally.

Crash on JSON.parse

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)
 <-- Приложение аварийно завершило работу

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.