-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 608ca62..66e1ac5 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Robottle
+# Cellar
WIP: Don't expect any structure in there. As of now it's a collection of tryouts without particular shape
@@ -28,10 +28,14 @@ https://github.com/cory-johannsen/gradle-jni-example
pi/robottle
raspberrypi
-ping raspberrypi.local
+ssh pi@raspberrypi.local
http://hirt.se/blog/?p=1116
https://github.com/fauna/faunadb-jvm/blob/master/docs/java.md
-Stack Overflow Question : https://iot.stackexchange.com/questions/4662/in-what-form-should-i-store-data-in-the-cloud-for-a-single-device
\ No newline at end of file
+Stack Overflow Question : https://iot.stackexchange.com/questions/4662/in-what-form-should-i-store-data-in-the-cloud-for-a-single-device
+
+# To run :
+
+$ mvn clean package
\ No newline at end of file
diff --git a/cellar-app/pom.xml b/cellar-app/pom.xml
index a0755d2..58271cc 100644
--- a/cellar-app/pom.xml
+++ b/cellar-app/pom.xml
@@ -63,8 +63,8 @@
nl.lengrandcellar-driver
- 1.0-SNAPSHOT
- compile
+ 1.1
+ jar-with-dependenciescom.faunadb
@@ -95,4 +95,12 @@
+
+
+
+ github
+ GitHub Packages
+ https://maven.pkg.github.com/jlengrand/cellar-driver
+
+
diff --git a/cellar-app/src/main/java/nl/lengrand/CellarMonitor.java b/cellar-app/src/main/java/nl/lengrand/CellarMonitor.java
index 8b8574f..c4907d9 100644
--- a/cellar-app/src/main/java/nl/lengrand/CellarMonitor.java
+++ b/cellar-app/src/main/java/nl/lengrand/CellarMonitor.java
@@ -11,7 +11,7 @@ public class CellarMonitor {
// From config
private static final long START = 0;
- private static final long SPAN = 3;
+ private static final long SPAN = 30;
private static final TimeUnit UNIT = TimeUnit.MINUTES;
private ScheduledFuture monitorHandle;
@@ -31,7 +31,7 @@ public class CellarMonitor {
};
public void startMonitoring(){
- monitorHandle = scheduler.scheduleAtFixedRate(monitoring, START, SPAN, TimeUnit.MINUTES);
+ monitorHandle = scheduler.scheduleAtFixedRate(monitoring, START, SPAN, UNIT);
}
public void stopMonitoring(){
diff --git a/cellar-app/src/main/java/nl/lengrand/ReactiveService.java b/cellar-app/src/main/java/nl/lengrand/ReactiveService.java
deleted file mode 100644
index e310eb2..0000000
--- a/cellar-app/src/main/java/nl/lengrand/ReactiveService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package nl.lengrand;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-import io.helidon.microprofile.server.RoutingPath;
-import io.helidon.security.SecurityContext;
-import io.helidon.webserver.Routing;
-import io.helidon.webserver.Service;
-
-/**
- * TODO javadoc.
- */
-@ApplicationScoped
-@RoutingPath("/reactive")
-public class ReactiveService implements Service {
- @Inject
- private SecurityContext securityContext;
-
- @Override
- public void update(Routing.Rules rules) {
- rules.get("/", (req, res) -> res.send("Context: " + securityContext));
- }
-}
diff --git a/cellar-driver/pom.xml b/cellar-driver/pom.xml
deleted file mode 100644
index 38e0df4..0000000
--- a/cellar-driver/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
- cellar
- nl.lengrand
- 1.0-SNAPSHOT
-
- 4.0.0
-
- cellar-driver
-
-
-
-
- maven-compiler-plugin
- 3.7.0
-
-
- -h
- ${project.basedir}/target/headers
-
-
-
-
- org.codehaus.mojo
- exec-maven-plugin
- 1.6.0
-
-
- compile
-
- exec
-
-
- ${project.basedir}/src/main/c
- make
-
-
-
-
-
- maven-assembly-plugin
-
-
-
- nl.lengrand.cellar.TestLib
-
-
-
- jar-with-dependencies
-
-
-
-
- make-assembly
- package
-
- single
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/cellar-driver/src/main/c/Dht11Driver.c b/cellar-driver/src/main/c/Dht11Driver.c
deleted file mode 100644
index 6c12a86..0000000
--- a/cellar-driver/src/main/c/Dht11Driver.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include "../../../target/headers/nl_lengrand_cellar_Dht11Driver.h"
-#include "adafruit/Raspberry_Pi_2/pi_2_dht_read.h"
-
-JNIEXPORT void JNICALL Java_nl_lengrand_cellar_Dht11Driver_sayHello(JNIEnv *env, jobject thisObj) {
- printf("Hello JNI!\n");
- return;
-}
-
-JNIEXPORT jfloatArray JNICALL Java_nl_lengrand_cellar_Dht11Driver_getTemperatureAndHumidity(JNIEnv *env, jobject thisObj){
- float humidity = 0, temperature = 0;
- int sensor = 11; // Make those dynamic one day?
- int pin = 4; // Make those dynamic one day?
- int res = pi_2_dht_read(sensor, pin, &humidity, &temperature); // Might wanna do something with status one day
-
- jfloat* values = (jfloat *) malloc(2*sizeof(jfloat));
- values[0] = temperature;
- values[1] = humidity;
-
- jfloatArray outJNIArray = (*env)->NewFloatArray(env, 2);
- if (NULL == outJNIArray) return NULL;
-
- (*env)->SetFloatArrayRegion(env, outJNIArray, 0, 2, (const jfloat*)values);
- return outJNIArray;
-}
\ No newline at end of file
diff --git a/cellar-driver/src/main/c/Makefile b/cellar-driver/src/main/c/Makefile
deleted file mode 100644
index 5cebfd8..0000000
--- a/cellar-driver/src/main/c/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-JAVA_HOME=/usr/lib/jvm/java-11-openjdk-armhf
-INCLUDES = -I. -I../java -Iadafruit/Raspberry_Pi_2 -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
-HEADERS = ../../../target/headers/nl_lengrand_cellar_Dht11Driver.h adafruit/common_dht_read.h adafruit/Raspberry_Pi_2/pi_2_mmio.h adafruit/Raspberry_Pi_2/pi_2_dht_read.h
-FILES = adafruit/common_dht_read.c adafruit/Raspberry_Pi_2/pi_2_mmio.c adafruit/Raspberry_Pi_2/pi_2_dht_read.c Dht11Driver.c
-OUT = libdht11
-
-default: library move
-
-program: Dht11Driver.c
- gcc -Wall $(INCLUDES) $(HEADERS) $(FILES) -o $(OUT)
-
-library:
- gcc -shared -fPIC -o $(OUT).so $(INCLUDES) $(FILES)
-
-move:
- -cp $(OUT).so ../resources/libs/raspberry/
-
-clean:
- -rm -f $(OUT).so
- -rm -f $(OUT)
\ No newline at end of file
diff --git a/cellar-driver/src/main/c/README.md b/cellar-driver/src/main/c/README.md
deleted file mode 100644
index 8f5bd34..0000000
--- a/cellar-driver/src/main/c/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-The code contained in the adafruit folder comes from https://github.com/adafruit/Adafruit_Python_DHT and will be used as driver
-
-To run right now :
-
-* Create h file from Java folder : javac -h . nl.lengrand.cellar.Dht11Driver.java
-* Make (check converted to tabs)
-* cp .so file in java folder
-* pi@raspberrypi:~/projects/cellar/cellar-driver/src/main/java $ javac nl.lengrand.cellar.Dht11Driver.java nl.lengrand.cellar.TestLib.java
-* pi@raspberrypi:~/projects/cellar/cellar-driver/src/main/java $ java -Djava.library.path=. nl.lengrand.cellar.TestLib
-* java -Djava.library.path=../src/main/c -jar cellar-driver-1.0-SNAPSHOT-jar-with-dependencies.jar
\ No newline at end of file
diff --git a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_dht_read.c b/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_dht_read.c
deleted file mode 100644
index dd0b9e1..0000000
--- a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_dht_read.c
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright (c) 2014 Adafruit Industries
-// Author: Tony DiCola
-
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#include
-#include
-
-#include "pi_2_dht_read.h"
-#include "pi_2_mmio.h"
-
-// This is the only processor specific magic value, the maximum amount of time to
-// spin in a loop before bailing out and considering the read a timeout. This should
-// be a high value, but if you're running on a much faster platform than a Raspberry
-// Pi or Beaglebone Black then it might need to be increased.
-#define DHT_MAXCOUNT 32000
-
-// Number of bit pulses to expect from the DHT. Note that this is 41 because
-// the first pulse is a constant 50 microsecond pulse, with 40 pulses to represent
-// the data afterwards.
-#define DHT_PULSES 41
-
-int pi_2_dht_read(int type, int pin, float* humidity, float* temperature) {
- // Validate humidity and temperature arguments and set them to zero.
- if (humidity == NULL || temperature == NULL) {
- return DHT_ERROR_ARGUMENT;
- }
- *temperature = 0.0f;
- *humidity = 0.0f;
-
- // Initialize GPIO library.
- if (pi_2_mmio_init() < 0) {
- return DHT_ERROR_GPIO;
- }
-
- // Store the count that each DHT bit pulse is low and high.
- // Make sure array is initialized to start at zero.
- int pulseCounts[DHT_PULSES*2] = {0};
-
- // Set pin to output.
- pi_2_mmio_set_output(pin);
-
- // Bump up process priority and change scheduler to try to try to make process more 'real time'.
- set_max_priority();
-
- // Set pin high for ~500 milliseconds.
- pi_2_mmio_set_high(pin);
- sleep_milliseconds(500);
-
- // The next calls are timing critical and care should be taken
- // to ensure no unnecssary work is done below.
-
- // Set pin low for ~20 milliseconds.
- pi_2_mmio_set_low(pin);
- busy_wait_milliseconds(20);
-
- // Set pin at input.
- pi_2_mmio_set_input(pin);
- // Need a very short delay before reading pins or else value is sometimes still low.
- for (volatile int i = 0; i < 50; ++i) {
- }
-
- // Wait for DHT to pull pin low.
- uint32_t count = 0;
- while (pi_2_mmio_input(pin)) {
- if (++count >= DHT_MAXCOUNT) {
- // Timeout waiting for response.
- set_default_priority();
- return DHT_ERROR_TIMEOUT;
- }
- }
-
- // Record pulse widths for the expected result bits.
- for (int i=0; i < DHT_PULSES*2; i+=2) {
- // Count how long pin is low and store in pulseCounts[i]
- while (!pi_2_mmio_input(pin)) {
- if (++pulseCounts[i] >= DHT_MAXCOUNT) {
- // Timeout waiting for response.
- set_default_priority();
- return DHT_ERROR_TIMEOUT;
- }
- }
- // Count how long pin is high and store in pulseCounts[i+1]
- while (pi_2_mmio_input(pin)) {
- if (++pulseCounts[i+1] >= DHT_MAXCOUNT) {
- // Timeout waiting for response.
- set_default_priority();
- return DHT_ERROR_TIMEOUT;
- }
- }
- }
-
- // Done with timing critical code, now interpret the results.
-
- // Drop back to normal priority.
- set_default_priority();
-
- // Compute the average low pulse width to use as a 50 microsecond reference threshold.
- // Ignore the first two readings because they are a constant 80 microsecond pulse.
- uint32_t threshold = 0;
- for (int i=2; i < DHT_PULSES*2; i+=2) {
- threshold += pulseCounts[i];
- }
- threshold /= DHT_PULSES-1;
-
- // Interpret each high pulse as a 0 or 1 by comparing it to the 50us reference.
- // If the count is less than 50us it must be a ~28us 0 pulse, and if it's higher
- // then it must be a ~70us 1 pulse.
- uint8_t data[5] = {0};
- for (int i=3; i < DHT_PULSES*2; i+=2) {
- int index = (i-3)/16;
- data[index] <<= 1;
- if (pulseCounts[i] >= threshold) {
- // One bit for long pulse.
- data[index] |= 1;
- }
- // Else zero bit for short pulse.
- }
-
- // Useful debug info:
- //printf("Data: 0x%x 0x%x 0x%x 0x%x 0x%x\n", data[0], data[1], data[2], data[3], data[4]);
-
- // Verify checksum of received data.
- if (data[4] == ((data[0] + data[1] + data[2] + data[3]) & 0xFF)) {
- if (type == DHT11) {
- // Get humidity and temp for DHT11 sensor.
- *humidity = (float)data[0];
- *temperature = (float)data[2];
- }
- else if (type == DHT22) {
- // Calculate humidity and temp for DHT22 sensor.
- *humidity = (data[0] * 256 + data[1]) / 10.0f;
- *temperature = ((data[2] & 0x7F) * 256 + data[3]) / 10.0f;
- if (data[2] & 0x80) {
- *temperature *= -1.0f;
- }
- }
- return DHT_SUCCESS;
- }
- else {
- return DHT_ERROR_CHECKSUM;
- }
-}
diff --git a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_dht_read.h b/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_dht_read.h
deleted file mode 100644
index 89d5dce..0000000
--- a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_dht_read.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2014 Adafruit Industries
-// Author: Tony DiCola
-
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#ifndef PI_2_DHT_READ_H
-#define PI_2_DHT_READ_H
-
-#include "../common_dht_read.h"
-
-// Read DHT sensor connected to GPIO pin (using BCM numbering). Humidity and temperature will be
-// returned in the provided parameters. If a successfull reading could be made a value of 0
-// (DHT_SUCCESS) will be returned. If there was an error reading the sensor a negative value will
-// be returned. Some errors can be ignored and retried, specifically DHT_ERROR_TIMEOUT or DHT_ERROR_CHECKSUM.
-int pi_2_dht_read(int sensor, int pin, float* humidity, float* temperature);
-
-#endif
diff --git a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_mmio.c b/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_mmio.c
deleted file mode 100644
index 4c40fe8..0000000
--- a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_mmio.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2014 Adafruit Industries
-// Author: Tony DiCola
-// Based on code from Gert van Loo & Dom: http://elinux.org/RPi_Low-level_peripherals#GPIO_Code_examples
-
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "pi_2_mmio.h"
-
-#define GPIO_BASE_OFFSET 0x200000
-#define GPIO_LENGTH 4096
-
-volatile uint32_t* pi_2_mmio_gpio = NULL;
-
-int pi_2_mmio_init(void) {
- if (pi_2_mmio_gpio == NULL) {
- // Check for GPIO and peripheral addresses from device tree.
- // Adapted from code in the RPi.GPIO library at:
- // http://sourceforge.net/p/raspberry-gpio-python/
- FILE *fp = fopen("/proc/device-tree/soc/ranges", "rb");
- if (fp == NULL) {
- return MMIO_ERROR_OFFSET;
- }
- fseek(fp, 4, SEEK_SET);
- unsigned char buf[4];
- if (fread(buf, 1, sizeof(buf), fp) != sizeof(buf)) {
- return MMIO_ERROR_OFFSET;
- }
- uint32_t peri_base = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3] << 0;
- uint32_t gpio_base = peri_base + GPIO_BASE_OFFSET;
- fclose(fp);
-
- int fd = open("/dev/gpiomem", O_RDWR | O_SYNC);
- if (fd == -1) {
- // Error opening /dev/gpiomem.
- return MMIO_ERROR_DEVMEM;
- }
- // Map GPIO memory to location in process space.
- pi_2_mmio_gpio = (uint32_t*)mmap(NULL, GPIO_LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, fd, gpio_base);
- close(fd);
- if (pi_2_mmio_gpio == MAP_FAILED) {
- // Don't save the result if the memory mapping failed.
- pi_2_mmio_gpio = NULL;
- return MMIO_ERROR_MMAP;
- }
- }
- return MMIO_SUCCESS;
-}
diff --git a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_mmio.h b/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_mmio.h
deleted file mode 100644
index cda66db..0000000
--- a/cellar-driver/src/main/c/adafruit/Raspberry_Pi_2/pi_2_mmio.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2014 Adafruit Industries
-// Author: Tony DiCola
-// Based on code from Gert van Loo & Dom: http://elinux.org/RPi_Low-level_peripherals#GPIO_Code_examples
-
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-// Simple fast memory-mapped GPIO library for the Raspberry Pi.
-#ifndef PI_2_MMIO_H
-#define PI_2_MMIO_H
-
-#include
-
-#define MMIO_SUCCESS 0
-#define MMIO_ERROR_DEVMEM -1
-#define MMIO_ERROR_MMAP -2
-#define MMIO_ERROR_OFFSET -3
-
-extern volatile uint32_t* pi_2_mmio_gpio;
-
-int pi_2_mmio_init(void);
-
-static inline void pi_2_mmio_set_input(const int gpio_number) {
- // Set GPIO register to 000 for specified GPIO number.
- *(pi_2_mmio_gpio+((gpio_number)/10)) &= ~(7<<(((gpio_number)%10)*3));
-}
-
-static inline void pi_2_mmio_set_output(const int gpio_number) {
- // First set to 000 using input function.
- pi_2_mmio_set_input(gpio_number);
- // Next set bit 0 to 1 to set output.
- *(pi_2_mmio_gpio+((gpio_number)/10)) |= (1<<(((gpio_number)%10)*3));
-}
-
-static inline void pi_2_mmio_set_high(const int gpio_number) {
- *(pi_2_mmio_gpio+7) = 1 << gpio_number;
-}
-
-static inline void pi_2_mmio_set_low(const int gpio_number) {
- *(pi_2_mmio_gpio+10) = 1 << gpio_number;
-}
-
-static inline uint32_t pi_2_mmio_input(const int gpio_number) {
- return *(pi_2_mmio_gpio+13) & (1 << gpio_number);
-}
-
-#endif
diff --git a/cellar-driver/src/main/c/adafruit/common_dht_read.c b/cellar-driver/src/main/c/adafruit/common_dht_read.c
deleted file mode 100644
index 3bbb663..0000000
--- a/cellar-driver/src/main/c/adafruit/common_dht_read.c
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014 Adafruit Industries
-// Author: Tony DiCola
-
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#include
-#include
-#include
-#include
-#include
-
-#include "common_dht_read.h"
-
-void busy_wait_milliseconds(uint32_t millis) {
- // Set delay time period.
- struct timeval deltatime;
- deltatime.tv_sec = millis / 1000;
- deltatime.tv_usec = (millis % 1000) * 1000;
- struct timeval walltime;
- // Get current time and add delay to find end time.
- gettimeofday(&walltime, NULL);
- struct timeval endtime;
- timeradd(&walltime, &deltatime, &endtime);
- // Tight loop to waste time (and CPU) until enough time as elapsed.
- while (timercmp(&walltime, &endtime, <)) {
- gettimeofday(&walltime, NULL);
- }
-}
-
-void sleep_milliseconds(uint32_t millis) {
- struct timespec sleep;
- sleep.tv_sec = millis / 1000;
- sleep.tv_nsec = (millis % 1000) * 1000000L;
- while (clock_nanosleep(CLOCK_MONOTONIC, 0, &sleep, &sleep) && errno == EINTR);
-}
-
-void set_max_priority(void) {
- struct sched_param sched;
- memset(&sched, 0, sizeof(sched));
- // Use FIFO scheduler with highest priority for the lowest chance of the kernel context switching.
- sched.sched_priority = sched_get_priority_max(SCHED_FIFO);
- sched_setscheduler(0, SCHED_FIFO, &sched);
-}
-
-void set_default_priority(void) {
- struct sched_param sched;
- memset(&sched, 0, sizeof(sched));
- // Go back to default scheduler with default 0 priority.
- sched.sched_priority = 0;
- sched_setscheduler(0, SCHED_OTHER, &sched);
-}
diff --git a/cellar-driver/src/main/c/adafruit/common_dht_read.h b/cellar-driver/src/main/c/adafruit/common_dht_read.h
deleted file mode 100644
index bb56c67..0000000
--- a/cellar-driver/src/main/c/adafruit/common_dht_read.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2014 Adafruit Industries
-// Author: Tony DiCola
-
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#ifndef COMMON_DHT_READ_H
-#define COMMON_DHT_READ_H
-
-#include
-
-// Define errors and return values.
-#define DHT_ERROR_TIMEOUT -1
-#define DHT_ERROR_CHECKSUM -2
-#define DHT_ERROR_ARGUMENT -3
-#define DHT_ERROR_GPIO -4
-#define DHT_SUCCESS 0
-
-// Define sensor types.
-#define DHT11 11
-#define DHT22 22
-#define AM2302 22
-
-// Busy wait delay for most accurate timing, but high CPU usage.
-// Only use this for short periods of time (a few hundred milliseconds at most)!
-void busy_wait_milliseconds(uint32_t millis);
-
-// General delay that sleeps so CPU usage is low, but accuracy is potentially bad.
-void sleep_milliseconds(uint32_t millis);
-
-// Increase scheduling priority and algorithm to try to get 'real time' results.
-void set_max_priority(void);
-
-// Drop scheduling priority back to normal/default.
-void set_default_priority(void);
-
-#endif
diff --git a/cellar-driver/src/main/c/compile.sh b/cellar-driver/src/main/c/compile.sh
deleted file mode 100755
index 5a7f763..0000000
--- a/cellar-driver/src/main/c/compile.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-rm testAdafruit;
-gcc -Wall -I. -Iadafruit/Raspberry_Pi_2 adafruit/common_dht_read.c adafruit/Raspberry_Pi_2/pi_2_mmio.c adafruit/Raspberry_Pi_2/pi_2_dht_read.c testAdafruit.c -o testAdafruit
\ No newline at end of file
diff --git a/cellar-driver/src/main/c/testAdafruit.c b/cellar-driver/src/main/c/testAdafruit.c
deleted file mode 100644
index d5f5f7b..0000000
--- a/cellar-driver/src/main/c/testAdafruit.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include
-#include
-#include
-#include
-
-#include "adafruit/Raspberry_Pi_2/pi_2_dht_read.h"
-
-int main( void )
-{
- printf( "Raspberry Pi 2 DHT11 test program\n" );
-
- int i;
- int res;
- float humidity = 0, temperature = 0;
- int sensor = 11;
- int pin = 4;
- for (i = 1; i < 15; ++i){
- res = pi_2_dht_read(sensor, pin, &humidity, &temperature);
- if(res == 0){
- printf("Temperature : %f\n", temperature);
- printf("Humidity : %f\n", humidity);
- }
- else{
- printf("Error when reading from sensor : %d\n", res);
- }
- sleep(1);
- }
-
- return 0;
-}
\ No newline at end of file
diff --git a/cellar-driver/src/main/java/nl/lengrand/cellar/Dht11Driver.java b/cellar-driver/src/main/java/nl/lengrand/cellar/Dht11Driver.java
deleted file mode 100644
index 8257f8f..0000000
--- a/cellar-driver/src/main/java/nl/lengrand/cellar/Dht11Driver.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package nl.lengrand.cellar;
-
-public class Dht11Driver {
-
- static {
- System.loadLibrary("dht11");
- }
-
- public native void sayHello();
-
- public native float[] getTemperatureAndHumidity();
-}
\ No newline at end of file
diff --git a/cellar-driver/src/main/java/nl/lengrand/cellar/TestLib.java b/cellar-driver/src/main/java/nl/lengrand/cellar/TestLib.java
deleted file mode 100644
index 74d854b..0000000
--- a/cellar-driver/src/main/java/nl/lengrand/cellar/TestLib.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package nl.lengrand.cellar;
-
-import nl.lengrand.cellar.Dht11Driver;
-
-import java.util.concurrent.ExecutionException;
-
-public class TestLib {
-
- public static void main(String[] args) throws InterruptedException, ExecutionException {
- Dht11Driver theDriver = new Dht11Driver();
- theDriver.sayHello();
-
- Thread.sleep(1000);
-
- for (int i = 0; i < 5; i++) {
- float [] res = theDriver.getTemperatureAndHumidity();
- if(res[0] != 0 && res[1] != 0){
- System.out.println("Receiving " + res[0] + " " + res[1]);
- }
- else{
- System.out.println("Incorrect data!" + res[0] + " " + res[1]);
- }
- Thread.sleep(10000);
- }
- }
-}
\ No newline at end of file
diff --git a/cellar-driver/src/main/resources/libs/raspberry/.containerFolder b/cellar-driver/src/main/resources/libs/raspberry/.containerFolder
deleted file mode 100644
index e69de29..0000000
diff --git a/pom.xml b/pom.xml
index 4f9988b..52466da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,12 +10,11 @@
1.0-SNAPSHOT
- 1.8
- 1.8
+ 11
+ 11
- cellar-drivercellar-app