ardtweeno 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +60 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +35 -33
- data/INSTALL +12 -8
- data/README.md +17 -17
- data/Rakefile +20 -8
- data/lib/ardtweeno/api.rb +409 -9
- data/lib/ardtweeno/dispatcher.rb +177 -128
- data/lib/ardtweeno/nodemanager.rb +33 -14
- data/lib/ardtweeno/restapi.rb +77 -26
- data/lib/ardtweeno/ringbuffer.rb +115 -0
- data/lib/ardtweeno.rb +2 -2
- data/public/favicon.ico +0 -0
- data/public/main.css +80 -14
- data/public/main.js +8 -1
- data/test/api_test.rb +60 -7
- data/test/debug/run_mock +1 -1
- data/test/debug/run_packet_push +4 -4
- data/test/debug/run_post_watch +4 -4
- data/test/debug/tty0tty-1.1/pts/tty0tty +0 -0
- data/test/dispatcher_test.rb +11 -8
- data/test/node_test.rb +7 -3
- data/test/nodemanager_test.rb +9 -5
- data/test/packet_test.rb +7 -3
- data/test/parser_test.rb +1 -3
- data/test/rest_api_test.rb +8 -0
- data/test/ringbuffer_test.rb +64 -0
- data/views/home.erb +2 -1
- data/views/index.erb +14 -10
- data/views/punchcard.erb +55 -0
- data/views/status.erb +48 -135
- data/views/topology.erb +12 -0
- metadata +7 -34
- data/public/bootstrap.min.js +0 -6
- data/public/highcharts.js +0 -270
- data/public/jquery-1.8.2.min.js +0 -2
- data/public/jquery-2.0.1.min.js +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d157740b9956acd9a32efa343e0f781d4aca11d
|
4
|
+
data.tar.gz: 6d23a441b410510a3212412e0ec9424a4d981911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4114dd22733d63b18891faaafc33f0668f45a01f6be67bc678306602283202dff74ac63bd5ee7a5bf19e4e4416c78ef0669627d1f655496822c5e33bd614888f
|
7
|
+
data.tar.gz: fcd8e50001b844d2b98a127253c730e5255dfaaa74a762a29d643443750d55687b03ece7904cdaff5a78045f0098b8c9506108d0a43652d2c02b8ca2fe51a588
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,63 @@
|
|
1
|
+
## Version 0.4.0
|
2
|
+
- Implemented status graph using the flot.js library. Fixes #28
|
3
|
+
- Implemented disk utility df parser - Table in /status endpoint now populated with disk usage data. Fixes #23
|
4
|
+
- Refactored Ardtweeno::Dispatcher#status? and broke functionality to Ardtweeno::API#status. Refs #23
|
5
|
+
- Implemented tests to cover Ardtweeno::API.buildPunchcard. Fixes #33
|
6
|
+
- Added retrieve-zones to the api-examples directory. Refs #27
|
7
|
+
- Updated retrieve-status.rb, and added retrieve-config and retrieve-nodes. Refs #28
|
8
|
+
- Fleshed out implementation of the api example retrieve-status.rb. Refs #27
|
9
|
+
- Renamed api example to fix typo
|
10
|
+
- Initial implementation of API Example demonstrating how to retrieve information about gateway status and load. Refs #27
|
11
|
+
- Incorporated the Ardtweeno::RingBuffer into a buffer containing the last 15 minutes worth of status data. - Exposed the buffer through /api/v1/system/status/list it does not require authentication to use.
|
12
|
+
- Added Ardtweeno::RingBuffer class to the Ardtweeno gem - Implemented test fixtures for the Ardtweeno::RingBuffer class
|
13
|
+
- Resolved an issue in the example-app where the application was not handling an exception correctly when the gateway was unavailable. Refs #26
|
14
|
+
- Resolved issue with date ranges during the first 7 days of the month. Punchcard graph generator now correctly calculates this range. Fixes #32
|
15
|
+
- Added api-sample-usage directory containing snippets of examples of the API being used. Refs #27
|
16
|
+
- Dispatcher#store was incorrectly sending invalid parameters to NodeManager#watched? Now resolved
|
17
|
+
- Fixed issue with disabled buttons in the example-app controlpanel view continuing to generate AJAX calls
|
18
|
+
- Navbar now correctly sets the active class to the selected menu link. Refs #26
|
19
|
+
- Added unit tests to cover functionality added to the API regarding querying the gateway for watch information
|
20
|
+
- API extended to query the gateway for all nodes currently watched, with the details of the watchee
|
21
|
+
- API extended to query the gateway if an individual node is watched. Fixes #31
|
22
|
+
- Example app example-app now queries the API and displays whether or not the nodes are watched in the control panel view. Refs #26
|
23
|
+
- Adding a watch now disables the button. Refs #26
|
24
|
+
- Hardened the implementation of watch lists - example-app now listens for return codes from the /api/v1/watch/node and behaves accordingly. Refs #26
|
25
|
+
- Tidied up the watch notification system slightly - Implemented means to add a node to a watchlist from the example-app control panel page. Refs #26
|
26
|
+
- Alterered logging output from fatal to warn for error messages surrounding the MongoDB connector creation
|
27
|
+
- Added skeleton interface for adding nodes to a watchlist from the example-app. Refs #26
|
28
|
+
- continuing development on the example-app refs #26
|
29
|
+
Merge branch 'punchcard-graph-date-range' into dev
|
30
|
+
- Ardtweeno punchcard graph v1 now produces date range information which is available from the node URI in the topology graph. Fixes #29
|
31
|
+
- Updated main README
|
32
|
+
- Fleshing out basic functionality of the example-app
|
33
|
+
- last 5 packets and zone information listed on front page. Refs #26
|
34
|
+
- Updated README for the ardtweeno-gem directory
|
35
|
+
- Slightly updated install instructions
|
36
|
+
- Noticed issue with Rakefile on system before bundle and dependencies were installed was not exiting gracefully, hopefully fixed this issue now
|
37
|
+
- example-app now correctly raises the desired HTML status codes when the Ardtweeno gateway is inaccessible. Refs #26
|
38
|
+
- Further refactorisation of the example-app. Refs #26
|
39
|
+
- Hardened example-app starting and stopping the gateway, while updating the interface with current status. Refs #26
|
40
|
+
- example-app is aware if the Ardtweeno gateway is accessible, and whether the SerialParser is running
|
41
|
+
- example-app now has a basic interface developed to allow the starting of the SerialParser. Refs #26
|
42
|
+
- Refactored example-app view templates into reusable layouts. Refs #26
|
43
|
+
- Adding some basic functionality to the example-app. Refs #26
|
44
|
+
- Added skeleton example-app which consumes the Ardtweeno API. Refs #26
|
45
|
+
- Deleting tech-demo app and starting to build a sample application which consumes the Ardtweeno API. Refs #26
|
46
|
+
- Altered the output from the punchcard graph generator to display times in a 24 hour format HH. Fixes #25
|
47
|
+
- Modified the Ardtweeno frontend Javascript to stop AJAX requests to the status API when navigating away from the status tab. Fixes #18
|
48
|
+
- Added favicon.ico. Fixes #21
|
49
|
+
- Added bootstrap styles to the punchcard view
|
50
|
+
- Implemented punchcard graph generator accessible when clicking on a node in the topology graph. Refs #6
|
51
|
+
- Implemented Topology graph generation internally and available from a tab menu on the gateway frontend. Fixes #5
|
52
|
+
- Added skeleton implementation of topology view - Updated index view with a new AJAX menu tab linked to the topology view
|
53
|
+
- Added Raphael.js library which is used in the construction of the topology graph. Refs #5
|
54
|
+
- Rakefile target test now cleans the tty0tty and then builds the binary before running tests. Fixes #19
|
55
|
+
|
56
|
+
|
57
|
+
## Version 0.3.1
|
58
|
+
- Fixed runtime dependency added twice in gemspec. - Fixes #17
|
59
|
+
- Release 0.3.0 merged to origin/master
|
60
|
+
|
1
61
|
## Version 0.3.0
|
2
62
|
- Incorrectly assert_true against method which does not return true or false - Refs #16
|
3
63
|
- System now passes mock confdata into the options hash should the ENV['RACK_ENV'] == 'test' - Fixes #16
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,68 +1,71 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
ardtweeno (0.
|
4
|
+
ardtweeno (0.4.0)
|
5
5
|
bson_ext (>= 1.6.2)
|
6
6
|
bundler (>= 1.2.3)
|
7
7
|
foreman (>= 0.63.0)
|
8
8
|
mongo (>= 1.6.2)
|
9
9
|
rufus-scheduler (>= 2.0.0)
|
10
10
|
sinatra (>= 1.3.3)
|
11
|
-
sinatra (>= 1.3.3)
|
12
11
|
thin (>= 1.5.0)
|
13
12
|
typhoeus (>= 0.6.3)
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
atomic (1.1.14)
|
14
|
+
bson (1.9.2)
|
15
|
+
bson_ext (1.9.2)
|
16
|
+
bson (~> 1.9.2)
|
17
17
|
daemons (1.1.9)
|
18
18
|
diff-lcs (1.2.4)
|
19
|
-
dotenv (0.
|
20
|
-
ethon (0.
|
19
|
+
dotenv (0.9.0)
|
20
|
+
ethon (0.6.1)
|
21
21
|
ffi (>= 1.3.0)
|
22
22
|
mime-types (~> 1.18)
|
23
23
|
eventmachine (1.0.3)
|
24
|
-
ffi (1.9.
|
24
|
+
ffi (1.9.1)
|
25
25
|
foreman (0.63.0)
|
26
26
|
dotenv (>= 0.7)
|
27
27
|
thor (>= 0.13.6)
|
28
|
-
json (1.8.
|
29
|
-
mime-types (1.
|
30
|
-
mini_portile (0.5.
|
31
|
-
mongo (1.9.
|
32
|
-
bson (~> 1.9.
|
28
|
+
json (1.8.1)
|
29
|
+
mime-types (1.25)
|
30
|
+
mini_portile (0.5.2)
|
31
|
+
mongo (1.9.2)
|
32
|
+
bson (~> 1.9.2)
|
33
33
|
nokogiri (1.6.0)
|
34
34
|
mini_portile (~> 0.5.0)
|
35
35
|
rack (1.5.2)
|
36
|
-
rack-protection (1.5.
|
36
|
+
rack-protection (1.5.1)
|
37
37
|
rack
|
38
38
|
rack-test (0.6.2)
|
39
39
|
rack (>= 1.0)
|
40
|
-
rake (10.0
|
41
|
-
rspec (2.
|
42
|
-
rspec-core (~> 2.
|
43
|
-
rspec-expectations (~> 2.
|
44
|
-
rspec-mocks (~> 2.
|
45
|
-
rspec-core (2.
|
46
|
-
rspec-expectations (2.
|
40
|
+
rake (10.1.0)
|
41
|
+
rspec (2.14.1)
|
42
|
+
rspec-core (~> 2.14.0)
|
43
|
+
rspec-expectations (~> 2.14.0)
|
44
|
+
rspec-mocks (~> 2.14.0)
|
45
|
+
rspec-core (2.14.6)
|
46
|
+
rspec-expectations (2.14.3)
|
47
47
|
diff-lcs (>= 1.1.3, < 2.0)
|
48
|
-
rspec-mocks (2.
|
49
|
-
rufus-scheduler (
|
50
|
-
tzinfo
|
51
|
-
serialport (1.1
|
52
|
-
sinatra (1.4.
|
48
|
+
rspec-mocks (2.14.4)
|
49
|
+
rufus-scheduler (3.0.2)
|
50
|
+
tzinfo
|
51
|
+
serialport (1.2.1)
|
52
|
+
sinatra (1.4.4)
|
53
53
|
rack (~> 1.4)
|
54
54
|
rack-protection (~> 1.4)
|
55
55
|
tilt (~> 1.3, >= 1.3.4)
|
56
56
|
test-unit (2.5.5)
|
57
|
-
thin (1.
|
57
|
+
thin (1.6.0)
|
58
58
|
daemons (>= 1.0.9)
|
59
|
-
eventmachine (>= 0.
|
60
|
-
rack (>= 1.
|
59
|
+
eventmachine (>= 1.0.0)
|
60
|
+
rack (>= 1.5.0)
|
61
61
|
thor (0.18.1)
|
62
|
+
thread_safe (0.1.3)
|
63
|
+
atomic
|
62
64
|
tilt (1.4.1)
|
63
|
-
typhoeus (0.6.
|
64
|
-
ethon (~> 0.
|
65
|
-
tzinfo (1.
|
65
|
+
typhoeus (0.6.5)
|
66
|
+
ethon (~> 0.6.1)
|
67
|
+
tzinfo (1.1.0)
|
68
|
+
thread_safe (~> 0.1)
|
66
69
|
|
67
70
|
PLATFORMS
|
68
71
|
ruby
|
@@ -78,7 +81,6 @@ DEPENDENCIES
|
|
78
81
|
rack-test
|
79
82
|
rake
|
80
83
|
rspec
|
81
|
-
rufus-scheduler (>= 2.0)
|
82
84
|
serialport (>= 1.1.0)
|
83
85
|
sinatra (>= 1.3.3)
|
84
86
|
test-unit
|
data/INSTALL
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
+
####################################################################################################
|
2
|
+
# @author David Kirwan https://github.com/davidkirwan/ardtweeno
|
3
|
+
# @description Ardtweeno Gem Installation Instructions
|
4
|
+
#
|
5
|
+
# @date 02-07-2013
|
6
|
+
####################################################################################################
|
7
|
+
|
1
8
|
# Ardtweeno MVP - Installation instructions
|
2
9
|
The Ardtweeno system can be installed from https://rubygems.org/gems/ardtweeno through the _gem_ utility, or by checking
|
3
|
-
out the
|
4
|
-
|
5
|
-
|
6
|
-
System gem dependencies can be installed using the _bundler install_ command from the git repository root directory.
|
10
|
+
out the code from the git repository on https://github.com/davidkirwan/ardtweeno. To install change directory to the
|
11
|
+
_ardtweeno-gem_ directory then use the _bundle_ utility to install the dependencies. Use the _rake_ utility to build and
|
12
|
+
install the gem.
|
7
13
|
|
8
|
-
Tests can be run with the _rake test_ command from the
|
9
|
-
serial modem to have been compiled prior to the tests being executed. This system is bundled with the gem in the following
|
10
|
-
directory: _tests/tty0tty/pts_. Enter the directory and compile the library with the _make_.
|
14
|
+
Tests can be run with the _rake test_ command from the _ardtweeno-gem_ folder.
|
11
15
|
|
12
|
-
To launch the system, simply type _foreman start -f Procfile -p <port>_
|
16
|
+
To launch the system, simply type _foreman start -f Procfile -p <port>_ from the _ardtweeno-gem_ folder.
|
data/README.md
CHANGED
@@ -1,22 +1,25 @@
|
|
1
1
|
# Ardtweeno
|
2
|
-
Ardtweeno is
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
Ardtweeno is an application gateway which bridges a Serial Device and an Internet Protocol network.
|
3
|
+
The system is designed as a PaaS (platform as a service) for the Raspberry Pi ARM platform. All data
|
4
|
+
received on the serial interface is stored to a MongoDB database if one is available otherwise stores
|
5
|
+
the data in system RAM. The gateway exposes a HTTP REST API for configuration and data manipulation purposes
|
6
|
+
which can be queried in order to build statistics, graphs and other forms of data reporting.
|
7
7
|
|
8
|
-
|
9
|
-
inclusion in hourly/daily reports which can be attached to the systems twitter feed.
|
10
|
-
|
11
|
-
The core system is wrapped in a Ruby Sinatra webapp which exposes a HTTP REST API and allows interaction
|
8
|
+
The core system is wrapped in a Ruby Sinatra web application which exposes a HTTP REST API and allows interaction
|
12
9
|
with the gateway over RESTful HTTP calls on the IP network. This has been designed with a Raspberry Pi in
|
13
|
-
mind and has been tested to work correctly on the Raspbian distribution.
|
10
|
+
mind and has been tested to work correctly on the Raspbian Wheezy distribution.
|
11
|
+
|
12
|
+
The system has been designed to be as modular in nature as possible. It is for this reason the interface to
|
13
|
+
the gateway from the serial link is through a HTTP REST API. This allows many different devices at multiple
|
14
|
+
sites to communicate with the central gateway over a LAN/WAN or the internet, while also retrieving data
|
15
|
+
from a serial device connected locally.
|
16
|
+
|
17
|
+
To enable the Ardtweeno gateway to speak to a specific serial device, a SerialParser implementation must be
|
18
|
+
developed. The only requirement from the gateway's point of view is that it must interact with it through the
|
19
|
+
HTTP REST API.
|
14
20
|
|
15
21
|
In future releases, I hope to make the service interactable so that it may respond to commands received
|
16
|
-
on twitter, or through web hooks and possibly an IRC bot.
|
17
|
-
on Rails web application to act as an end user front end to the system and display generated reports and
|
18
|
-
graphs from data recieved on the mesh network, while also extending the feature set of the HTTP REST API
|
19
|
-
and eventually offer the means to manage and upload updated firmwares to the mesh network nodes.
|
22
|
+
on twitter, or through web hooks and possibly an IRC bot.
|
20
23
|
|
21
24
|
This is a work in progress! The Wiki associated now contains the instructions for accessing the REST
|
22
25
|
API and installation instructions. Any bugs encountered can be raised on the issue tracker.
|
@@ -24,8 +27,6 @@ API and installation instructions. Any bugs encountered can be raised on the iss
|
|
24
27
|
If you would like to collaborate with me on this project please fork the repository and send any changes
|
25
28
|
through a pull request! I gladly welcome constructive input!
|
26
29
|
|
27
|
-
|
28
|
-
|
29
30
|
# COPYING / Licence
|
30
31
|
This software is released under the Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0)
|
31
32
|
for more information see the full details of this licence here: http://creativecommons.org/licenses/by-nc/3.0/
|
@@ -33,7 +34,6 @@ for more information see the full details of this licence here: http://creativec
|
|
33
34
|
For information regarding commercial use of the Ardtweeno Gateway, please contact the author at:
|
34
35
|
davidkirwanirl (_at_) gmail dot com or through Twitter at @kirwan\_david
|
35
36
|
|
36
|
-
|
37
37
|
# DISCLAIMER
|
38
38
|
All code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
39
39
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
data/Rakefile
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
-
|
1
|
+
####################################################################################################
|
2
|
+
# @author David Kirwan https://github.com/davidkirwan/ardtweeno
|
3
|
+
# @description Ardtweeno Gem Rakefile
|
4
|
+
#
|
5
|
+
# @date 02-07-2013
|
6
|
+
####################################################################################################
|
2
7
|
|
3
8
|
begin
|
4
9
|
require 'bundler'
|
10
|
+
Bundler::GemHelper.install_tasks
|
5
11
|
rescue Exception => e
|
6
|
-
|
7
|
-
exit
|
12
|
+
raise 'bundler gem not found, please install bundler and try again.'
|
8
13
|
end
|
9
14
|
|
10
15
|
|
11
|
-
|
12
|
-
Bundler::GemHelper.install_tasks
|
13
|
-
|
14
16
|
task :default => 'menu'
|
15
17
|
|
16
18
|
task :menu do
|
@@ -22,8 +24,18 @@ MSG
|
|
22
24
|
end
|
23
25
|
|
24
26
|
desc "Run the unit testing suite on this gem."
|
25
|
-
task :test do
|
26
|
-
|
27
|
+
task :test => :tty0tty do
|
27
28
|
require "./test/test_helper.rb"
|
29
|
+
end
|
30
|
+
|
31
|
+
# Build the tty0tty binary before running tests
|
32
|
+
task :tty0tty => :clean_tty0tty do
|
33
|
+
thePath = File.dirname(__FILE__) + "/test/debug/tty0tty-1.1/pts/"
|
34
|
+
sh "gcc -Wall -O2 -D_GNU_SOURCE #{thePath}tty0tty.c -o #{thePath}tty0tty"
|
35
|
+
end
|
28
36
|
|
37
|
+
# Clean the build before compiling
|
38
|
+
task :clean_tty0tty do
|
39
|
+
thePath = File.dirname(__FILE__) + "/test/debug/tty0tty-1.1/pts/"
|
40
|
+
sh "rm -rf #{thePath}tty0tty #{thePath}*.o #{thePath}core"
|
29
41
|
end
|