The recent AddDeviceWizard exposed some of the
Quarq devices which are possibly experimental.
Commented them out in case they re-appear at a
later date.
The initialisation of the new 'channels' member
was being set inside LIBUSB conditionals. This
means when built without LIBUSB channels would
not get initialised.
Introduce a wizard for adding realtime devices since it
is prone to user error, is relatively complicated and is
something most users will only ever do once or twice.
There are several logical updates within this patch:
First; Fix intermittent ANT+ not working
* LibUsb - check bufRemaining is > 0 not non-zero
* LibUsb - Always reset the USB stick on open
* ANT.cpp - Support > 4 channels on USB2
* ANTChannel - Do not use pairing, but always
* unassign, assign and set channel id.
Second; Fix device discovery
* Find and discover support in realtime controllers
* Extend Serial.cpp to cover more Serial devices
* Support for 4 or 8 ANT channels for USB1/USB2
Third; Introduce Add Device Wizard with
* General and Specific wizard pages for each device type
* Device pairing with telemetry display
* fixed compile time warnings
Fourth; Update Device Config Page
* use wizard to add new device
* remove edit fields, replaced by wizard
* remove pair, firmware buttons replaced by wizard
Fifth; Deprecate/Remove Device Types
* Null Device - used by developers only
* Quarqd client - replaced by Native ANT+
* GC Server - not implemented yet
I have also introduced a device specific wheel size
and flags for controlling the default selection and
sources for sensor data when in multi-device mode. These
are not yet supported in the code.
Fixes#611.
Fixes#497.
Added a usb_init() call prior to starting a workout, this
appears to clear state inside libusb.
Also added some commented code for displaying diagnostics
when sending/receiving ANT messages.
This should make the ANT+ connection more robust on first
use, since subsequent uses are now fine.
This may be related to the state the USB host controller (stick)
is left in after we first connect, more investigation is required.
It was neccessary to reset the USB2 stick between
sessions. This was due to incorrect state data
being maintained within the ANT code.
New sessions should start without requiring a USB
device reset or running ANT agent etc.
Fixes#558.
Forgot to increment the power channels count, which
mean't that the alternate power device was not set.
Also now allow for scanning for same device types on
multiple channels.
Add support for dual ANT+ power devices (in this case using
dual track SRM cranks). The two power devices are assumed to
represent power and alternative power.
The following changes have been made for this support:
* ANT+ device profile support multiple power devices
* Allow editing ANT+ device profile on Mac/Linux (it
is already available on Windows)
* When a second ANT Channel is assigned to power it is
set as alternative, and updates alternative watts
* RealtimeData now supports Watts and AltWatts
* AltWatts dial and associated color settings
* LRBalance dial to show difference between Watts and AltWatts
* Realtime plot plots watts and altWatts
Fixes#572.
Under Mac OSX the Tacx Fortius support needed
a few minor tweaks;
* sleep 60ms between read/write operations to
avoid interrupt errors
* clear_halt on read/write endpoints before
attempting to read/write to the device
* remove the errant usb_reset which really should
not have been called in LibUsb since it deletes
the device structure(!)
The LibUsb class has been modified to clear_halt
when opening ANT devices too -- since regression
testing on Mac showed that a) you need the latest
drivers to work with a USB2 stick on Lion (64bit)
and it now appears to mandate a clear_halt when
opening the device (but this may be related to the
Garmin ANT agent leaving it in an unknown state).
Initial support for Tacx Fortius devices.
Note this requires libusb support to be present and will
work on Linux, Mac and Windows.
The handlebar buttons up/down will increase/decrease the
load/intensity in a similar fashion to the +/- keys on
the Computrainer controller.
The cancel button will stop a workout and the enter key
is used to mark a lap.
Slope and Ergo modes are supported, but we do not set the
brake at all if the speed is below 10kph, this is to
ensure it does not get burnt out when users 'grind'.
SPECIAL NOTE:
The Fortius handlebar controller is a Ez-Usb device
and requires firmware to be loaded when it is connected.
Since this is copyrighted by Tacx BV we do not distribute
it, instead, when the user sets up a Fortius device they
must also provide the file. Full instructions on how this
should be done are given when configuring the device.
Additionally, for Linux users udev rules should be added to
ensure that the USB devices are accessible to non-root users.
Fixes#538.
When working with ANT+ devices the load dial always
showed zero, because the ANT device was not updating
the realtime data with the desired load.
In addition, the target load telemetry always showed
watts even when working in slope mode (where it should
show the gradient).
Fixes#532.
This update completes support for USB2 sticks for ANT+ devices
in train view. The code now works on Linux and Mac as well as
Windows.
IOKit is now a required framework for builds on Mac OSX and
src.pro has been updated accordingly.
I have also added a tarball of the required version of libusb
in a new 'contrib' directory. Users may wish to use a later
version or download from an alternative source, but this
version is guaranteed to work.
Fixes#310
Fixup support for USB2 on Linux via libusb. The code
is pretty ghetto with a maze of pre-processor conditionals.
But it works.
Of special note:
* You MUST build with a very specific version of libusb, the
stock libs in Ubuntu do not work. Might pull the code into
the main repo, since its pretty darned tiny.
* On Linux access controls for the USB devices is controlled
by udev, and requires a rule adding to ensure the devie can
be read/written by users other than root. A udev rule file
has been added to a 'linux' subdirectory in src.
Some of the timeouts and usb setup/reset code has been adjusted
to ensure the device is always in a consistent state. This appears
to be more important on Linux than Windows for some reason.
Update to training mode to improve the UI and overall
user experience. This initial patch introduces:
* Video Window - but ghetto and not fully functional
* Congigurable - drag and drop 'dials' onto homewindow
In future updates we need to:
* Support Video fully - Only Linux in this patch
* HomeWindow - Make Training mode the same as HomeWindow
* More Dials - Support metrics (e.g. BikeScore)
* RT Charts - Make RT plot drag/drop and support other
types of charts (e.g. Time In Zone)
* Controls - Add more controls for FFWD/REW, Skip etc
This patch has been tested on Linux ONLY. It is being committed
to support further build/deployment work for Win32 and Mac OSX.
This patch adds support for the Garmin USB2 stick using
libusb-win library. Instructions are included in gcconfig.pri.in
for configuring and installing the neccessary libs.
To enable support for USB1 and USB2 support in the same binary
stubs are created when UsbXpress/Libusb are not available and the
device i/o attempts to use USB2 before falling back to USB1.
Since I was also in the middle of some coding changes I merged
my developments (Mark) with Darren's patch whilst fixing it up
for commit, namely:
1. the configuration screen no longer demands a COMx port
when using Native ANT+ on Windows.
2. new signals in ANTChannel notify the ANT class when info is
stale or lost (but they are not used at present).
3. The previous debug messages have been removed, although new
debug messages are added for stale/drop/timeout signals.
A patch to create an 'antlog.bin' in the current working
directory when working with ANT+ devices. This is to enable
users to test the ANT+ support and share the received messages
to diagnose issues related to parsing messages and displaying
telemetry.
This 'antlog.bin' will ultimately become a native ant file format
and have an associated extension (.ant) and a ridefile reader.
For now it just writes a stream of fixed length messages (12 bytes)
of all received messages.
This patch provides support for Garmin USB1 sticks under
Windows. Since the device does not present a serial port
this code uses the USBXpress API from SiLabs that the
Garmin device uses.
Support for USB2 sticks is pending.
To build you will need to download and install the SiLabs
development kit from http://www.silabs.com/products/mcu/Pages/USBXpress.aspx
and set USBXPRESS_INSTALL appropriately in gcconfig.pri. I
have provided instructions in gcconfig.pri.in.
At runtime the SiUSBXp.dll will need to be in the path, I will
assume that Gareth will fix up the windows installer for this, but
for now just copy the file manually.
Tested with a GARMIN USB1 stick on Windows 7 with SRM, Garmin HR and
a GSC-10 dual speed/cadence device.
There are other minor fixes to the ANTMessage code in this patch
related to decoding of calibration messages.
Second stage of development, refactored the quarqd sources and introduced
an ANTChannel and ANTMessage class.
This is a functional patch and should work with known ANT+ devices, but
has only been tested with a Garmin HR strap, GSC-10 dual speed/cadence
and SRM wireless cranks. It has only been tested with a first generation
Garmin ANT+ USB stick.
It *should* work with other devices (e.g. Powertap, Quarq) but this has
not been tested.
The configuration pane has not been fixed yet, so you can either add a
Native ANT+ device and leave the profile blank (it will autodiscover
whatever it can when you run) or you can copy the profile from a Quarqd
device and use that.
There are lots of bugs;
* Calibration is not supported, uses a static srm_offset
* Wheel circumference is fixed at 2100mm for speed calculations
* Timeouts are hit and miss and need to be completed
* Sensor loss / timeouts are not managed yet
* Burst data and Acks are not handled
* Device descriptions, versions and battery messages are not handled
Aside from the bugs above part 3 wil also need to include;
* Configuration screen fixups and device pairing
* Add a calibration button to the realtime window
Lastly, the refactoring of the quarqd code is incomplete, there is still
a need to use ANTMessage across the code, especially within the ANTChannel
code which still does a bit of decoding locally.
First stage of development, folding together the
quarqd sources and creating an ANT+ worker and controller
to work with realtime window.
The basic code is folded together and compiles fine. The next
step is to address the channel management code, device discovery
channel assignment and channel event handling. This will be pushed
as part of the next commit.
The third commit will need to fixup the configuration pages to
support selection of device/baudrate, fix native discovery/pairing
in config and lastly, fix a long standing issue with the config pane
to allow editing of existing device configurations.
This is NOT a functional patch yet, but compiles and runs fine. Committed
as a checkpoint before refactoring quarqd supplied code.