tplink-monitor-linux install?

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Ahh, i'm going to say something unpopular now but:
UNIX CLI is mostly comparable to Linux CLI (except sed, sed has... an attitude...)

Anyhow ontopic:
I understand being conservative, There is something to say about just waiting a month or so and pushing to 12.1 right away... thats up to you.
But anyway: You should be able to change the pkg repo, if there is any, yes.
you could also build from ports, but thats a WHOLE other story and makes things needlessly complicated...
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
If
https://pkg.freebsd.org/ only does not allow browsing anymore. but... the URL of a
file on a known location it still works.
...then presumably my original FreeBSD.conf should still work? I say this because I've amended the /etc/pkg/FreeBSD.conf file as above and it still won't update.

root@TPLink_Devices:~ # cat /etc/pkg/FreeBSD.conf
# $FreeBSD: releng/11.0/etc/pkg/FreeBSD.conf 303975 2016-08-11 23:39:23Z gjb $
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
# mkdir -p /usr/local/etc/pkg/repos
# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
url: "pkg+http://pkg0.jinx.freebsd.org/${ABI}/release_1",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
root@TPLink_Devices:~ #

root@TPLink_Devices:~ # pkg install npm git
Updating FreeBSD repository catalogue...
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
[TPLink_Devices] Fetching meta.txz: 100% 916 B 0.9kB/s 00:01
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
[TPLink_Devices] Fetching packagesite.txz: 100% 6 MiB 1.6MB/s 00:04
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
root@TPLink_Devices:~ #

Trust me after all this grief, I WILL look VERY hard at updating!!
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
Ahh, i'm going to say something unpopular now but:
UNIX CLI is mostly comparable to Linux CLI (except sed, sed has... an attitude...)

Anyhow ontopic:
I understand being conservative, There is something to say about just waiting a month or so and pushing to 12.1 right away... thats up to you.
I'm perfectly at home with vi. I've used it for decades, and my Van Dyke Software Secure CRT has plenty of tabs programmed with it's useful bits. I'm just unfamiliar with the admin of the guts of unix. Would an update from 11v1-U7 to 12.1 go completely smoothly? You can see the problems I'm having with this and if I hit any issues I'd lose the whole NAS again.....
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,741
You should just upgrade from 11.1 to 11.3, IMHO. 11.3 is still a perfectly supported version in FreeNAS as well as in FreeBSD.
Only FreeBSD 11.1 and 11.2 are EOL, that's why you face problems installing packages.

No pressure to mess with the Beta just yet.
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
If you upgrade do it step by step. 11.1->11.2->11.3
Save the config on each upgrade step.
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
OK I've just checked my FreeNAS GUI and it shows me 11.2 and 11.3 updates available, and I'm happy to do each individually as advised. Will it update the Jail too please?
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
If you upgrade do it step by step. 11.1->11.2->11.3
Save the config on each upgrade step.
This.
And make snapshots/backups allong the way.


Will it update the Jail too please?
No it won't it won't touch your jail itself. (it might touch and break iocage, thats not unheard, but those issues are mostly when people downgrade)
You can do:
iocage upgrade $JAILNAME -r 11.3-RELEASE
After the freenas upgrade
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,741
If you are not running anything productive in the jail, yet - which is what I guess from your failed attempts - I recommend nuking the entire "iocage" dataset, performing the two upgrades, check that everything else works that your FreeNAS is supposed to do, then start afresh.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
If you are not running anything productive in the jail, yet - which is what I guess from your failed attempts - I recommend nuking the entire "iocage" dataset, performing the two upgrades, check that everything else works that your FreeNAS is supposed to do, then start afresh.
Uhmm... Indeed!
Don't go through the trouble of porting jails that never actually functioned to begin with...
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
I recommend nuking the entire "iocage" dataset
It wasn't even an iocage, as it was FreeNAS 11.1 it was a warden jail, which were a real pain to update.
iocage is so much better .... You can even run a 11.3 jail on a 11.2 FreeNAS. And I guess you can run a 11.4 jail in a 11.3 FreeNAS.
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
OK, I think that sounds reasonable. I take it that I can just got to the GUI > Jails > select the only Jail I have, and click on the "Dustbin" icon?
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
OK. Jail deleted as per previous. Snapshots taken manually, (first ever) and same scheduled. Config backed-up with and without key.
My next plan is GUI > System > Update > select 11.2 STABLE from the dropdown and perform a "Manual Update".
Any further suggestions please before I do? Like a Reboot first?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,741
No need for "Manual Update" - just select the proper "train", i.e. 11.2 STABLE and confirm, you will then be offered the latest 11.2 version and can click to install that.
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
(please don't go wrong...please don't go wrong...)
Update to 11.2-U8 seems ok, snapshots and config copies done.
Update to 11.3-U4 seems ok, snapshots and config copies done.
PHEW!!!!
Thank you sincerely all for your patience and help!
 
Last edited:

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
I need to go and have a lie down now. Then I can re-attempt to create the Jail for TPLink Monitor .....
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
Well, I'm immensely happier and more relaxed now.
I have a FreeNAS running 11.3-U4 and a Jail running same. I have created a user on the Jail and can SSH to it. I have installed npm and git, and then used npm to install the javascript application. It is almost working...
I can browse to the Jail TPLink application and it gives me an identical webpage to the one I experienced when running it on the PC, but with one, very serious difference: It doesn't discover any devices. I have used tcpdump to monitor the Jail interface traffic. I did get some error messages when I was installing the above.

root@TPLink-Devices:/home/andrew/tplink-energy-monitor # npm install
npm WARN npm npm does not support Node.js v14.4.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12, 13.
npm WARN npm You can find the latest version at https://nodejs.org/
added 222 packages from 278 contributors and audited 223 packages in 10.133s
found 21 vulnerabilities (4 low, 10 moderate, 6 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
root@TPLink-Devices:/home/andrew/tplink-energy-monitor #


root@TPLink-Devices:/home/andrew/tplink-energy-monitor # npm start
npm WARN npm npm does not support Node.js v14.4.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12, 13.
npm WARN npm You can find the latest version at https://nodejs.org/

> tplink-monitor@0.0.1 start /usr/home/andrew/tplink-energy-monitor
> node ./app.js

Logger config file: "logger-config.json"
Log directory path: "."
Starting discovery on interface: 192.168.1.29
(node:25215) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:25215) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:25215) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
GET / 200 114.192 ms - 9826
GET /stylesheets/style.css 200 4.671 ms - 1229
GET /javascripts/dash.js 200 1.141 ms - 10233
GET /favicon.ico 200 15.496 ms - 9826
GET /index.html 200 12.731 ms - 9826
GET /stylesheets/style.css 304 1.345 ms - -
GET /javascripts/dash.js 304 0.576 ms - -
GET /index.html 304 17.911 ms - -
GET /stylesheets/style.css 304 1.327 ms - -
GET /javascripts/dash.js 304 0.620 ms - -
GET /index.html 304 10.533 ms - -
GET /stylesheets/style.css 304 0.593 ms - -
GET /javascripts/dash.js 304 0.613 ms - -

The "GET"'s are a result of my browsing to the webpage it produces.
I haven't performed any corrective action, as suggested by some of the above, I wanted to ask for advice first.
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
I'm looking at the error messages I got above and trying to rectify one at a time, but not getting far.
In trying to resolve "npm WARN npm npm does not support Node.js v14.4.0 ", I tried to downgrade to an earlier version and followed this thread: https://www.ixsystems.com/community/threads/how-to-downgrade-or-install-specific-port-in-jail.41569/. I installed "portdowngrade" which seemed to install correctly, but when run it comes up with an error message about a file it can't create. When I check, the directory doesn't even exist? Then further research showed that perhaps npm would do the job, so I ran "npm install node@13". That produced an even more impressive error list.
Could someone give me a pointer please? Or is this stricly FreeBSD and should I start a thread on a relevant support website please?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,741
To install node and npm you don't need to mess with the ports. Simply do a pkg search npm and you will see what's available, then use pkg install and the npm package will pull in the correct node package to go with it.

Which version you need should be documented somewhere with the software you are trying to use. No clue about that TP-Link thing, but just for comparison:
 

fixit9660

Dabbler
Joined
Jan 14, 2018
Messages
33
Thank you Patrick! That worked perfectly. Now I get no errors at all when it runs. I've learned something else today.
The program is not discovering the network item but that's something I need to research for myself to see if I can understand why and fix it.
Much apprecaited.
Andrew.
 
Top