GithubHelp home page GithubHelp logo

edgecommander / edge-commander Goto Github PK

View Code? Open in Web Editor NEW
10.0 6.0 3.0 15.23 MB

Device Management & Monitoring Application

Elixir 8.72% HTML 7.33% JavaScript 7.93% CSS 68.56% Vue 7.46%
iot elixir-phoenix cctv-cameras cctv routers onvif

edge-commander's Introduction

Edge Commander : Device Management & Monitoring Build Status

Update: This app has served its purpose for us and is now offline. If the code or the idea is of interest to anyone, please feel welcome to work with it. You can contact me at @marcoherbst

This is an open source application written in Phoenix that allows monitoring & management of devices on the edge.

That includes:

  • NVRs (Hikvision or OnVIF)
  • Routers (Dovado & Teltonika)
  • SIMs (From Three (Ireland & UK))
  • Solar Controller (Victron MPTT)

Functionality includes:

  • Status Polling & Alerts
  • Graphical representation of Device Online / Offline status using Visavail
  • If This Then That functionality (e.g. If SIM usage is > X then Notify)

It is designed to be an extensible platform for system integrators to monitor client-side equipment.

edge-commander's People

Contributors

ali7862 avatar azharmalik3 avatar dependabot-preview[bot] avatar dependabot[bot] avatar hadi786 avatar marcoherbst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

edge-commander's Issues

Public Website

Maybe this:
https://onepagelove.com/namari

If there are no better ideas, and this template etc. is suitable, then I'd suggest using Github pages static hosting for this. We'll need to configure domains etc.

It might be better to have this all in the same repo and all on Heroku, I don't know.

I think:

www.edgecommander.com is the public site by default and
app.edgecommander.com will be the dashboard (or use /app if you prefer).

SIM DB populated from other sources?

Today our SIM DB is populated only from Three

I have a few Vodafone SIMS that we can add either:

a) manually
b) by there being correspondence via nexmo

This means also, I guess, that there will be a new field for SIMS such as "Provider" ... needs discussion.

Add NVR using QR Code

Scan the QR code to add the device. See if you can do this. You'll need a QR code reading API and will also need to access the USB camera via browser.

Add Sites (Name, SIM, Router, NVR, Location)

A site is an aggregation of SIM, Router, NVR it has a name & location.

In the future this may be one to many, but I think the first version should be 1:1

It is optional to add SIM, Router, Name, Location. Name is not optional.

Sensible naming & urls

/ - Dashboard
/nvrs
/nvrs/23323/
/sims/
/sims/23232
/status
/sites/
/sites/waxie
/routers/
/routers/32423

etc.

Integrations: Zoho

Needs discussion. At the simplest level, it's just associating a site with a Zoho Account Name so that we can:

  1. From EC open Zoho Account
  2. From Zoho, open EC Site

M

HTTP Commander (Generic Devices)

Create the possibility of adding a generic device.
This means user enters:

Username
Password
HTTP URL
(maybe) Auth Type:

and, whatever the response is gets formatted and displayed in a table under a left nav item "Other"

We may have to have a 2nd step where the user defines a new "Device Type" .....

This is not a small task, but a proof of concept would be very interesting to see, it makes EdgeComm universal

Add Dashboard

Really I don't know what will be on the / homepage, but it should not be NVRs.

It will be something. Maybe some kind of summary of activity or the first 10 rows from all tables in one view. Something like that.

Main point: The other reports (nvrs, status etc.) all are subheadings.

A lovely swagger API :)

We discussed this for Evercam.
One of the reasons you're doing this is to learn how swagger (now OpenAPI) works and how it can be done really nicely...

The API endpoints will be api.edgecommander.com/v1/....

Think carefully about how you want them to look, this can easily be done badly.

Users & Roles

Users have rights on a device Read Only or Full (these are called Roles). It's the same as Evercam really.

We will also add Teams. See relevant issue.

SMS history like Mightytext layout

  • Left / right alignment of sent / resceived
  • and new message at the TOP.
  • and infinite scrolling for history.

... This should avoid you having to have the "inbound" / "outbound" flag ... you wont need this if you do ALIGN RIGHT / ALIGN LEFT

Priority One Tasks

  • SIM report working 100% with Graph
  • NVR Report: Add NVR, Edit, Delete
  • Status Report: Data Toggle
  • Add in Dummy Navigation as per spec.
  • Move GH repo to evercam
  • Get the domain working, SSL etc.

Many errors in production logs

Go through each of them and fix them.

05:08:06.301 [error] Task #PID<0.577.0> started from #PID<0.576.0> terminating
2018-01-31T05:08:06.301671+00:00 app[web.1]: ** (BadMapError) expected a map, got: nil
2018-01-31T05:08:06.301672+00:00 app[web.1]:     (stdlib) :maps.remove("reason", nil)
2018-01-31T05:08:06.301674+00:00 app[web.1]:     (edge_commander) lib/edge_commander/monitors/portable.ex:67: EdgeCommander.Portable.update_nvr_status/3
2018-01-31T05:08:06.301676+00:00 app[web.1]:     (elixir) lib/enum.ex:675: Enum."-each/2-lists^foreach/1-0-"/2
2018-01-31T05:08:06.301678+00:00 app[web.1]:     (elixir) lib/enum.ex:675: Enum.each/2
2018-01-31T05:08:06.301680+00:00 app[web.1]:     (quantum) lib/quantum/executor.ex:98: Quantum.Executor.execute_task/1
2018-01-31T05:08:06.301681+00:00 app[web.1]:     (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
2018-01-31T05:08:06.301683+00:00 app[web.1]:     (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
2018-01-31T05:08:06.301685+00:00 app[web.1]:     (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
2018-01-31T05:08:06.301687+00:00 app[web.1]: Function: #Function<6.79063667/0 in Quantum.Executor.run/3>
2018-01-31T05:08:06.301689+00:00 app[web.1]:     Args: []
2018-01-31T05:08:18.959582+00:00 app[web.1]: 05:08:18.959 request_id=33dc4f54-77a2-4464-bebc-a7291c15d74f [info] GET /delivery_receipt
2018-01-31T05:08:18.963225+00:00 app[web.1]: 05:08:18.963 [error] #PID<0.582.0> running EdgeCommanderWeb.Endpoint terminated
2018-01-31T05:08:18.961736+00:00 app[web.1]: 05:08:18.961 request_id=33dc4f54-77a2-4464-bebc-a7291c15d74f [info] Sent 500 in 2ms
2018-01-31T05:08:18.963227+00:00 app[web.1]: Server: app.edgecommander.com:80 (http)
2018-01-31T05:08:18.963229+00:00 app[web.1]: Request: GET /delivery_receipt?msisdn=353867514314&to=353872705838&network-code=27202&messageId=0D0000007780398E&price=0.05850000&status=accepted&scts=1801301203&err-code=1&client-ref=SMe672cfdbf11d067f&message-timestamp=2018-01-30+12%3A03%3A37
2018-01-31T05:08:18.963230+00:00 app[web.1]: ** (exit) an exception was raised:
2018-01-31T05:08:18.963231+00:00 app[web.1]:     ** (FunctionClauseError) no function clause matching in EdgeCommander.Nexmo.SimMessages.changeset/2
2018-01-31T05:08:18.963233+00:00 app[web.1]:         (edge_commander) lib/edge_commander/nexmo/sim_messages.ex:20: EdgeCommander.Nexmo.SimMessages.changeset(nil, %{status: "accepted"})
2018-01-31T05:08:18.963236+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/controllers/sims_controller.ex:1: EdgeCommanderWeb.SimsController.action/2
2018-01-31T05:08:18.963234+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/controllers/sims_controller.ex:161: EdgeCommanderWeb.SimsController.delivery_receipt/2
2018-01-31T05:08:18.963237+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/controllers/sims_controller.ex:1: EdgeCommanderWeb.SimsController.phoenix_controller_pipeline/2
2018-01-31T05:08:18.963238+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/endpoint.ex:1: EdgeCommanderWeb.Endpoint.instrument/4
2018-01-31T05:08:18.963240+00:00 app[web.1]:         (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-01-31T05:08:18.963241+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/endpoint.ex:1: EdgeCommanderWeb.Endpoint.plug_builder_call/2
2018-01-31T05:08:18.967190+00:00 app[web.1]: 05:08:18.966 request_id=28944cf1-7582-479f-beb7-63bc76821bb6 [info] GET /delivery_receipt
2018-01-31T05:08:18.963243+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/endpoint.ex:1: EdgeCommanderWeb.Endpoint.call/2
2018-01-31T05:08:18.968943+00:00 app[web.1]: 05:08:18.968 request_id=28944cf1-7582-479f-beb7-63bc76821bb6 [info] Sent 500 in 1ms
2018-01-31T05:08:18.970444+00:00 app[web.1]: 05:08:18.970 [error] #PID<0.583.0> running EdgeCommanderWeb.Endpoint terminated
2018-01-31T05:08:18.970449+00:00 app[web.1]: Request: GET /delivery_receipt?msisdn=353867514314&to=353872705838&network-code=27202&messageId=0D0000007780398E&price=0.05850000&status=delivered&scts=1801301203&err-code=0&client-ref=SMe672cfdbf11d067f&message-timestamp=2018-01-30+12%3A03%3A39
2018-01-31T05:08:18.970446+00:00 app[web.1]: Server: app.edgecommander.com:80 (http)
2018-01-31T05:08:18.970451+00:00 app[web.1]: ** (exit) an exception was raised:
2018-01-31T05:08:18.970453+00:00 app[web.1]:     ** (FunctionClauseError) no function clause matching in EdgeCommander.Nexmo.SimMessages.changeset/2
2018-01-31T05:08:18.970457+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/controllers/sims_controller.ex:161: EdgeCommanderWeb.SimsController.delivery_receipt/2
2018-01-31T05:08:18.970459+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/controllers/sims_controller.ex:1: EdgeCommanderWeb.SimsController.action/2
2018-01-31T05:08:18.970455+00:00 app[web.1]:         (edge_commander) lib/edge_commander/nexmo/sim_messages.ex:20: EdgeCommander.Nexmo.SimMessages.changeset(nil, %{status: "delivered"})
2018-01-31T05:08:18.970461+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/controllers/sims_controller.ex:1: EdgeCommanderWeb.SimsController.phoenix_controller_pipeline/2
2018-01-31T05:08:18.970463+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/endpoint.ex:1: EdgeCommanderWeb.Endpoint.instrument/4
2018-01-31T05:08:18.970465+00:00 app[web.1]:         (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-01-31T05:08:18.970466+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/endpoint.ex:1: EdgeCommanderWeb.Endpoint.plug_builder_call/2
2018-01-31T05:08:18.970468+00:00 app[web.1]:         (edge_commander) lib/edge_commander_web/endpoint.ex:1: EdgeCommanderWeb.Endpoint.call/2
2018-01-31T05:08:18.963431+00:00 heroku[router]: at=info method=GET path="/delivery_receipt?msisdn=353867514314&to=353872705838&network-code=27202&messageId=0D0000007780398E&price=0.05850000&status=accept

UX items v2

  • x-axis give true dot spacing
  • Add status to NVR report, maybe also include last 24hrs in vizavil

Command 2: NVR SDK Reboot when HTTP port fails

When HTTP port is down, but SDK port is still working (consistently for more than, say, 2 mins), then send an SDK reboot command.

If one has been sent within last 6 hours, do not send another one.

This will need a demo from Faisal and then Wireshark to work out what the command is.

2 Conditions must be true:

  1. Failed response to a HTTP command (e.g. ISAPI device info) (or ... a port open test might be enough)
  2. Successful test of SDK port (not sure how you want to do that, a port open test might be enough).

My guess is that you will need us to find an example of one of these NVRs so we can do this test.

UX improvements

Remove Left Nav: Dashboard & Password Generator

It seems that all pages have a title which repeats their name in the left nav. Remove that (and save vertical space).

Default to SIMS report.

Remove Footer

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.