Coder Social home page Coder Social logo

mrverrall / go-row Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 2.0 1.98 MB

Connect Concept2 rowers to Zwift. Go-row is a Bluetooth LE bridge, written in Go, to convert a Concept2 PM5 rower into a Cycle Power and a Running Speed Service. This enables you to use a Concept2 rower with cycling/running games such a Zwift.

Home Page: https://blog.mrverrall.co.uk/2020/07/connecting-concept2-rower-to-zwift.html

License: MIT License

Go 100.00%
bluetooth concept2 rower zwift running rowing concept2-rowing row-cycle pm5 concept2-pm5-rower

go-row's Introduction

go-row

Go-row is a Bluetooth LE bridge written in Go. It re-transmits a Concept2 PM5 rowers metrics as Bluetooth 'Cycle Power' and 'Running Speed' services. This allows you to use a Concept2 rower in cycling or runnning games such a Zwift.

You can now install gow-row as a simple deb package for Raspbian.

Cycling cadance is set to 3x the rowing SPM and running cadance 6x.

Quick Start

Raspberry Pi package (deb)

The go-row deb package can be download from the releases page. Below is an example of installing via the command line. The package will install go-row as a service that starts on boot, perfect for a headless system.

# Download
wget https://github.com/mrverrall/go-row/releases/download/v0.0.1-2/go-row_0.0.1-2_armhf.deb

# Install
sudo dpkg -i go-row_0.0.1-2_armhf.deb

Go-row should now be running as a service, you can check this with,

systemctl status go-row

From Source

Assuming a clean install of Raspbian on an Raspberry Pi Zero W...

apt-get install golang
go get "github.com/mrverrall/go-row"
sudo ~/go/bin/go-row

Connecting to your Rower and Game

While go-row is running select 'connect' from the main PM5 menu, connection is then automatic.

Once connected to a PM5 go-row will advertise the cycle and running services. Within your game/app select the 'go-row' device.

Row!

Installing as a service

N.B. This is not needed if you installed go-row using the debian package.

An example systemd service file is included in this repository.

To install as a boot service with systemd, edit the "ExecStart" path in the service file to the location your compiled go-row executable.

Copy your service file to '/var/lib/systemd/system/go-row.service'. then,

sudo systemctl daemon-reload
sudo systemctl enable go-row.service
sudo systemctl start go-row.service

Check your service is ruuning with,

sudo systemctl status go-row.service

go-row's People

Contributors

mrverrall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-row's Issues

Cadence too high

Hi, this works really well except the cadence is seventy-something when I'm only at twenty something strokes per minute. I tried changing *3 to *1 in cpm.go, but clearly that isn't the bit I need to change! Can you help please?

Docs: Example usage?

It’d be good if the docs showed how you’d install/run this. Not sure what commands would need to be run and how to pair it to a rower?

Crash on OS interrupt in some states.

Not a massive issues as It's an interrupt so you wanted to close anyway, but need to handle this scenario.

2020/06/23 10:30:55 PM5 error: Unresolvable connection error: can't scan: context deadline exceeded
^C2020/06/23 10:30:58 signal received from os: interrupt
panic: close of closed channel

goroutine 1 [running]:
github.com/go-ble/ble/linux/hci/socket.(*Socket).Close(0x1043660, 0x0, 0x0)
/home/pi/go/src/github.com/go-ble/ble/linux/hci/socket/socket.go:148 +0x30
github.com/go-ble/ble/linux/hci.(*HCI).close(0x107c360, 0x0, 0x0, 0x101a03c, 0x101a03c)
/home/pi/go/src/github.com/go-ble/ble/linux/hci/hci.go:327 +0x50
github.com/go-ble/ble/linux/hci.(*HCI).Close(0x107c360, 0x1000194, 0x108d14)
/home/pi/go/src/github.com/go-ble/ble/linux/hci/hci.go:169 +0x2c
github.com/go-ble/ble/linux.(*Device).Stop(0x100eb00, 0x108d0c, 0x10000e0)
/home/pi/go/src/github.com/go-ble/ble/linux/device.go:105 +0x20
github.com/go-ble/ble.Stop(0x1000001, 0x1077f9c)
/home/pi/go/src/github.com/go-ble/ble/gatt.go:52 +0x34
main.unsetBT()
/home/pi/go/src/github.com/mrverrall/go-row-cycle/go-row-cycle.go:65 +0x14
main.main()
/home/pi/go/src/github.com/mrverrall/go-row-cycle/go-row-cycle.go:33 +0x104

Add support for a SPM-Cadence scaling factor

In-game avatars look weird riding at the usual rowing spm/cadence of ~30. As cadence doesn't impact in-game performance, look to add a command line switch to scale this if desired.

I don't think this is reasonable for power, a watt is a watt.

PM5 reconnects after setting wireless to off

Not sure if this is my bug or theirs, but the PM5 will not power down automatically as long as there is an active wireless connection, however even if you turn wireless off on the PM5 it will allow go-row-cycle to reconnect.
go-row-cycle implements a 5s cooling off period when a PM5 disconnects, extending this might mitigate against the issue, but would also delay dynamic reconnects if we experience a disconnection mid session.
Need to investigate ways to mitigate against this without compromising user experience.

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.