Code Monkey home page Code Monkey logo

temperature-machine's Introduction

temperature-machine's People

Contributors

calvellido avatar toby-weston-db avatar tobyweston 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

Watchers

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

temperature-machine's Issues

Make config for 'All/Averaged Sensors' sticky

One of my machines has two sensors, one of which is indoors and the other outdoors. Because of this, the average value between the two is rather meaningless to me, so I always check the "show all sensors" setting. But at every refresh, it reverts to the default behavior of averaging. Would it be possible to make it remember the last setting, or at least, set the default via config file?

can't seem to make it work, need help

Hi again,
ok so the eth0 is ok
so i started again. removed all directories and started again as user pi

followed the most detailed instractions from
http://baddotrobot.com/blog/2016/03/23/homebrew-temperature-logger/

1)I followed the steps to setup sbt
2)Created the file /usr/local/bin/sbt
3)cloned the data logger’s from Git repository
4)changed the .sh files to reflect my eth0 instead of wlan0
5)build the binary

during the build I noticed

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

at the end of the build of binary I got
[info] Done updating.
[info] Compiling 48 Scala sources to /home/pi/code/temperature-machine/target/scala-2.12/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.12.3. Compiling...
[info] Compilation completed in 220.088 s
[info] Compiling 26 Scala sources to /home/pi/code/temperature-machine/target/scala-2.12/test-classes...
/usr/local/bin/sbt: line 3: 2222 Killed java $SBT_OPTS -jar dirname $0/sbt-launch.jar "$@"
pi@pizero:~/code/temperature-machine $

i didn't know if all was ok or not, but then I run

pi@pizero:~ /code/temperature-machine $ ./start.sh
Started your temperature-machine, redirecting output to temperature-machine.log, PID stored in temperature-machine.pid
pi@pizero:~ /code/temperature-machine $

pi@pizero:~/code/temperature-machine $ more temperature-machine.log
Error: Unable to access jarfile target/scala-2.12/temperature-machine-2.1.jar

what I am doing wrong?

Export Data & Time resolution

1/ Would be nice to have the possibility to export the data (tab.txt or csv).

2/ Also, would be nice to have the possibility to change the timing of the temperature sampling.

3/ Finally, if one could - from the web interface - to reset the data stored in the ~/temperature.rrd

Compilation failure on Pi Zero

pi $ sbt -J-Xmx512m -J-Xms512m assembly
[info] Loading project definition from /home/pi/code/temperature-machine/project
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[info] Set current project to temperature-machine (in build file:/home/pi/code/temperature-machine/)
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
[info] Compiling 48 Scala sources to /home/pi/code/temperature-machine/target/scala-2.12/classes...
[info] Including from cache: scala-library.jar
[info] Checking every *.class/*.jar file's SHA-1.
[info] Merging files...
[warn] Merging 'META-INF/MANIFEST.MF' with strategy 'discard'
[warn] Strategy 'discard' was applied to a file
[info] Assembly up to date: /home/pi/code/temperature-machine/site/target/scala-2.10/site-assembly-0.1-SNAPSHOT.jar
java.lang.ClassNotFoundException: xsbt.CompilerInterface
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at sbt.compiler.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:128)
	at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:104)
	at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:62)
	at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:57)
	at sbt.compiler.CompilerCache$$anon$2.apply(CompilerCache.scala:47)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:45)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
	at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
	at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
	at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:72)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:71)
	at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:99)
	at sbt.inc.Incremental$.compile(Incremental.scala:71)
	at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
	at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
	at sbt.Compiler$.compile(Compiler.scala:155)
	at sbt.Compiler$.compile(Compiler.scala:141)
	at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:879)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:870)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:868)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	at sbt.std.Transform$$anon$4.work(System.scala:63)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.Execute.work(Execute.scala:237)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
[error] (temperature-machine/compile:compileIncremental) java.lang.ClassNotFoundException: xsbt.CompilerInterface
[error] Total time: 55 s, completed 09-Oct-2017 17:12:28
[error] Not a valid command: J-Xms512m
[error] Not a valid key: J-Xms512m
[error] J-Xms512m
[error]          ^

Auto update of graphs

I noticed that the numeric temperature value updates automatically, but the graph doesn't. It would be nice to have it update automatically - in real time or even just every x minutes. That would allow us to leave a browser window open, with a constantly up-to-date graph being shown.
I understand why some people would need the current behavior; so maybe this could be made user-selectable, maybe with an "auto-update" checkbox near the graph itself?

Cristian

Automatic or fixed Y-axis (temperature) range

It would be nice to have an option to configure the y-axis range (especially on the main graph, but also on the smaller ones); maybe an option to leave it to automatic, or manually set a range with minimum and/or maximum temperature... The same goes for the "green zones" on the long term graphs. Ideally these should be configurable from the web page, but a config file would do as well. This would also avoid the "compressing" effect of spurious spikes...

Cristian

Unable to start temperature-machine on boot

Hi,

I tried to adapt the recommendation from the documentation to start the temperature-machine on startup. In my case, the server (Pi 3, hosname=raspberrypi) has the probes, so I added this line in /etc/rc.local file (before exit 0 line):

su pi -c 'cd /home/pi/code/temperature-machine && ./start.sh raspberrypi &'

But this doesn't work. I have to launch manually the server:

sudo cd /home/pi/code/temperature-machine
./start.sh

What am I doing wrong?

Config frequency of recording

Currently, temperatures are uploaded every 30 seconds.

Allow this to be configurable.

Eventually, I'd prefer to have the temperature file on the OS be read continually and 'streamed' to the client. Until then, make it configurable as it's pretty quick to do.

Add /version endpoint

Add a version endpoint, something like this in a version.sbt:

val latestSha = SettingKey[String]("latest-sha")

latestSha := Process("git rev-parse HEAD").lines.head.take(6)

version in ThisBuild := latestSha.value

Then bring it back in a VersionEndpoint:

import org.http4s.HttpService
import org.http4s.dsl._

object VersionEndpoint {

  private val version = Option(getClass.getPackage.getImplementationVersion).getOrElse("UNKNOWN")

  def apply = HttpService {
    case GET -> Root / "version" => Ok(version)
  }
}

LogParserTest fails when using different timezones

I live in Italy and have set my local timezone accordingly. I have to do that, because otherwise, the graphs will show the wrong time.
But with the changed timezone, the LogParserTest always fails:

[info] LogParserTest
[info] 
[error] x Example inputs
[error]  LogMessage(2017-10-31T09:40:05.976Z,[main],INFO,Starting temperature-machine (server mode)...) != LogMessage(2017-10-31T10:40:05.976Z,[main],INFO,Starting temperature-machine (server mode)...) (LogParserTest.scala:97)
[error] Actual:   ...0-31T[09]:4...Z,[main],INFO...
[error] Expected: ...0-31T[10]:4...Z,[main],INFO...

I'm forced to revert the timezone to UTC to compile, then change it back (which is annoying) or to skip the tests altogether (which defeats the point of having those tests).

Data doesn't appear to be archiving

Previously had issues with the graphs but since pulling the latest commits the issue has since changed.

The graph now does not update in any way shape or form and shows stale data which doesn't exist (i know it doesn't exist because i deleted the rrd file to see if that kicks it back into shape!)

also - not sure where the sensor name "bedroom1-sensor1" has come from!

screen shot 2018-01-20 at 19 07 55

Improve information in CrcFailure

When CrcFailures are output, they don't show anything interesting.

Change

case class CrcFailure() extends Error(...")

to

case class CrcFailure(scratchPad: String) extends Error("...")

Then ensure when it's output in the log, it displays the scratchpad.

Also investigate why the stream message isn't displayed. From a recent log:

Fri 19-Jan-2018 09:09:24.835 [temperature-reading-thread-1] ERROR CrcFailure()

Stream temperature changes

Using inotifywait (), watch for file changes of the temperature sensor and send straight to the server.

Update the sever to stream current temperatures via web sockets rather than HTTP GET.

Update the UI to respond reactively to streamed temperature changes. Potentially update the chart in real time.

Note that RRD has a rate limit of 1 second, so might need the debounce.

I can't find ~/.temperatures

Where is the above please?

I think it's essential to have access to it in order to make changes such as to the hostname etc

Many thanks

CSV Export

From @singh763173

Apologies, me again - Any chance you might be able to help me write a cron job that can query the domain.com/temperature file and copy that contents into a CSV file?
I'm thinking that I can create a csv with three columns, date, time, temp and then collect the data and work with that - what do you think?

Update the site docs

There's a few improvements I've spotted re-reading

  • Point out there is more in the documentation section than just the landing page suggests ✅
  • Add binary download
  • Update the image
  • More

A few suggestions / feature requests

Hello,
after successfully using this system for a few days I have some suggestions, which are not bug reports but more like "feature requests"...

  1. It would be nice to have the current version printed somewhere on the web page... just for reference, and to know if an update worked fine. Maybe near the copyright message on the bottom? Or as an "about" entry on the side menu...

  2. I noticed that the numeric temperature value updates automatically, but the graph doesn't. It would be nice to have it update automatically - in real time or even just every x minutes. That would allow us to leave a browser window open, with a constantly up-to-date graph being shown.

  3. The main graph and the 24-hour small graph are very smooth. But the 1-week and 1-month are "stepped". I suppose a reading is taken every so often, and then replicated for several pixels, until the new reading is taken. But this means that the graphs are quite "messy" and a bit meaningless if the temperature oscillates regularly, as is the case where a thermostat keeps the temp within a certain range. If for example 2 or 3 readings happen to be taken when the temperature is at the max value, then the following reading happens when the temp is at the minimum, then another when it's at max again... the graph would show a long "high temp" phase, followed by a low peak. This is not very representative. It would be nice if every "horizontal segment" could be made to show the average value of all the readings of the respective time interval. Even better would be if every pixel had its own value, to avoid the "stepped" look...

  4. It would be nice to have an option to configure the y-axis range (especially on the main graph, but also on the smaller ones); maybe an option to leave it to automatic, or manually set a range with minimum and/or maximum temperature... The same goes for the "green zones" on the long term graphs. Ideally these should be configurable from the web page, but a config file would do as well. This would also avoid the "compressing" effect of spurious spikes...

  5. One last thing... I've written three short scripts that save the small graphs to three folders (the 1-day at the end of the day, the 1-week at the end of the week, and the 1-month at the end of the month) to keep them for future reference. They are activated using cron. Maybe others could be interested in this, and it could be made an option in the software?

Thank you again for a wonderful piece of software!
Cristian

Export data into csv

As requested by tobyweston in the issue #24, I post here the point 1:

1/ Would be nice to have the possibility to export the data (tab.txt or csv).

Toby:
1/ I have something I've been using to debug things. It's on a branch but https://github.com/tobyweston/temperature-machine/blob/bf81f043d5fc2cc802b1ae9ee7760101c354eb90/src/test/scala/bad/robot/temperature/ConvertJsonToCsv.scala will create a CSV from JSON. If you can wait for a bit, I'll be merging it back to master and can make it usable / add it in properly. If not, you can hack about with it to get you started.

Long term graphs title

I just updated to the latest available version. I noticed that when I click on one of the long range graphs, and it enlarges, at the top left of the screen I get the "title" of that graph (i.e. 24-hour or 1 week). If then I change to another graph using the left/right arrows on screen, the graph does change, but the title does not. It should change to constantly reflect what graph is being shown...

Cristian

Negative temperatures

Problem with temperatures below zero being logged as large positive numbers (e.g. 4085.3 °C). This is also reflected in the graphs auto-scaling to 4000 °C.

When I read the sensor temperature using a python script with an expression such as echo /usr/local/bin/get_temp.py | head -1 | awk -F. '{print $1"."int(($2/100)+0.5)}'`` this returns the correct negative temperature.

Could this be a problem with how Temperature-Machine reads the sensor and handles signing?

negative temp example

get_temp.py.zip

Changed Hostname and Device has stopped logging

Hey Toby,

Wondering if you could help me out - I changed the hostname on my Pi last night and now it has stopped logging. The page is still available on port 11900 and when i cat the w1_slave file for the sensor, I'm getting a reading.

I'm guessing the hostname is hardcoded somewhere and needs to be updated? Any idea where?

Cheers

Error message: This site can't be reached

I've tried this on a Pi B, that should work shouldn't it?

It was all going so well until the very last step ... IPaddress:11900 This site can't be reached.

port 11900 doesn't appear to be open.

Any ideas anyone?

Many thanks

Name the probes

I run a raspberry pi3 with 5 probes connected to it. Is there a way to give a name to each of them? If not, to have the possibility to it from the web interface could be nice.
Thank you again for this great project.

Auto backup of past long-term graphs

I've written three short scripts that save the small graphs to three folders (the 1-day at the end of the day, the 1-week at the end of the week, and the 1-month at the end of the month) to keep them for future reference. They are activated using cron. Maybe others could be interested in this, and it could be made an option in the software?

My scripts are really crude, as I'm not at all an expert at this. The 24-hour graph is backed up at 23:59 each day, the 7-day at 23:58 on Sundays, and the monthly at 23:57 on the 30th day of the month. Not the 31st because of course not all months have 31 days, and those months would be skipped. Now that I think of it, with my script February probably gets skipped too, so this should be looked into.

It would have been better to save the files at 0:00 of the first day of the month (and the same for the other graphs) but then it would already be the following month, and since I use the "date" command to time-code the files, then the file name would not match the period of time it refers to.

Anyway, I created three folders under .temperature:

cd ~/.temperature
mkdir daily
mkdir weekly
mkdir monthly

Then I created the three scripts, named daily_copy.sh, weekly_copy.sh, monthly_copy.sh. They just copy the relevant file to the correct folder (date-coding it in the filename).

daily_copy.sh:

#!/bin/bash
cp ~/.temperature/temperature-1-days.png ~/.temperature/daily/`date +%Y_%m_%d_`1_day.png

weekly_copy.sh:

#!/bin/bash
cp ~/.temperature/temperature-7-days.png ~/.temperature/weekly/`date +%Y_%m_%d_`7_days.png

monthly_copy.sh:

#!/bin/bash
cp ~/.temperature/temperature-30-days.png ~/.temperature/monthly/`date +%Y_%m_%d_`30_days.png

I then made them executable:

sudo chmod +x daily_copy.sh
sudo chmod +x weekly_copy.sh
sudo chmod +x monthly_copy.sh

Then I edited the file /etc/crontab and added the following lines:

59 23   * * *   pi      /home/pi/.temperature/daily_copy.sh
58 23   * * 7   pi      /home/pi/.temperature/weekly_copy.sh
57 23   30 * *  pi      /home/pi/.temperature/monthly_copy.sh

and, without the need to reboot, I stopped and restarted cron:

sudo /etc/init.d/cron stop
sudo /etc/init.d/cron start

and that's it. Very crude, but it works, with the exceptions described above...

Cristian

Feature Request: Display Individual Temperatures

Hello,

would it be possible to deal for custom development of few features:

  1. removing restriction of 5 sensors per board, 8 would be ideal
  2. instead of showing average temperature over all connected sensors, show current temperature for every connected sensor on the left side, organized vertically.

Everything else is more or less perfect, thank you for sharing the project with DIY.

Regards, Damir

Dates: UTC vs LocalDateTime

Some of the system uses UTC whilst others local data times.

Log is generated by Log4J and the pattern %d{yyyy-MM-dd HH:mm:ss:SSS} and so local time.

Logs

Instant is UTC and the LogParser and LogMessage use Instant, so it probably makes sense to convert the log code to use LocalDateTime.

Or, we could store UTC in the log file (add a Z to the log4j.properties) and present in the local time zone of the client.

Charts / RRD

RRD itself will use UTC as it uses System.currentTimeMillis under the covers (RrdUpdate.scala L16) with the below.

  public static long getTime() {
        return (System.currentTimeMillis() + 500L) / 1000L;
  }

The /temperatures endpoint returns seconds for the event time (used by the main current temperature display) whereas the /temperature.json endpoint returns millis (for the chart). Both as UTC.

Fails to run tests

[info] Total for specification ErrorOnTemperatureSpikeTest
[info] Finished in 42 seconds, 994 ms
[info] 11 examples, 0 failure, 0 error
[info] 
2018-02-04 16:51:36:642 [pool-4-thread-7] INFO Temperature spikes greater than +/-30% will not be recorded
Non-200 body was:
\/-(Unable to parse content as JSON [1.1] failure: string matching regex `\d{4}' expected but `E' found

Error: Could not find or load main class bad.robot.temperature.client.Client
^)

Alert System

Would it be difficult to implement an alert (email?) based on an upper and lower variable.

I.e temp has decreased below threshold. Or above threshold.

Use case - I’ve now submerged my sensor in my tropical fish tank and want to monitor temps

Wireless errors when you don't have wireless

The start.sh, start-client.sh and start-server.sh script is geared up for wireless connections.

When the server starts up, it attempts to get the IP address of of the machine so you can monitor stats via the JMX console.

It does this with the following line:

IP=$( ifconfig wlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' )

If you don't have a wlan0 configured, this won't work and you'll get an error similar to the following:

wlan0: error fetching interface information: Device not found

Delete old data

What time period can be saved on memory?
How can I delete older data when the card is full?

UnexpectedError(Failed attempting to connect to localhost/127.0.0.1 to send Measurement logs

We're often seeing something like the following in the client logs.

-\/(UnexpectedError(Failed attempting to connect to localhost/127.0.0.1 to send Measurement(Host(example),1509221361 seconds,List(SensorReading(28-0115910f5eff,Temperature(19.75))))

Error was: org.http4s.MalformedMessageBodyFailure: Malformed message body: Invalid JSON: empty body
Payload was: '{
  "host" : "example",
  "seconds" : 1509221361,
  "sensors" : [
    {
      "name" : "28-0115910f5eff",
      "temperature" : {
        "celsius" : 19.75
      }
    }
  ]
}'

This is a bug where a non-200 response from the server is being incorrectly captured as a client (connection) error. The log detail about the malformed message body doesn't make any sense because it looks like it's saying the client couldn't connect because of a bad payload, even though the printed payload is valid JSON.

In fact, what's happening is the server is responding with say, a 500 Internal Server Error and the code that tries to display the response body is throwing an uncaught exception cause the default Task error handler (withHandler) to capture it and deal with it.

PCB

On the http://temperature-machine.com web site, you mention the PBC that you have designed. It is pretty neat. I have found that it could be easy and cheap to order it from the JLCPCB website. Would it be possible to share the gerber file of your PCB?

pi zero with eth0 nic

Hi,
I have pi zero with eth0 usb nic and following the guide when run the ./start.sh i got :

wlan0: error fetching interface information: Device not found
Started your temperature-machine, redirecting output to temperature-machine.log, PID stored in temperature-machine.pid

i also got the following on the log file :

root@pizero:~/code/temperature-machine# more temperature-machine.log
Error: Unable to access jarfile target/scala-2.12/temperature-machine-2.0.jar

also at the end of the sbt assembly I got:

   at java.lang.Thread.run(Thread.java:745)
[error] (temperature-machine/compile:compileIncremental) java.lang.ClassNotFoundException: xsbt.CompilerInterface
[error] Total time: 315 s, completed 07-Oct-2017 14:03:27

on the instructions there was no mention to java installation. This is a fresh install of raspbian lite on a pi zero. so in order to install the java I run :

root@pizero: sudo apt-get install oracle-java8-jdk

and the result of the java ver is the following :

root@pizero:~/code/temperature-machine# java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

too much? (should have split into 3 issues?)
Looking forward for your input

Laz

Better error reporting

Make the log viewable in the app and show dates / times.

Bit of a shame as I made an effort to display interesting startup output (below)

Starting temperature-machine (server mode)...
RRD initialising for 'study', 'bedroom1', 'bedroom2', 'bedroom3', 'outside', 'kitchen', 'lounge' (with up to 5 sensors each)...Ok
Starting Discovery Server, listening for 'study', 'bedroom1', 'bedroom2', 'bedroom3', 'outside', 'kitchen', 'lounge'...
Listening for broadcast messages...
Monitoring sensor file(s) on 'study' 
	/sys/bus/w1/devices/28-031591c760ff/w1_slave
Temperature spikes greater than +/-25% will not be recorded
HTTP Server started on http://127.0.1.1:11900
UnexpectedError(Failed to PUT temperature data to http://127.0.1.1:11900/temperature, response was 502 Bad Gateway: Error in RRD Bad sample time: 1507971519. Last update time was 1507971519, at least one second step is required)

Which would get muddled a little if I swap in an arbitrary logging framework:

2017-10-16 22:50:58:391 [main] INFO Starting temperature-machine (server mode)...
2017-10-16 22:50:58:427 [main] INFO RRD initialising for 'test', 'test2' (with up to 5 sensors each)...
2017-10-16 22:50:58:439 [main] INFO Ok
2017-10-16 22:51:09:128 [main] INFO Starting Discovery Server, listening for 'test', 'test2'...
2017-10-16 22:51:09:136 [temperature-machine-discovery-server-1] INFO Listening for broadcast messages...
2017-10-16 22:51:09:170 [main] INFO Monitoring sensor file(s) on 'MacBook-Pro' 
	/Users/toby/Workspace/github/temperature-machine/src/test/resources/more_examples/28-000005e2fdc2/w1_slave
	/Users/toby/Workspace/github/temperature-machine/src/test/resources/more_examples/28-000005e2fdc3/w1_slave

2017-10-16 22:51:09:317 [main] INFO Temperature spikes greater than +/-31% will not be recorded
2017-10-16 22:51:14:916 [main] INFO HTTP Server started on http://10.0.1.7:11900
2017-10-17 20:08:15:895 [temperature-machine-discovery-server-1] INFO Listening for broadcast messages...
2017-10-17 20:08:25:885 [temperature-machine-discovery-server-1] INFO Listening for broadcast messages...
2017-10-17 20:08:40:898 [temperature-machine-discovery-server-1] INFO Discovery server shutdown

Issues building new device

Me again (this isn't related to any other issues)

I'm currently building a new Pi as i want to log temps elsewhere but getting the following issues when running sbt assembly

[info] Checking every *.class/*.jar file's SHA-1.
[info] Merging files...
[warn] Merging 'META-INF/MANIFEST.MF' with strategy 'discard'
[warn] Strategy 'discard' was applied to a file
[info] SHA-1: 825dc9a8fcfcf8e80307c9fbec336c195183b74d
[info] Packaging /home/pi/code/temperature-machine/site/target/scala-2.10/site-assembly-0.1-SNAPSHOT.jar ...
[info] Done packaging.
[info] Passed: Total 109, Failed 0, Errors 0, Passed 109
[info] Checking every *.class/*.jar file's SHA-1.
[info] Merging files...
[warn] Merging 'META-INF/NOTICE' with strategy 'rename'
[warn] Merging 'META-INF/LICENSE.txt' with strategy 'rename'
[warn] Merging 'META-INF/LICENSE' with strategy 'rename'
[warn] Merging 'META-INF/DEPENDENCIES' with strategy 'discard'
[warn] Merging 'META-INF/MANIFEST.MF' with strategy 'discard'
[warn] Merging 'META-INF/maven/com.twitter/hpack/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/com.twitter/hpack/pom.xml' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.apache.logging.log4j/log4j-api/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.apache.logging.log4j/log4j-api/pom.xml' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.apache.logging.log4j/log4j-core/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.apache.logging.log4j/log4j-core/pom.xml' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.apache.logging.log4j/log4j-slf4j-impl/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.apache.logging.log4j/log4j-slf4j-impl/pom.xml' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.eclipse.jetty.alpn/alpn-api/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.eclipse.jetty.alpn/alpn-api/pom.xml' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.rrd4j/rrd4j/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.rrd4j/rrd4j/pom.xml' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.slf4j/slf4j-api/pom.properties' with strategy 'discard'
[warn] Merging 'META-INF/maven/org.slf4j/slf4j-api/pom.xml' with strategy 'discard'
[error] 1 error was encountered during merge
java.lang.RuntimeException: deduplicate: different file contents found in the following:
/root/.ivy2/cache/org.apache.logging.log4j/log4j-api/jars/log4j-api-2.10.0.jar:module-info.class
/root/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.8.0-alpha2.jar:module-info.class
	at sbtassembly.Assembly$.applyStrategies(Assembly.scala:140)
	at sbtassembly.Assembly$.x$1$lzycompute$1(Assembly.scala:25)
	at sbtassembly.Assembly$.x$1$1(Assembly.scala:23)
	at sbtassembly.Assembly$.stratMapping$lzycompute$1(Assembly.scala:23)
	at sbtassembly.Assembly$.stratMapping$1(Assembly.scala:23)
	at sbtassembly.Assembly$.inputs$lzycompute$1(Assembly.scala:67)
	at sbtassembly.Assembly$.inputs$1(Assembly.scala:57)
	at sbtassembly.Assembly$.apply(Assembly.scala:83)
	at sbtassembly.Assembly$$anonfun$assemblyTask$1.apply(Assembly.scala:240)
	at sbtassembly.Assembly$$anonfun$assemblyTask$1.apply(Assembly.scala:237)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	at sbt.std.Transform$$anon$4.work(System.scala:63)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.Execute.work(Execute.scala:237)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
[error] (temperature-machine/*:assembly) deduplicate: different file contents found in the following:
[error] /root/.ivy2/cache/org.apache.logging.log4j/log4j-api/jars/log4j-api-2.10.0.jar:module-info.class
[error] /root/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.8.0-alpha2.jar:module-info.class
[error] Total time: 1092 s, completed 30-Dec-2017 13:35:15
pi@tempmonitor2:~/code/temperature-machine $
``` 
`

Feature Request: More Sensors

Splitting #1 from @damirj79

Hello,

would it be possible to deal for custom development of few features:

 1. removing restriction of 5 sensors per board, 8 would be ideal
 2. instead of showing average temperature over all connected sensors, show current temperature for every connected sensor on the left side, organized vertically.

Everything else is more or less perfect, thank you for sharing the project with DIY.

Regards, Damir

Reset data from web interface

As requested by tobyweston in the issue #24, I post here the point 3:

3/ Could you add the possibility to reset the data stored in the ~/temperature.rrd from the web interface?

Toby:
3/ Good idea.

Smoothing the weekly and monthly graphs

The main graph and the 24-hour small graph are very smooth. But the 1-week and 1-month are "stepped". I suppose a reading is taken every so often, and then replicated for several pixels, until the new reading is taken. But this means that the graphs are quite "messy" and a bit meaningless if the temperature oscillates regularly, as is the case where a thermostat keeps the temp within a certain range. If for example 2 or 3 readings happen to be taken when the temperature is at the max value, then the following reading happens when the temp is at the minimum, then another when it's at max again... the graph would show a long "high temp" phase, followed by a low peak. This is not very representative. It would be nice if every "horizontal segment" could be made to show the average value of all the readings of the respective time interval. Even better would be if every pixel had its own value, to avoid the "stepped" look...
I assume that the code that builds the graphs, just reads the relevant values from the RRD (one every x values). It could be better if the code could read ALL the values between a graph point and the previous one, and then display the AVERAGE of all those values. I think this would smooth the graph, avoiding those kind of "moire' artifacts"...

Cristian

Unwanted spurious spikes

My server has been behaving well, with no drops and no spikes. But the client, which has two sensors attached, sometimes shows large spikes, which are annoying especially because they mess up the autoscale of the y axis, and so I loose detail.
What is weird is that both sensors show the same spike, and it appears to be on only one frame. Could this be a communication error? It's hard to believe that both sensors always show the same spike at exactly the same moment...
temperature

temperature2

Avoid spikes in temperature data

I'm not sure why it started happening but I'm seeing extreme spikes in temperature data.

screen shot 2017-04-12 at 17 02 30

Potentially ignore volitile readings or check the CRC when reading (as suggested in the Arduino forum).

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.