Debugging pyergometer

pyergometer

See also: ergometria.async.fi

Tagged with:

Categorised as:


Kettler ergometer serial protocol

I'm having some issues getting JErgometer working with my new Kettler E3, so to rule out the possibility of miswiring (the bike has a traditional RS-232 interface so I got a USB-RS232-WE-5000-BT_0.0 cable from FTDI which comes "wire-ended" and requires some soldering) I dug out "Kettler Treadmill Serial lua class" from mhwlng (thanks!). This, and my own brute-force testing got me the following list of commands relevant in the bike's context, which may be only a subset of the commands that the bike accepts but what could be used to build one's own implementation:

RS
Reset device
ID
Ergometer computer model info ("SF1B1706")
VE
Ergormeter computer firmware version ("117")
ST
Request status; reply:

pulse rpm speed*10 distance requested_power energy mm:ss actual_power
CM
Enter command mode; required before calling the P-commands below
PW x
Request power of x watts
PT mmss
Request time of mmss
PD x
Request x/10 km distance

Notes: I only connected RX, TX and signal ground (looks like the bike does not use any kind handshaking). Serial port settings are 9600bps, 8N1.

Tagged with:

Categorised as:


Debian SSD tips

  • Do not use swap; this may be overly cautious these days as the drives have fancy wear-leveling schemes and whatnot implemented but still, if you're not tight on memory then it should not hurt. And if memory is an issue then in order to avoid performance problems perhaps you should upgrade it in the first place.
  • Do use the "noop" I/O scheduler, i.e.
  • apt-get install grub
  • add GRUB_CMDLINE_LINUX="elevator=noop" to /etc/default/grub
  • update-grub
  • after boot, /sys/block/sda/queue/scheduler should read "[noop] anticipatory deadline cfq"
That last part about the scheduler ensures that the default disk I/O scheduling, which rearranges reads and writes to boost IOPS for traditional cylindrical platters and is therefore just bad for SSD performance, is not used. With the "noop" scheduler, reads and writes happen in order.

Tagged with:

Categorised as:


Working ntp.conf for the Pool

driftfile /var/lib/ntp/ntp.drift

statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# From http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers
# each of these ISO: FR, Notify?: No
server ntp1.kamino.fr iburst
server ntp1.doowan.net iburst
server ntp.duckcorp.org iburst
server itsuki.fkraiem.org iburst
server time.zeroloop.net iburst

restrict 127.0.0.1
restrict ::1
restrict default kod notrap nomodify nopeer noquery

Pool stats for the servers be found here.

Tagged with:

Categorised as:


Note to self: Django/South basic usage

Not that I understand how this schema migration thing actually works. Anyway, initially, on an empty database:
./manage.py syncdb --noinput
./manage.py schemamigration YOUR_APP --initial
./manage.py migrate YOUR_APP 0001 --fake
Then, after fiddling with your models:
./manage.py schemamigration YOUR_APP --auto
./manage.py migrate YOUR_APP
That should do it. But like I said, my understanding of the system is very limited and I'm sure there are cases when this simplistic pattern just won't cut it. My needs, however, at the moment are not the most complicated.

Tagged with:

Categorised as: