Open bsimmo opened 6 years ago
Thank you for your feedback! We should update the wiki with your findings.
This can be closed now; since some of this (all the dependencies have changed) is not relevant to the current version of Wii-Scale, Node is now readily available in the Repo's and I already rewrote the Raspberry Pi wiki page based on my findings as I installed the software this morning (on a 0W) - The rewrite also includes appropriate pairing instructions.
I'll give the new Wii-Scale a go as soon as I can and follow the new Wiki on a ZeroW on 3B's.
Thanks for being a guinea pig! The way I found it easiest is to put an 'ssh' file in /boot while writing the image, then use a 3B on an ethernet cable to set up the wifi - then the card can be swapped into the 0W and everything else can be done wirelessly on that.
Final install took about 30 minutes from 'booting the 0W' to 'Dang, I've lost weight!'
@bsimmo I decided to run through it again and fixed a bug in my instructions. I decided to consolidate a bunch of little servers onto a single Pi - and I was trying to get the logging working with Forever while I did it. Once I did, I realized it wasn't doing the right thing - constantly killing and respawning the job, which isn't ideal. I ended up using a simple systemd script and creating a separate user to run wii-scale under, which works properly, is the 'correct' thing to do (i.e. from a security and best practice perspective) and takes care of the logging through journald.
If you're up for testing that as well, let me know and I'll write you a set of experimental instructions for repeating my configuration.
I have some time to have a go at this :-)
Sweet!
I haven't got documentation for installing as a service to hand, it involves tweaking the install process slightly as well. The basic principle is to create a new user and group which the app will run as, and setting systemd up to start, log and end that job automatically. I'll see if I can get to it tonight, but no promises!
Ok, my install has spontaneously died. (Hadn't used it since the 10th, and now it doesn't detect me standing on the board) so I'm about to reinstall. Bear with me.
Well, that was weird. I had to delete, clone and rebuild my entire app. Goodness knows why.
Anyway. Writing you a wiki, brb.
Ok @bsimmo ...in theory, this should work: https://github.com/mo-g/Wii-Scale/wiki
It probably won't, but let me know what bits are broken and I'll fix them.
Very sorry for the delay Playing with this today as I have all the stuff and am not away on some holiday :-)
node-js legacy, do we actually need this (a symlink from my readings). It's recently been removed from Raspbian some days ago ?
First error as I work thorough, i'll add as I go along 'sudo chown root:wiiscale Wii-Scale' should be pi not root (as I've just been battling with it as it kept saying I had no permission, no matter how many times I rebooted, logged out or redid the folder setup and command, lol I guess I need to now remove root permission :-) )
a few warning and at least a deprecation that needs sorting out `npm install --production
(node:1777) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
ws@0.5.0 install /opt/Wii-Scale/node_modules/socket.io/node_modules/engine.io/node_modules/ws (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/opt/Wii-Scale/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build' CXX(target) Release/obj.target/bufferutil/src/bufferutil.o bufferutil.target.mk:95: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed make: Leaving directory '/opt/Wii-Scale/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'
ws@0.4.31 install /opt/Wii-Scale/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/opt/Wii-Scale/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build' CXX(target) Release/obj.target/bufferutil/src/bufferutil.o bufferutil.target.mk:95: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed make: Leaving directory '/opt/Wii-Scale/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build' lokijs@1.3.7 ../node_modules/lokijs`
Now at the point of testing and it's all working (I didn't install nodejs-legacy just to see) (may be good just to mention localhost:8080 in a browser on the Pi or if remote point to it's IP address (or by default raspberrypi.lan:8080 ) As a side, for a standalone setup I would change the host name e.g. using raspi-config or raspberry pi configuration @ the desktop to WiiScale so you can use WiiScale.lan:8080 and not need to know the IP address and also not get it confused with other default Pi on the network )
and after 'Run on Boot' and two reboots. I can see it locally, BUT it cannot see the board on the when I click on connect webpage, my board blue light is constant blue light
(but not remotely any morevia IP address. (this could just be network)
Off to have a coffee and turn it off and hope it all just happens to work when I come back
node-js legacy, do we actually need this (a symlink from my readings). It's recently been removed from Raspbian some days ago ?
Don't know - I need to actually try that.
I didn't install nodejs-legacy just to see)
Never mind! Thanks. :+1:
should be pi not root
No it shouldn't. Something else went wrong here. sudo usermod -aG wiiscale pi
should have given you access to that folder.
a few warning and at least a deprecation that needs sorting out
Nah, not our problem. Those are all part of the socket.io library.
BUT it cannot see the board on the when I click on connect webpage
That's usually a udev problem. sudo cp wii-scale/70-wii-scales.rules /etc/udev/rules.d/
would have dealt with that. Can you run sudo systemctl restart wiiscale
, try and connect the board, then do `sudo journalctl -xe' and post the results?
but not remotely any morevia IP address.
Try rerunning npm config set wii-scale:host 0.0.0.0
.
Thanks for the feedback! Weird that you're having issues. (I'm also having problems, but... different ones. :/)
should be pi not root
No it shouldn't. Something else went wrong here. sudo usermod -aG wiiscale pi should have given you access to that folder.
--
As it obviously didn't for me.
Hopefully get it done today.
On Wed, 15 Aug 2018, 22:58 Gray Marchiori, notifications@github.com wrote:
node-js legacy, do we actually need this (a symlink from my readings). It's recently been removed from Raspbian some days ago ?
Don't know - I need to actually try that.
I didn't install nodejs-legacy just to see)
Never mind! Thanks. 👍
should be pi not root
No it shouldn't. Something else went wrong here. sudo usermod -aG wiiscale pi should have given you access to that folder.
a few warning and at least a deprecation that needs sorting out
Nah, not our problem. Those are all part of the socket.io library.
BUT it cannot see the board on the when I click on connect webpage
That's usually a udev problem. sudo cp wii-scale/70-wii-scales.rules /etc/udev/rules.d/ would have dealt with that. Can you run sudo systemctl restart wiiscale, try and connect the board, then do `sudo journalctl -xe' and post the results?
but not remotely any morevia IP address.
Try rerunning npm config set wii-scale:host 0.0.0.0.
Thanks for the feedback! Weird that you're having issues. (I'm also having problems, but... different ones. :/)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aelveborn/Wii-Scale/issues/26#issuecomment-413351565, or mute the thread https://github.com/notifications/unsubscribe-auth/ALALt76lovwAVDjS3Jv-RF9WY-N02D9aks5uRJl6gaJpZM4SSRaM .
Try running groups pi
. Should give you a list of your group memberships.
Ok corrected users, some reason pi hadn't taken wiiscale ...
Anyway I've checked through and journal to doesn't seem to have a problem. All npm seem fine from a clean startup. (Will cut and paste later , but Listening on localhost:8080 Wii-Scale started [connect] successful [connect] WebSocket ... and then a repeat of that (same timestamp 11:05:27 as above). But WebScoket is now WebSocket Connection 127.9.0.1:8080 v-2 "WebSocket++/0.7.x-dev" /socket.io/?EIO=4&transp That's the end of the line I can read, may have cut off).
Still not working properly.
No access from outside. It doesn't autoconne t when you click the button, I have to use the Bluetooth (desktop icon and press the board button). At which point the webpage just doesn't do anything and the blue light stays on.
If I run nom start again in /opt/Wii-Scale it errors, probably as its already running, I'll have play as it work working fine before the auto start on boot.
As a test. If it Remove Device, the Board from the Bluetooth list so it forgets it. Then rescan and red button it. It works fine for use and the webpage is now connected
Also I just tried to install nodejs-legacy. It wouldn't as unmet dependencies nodejs >= 0.6.19..... and it cannot correct them So it not possible as nodejs is version 8.11.1.... latest apt version.
Probably why it was removed /no longer needed not long ago.
While it works ish, if I npm start again (or stop and restart) it shows errors
pi@raspberrypi:/opt/Wii-Scale $ npm stop
(node:2509) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
pi@raspberrypi:/opt/Wii-Scale $ npm config set wii-scale:host 0.0.0.0
(node:2520) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
pi@raspberrypi:/opt/Wii-Scale $ npm start
(node:2530) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
> wii-scale@0.0.4 start /opt/Wii-Scale
> node scripts/start.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:8080
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1367:14)
at listenInCluster (net.js:1408:12)
at doListen (net.js:1517:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
npm ERR! wii-scale@0.0.4 start: `node scripts/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wii-scale@0.0.4 start script.
npm ERR! This is most likely a problem with the wii-scale package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/start.js
npm ERR! You can get their info via:
npm ERR! npm owner ls wii-scale
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.52-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /opt/Wii-Scale
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/Wii-Scale/npm-debug.log
npm ERR! not ok code 0
pi@raspberrypi:/opt/Wii-Scale $
debug.txt
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@1.4.21
3 info using node@v8.11.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart wii-scale@0.0.4
6 info start wii-scale@0.0.4
7 verbose unsafe-perm in lifecycle true
8 info wii-scale@0.0.4 Failed to exec start script
9 error wii-scale@0.0.4 start: `node scripts/start.js`
9 error Exit status 1
10 error Failed at the wii-scale@0.0.4 start script.
10 error This is most likely a problem with the wii-scale package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node scripts/start.js
10 error You can get their info via:
10 error npm owner ls wii-scale
10 error There is likely additional logging output above.
11 error System Linux 4.14.52-v7+
12 error command "/usr/bin/node" "/usr/bin/npm" "start"
13 error cwd /opt/Wii-Scale
14 error node -v v8.11.1
15 error npm -v 1.4.21
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]
Hello I've just had a play at this but use the current RaspberryPi Raspbian Stretch (desktop) version release, which is two distributions newer than the instructions. I also used a Pi3 as it has built in Bluetooth as does the smaller Pi0W.
Anyway this worked for me (I don't know NodeRed at all ) I skipped the install of nodered (as it comes with rasbian desktop)
(same as normal here) in a terminal window created a folder, moved into it. cloned the git git clone https://github.com/aelveborn/Wii-Scale.git cd into folder
sudo python setup.py install
now sudo npm install --production failed with no npm, a quick look at https://nodered.org/docs/hardware/raspberrypi and all I did wassudo apt-get install npm
not the rest of itsudo npm install --production
worked fine followed byand opened chromium and pointed to http://127.0.0.1:8080
hit the sync and pressed the red button and it worked I say worked, I had to remove the BalanceBoard (Nintendo RVL-WBC-01) as a device from the Bluetooth icon in the taskbar. (since I had added it as a new device) otherwise it cannot find it.