Coder Social home page Coder Social logo

alexstocker / sensorlogger Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 25.0 778 KB

Log sensor data to your owncloud instance, view data and graphs. Group and tag your sensors and share data

Home Page: https://www.html5live.at/sensorlogger/

License: MIT License

Makefile 1.47% PHP 40.87% CSS 2.65% JavaScript 54.49% Shell 0.52%
datalogger owncloud

sensorlogger's People

Contributors

alexstocker avatar kixunil avatar sensorlogger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensorlogger's Issues

Show data and unregister devices

The registration of devices via "register devices" works fine for me and the devices are shown in the device list.
Nevertheless I can see no data when I perform the extended API call.
Even when I try to perfom a simple API call I can see no data.

How can I unregister the devices shown in the list?

Initial example script not working

Expected Behavior

after excecuting the example script from https://github.com/alexstocker/sensorlogger/blob/master/tests/curl/post.php a new device should appear on the UI.

Actual Behavior

Nothin happens.
Script returns false
No log entry.
(Got sensorloger running with registering a device and generating the nesessary datatypes with the other example scripts)

Steps to Reproduce the Problem

  1. Fresh installation of sensorlogger on nextcloud 12 (empty databaseentries for sensorlogger)
  2. Generate app password and fill data to example script
  3. Excecute https://github.com/alexstocker/sensorlogger/blob/master/tests/curl/post.php

Specifications

  • Version: Nextcloud 12.04
  • Platform: Ubunutu 16.04 LTS
  • Subsystem: php 7

Empty Chart with Simplelog

Hi all,

without provided data array value, the chart data remain empty.
In the Table oc_sensorlogger_logs, columns temperature and humidity are filled.
In column data there is a JSON array with "_route:" value starting.
for example: {"_route":"sensorlogger.apisensorlogger.createLog","deviceId":"28-000006a2e6ae","temperature":21.81,"humidity":0,"date":"2017-11-20 20:03:40"}

With multivalue posts, there are no issues.

Did i something wrong?

NC 12.0.3
Apache 2.4.27, PHP 7.0.21, MariaDB 10.0.31 on Synology DSM 6

sensorlogger at webspace

Hi Alex,
does sensorlogger works on webspace also?
I uploaded the file sensorlogger-0.0.5-nc.13 in the apps directory.
it is not possible for me to execute php post.php on command line.
Is there another way?

documentation walkthrough device with non-standard meassurement

Expected Behavior

I do not manage to get a sensor running that does not meassure the standard values tempereature and humidity according to the documentation as it is now

Actual Behavior

have a documentation in a way where it is easy to see how to setup AND send data to sensorlogger that is non-standard. In my case I would like to have a 3rd value voltage to control the battery. I would like to have that in the data list but don't see how to do that.

From the docu I can learn how to register a device with whatever value but I do not see how to send data afterwards.

Accumulated data per interval and data downsampling

Hello Alex,

let me begin with a thank you for writing this app. It looks promising to me. What I would like to suggest as features are:

  • Display accumulated data
    • E. g. in a widget were one can edit the title and the formular
    • This would be especially useful for measuring the rain amount were commonly 24h/12h/6h values are more interesting.
  • Data downsampling
    • As the data is obviously stored in a RDBMS and not a TSDB I think it could be useful to have rules like in RRDtool to downsample data older than time x to prevent the DB from getting too heavy.

Greetings
Eike

widgets on dashboard are not persistant

Expected Behavior

I setup widgets on the dashboard - 2 sensors - charts on top, list on the bottom - looks nice, after reloading the page the view is cluttered

Actual Behavior

widgets are cluttered and do not stay in the same order after reload
first row shows: data list of second sensor - chart second sensor - data list first sensor
second row shows: chart of second sensor

Steps to Reproduce the Problem

  1. setup 2 charts for 2 sensors, arrange them in the top row the charts, below a row with the data lists
  2. reload page

Specifications

  • Version: 0.0.6
  • Browser: Firefox 52.5.0

Add ability to rename device in Sensorlogger

Hello,

I created two devices which have the name "Default device". Is it possible to rename them into something more descriptive? If not from the UI, is it possible to change the name in the database?

Not working with NextCloud 12 / White page

I upgraded to nextcloud 12 and sensorlogger is just showing a white page now. I am on the latest release of sensorlogger.

heres a error messages found in error log:

Error	PHP	Argument 6 passed to OC\NavigationManager::__construct() must implement interface OCP\IConfig, none given, called in /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined at /var/www/nextcloud/lib/private/NavigationManager.php#67	2017-05-23T13:14:59+0200
Error	PHP	Argument 5 passed to OC\NavigationManager::__construct() must implement interface OCP\IGroupManager, none given, called in /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined at /var/www/nextcloud/lib/private/NavigationManager.php#66	2017-05-23T13:14:59+0200
Error	PHP	Argument 4 passed to OC\NavigationManager::__construct() must implement interface OCP\IUserSession, none given, called in /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined at /var/www/nextcloud/lib/private/NavigationManager.php#65	2017-05-23T13:14:59+0200
Error	PHP	Argument 3 passed to OC\NavigationManager::__construct() must implement interface OCP\L10N\IFactory, none given, called in /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined at /var/www/nextcloud/lib/private/NavigationManager.php#64	2017-05-23T13:14:59+0200
Error	PHP	Argument 2 passed to OC\NavigationManager::__construct() must implement interface OCP\IURLGenerator, none given, called in /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined at /var/www/nextcloud/lib/private/NavigationManager.php#63	2017-05-23T13:14:59+0200
Error	PHP	Argument 1 passed to OC\NavigationManager::__construct() must implement interface OCP\App\IAppManager, none given, called in /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined at /var/www/nextcloud/lib/private/NavigationManager.php#62	2017-05-23T13:14:59+0200

E.g. the weahter app also had an error. see how they fixed it: nextcloud/weather@8f41dd3

Not working with NextCloud 12.0.3 / White page

Error Log

Error | PHP | Undefined variable: config at /var/www/nextcloud/lib/private/NavigationManager.php#73 | 2017-11-14T02:22:01+0100
-- | -- | -- | --
Error | PHP | Undefined variable: groupManager at /var/www/nextcloud/lib/private/NavigationManager.php#72 | 2017-11-14T02:22:01+0100
Error | PHP | Undefined variable: userSession at /var/www/nextcloud/lib/private/NavigationManager.php#71 | 2017-11-14T02:22:01+0100
Error | PHP | Undefined variable: l10nFac at /var/www/nextcloud/lib/private/NavigationManager.php#70 | 2017-11-14T02:22:01+0100
Error | PHP | Undefined variable: urlGenerator at /var/www/nextcloud/lib/private/NavigationManager.php#69 | 2017-11-14T02:22:01+0100
Error | PHP | Undefined variable: appManager at /var/www/nextcloud/lib/private/NavigationManager.php#68 | 2017-11-14T02:22:01+0100
Error | PHP | Argument  6 passed to OC\NavigationManager::__construct() must implement  interface OCP\IConfig, none given, called in  /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined  at /var/www/nextcloud/lib/private/NavigationManager.php#67 | 2017-11-14T02:22:01+0100
Error | PHP | Argument  5 passed to OC\NavigationManager::__construct() must implement  interface OCP\IGroupManager, none given, called in  /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined  at /var/www/nextcloud/lib/private/NavigationManager.php#66 | 2017-11-14T02:22:01+0100
Error | PHP | Argument  4 passed to OC\NavigationManager::__construct() must implement  interface OCP\IUserSession, none given, called in  /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined  at /var/www/nextcloud/lib/private/NavigationManager.php#65 | 2017-11-14T02:22:01+0100
Error | PHP | Argument  3 passed to OC\NavigationManager::__construct() must implement  interface OCP\L10N\IFactory, none given, called in  /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined  at /var/www/nextcloud/lib/private/NavigationManager.php#64 | 2017-11-14T02:22:01+0100
Error | PHP | Argument  2 passed to OC\NavigationManager::__construct() must implement  interface OCP\IURLGenerator, none given, called in  /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined  at /var/www/nextcloud/lib/private/NavigationManager.php#63 | 2017-11-14T02:22:01+0100
Error | PHP | Argument  1 passed to OC\NavigationManager::__construct() must implement  interface OCP\App\IAppManager, none given, called in  /var/www/nextcloud/apps/sensorlogger/lib/App.php on line 19 and defined  at /var/www/nextcloud/lib/private/NavigationManager.php#62 | 2017-11-14T02:22:01+0100

Set timezone

My Nextcloud (12 stable, Ubuntu 16.04) instance is set to UTC+2.

Expected behavior: sensorloger displays times in UTC+2.

Actual behavior: sensorloger displays times in UTC only.

screen shot 2017-07-07 at 14 28 15

Adjust widget size and x-axis

I'm using v0.0.4 from the nextcloud appstore and current NC12 stable.

Is it possible to adjust the widget size to something like here?
And is it possible to adjust the scale of the x-axis somehow?

Currently it looks like this:
screen shot 2017-07-07 at 14 28 15

Data display issues

Hi, thanks for your effort to create such a nice app.

I'm currently writing an esp8266 library for interfacing with sensorlogger (I plan to opensource once it's ready, part of my frankenstein firmware for esp8266), and have run in a quite an issue. I'm able to register the device and post the data, and can even see all the data appearing in sensorlogger_logs database. But the UI is somehow messed up, as if the deviceDataTypes portion of 'register device' api request was not handled properly: e.g. in the chart for the device it shows humidity and temperature, although no such data types exist for this device. Same goes for the list of data values.

(The current device is right now just a dumb mockup, posting random numbers).

Expected Behavior

GUI should not show data registered for the device, same goes for data view.

Actual Behavior

GUI shows only temperature and humidity for every device.

Steps to Reproduce the Problem

Can be done by posting the following JSON to the server :

frankenstein > svclog register                                                                                                                                            
Registering device at https://cloud.ncrmnt.org/index.php/apps/sensorlogger/api/v1/registerdevice/                                                                         
{                                                                                                                                                                         
        "deviceId":     "dev-arven-001",                                                                                                                                  
        "deviceName":   "arven-green",                                                                                                                                    
        "deviceType":   "dummy",                                                                                                                                          
        "deviceGroup":  "development",                                                                                                                                    
        "deviceParentGroup":    "",                                                                                                                                       
        "deviceDataTypes":      {                                                                                                                                         
                "type": "mana",                                                                                                                                           
                "description":  "Mana regen rate",                                                                                                                        
                "unit": "pts/sec"                                                                                                                                         
        }                                                                                                                                                                 
}

frankenstein > svclog post                                                                                                                                                
Posting data to https://cloud.ncrmnt.org/index.php/apps/sensorlogger/api/v1/createlog/                                                                                    
{                                                                                                                                                                         
        "deviceId":     "dev-arven-001",                                                                                                                                  
        "mana": "39.52"                                                                                                                                                   
}

Specifications

  • Version: 0.0.5 (from nextcloud appstore)
  • Platform: nextcloud 12.0.4
  • PHP 7.0.19-1 (debian stretch)

P.S. I've also noticed that if I omit deviceParentGroup from json query I'll get an exception with data partially(?) added to the db.

implement ability to delete measurements from the list

It would be great if there was a way to delete measurements from the list. Sometimes I do some test measurements to see if things are working and I have no way to remove them. They affect the graphs and other listings.

I am not sure if this is easy to implement, but I believe it will improve the testing of different sensors greatly.

Thanks!

Nextcloud 13 support

Hello,

Nextcloud 13 will be released soon. Can you provide a new version to the app store that supports the new release as well?

How does this work with nextcloud?

Hello,

sorry for a newbie question - but I don't find how sensorlogger works with nextcloud. I'm running nextcloud 12 and don't find any menu item which would allow me to configure devices.

Any help would be appreciated. Maybe it would be good to describe this also in the README.

Thanks and cheers,
Georg

Inability to delete device

Hello,

Before I setup my sensor, I run couple post.php to see if it shows on the nextcloud as per the instructions. I setup the sensor and it is working fine.

I go to the Devices page, and try to remove the device that was posted with post.php tests. However it keeps telling me Device NOT deleted (as you can see from the image below as device #1). What is preventing me to delete this Device? Is there a reason for this, or this is a bug?

Delete_Error

Thank you

Use server time when json does not contains the date field

On some systems, it may be cumbersome to create the correct timestamp for the json that is sent to the server.

For example under esp2866 with the arduino ide. There I have to fetch the time from an NTP server. Then, convert the time to the correct time zone and paying attention to daylight saving time. And then the time stamp has to be formatted. To do this I need several librarys and lines of code.

It would be easier if the server time is stored automatically if the json does not contain the date field. Or in the json it can be specified explicitly that the server time should be used (ex.: ["date"] = "server-time").

By the way: I like this application very much, even if it is not finished yet.

Add postgres support

I really would like to try the sensorlogger but my NC is running on postgres. Is support for postgres planned for the future?

Own dataTypes

I can't create my own dataTypes like fan speed.

My API call for 'registerdevice':

"_route":"sensorlogger.apisensorlogger.registerDevice",
"deviceId":"231d2508-786d-400d",
"deviceName":"PC Sensoren",
"deviceType": "CPU Temp u. Fan speed",
"deviceGroup": "Wohnzimmer",
"deviceParentGroup": "Server",
"deviceDataTypes": 
[
    {
	"type": "temp",
	"description": "Temperature",
	"unit": "°C"
    }
    ,
    {
	"type": "fan1",
	"description": "Fan1",
	"unit": "U/min"
    }
]

My API call for 'createlog':

$fan = 100;
$cpu = 1000;
$array = array("deviceId" => "231d2508-786d-400d",
	"temp" => $cpu,
	"fan1" => $fan,
	"date" => date('Y-m-d H:i:s'));
$data_json = json_encode($array);

But in NextCloud I only see at 'List':

#  UUID               °C     % r.F. Created
1  231d2508-786d-400d  0.00  0.00   2017-05-12 08:22:23

automatic value removal after time & changeable date formats

Hello,
i got two enhancement ideas:

  1. Add a option to enable automatic deletetion of values and a dropdown to select the timespan.
    example: you only want to store two years of data. Activate this option and chose 2 years. Data older than the selection will be deleted.

  2. Add an option to select different displayed date formats. Sending the date in the date('Y-m-d H:i:s') format is ok. But showing other formats in the visualisation and log lists would be great.

Timeout while createlog

I tried SensorLogger in combination with OwnTracks and constantly receiving timeouts.

With curl on the command line it needs 70secs to respond to the request:

$ time curl -H 'Content-Type: application/json' -d '{"deviceId":"test"}' --user USER:PASSWD https://example.com/index.php/apps/sensorlogger/api/v1/createlog/
{"message":"CORS requires basic auth"}
real	1m10,438s
user	0m0,032s
sys	0m0,012s

This is not happening on normal http requests.

make the app available for Nextcloud 13

Hi,

I really like this app and would highly appreciate further development.
Actually I use it with Nextcloud 13 which is unfortunately officially not supported but seems to work as good as Nextcloud 12. I think it just needs to be changed ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.