Closed mo-g closed 3 years ago
Haha, missed the recursive flag. user=1D10T for sure.
Also found libssl-dev
and cppcheck
are dependencies.
Ended up finding a genu-ine issue in the end!
On debian and derivatives, node
has been renamed nodejs
which also caused an issue.
Have now completely updated the ubuntu guide to reflect the changes in both this project and the OS. The raspbian one should follow; especially as all new models of the Raspberry Pi are getting wifi and bluetooth out of the box. (I'm testing on my workstation, with a plan to follow with a 0W hidden in my bookcase)
Ok, well - since I have a 3B+ and a 0W sat on my desk, I'll use the former to build a small headless server on the latter, and see about putting together an updated guide for that as well. I have a completely unrelated project going on where I need a monitor of my health, and having a platform agnostic web-based client for that would be helpful.
Unrelated question, since I haven't dug through the code yet - does the software have any battery saving auto-disconnect time-outs? Something along the lines of:
git
isn't a default install on Raspbian Lite. Wasn't actually expecting that! Cmake
either. It also needs some additional boost libraries to be manually installed: libboost-system-dev libboost-date-time-dev libboost-random-dev
Managed to get my board connected through bluetoothctl, but wii-scale doesn't seem to be able to disconnect it. Interesting.
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.17" (uid=1000 pid=11554 comm="build/wii-scale -h0.0.0.0 -p8080 -c0 ") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.3" (uid=0 pid=477 comm="/usr/lib/bluetooth/bluetoothd ")
terminate called after throwing an instance of 'Gio::DBus::Error'
power on
agent on
default-agent
scan on
<press red sync button>
pair <MAC of the found wiimote>
# note: we do not explicitly connect, we just pair!
connect <MAC of the wiimote>
# there seems to be a pretty short timeout, so execute this immediately after the pairing command
trust <MAC of the wiimote>
disconnect <MAC of the wiimote>
scan off
exit
Also, the dbus error requires usermod -aG lp <username>
to fix.
So, both guides have now been updated.
Last thing is the daemonization of Wii-Scale on the Raspberry Pi guide - When I start it through forever, the port remains closed. I need to look at it further, but it's 1am, so it can wait till tomorrow! Night!
Right, it's morning now! I need to go buy some food and then cook some freezer boxes, but here's some logs:
pi@scales:/opt/wiiscale $ forever start /opt/wiiscale/scripts/start.js
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: /opt/wiiscale/scripts/start.js
Decided to try using the log file option:
pi@scales:/opt/wiiscale $ sudo mkdir /var/log/wiiscale
pi@scales:/opt/wiiscale $ sudo chown root:pi /var/log/wiiscale
pi@scales:/opt/wiiscale $ sudo chmod 775 /var/log/wiiscale
pi@scales:/opt/wiiscale $ forever stopall
info: Forever stopped processes:
data: uid command script forever pid id logfile uptime
data: [0] xain /usr/bin/nodejs /opt/wiiscale/scripts/start.js 4005 4267 /home/pi/.forever/xain.log 0:0:0:6.748
pi@scales:/opt/wiiscale $ forever start /opt/wiiscale/scripts/start.js -o /var/log/wiiscale/stdout.log -e /var/log/wiiscale/stderr.log
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: /opt/wiiscale/scripts/start.js
pi@scales:/opt/wiiscale $ tail -f /var/log/wiiscale/*
tail: cannot open '/var/log/wiiscale/*' for reading: No such file or directory
tail: no files remaining
pi@scales:/opt/wiiscale $ touch /var/log/wiiscale/stdout.log
pi@scales:/opt/wiiscale $ touch /var/log/wiiscale/stderr.log
pi@scales:/opt/wiiscale $ tail -f /var/log/wiiscale/*
==> /var/log/wiiscale/stderr.log <==
==> /var/log/wiiscale/stdout.log <==
And:
pi@scales:/opt/wiiscale $ telnet localhost 8080
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
pi@scales:/opt/wiiscale $ forever start -c "npm start" /opt/wiiscale/ -o /var/log/wiiscale/stdout.log -e /var/log/wiiscale/stderr.log
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: /opt/wiiscale/
pi@scales:/opt/wiiscale $ cat /var/log/wiiscale/*
pi@scales:/opt/wiiscale $ cat /var/log/wiiscale/*
pi@scales:/opt/wiiscale $ cat /var/log/wiiscale/*
pi@scales:/opt/wiiscale $ cat /var/log/wiiscale/*
pi@scales:/opt/wiiscale $ telnet localhost 8080
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET
Connection closed by foreign host.
So that works - but the log files are still empty. Will update the documentation to remove the bad command suggestion, at least.
That's done - the wiki instructions are now correct - but if anyone else wants to run through them on a fresh SD card and confirm that I haven't made a typo, or forgotten to copy something I did into the wiki - would appreciate.
Please don't close this yet, I'd like to get the logging issue fixed before we do.
Managed to get forever logging right, which showed the havok it was playing with the process (repeatedly killing it). Looking into a better solution.
Opened #35.
I've managed to install
nodejs
,xwiimote-dev
,libboost-program-options-dev
,libglibmm-2.4-dev
but for the life of me I can't fix this one by mashing my face against apt. Currently,socket.io-client-cpp
is empty,Cloning from git:
ribbons/socket.io-client-cpp
intowiimote/socket.io-client-cpp
fixes it, this should be added to the instructions (or automated by the config script).