I do a bit of dabbling in spaghetti code
iderp / pi-hole-for-lametric Goto Github PK
View Code? Open in Web Editor NEWShow your Pi-Hole status right on your LaMetric!
License: GNU General Public License v3.0
Show your Pi-Hole status right on your LaMetric!
License: GNU General Public License v3.0
I do a bit of dabbling in spaghetti code
Hi!
I alway end here:
Starting Pi-Hole for LaMetric v2.0.3-Beta...
✔ Pi-Hole Connection @ 10.0.0.13 Successful!
✔ Pi-Hole Auth Valid!
✔ Connected to "My LaMetric" @ 10.20.0.22 running OS v2.0.23 & Pi-Hole Status v5! (XXX)
ℹ Up to date.
⠴ Sending update for "My LaMetric" @ 10.20.0.22 to the server...(node:4148) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: 400 Bad Request
(node:4148) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠇ Sending update for "My LaMetric" @ 10.20.0.22 to the server...(node:4148) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: 400 Bad Request
Do you have any ideas how to solve that? Connections from my private vlan (10.10.0.0/24) to iot (10.20.0.0/24) is possible and works for all types of devices (sonos, hue) until now. I can also successfully access the LaMetric IP 10.20.0.22 via ping or browser.
I see there is some server-side processing hidden behind https://lametric.iderp.io/pihole/${LaMetricDeviceInfo2.body.id}. This might raise some privacy concerns: this server gets to know the top domains accessed for all users of your otherwise great app. Would you mind to also publish or document this part?
Lametric queries lametric.b1nzy.xyz every 5 seconds with plugin installed. Is it necessary?
Can anyone show me what the config.json file should look like? Mine is blank after renaming it per the instructions.
Got this now :=)
Nov 06 21:09:11 raspberrypi pilametric[2171]: (node:2171) UnhandledPromiseRejectionWarning: Error: 522 undefined
Nov 06 21:09:11 raspberrypi pilametric[2171]: at _response.transport.request.then (/home/pi/Pi-Hole-for-LaMetric/node_modules/snekfetch/src/index.js:193:21)
Nov 06 21:09:11 raspberrypi pilametric[2171]: at
Nov 06 21:09:11 raspberrypi pilametric[2171]: at process._tickCallback (internal/process/next_tick.js:182:7)
Nov 06 21:09:11 raspberrypi pilametric[2171]: (node:2171) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch
Nov 06 21:09:11 raspberrypi pilametric[2171]: (node:2171) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
PiHole installed on Ubuntu 18.04 VM
:~/Pi-Hole-for-LaMetric$ node index.js
Starting Pi-Hole for LaMetric v2.0.1...
✔ Pi-Hole Connection @ 192.168.88.250 Successful!
✔ Pi-Hole Auth Valid!
✔ Connected to "My LaMetric" @ 192.168.88.54 running OS v2.0.17 & Pi-Hole Status v4! (SAXX04XXXXXXXXXXXX9)
✖ Connection to LaMetric @ 0.0.0.0 Failed. LaMetric does not seem to linked to t his IP.
ℹ Up to date.
⠙ Connecting to LaMetric @ 192.168.88.54...(node:1577) UnhandledPromiseRejection Warning: TypeError: Cannot read property 'toString' of undefined
at snek.get.set.then.LaMetricDeviceInfo2 (/home/milan1201/Pi-Hole-for-LaMetr ic/index.js:71:112)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:1577) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1577) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠼ Sending update for "My LaMetric" @ 192.168.88.54 to the server...⠋ Connecting ⠙ Connecting to LaMetric @ 192.168.88.54...(node:1577) UnhandledPromiseRejection Warning: TypeError: Cannot read property 'toString' of undefined
at snek.get.set.then.LaMetricDeviceInfo2 (/home/milan1201/Pi-Hole-for-LaMetr ic/index.js:71:112)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:1577) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
VM, PiHole and Lametric all running latest versions.
Hi,
Here is the console output:
Starting Pi-Hole for LaMetric v2.0.3-Beta... ✔ Pi-Hole Connection @ 192.168.0.61 Successful! ✔ Pi-Hole Auth Valid! ✔ Connected to "My LaMetric" @ 192.168.0.53 running OS v2.1.2 & Pi-Hole Status v5! (####################) ℹ Up to date. ⠙ Connecting to LaMetric @ 192.168.0.53...(node:204687) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of undefined at snek.get.set.then.LaMetricDeviceInfo2 (/root/Pi-Hole-for-LaMetric/index.js:74:109) at process._tickCallback (internal/process/next_tick.js:68:7) (node:204687) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:204687) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Node version is v10.21.0
System details:
Icon name: computer-vm Chassis: vm Virtualization: microsoft Operating System: CentOS Linux 8 (Core) CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 4.18.0-193.19.1.el8_2.x86_64 Architecture: x86-64
This doesn't seem to be sending the data over to the LaMetric, and loops the sending with no successful "sent" output on the console.
Is there any ports that require to be opened?
I have removed/censored any details i'm unwilling to share.
Let me know if you need any more details. Unluckily i'm not proficient in node js code.
I look forward to your response.
Thanks
Edit: I've tested Node versions 6.13.0; 8.9.0; 9.4.0 and 10.21.0. The software wouldn't run on 6.13.0. All other version produce similar to same outcomes.
Edit2: I've tested previous versions of this program. (2.0.2 and 2.0.1) with same issue/outcomes.
Trying to run this on my pihole and get the folowwing error.. any ideas?
Sending update for "LaMetric" @ 192.168.1.64 to the server...(node:11932) ExperimentalWarning: The http2 module is an experimental API.
⠦ Sending update for "LaMetric" @ 192.168.1.64 to the server...(node:11932) UnhandledPromiseRejectionWarnin g: Error: 502 Bad Gateway
at _response.transport.request.then (/home/pi/Pi-Hole-for-LaMetric/node_modules/snekfetch/src/index.js: 193:21)
at
at process._tickCallback (internal/process/next_tick.js:182:7)
(node:11932) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handle d with .catch(). (rejection id: 2)
(node:11932) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, prom ise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Newly got this error. Any ideas how to fix that?
pi@Eggman:~/Pi-Hole-for-LaMetric $ node index.js
Starting Pi-Hole for LaMetric v2.0.3-Beta...
⠋ Testing Pi-Hole Connection @ 10.0.0.13...Debug Mode Enabled
✔ Pi-Hole Connection @ 10.0.0.13 Successful!
✔ Pi-Hole Auth Valid!
✔ Connected to "Rayman" @ 10.20.0.22 running OS v2.0.24 & Pi-Hole Status v5! (XXX)
ℹ Up to date.
⠸ Sending update for "Rayman" @ 10.20.0.22 to the server...(node:3678) UnhandledPromiseRejectionWarning: Error: 523 undefined
at /home/pi/Pi-Hole-for-LaMetric/node_modules/snekfetch/src/index.js:193:21
at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:3678) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:3678) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate th⠏ Sending update for "Rayman" @ 10.20.0.22 to the server
"Blocked Today" is really showing blocked last 24 hours "XXX ADs has been blocked in the last 24h"
Hey there!
Sending the data received from Pi-Hole to the server https://lametric.iderp.io/pihole lead currently to an http error 522. Isn't the server available any longer?
BR,
Markus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.