cv07nguyend / Withings

Allow for local network logging of Withings scale data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to setup local Withings scale data capture

This project will allow you to capture scale readings to a local TSV file for import into a spreadsheet or other software

Steps

These steps are for my router running DD-WRT, if you're using a different network configuration you'll have to modify them appropriately

1) Copy all bits in this folder to the location you'd like to host from
2) Run 'mongoose-3.0.exe'
3) Test service by going to 'http://<YourIpAddress>/info.php' and verify 
   that PHP is functioning 
4) Redirect all traffic from scalews.withings.com to your computer
  a) Login to DD-WRT on your router
  b) Navigate to 'Administration->Commands'
  c) Add 'iptables -t nat -A PREROUTING -d scalews.withings.net -j DNAT --to <YourIpAddress>' 
     to the commands list
  d) First 'Run Commands' to apply the command immediately
  e) Then 'Save Startup' so that it will be stored for any resets
  f) Then 'Save Firewall' just in case;
5) Test redirection by going to 'http://scalews.withings.net/cgi-bin/once' 
   and ensure you see only the string '{"status":0,"body":{"once":"21112cb3-1b433eef"}}'
6) Test scale logging
  a) give it about 20 seconds to send the data after stepping off the scale 
  b) check the measure.tsv file for 'measure' readings

Resources

Reference sites

Tools included with this project

  • Mongoose -- A very basic, free, stand alone, single exe, zero install webserver
  • PHP -- PHP script processor 'php-cgi.exe' that is used to run the logging scripts

Other helpful tools

  • DD-WRT logging -- Enable both Services->syslogd(enable) and Security->Log(enable)
  • WallWatcher -- DD-WRT traffic log viewer. No support but last release still worked great.
  • WireShark -- For all your packet sniffing needs

Other Withing related links

  • Hardwire power -- Might look into this simple mod if it starts eating batteries

About

Allow for local network logging of Withings scale data