Wip/mqtt/init - tracking mqtt experiments #190

Merged
merged 37 commits into from Mar 19, 2015

Conversation

Projects
None yet
4 participants
Owner

bewest commented Oct 1, 2014

The corresponding uploader changes (there are a few actually)

The protobuf model:
https://github.com/nightscout/android-uploader/blob/master/core/src/main/java/com/nightscout/core/model/Download.proto

Feel free to close/ignore if this gets in the way of things, I'll move it to my personal fork if it becomes a distraction.

bewest added some commits Aug 2, 2014

@bewest bewest introduce mqtt
Introduce basic mqtt.
4f195dd
@bewest bewest lint records first
cc0cd36
@bewest bewest Merge remote-tracking branch 'origin/develop' into wip/mqtt/init
8759cb9
@bewest bewest Merge branch 'dev' into wip/mqtt/init
Simple conflicts merged.
Conflicts:
	env.js
	package.json
e16328c
Owner

bewest commented Oct 1, 2014

I can see some messages being delivered from some past experiment, interesting.

@bewest bewest make mqtt experiments suitable for hacking
Uses experimental support in sgvdata for protobuf.
b9e8a5f
Owner

bewest commented Oct 1, 2014

This should work with @ktind's mqtt uploader with the download model to at least debug the thing (it won't record anything yet, but should be able to receive the messages and print them).

Owner

bewest commented Oct 1, 2014

Really want to arrange the last will and testament message, the on connect message, and a message for usb connection status. The combination will allow us to put a real-time widget on the web app with the connection status.

bewest added the ready label Nov 22, 2014

Owner

bewest commented Nov 22, 2014

See also #272

bewest added some commits Nov 23, 2014

@bewest bewest get mqtt basically working, very rough
c8be1de
@bewest bewest forgot long 756e9e8
@bewest bewest test coverage
9ad7bf1

bewest referenced this pull request Dec 5, 2014

Closed

MQTT #272

Owner

bewest commented Dec 5, 2014

  • - update protobuf to match latest from android-uploader

@bewest bewest added in progress and removed ready labels Dec 5, 2014

ktind and others added some commits Dec 26, 2014

@ktind ktind Quick hack to get things working 33e1a36
@bewest bewest blarg, attempt to debug mqtt
1f1bc4d
@bewest bewest store each record according to own timestamp
f70a031
@bewest bewest tweak times and protobuf model with @ktind
bf2f623
@ktind ktind Adding experimental time calculation algorithm 70877f7
@bewest bewest Merge branch 'wip/mqtt/init' of github.com:ktind/cgm-remote-monitor i…
…nto wip/mqtt/init

Conflicts:
	lib/mqtt.js
Merging @ktind's version.
de51d22
@ktind ktind First pass at adding MGB, Sensor, Calibration, and Device Status reco…
…rds via MQTT

New method to create device status with a backdated timestamp
650bcd1
@bewest bewest allow multiple instances of mqtt to multiplex
This is intended to allow multiple listeners on mqtt to each receive data from
MQTT, so long as they are writing to different databases.
b37069e
@ktind ktind Merge remote-tracking branch 'origin/wip/mqtt/init' into wip/mqtt/ini…
…t-merge

Conflicts:
	lib/mqtt.js
e59adfc
@ktind ktind Store the download object in the entries for debugging purposes
Converting Sensor filtered and unfiltered data to a proper number
76b9a15
@ktind ktind Updating model and removing dead code 11a7d9d
@ktind ktind Merge remote-tracking branch 'origin/dev' into wip/mqtt/init
Conflicts:
	lib/devicestatus.js
e4d6675
@bewest bewest fix mbg undefined
6b4041a
@bewest bewest only need one stream factory
Pass around the sync function for less code.
ddc9bf2
@bewest bewest force strict zero check
de7cb78
@jasoncalabrese jasoncalabrese Merge branch 'release/0.6.3'
1b5fc82
@jasoncalabrese jasoncalabrese Merge pull request #413 from nightscout/release/0.6.4
Dreamsicle (Release 0.6.4)
48bdd80
@jasoncalabrese jasoncalabrese merged master into mqtt/init
d529801
@jasoncalabrese jasoncalabrese Merge branch 'dev' into wip/mqtt/init
abbd231

Coverage Status

Coverage increased (+0.07%) to 70.89% when pulling abbd231 on wip/mqtt/init into d616b6c on dev.

@jasoncalabrese jasoncalabrese updated with dev
f21c317

@jasoncalabrese jasoncalabrese commented on an outdated diff Mar 9, 2015

lib/entries.js
@@ -167,6 +167,11 @@ function storage(name, storage, pushover) {
});
}
+ function writeStream (opts) {
@jasoncalabrese

jasoncalabrese Mar 9, 2015

Owner

doesn't look like this is used by anything

@jasoncalabrese jasoncalabrese Merge branch 'dev' into wip/mqtt/init
98417ae

Coverage Status

Coverage increased (+0.05%) to 72.74% when pulling 98417ae on wip/mqtt/init into 06c1008 on dev.

jasoncalabrese and others added some commits Mar 18, 2015

@jasoncalabrese jasoncalabrese Merge pull request #496 from nightscout/wip/context-range-fix
context range fix
a291a0e
@bewest bewest rebasing, it seems to run 469d868
@bewest bewest fix broken test 1a38f4e
@bewest bewest bring back ensureIndexes
Make sure indexes are created for commonly sought fields.
6705b62
@bewest bewest Merge branch 'wip/mqtt/rebased' into wip/mqtt/init
Resolved Conflicts:
	lib/devicestatus.js
	package.json
	server.js
82032f4
Owner

bewest commented Mar 18, 2015

The rebasing includes re-plays on top of wip/bootevent/init.

Coverage Status

Changes Unknown when pulling 82032f4 on wip/mqtt/init into * on dev*.

@jasoncalabrese jasoncalabrese commented on an outdated diff Mar 18, 2015

lib/models/entries.js
+}
+
+
+function make_timestamp ( ) {
+}
+
+function make_field ( ) {
+}
+
+function sanitizer (opts) {
+
+}
+
+function index (opts) {
+ function calc (data) {
+ var o = lo.pick(data, opts.keys);
@jasoncalabrese

jasoncalabrese Mar 18, 2015

Owner

should lo be _?

@jasoncalabrese jasoncalabrese commented on the diff Mar 18, 2015

lib/mqtt.js
+ console.log("WRITE TO MONGO");
+ var download_timestamp = moment(packet.download_timestamp);
+ if (packet.download_status === 0) {
+ iter_mqtt_record_stream(packet, 'sgv', toSGV)
+ .pipe(core.persist(function empty(err, result) {
+ console.log("DONE WRITING SGV TO MONGO", err, result.length);
+ }));
+ iter_mqtt_record_stream(packet, 'cal', toCal)
+ .pipe(core.persist(function empty(err, result) {
+ console.log("DONE WRITING Cal TO MONGO", err, result.length);
+ }));
+ iter_mqtt_record_stream(packet, 'meter', toMeter)
+ .pipe(core.persist(function empty(err, result) {
+ console.log("DONE WRITING Meter TO MONGO", err, result.length);
+ }));
+ iter_mqtt_record_stream(packet, 'sensor', toSensor)
@jasoncalabrese

jasoncalabrese Mar 18, 2015

Owner

need to get sensor entries merged with sgvs

@jasoncalabrese jasoncalabrese commented on an outdated diff Mar 18, 2015

lib/pebble.js~
@@ -0,0 +1,187 @@
+'use strict';
@jasoncalabrese

jasoncalabrese Mar 18, 2015

Owner

an extra file, note the trailing ~

@bewest bewest rm spurious tmp file
0cdd3c0

Coverage Status

Changes Unknown when pulling 0cdd3c0 on wip/mqtt/init into * on dev*.

Coverage Status

Changes Unknown when pulling 0cdd3c0 on wip/mqtt/init into * on dev*.

bewest added some commits Mar 18, 2015

@bewest bewest make mqtt listener more unique
7578c1a
@bewest bewest remove spurious, unused code
d185010

Coverage Status

Changes Unknown when pulling d185010 on wip/mqtt/init into * on dev*.

Coverage Status

Changes Unknown when pulling d185010 on wip/mqtt/init into * on dev*.

Coverage Status

Changes Unknown when pulling d185010 on wip/mqtt/init into * on dev*.

jasoncalabrese added this to the enchilada milestone Mar 18, 2015

@jasoncalabrese jasoncalabrese added a commit that referenced this pull request Mar 19, 2015

@jasoncalabrese jasoncalabrese Merge pull request #190 from nightscout/wip/mqtt/init
Wip/mqtt/init - tracking mqtt experiments
d0d708c

@jasoncalabrese jasoncalabrese merged commit d0d708c into dev Mar 19, 2015

3 checks passed

continuous-integration/codeship Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

jasoncalabrese deleted the wip/mqtt/init branch Mar 19, 2015

Owner

bewest commented Mar 19, 2015

W00t exciting
On Wed, Mar 18, 2015 at 9:55 PM Jason Calabrese notifications@github.com
wrote:

Merged #190 #190.


Reply to this email directly or view it on GitHub
#190 (comment)
.

This was referenced Mar 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment