diff --git a/client/main.html b/client/main.html
index 697405f..1c4450c 100644
--- a/client/main.html
+++ b/client/main.html
@@ -1,10 +1,6 @@
-
-
+
+ SmartGarden
+
diff --git a/client/public/SmartGarden.svg b/client/public/SmartGarden.svg
deleted file mode 100644
index 2bf7558..0000000
--- a/client/public/SmartGarden.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
diff --git a/imports/api/mqttApi.js b/imports/api/mqttApi.js
index 43491b3..5b400aa 100644
--- a/imports/api/mqttApi.js
+++ b/imports/api/mqttApi.js
@@ -1,7 +1,4 @@
import { connect } from 'mqtt';
-import _ from 'lodash';
-// var mqtt = require('mqtt');
-
var client = connect('mqtt://mqtt.timovolkmann.de')
diff --git a/imports/ui/About.jsx b/imports/ui/About.jsx
index 4091667..85e6e61 100644
--- a/imports/ui/About.jsx
+++ b/imports/ui/About.jsx
@@ -1,5 +1,5 @@
import React from 'react'
-import { Container, Row, Col} from 'react-bootstrap';
+import {Row, Col} from 'react-bootstrap';
export default function About() {
@@ -33,4 +33,4 @@ export default function About() {
>
)
-}
+}
\ No newline at end of file
diff --git a/imports/ui/App.jsx b/imports/ui/App.jsx
index 3d68829..7c636e7 100644
--- a/imports/ui/App.jsx
+++ b/imports/ui/App.jsx
@@ -6,7 +6,6 @@ import About from './About'
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
function App() {
-
return (
<>
@@ -27,4 +26,4 @@ function App() {
)
}
-export default App;
+export default App;
\ No newline at end of file
diff --git a/imports/ui/Home.jsx b/imports/ui/Home.jsx
index 81e3ed8..7bbaced 100644
--- a/imports/ui/Home.jsx
+++ b/imports/ui/Home.jsx
@@ -1,7 +1,7 @@
import React from 'react'
import {ConfiguredDevicesCollection, PlantTypesCollection} from "../../client/main";
import {useTracker} from 'meteor/react-meteor-data';
-import { Card, CardDeck, Table } from "react-bootstrap";
+import { Table } from "react-bootstrap";
import Settings from "./Settings";
export default function Home() {
@@ -35,7 +35,6 @@ export default function Home() {
}
-
return (
<>
diff --git a/imports/ui/NavigationBar.jsx b/imports/ui/NavigationBar.jsx
index ca90401..21507ad 100644
--- a/imports/ui/NavigationBar.jsx
+++ b/imports/ui/NavigationBar.jsx
@@ -1,23 +1,10 @@
import React from 'react'
import { Navbar, Nav } from 'react-bootstrap';
-//import logo from '../../client/public/SmartGarden.svg';
-
export default function NavigationBar() {
return (
- {/* NOT POSSIBLE IN METEOR, only from the DB -> https://forums.meteor.com/t/importing-assets-image/30266/2
-
-
{' '}
- */}
SmartGarden
@@ -25,18 +12,8 @@ export default function NavigationBar() {
)
-}
+}
\ No newline at end of file
diff --git a/imports/ui/Overview.jsx b/imports/ui/Overview.jsx
index 2019338..80272e1 100644
--- a/imports/ui/Overview.jsx
+++ b/imports/ui/Overview.jsx
@@ -21,7 +21,7 @@ export default function Overview() {
} else {
return SensorDataCollection.find({device_id: activeDevice.deviceId}, {
sort: {timestamp: -1},
- limit: 1441
+ limit: 1440
}).fetch().reverse();
}
});
@@ -83,7 +83,7 @@ export default function Overview() {
el.temperature !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}>
-
+
@@ -95,7 +95,7 @@ export default function Overview() {
el.humidity !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}>
-
+
@@ -109,7 +109,7 @@ export default function Overview() {
el.brightness !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}>
-
+
@@ -121,7 +121,7 @@ export default function Overview() {
el.moisture !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}>
-
+
diff --git a/imports/ui/SensorCardDeck.jsx b/imports/ui/SensorCardDeck.jsx
index 5bc8705..36e1fbb 100644
--- a/imports/ui/SensorCardDeck.jsx
+++ b/imports/ui/SensorCardDeck.jsx
@@ -37,6 +37,7 @@ export default function SensorCardDeck() {
}
});
+
if (sensorData.length <= 0 || plantType === undefined || deviceId === undefined || plantTypeData === undefined) {
return (
diff --git a/mongo-mqtt.js b/mongo-mqtt.js
index e25884a..64c7a30 100644
--- a/mongo-mqtt.js
+++ b/mongo-mqtt.js
@@ -1,11 +1,8 @@
const mqtt = require('mqtt')
const { MongoClient } = require('mongodb')
const _ = require('lodash')
-
const dbClient = new MongoClient("mongodb://garden:99009911@cloud.timovolkmann.de:27017/Smart_Garden", { useUnifiedTopology: true })
-// startMqttObserver()
-
export default async function startMqttObserver() {
console.log("setup connections...")
// setup mongodb
@@ -28,24 +25,10 @@ function messageCallback(collection) {
const id = topicElements.pop();
var date = new Date;
- var time;
-
- if (date.getHours() <= 9) {time = "0" + date.getHours();} else {
- time = date.getHours();
- }
- if (date.getMinutes() <= 9) {time = time + ":0" + date.getMinutes();} else {
- time = time + ":" + date.getMinutes();
- }
- /*
- if (date.getSeconds() <= 9) {time = time + ":0" + date.getSeconds();} else {
- time = time + ":" + date.getSeconds();
- }
- */
let doc = {
device_id: id,
timestamp: date,
- timeAsString: time,
}
try {
doc = _.merge(doc, JSON.parse(message));