As mentioned in the earlier Phant post the version of Phant available via npm & the phant github repo doesn’t have the WebUI part of data.sparkfun.com and thus a couple of things you can do with the Sparkfun hosted version of Phant can’t be done (AFAIK) with the self-hosted version. However, after digging around on the sparkfun github page & phant.io/docs I noticed that a /config page was mentioned
for configuring and deploying your own copy of the phant server
I left everything as default & clicked download, selected tar.gz as archive format and after it had downloaded copied to my raspberry pi. Once it was over on the Raspberry Pi I again followed the instructions to the letter (as i have no idea what i’m doing ) and created a directory phantconfig-custom & untared the downloaded tarball into it.
then installed it (as i’m not sure exactly how this works i’m installing it in a directory for my pi user rather than globally. It shouldn’t make that much different other than this way any problems are probably something I did rather than caused by not following instructions)
After a few minutes phant with a WebUI will be installed.
You can now test/use it by running it using the command
and if everything installed ok you’ll see a small phant banner
and I can now store sensor data in my self-host phant by either using the telnet interface.
or via the WebUI with all it’s extra bells and whistles such as hidden streams & stream aliases.
Everything looks fine & now matches up with http://phant.io/docs pretty well although of course you’ll need to change the domain:port part of the url in the docs to the one your self-hosted phant uses.
So you have a choice, you can run the github version of phant that only has the telnet ui for stream creation & a few less functions or you can use the full blown phant with all the shinies. Both versions seem to run reasonably well on the Raspberry Pi even with the warnings that the WebUI is a resource hog and not suitable for less powerful devices but i will admit i haven’t tested much and have just had a mess around with it trying to make it do things it wasn’t designed to do such as distributing binaries/data to many devices automagically.
one final thing is that I removed a couple of parts of the WebUI as if i’m using this privately i really don’t need them. I edited
and deleted the the block2 & block5
Now that it’s been tested in a user directory and seems to be working ok i’ll probably try it installed globally and/or use the forever https://www.npmjs.com/package/forever to keep it running 24/7 even if i close the ssh session or close the terminal window