Giter VIP home page Giter VIP logo

Comments (11)

mo-g avatar mo-g commented on August 24, 2024

Haha, missed the recursive flag. user=1D10T for sure.

Also found libssl-dev and cppcheck are dependencies.

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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)

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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:

  • No websocket client connected, auto-disconnect after 20 seconds if no client connects.
  • No weight detected, auto-disconnect after 180 seconds if nothing happens.
  • Weight successfully recorded, auto-disconnect after 60 seconds unless new user selected or new client connected.

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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'

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024
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.

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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!

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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.

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

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.

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

Managed to get forever logging right, which showed the havok it was playing with the process (repeatedly killing it). Looking into a better solution.

from wii-scale.

mo-g avatar mo-g commented on August 24, 2024

Opened #35.

from wii-scale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.