Received: from [209.160.97.41] (port=25605 helo=consumption.dtcwriting.com) by stodi.digitalkingdom.org with esmtp (Exim 4.92) (envelope-from ) id 1jWpEx-0005R9-UT for lojban@lojban.org; Thu, 07 May 2020 15:43:42 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=quwxr762; d=dtcwriting.com; h=Subject:Message-ID:Reply-To:From:To:MIME-Version:Content-Type:Date; i=fever.information@dtcwriting.com; bh=P9R71/Q6YDpbG2h7/joMJ5vgqgo=; b=YrlE/WJGvr5C4GCnJ/3TkR0RjqrDA1qrIB7j091IaCV5vxK21dwsKMccB20ThXPqW1tTSi55RmWP rkIO+8DdLLJz3lGK7ry3/1BP133X7Q0LcN790GALSQxMzkktr6COjf7wT5wNMyx/HFr8pPlIoff4 /kqSuooldhj1IHJHO74= Subject: Non-contact thermometers that ship for nothing Message-ID: <-X_ix_5BOk8jnM284bJCzXe@consumption.dtcwriting.com> Reply-To: fever.information@dtcwriting.com From: Fever Information To: lojban@lojban.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="pnYp3ik5JX5hL4ipXDvdB8yYYp8eM3S9Gwxor" Date: Thu, 7 May 2020 18:43:39 -0400 X-Spam-Score: 1.4 (+) X-Spam_score: 1.4 X-Spam_score_int: 14 X-Spam_bar: + X-Spam-Report: Spam detection software, running on the system "stodi.digitalkingdom.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: For the db in the initial build I chose the most used store for timeseries data; RRD. Fortunately there are a couple of different modules for node to use RRD, from which I picked the node rrd (https:/ [...] Content analysis details: (1.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4998] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 HTML_IMAGE_ONLY_32 BODY: HTML: images with 2800-3200 bytes of words 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS 0.0 T_REMOTE_IMAGE Message contains an external image --pnYp3ik5JX5hL4ipXDvdB8yYYp8eM3S9Gwxor Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 8bit For the db in the initial build I chose the most used store for timeseries data; RRD. Fortunately there are a couple of different modules for node to use RRD, from which I picked the node rrd (https://github.com/Orion98MC/node_rrd) . With a little tinkering, I wrote a driver (https://github.com/gildean/PiTherm/blob/master/dbdrivers/rrd.js) to be used that creates a new RRD-file if none exists, and does searches properly as RRD requires the timespan to be divisble with the interval of the RRA. This module also requires for the RRDtool (http://oss.oetiker.ch/rrdtool/) to be installed, but that just required a quick sudo apt-get install rrdtool. http://ww1.dtcwriting.com/homepage.html http://www.dtcwriting.com/information.html As the rpi normally runs with an SD-card, I didnt want to put too much stress on the disk and therefore wrote the HTTP-server (https://github.com/gildean/PiTherm/blob/master/httpserver.js) to run completely in-memory. And because the device might be set up somewhere with poor internet-connection, I made the HTTP-server also save a Gzipped and a deflated version of each file, and added a simple etagging-function to run as well. The HTML and CSS are also concatted at startup, as are the two js-files. For the application to be nice and real-timey, I included a WebSocket-server (https://github.com/gildean/PiTherm/blob/master/websocketserver.js) to the mix. All the requests from the frontend after the initial page-load are made through the WebSocket-connection, which also helps to keep the network-traffic to a minimum. The server sends new updates every 30 seconds so the page can be used as an actual thermometer. With the websocket-server being the actual way of serving the data, the web-page isn't the only option when creating a client either. --pnYp3ik5JX5hL4ipXDvdB8yYYp8eM3S9Gwxor Content-Type: text/html; charset="UTF-8" Content-transfer-encoding: 8bit

For the db in the initial build I chose the most used store for timeseries data; RRD. Fortunately there are a couple of different modules for node to use RRD, from which I picked the node rrd. With a little tinkering, I wrote a driver to be used that creates a new RRD-file if none exists, and does searches properly as RRD requires the timespan to be divisble with the interval of the RRA. This module also requires for the RRDtool to be installed, but that just required a quick sudo apt-get install rrdtool.

 
 
 

As the rpi normally runs with an SD-card, I didnt want to put too much stress on the disk and therefore wrote the HTTP-server to run completely in-memory. And because the device might be set up somewhere with poor internet-connection, I made the HTTP-server also save a Gzipped and a deflated version of each file, and added a simple etagging-function to run as well. The HTML and CSS are also concatted at startup, as are the two js-files.

For the application to be nice and real-timey, I included a WebSocket-server to the mix. All the requests from the frontend after the initial page-load are made through the WebSocket-connection, which also helps to keep the network-traffic to a minimum. The server sends new updates every 30 seconds so the page can be used as an actual thermometer. With the websocket-server being the actual way of serving the data, the web-page isn't the only option when creating a client either.

--pnYp3ik5JX5hL4ipXDvdB8yYYp8eM3S9Gwxor--