Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #18 from foglamp/1.5.0RC
Browse files Browse the repository at this point in the history
1.5.0 Release
  • Loading branch information
praveen-garg authored Feb 22, 2019
2 parents 12df99c + ca90d72 commit 1fad216
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Package Build
packages/Debian/build
packages/build

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2018 Dianomic Systems

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

27 changes: 27 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
foglamp-south-envirophat
========================

South Plugin for Raspberry PI EnviroPHAT

This directory contains a plugin that pulls readings from Enviro pHAT sensor. Enviro pHAT is an environmental sensing board that lets you measure temperature, pressure, light, colour, motion and analog sensors.

The polling is done at fixed intervals which is configurable via "pollInterval" configuration item.

All sensors can be enabled/disabled separately vide setting suitable configuration parameters. All sensors can also be named as desired vide setting suitable configuration parameters.

Installing the software:
========================

It is always recommended using the most up-to-date version of Raspbian, and it often helps to start with a completely fresh install of Raspbian, although this isn't necessary.

Please use an easy one-line-installer to get your Enviro pHAT set up. We'd suggest that you use this method to install the Enviro pHAT software.

Open a new terminal, and type the following, making sure to type 'y' or 'n' when prompted:

::

curl https://get.pimoroni.com/envirophat | bash

Once that's done, it's probably a good idea to reboot your Pi to let the changes propagate.

For more help, please visit https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-enviro-phat.
4 changes: 2 additions & 2 deletions VERSION.south.envirophat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
foglamp_south_envirophat_version=1.2
foglamp_version=1.2
foglamp_south_envirophat_version=1.5.0
foglamp_version>=1.5
25 changes: 15 additions & 10 deletions make_deb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

##--------------------------------------------------------------------
## Copyright (c) 2018 OSIsoft, LLC
## Copyright (c) 2018 Dianomic Systems
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@
## limitations under the License.
##--------------------------------------------------------------------
##
## Author: Ivan Zoratti
## Author: Ivan Zoratti, Vaibhav Singhal
##


Expand All @@ -35,19 +35,19 @@ do
case "$i" in
clean)
echo -n "Cleaning the build folder from older versions..."
find "${GIT_ROOT}/packages/Debian/build" -maxdepth 1 | grep '.*\.[0-9][0-9][0-9][0-9]' | xargs rm -rf
find "${GIT_ROOT}/packages/build" -maxdepth 1 | grep '.*\.[0-9][0-9][0-9][0-9]' | xargs rm -rf
echo "Done."
shift
exit 0
;;
cleanall)
if [ -d "${GIT_ROOT}/packages/Debian/build" ]; then
if [ -d "${GIT_ROOT}/packages/build" ]; then
echo -n "Cleaning the build folder..."
rm -rf ${GIT_ROOT}/packages/Debian/build/*
rm -rf ${GIT_ROOT}/packages/build/*
echo "Done."
else
echo "No build folder, skipping cleanall"
fi
shift
exit 0
;;
*)
echo "${usage}"
Expand All @@ -56,10 +56,15 @@ do
esac
done

if [ "$(dpkg --print-architecture)" != "armhf" ]; then
echo "Package building is only supported on armhf architecture!!"
exit 0
fi

architecture="armhf"
version=`cat ${GIT_ROOT}/VERSION.south.envirophat | tr -d ' ' | grep 'foglamp_south_envirophat_version=' | head -1 | sed -e 's/\(.*\)=\(.*\)/\2/g'`
foglamp_version=`cat ${GIT_ROOT}/VERSION.south.envirophat | tr -d ' ' | grep 'foglamp_version=' | head -1 | sed -e 's/\(.*\)=\(.*\)/\2/g'`
BUILD_ROOT="${GIT_ROOT}/packages/Debian/build"
foglamp_version=`cat ${GIT_ROOT}/VERSION.south.envirophat | tr -d ' ' | grep 'foglamp_version' | head -1 | sed -e 's/\(.*\)version\(.*\)/\2/g'`
BUILD_ROOT="${GIT_ROOT}/packages/build"

# Final package name
package_name="foglamp-south-envirophat-${version}-${architecture}"
Expand Down Expand Up @@ -96,7 +101,7 @@ echo -n "Populating the package and updating version file..."
cd "${package_name}"
cp -R ${GIT_ROOT}/packages/Debian/${architecture}/* .
sed -i "s/Version: 0.0/Version: $version/g" DEBIAN/control
sed -i "s/Depends: foglamp/Depends: foglamp (=$foglamp_version)/g" DEBIAN/control
sed -i "s/Depends: foglamp/Depends: foglamp (${foglamp_version})/g" DEBIAN/control

mkdir -p usr/local/foglamp
cd usr/local/foglamp
Expand Down
19 changes: 2 additions & 17 deletions packages/Debian/armhf/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

##--------------------------------------------------------------------
## Copyright (c) 2018 OSIsoft, LLC
## Copyright (c) 2018 Dianomic Systems
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,20 +31,5 @@ set_files_ownership () {
chown -R root:root /usr/local/foglamp/python/foglamp/plugins/south/envirophat
}

add_service () {
output=$(curl -sX POST http://localhost:8081/foglamp/service -d '{"name": "envirophat", "type": "south", "plugin": "envirophat"}')
service_id=$(echo $output | awk -F '"id": ' '{print $2}' | awk -F \" '{print $2}')
echo $service_id
}

enable_service () {
service_id=$1
echo $service_id
output=$(curl -X PUT -d '{"enabled": true}' http://localhost:8081/foglamp/schedule/$service_id)
echo $output
}

set_files_ownership
SERVICE_ID=$(add_service)
enable_service $SERVICE_ID
echo "Enviro pHAT plugin installed. Restart FogLAMP to enable the plugin."
echo "Enviro pHAT plugin is installed."
52 changes: 0 additions & 52 deletions packages/Debian/armhf/DEBIAN/preinst

This file was deleted.

Loading

0 comments on commit 1fad216

Please sign in to comment.