ANT+ for Moto G (4G) and maybe others...

Search This thread

antftw

New member
Sep 12, 2014
3
12
Code:
#include <std_disclaimer.h>
/*
 * Your warranty is now void.
 *
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns before flashing this modification!
 * YOU are choosing to make these modification, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */

I've noticed that the Moto G 4G had the same chipset as the Xperia M2.
The Xperia M2 supports ANT+, so the 4G should too...

I've managed to build Cyanogenmod with support for ANT+ by following the information at
https://github.com/ant-wireless/ANT_in_Android.

Here's the patch for https://github.com/CyanogenMod/android_device_motorola_msm8226-common:
Code:
diff --git a/msm8226.mk b/msm8226.mk
index 5a27cf5..826f371 100644
--- a/msm8226.mk
+++ b/msm8226.mk
@@ -251,3 +251,7 @@ PRODUCT_PACKAGES += \
 PRODUCT_COPY_FILES += \
     kernel/motorola/msm8226/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \
     kernel/motorola/msm8226/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
+
+#ANT
+BOARD_ANT_WIRELESS_DEVICE := "qualcomm-smd"
+$(call inherit-product, external/ant-wireless/build/ant-wireless.mk)

Attached to this post is a flashable zip which includes all binaries which were added by my own build in comparison to a normal CM build.
So you could add ANT+ support just by flashing it over CM(or probably every other rom).
sha256sum: 42bb6f552b5150e1baab6f9b8f28cec8c7c2ab408b3fbca418490d71159c2cf4
md5sum: c1c765acb10d0420a643bd4f84f714d5

After you've flashed it, get the "ANT+ Plugin Sampler" from the Play Store and try to connect to any sensor.
If a black window appears with the waiting circle on the upper left screen, then everything is working properly.
I only have a 4G to test, but i'd be very interested whether it works on a Moto G or a Moto E.

If you look at the patch, then you'll see that the driver for ANT+ is called "qualcomm-smd", so it's not specific to the chipset of the 4G but to a group of Qualcomm chips.

Let's find out to which ones exactly!
 

Attachments

  • moto_g_ant.zip
    817.1 KB · Views: 2,202

MiyagiSan

Senior Member
Sep 18, 2014
632
167
[...]

I've noticed that the Moto G 4G had the same chipset as the Xperia M2.
The Xperia M2 supports ANT+, so the 4G should too...

I've managed to build Cyanogenmod with support for ANT+ by following the information at
https://github.com/ant-wireless/ANT_in_Android.

[...]

Attached to this post is a flashable zip which includes all binaries which were added by my own build in comparison to a normal CM build.
So you could add ANT+ support just by flashing it over CM(or probably every other rom).
sha256sum: 42bb6f552b5150e1baab6f9b8f28cec8c7c2ab408b3fbca418490d71159c2cf4
md5sum: c1c765acb10d0420a643bd4f84f714d5

After you've flashed it, get the "ANT+ Plugin Sampler" from the Play Store and try to connect to any sensor.
If a black window appears with the waiting circle on the upper left screen, then everything is working properly.
I only have a 4G to test, but i'd be very interested whether it works on a Moto G or a Moto E.

If you look at the patch, then you'll see that the driver for ANT+ is called "qualcomm-smd", so it's not specific to the chipset of the 4G but to a group of Qualcomm chips.

Let's find out to which ones exactly!

Hi,

Have you successfully tested it with a 2013 Moto G 4G? (It isn't clear from your posting above)

Were you able to pair up actual ANT+ sensors (HRM, speed, cadence, power etc) to your 2013 Moto G 4G?

Do apps like Tracks, Runtastic, IpBike etc work with these ANT+ sensors on the 2013 Moto G 4G, properly?

Any issues?

Does the original 2013 Moto G non-4G version have the same chipset/SoC as the 4G version (and the Xperia M2)? No reason to expect that it will work on the device otherwise...

---------- Post added at 05:10 PM ---------- Previous post was at 05:05 PM ----------

I've flashed the zip on my moto g. The app seems to work. But i need to fin and ant+ device to know if it really work

Is this a 2013 Moto G 4G or the original 3G-only 2013 model?

Would be great to find out if pairing with an actual ANT+ device works.
 
Last edited:
  • Like
Reactions: rotech

antftw

New member
Sep 12, 2014
3
12
Have you successfully tested it with a 2013 Moto G 4G? (It isn't clear from your posting above)
Were you able to pair up actual ANT+ sensors (HRM, speed, cadence, power etc) to your 2013 Moto G 4G?

There's no 4G from 2013 as far as i know. So i'm specifically using a Moto G 4G (XT1039).
I've paired heartrate, speed, cadence, speed/cadence sucessfully with the ANT+ Plugin Sampler and let it run for maybe 30 minutes without any issues.

Does the original 2013 Moto G non-4G version have the same chipset/SoC as the 4G version (and the Xperia M2)? No reason to expect that it will work on the device otherwise...

According to gsmarena.com: Yes.
 

MiyagiSan

Senior Member
Sep 18, 2014
632
167
There's no 4G from 2013 as far as i know. So i'm specifically using a Moto G 4G (XT1039).
I've paired heartrate, speed, cadence, speed/cadence sucessfully with the ANT+ Plugin Sampler and let it run for maybe 30 minutes without any issues.

My bad. I should have said 1st gen Moto G 4G or xt1039.

Thanks for the clarification.

Have you tried any of the other ANT+ biking/fitness apps?
 

toot_k90

Member
Oct 19, 2010
12
5
Palermo
The phone is a xt1032. The app does the searching but sadly I've only polar devices so I can't say if the ant is working or not
 

MiyagiSan

Senior Member
Sep 18, 2014
632
167
So how would this need to be edited for a HTC One M8, they're running on the same chip right?

HTC One M8 and a Moto G (any variant)? Running the same chipset or Soc?

NO.

Someone else can answer the underlying question: "Does the HTC One M8's SoC support ANT+?"

My guess, YES.

I too, would also like to know how this process might be applied to another device btw. Seems like a useful hack to learn...
 
Last edited:

andy905

Senior Member
Mar 26, 2010
198
28
Hanoi
WCN3680
BRAND, PRODUCT NAME: ROMS
Amazon, Fire Phone
HTC, One (M8)
Motorola, Moto G 4G (http://xdaforums.com/moto...maybe-t2875420)
Motorola, Moto X
OnePlus, One
Samsung, Galaxy Mega 6.3
Sony, Xperia M2: Stock (certified)
Sony, Xperia Z Ultra: Stock (certified)
Xiaomi, Mi4

Just so you know they have the same Qualcomm WCN3680 chips so yes it does have ant+ capability
Sent from my HTC One_M8 using XDA Free mobile app
 

MiyagiSan

Senior Member
Sep 18, 2014
632
167
WCN3680
BRAND, PRODUCT NAME: ROMS

[...]

Just so you know they have the same Qualcomm WCN3680 chips so yes it does have ant+ capability

Seems I was looking at the wrong chip. This is all very interesting.

What is a WCN3680?

How and where did you get all this information from?

If I have a device, what do I do to get the info about the ANT+ support it may have? (I've just being searching for any similar device on gsmarena with the same SoC. I can see that isn't adequate now)

---------- Post added at 05:04 PM ---------- Previous post was at 04:29 PM ----------

Seems I was looking at the wrong chip. This is all very interesting.

What is a WCN3680?

How and where did you get all this information from?
[...]

Ok, found something information in this thread. Replying to myself as the info could be useful for others reading this thread.
 
Last edited:
  • Like
Reactions: lfueh

iRant

Member
Dec 11, 2012
43
21
Perth
I've noticed that the Moto G 4G had the same chipset as the Xperia M2.
The Xperia M2 supports ANT+, so the 4G should too...

The chipset info from GSM Arena is NOT the wireless chipset. Which wireless chipset a phone has is not generally published (it should be!).

I've managed to build Cyanogenmod with support for ANT+ by following the information at
https://github.com/ant-wireless/ANT_in_Android.

If you look at the patch, then you'll see that the driver for ANT+ is called "qualcomm-smd", so it's not specific to the chipset of the 4G but to a group of Qualcomm chips.

Let's find out to which ones exactly!

My attempt at a list of devices with ANT+ capable wireless chipsets is here: http://xdaforums.com/hardware-hacking/hardware/ref-devices-ant-hardware-t2879990

The service needs system permissions to access the drivers, which means it needs to be signed with the same signature as used in the platform build. Your files will only work on other Cyanogenmod builds, but not stock CyanogenMod like 11S on the OnePlus One.

However, as CyanogenMod have added the ANT repositories, your patch will work when building a ROM for phone with a WCN3680.
 

cJoey

Member
Sep 21, 2011
12
1
Århus
This is awesome and I have tried it a couple of times on my Moto G (4G) while running. However it seems that the GPS is being disabled while the ANT+ sensor is connected.

I'm using Cyanogemod (Nightly)

Anyone else having this issue?
 

rubensa

Member
Feb 3, 2011
30
5
Espiniella
Xiaomi Redmi 1S

I have tried an works on Xiaomi Redmi 1S with CM11 (11-20141201-UNOFFICIAL-armani).

Thank you for building and sharing!!

Code:
#include <std_disclaimer.h>
/*
 * Your warranty is now void.
 *
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns before flashing this modification!
 * YOU are choosing to make these modification, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */

I've noticed that the Moto G 4G had the same chipset as the Xperia M2.
The Xperia M2 supports ANT+, so the 4G should too...

I've managed to build Cyanogenmod with support for ANT+ by following the information at
https://github.com/ant-wireless/ANT_in_Android.

Here's the patch for https://github.com/CyanogenMod/android_device_motorola_msm8226-common:
Code:
diff --git a/msm8226.mk b/msm8226.mk
index 5a27cf5..826f371 100644
--- a/msm8226.mk
+++ b/msm8226.mk
@@ -251,3 +251,7 @@ PRODUCT_PACKAGES += \
 PRODUCT_COPY_FILES += \
     kernel/motorola/msm8226/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \
     kernel/motorola/msm8226/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
+
+#ANT
+BOARD_ANT_WIRELESS_DEVICE := "qualcomm-smd"
+$(call inherit-product, external/ant-wireless/build/ant-wireless.mk)

Attached to this post is a flashable zip which includes all binaries which were added by my own build in comparison to a normal CM build.
So you could add ANT+ support just by flashing it over CM(or probably every other rom).
sha256sum: 42bb6f552b5150e1baab6f9b8f28cec8c7c2ab408b3fbca418490d71159c2cf4
md5sum: c1c765acb10d0420a643bd4f84f714d5

After you've flashed it, get the "ANT+ Plugin Sampler" from the Play Store and try to connect to any sensor.
If a black window appears with the waiting circle on the upper left screen, then everything is working properly.
I only have a 4G to test, but i'd be very interested whether it works on a Moto G or a Moto E.

If you look at the patch, then you'll see that the driver for ANT+ is called "qualcomm-smd", so it's not specific to the chipset of the 4G but to a group of Qualcomm chips.

Let's find out to which ones exactly!
 

antftw

New member
Sep 12, 2014
3
12
[...] However it seems that the GPS is being disabled while the ANT+ sensor is connected.

I'm using Cyanogemod (Nightly)

Anyone else having this issue?

This doesn't happen here. I would expect that the app you are using is at fault.
Maybe it disables GPS because you have a foot pod which it uses as a source for the distance/speed information instead of GPS?
 

mirasierra

New member
Jul 20, 2015
3
0
HAL service missing

Hi -

great work!!!
Would love to have built in ANT+ working on my peregrine w/ stock rom 5.1
Bootloader is unlocked, device is rooted, twrp installed and your .zip sucessfully flashed.
Almost.
Turns out, hardware abstraction layer is missing - see attached screenshot of ANT+ Tester.
Suppose there is nothing I can do about it but flash one of the custom ROMs known to work, right?
 

Attachments

  • ANT_Tester.png
    ANT_Tester.png
    137.7 KB · Views: 571
Last edited:

cyberkid2002

Senior Member
Mar 15, 2008
253
19
Does the Moto G XT1072 have the necessary hardware for ant+ (msm8926 chipset)?

Have tried this patch but it unsurprisingly didn't work.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Code:
    #include <std_disclaimer.h>
    /*
     * Your warranty is now void.
     *
     * I am not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns before flashing this modification!
     * YOU are choosing to make these modification, and if
     * you point the finger at me for messing up your device, I will laugh at you.
     */

    I've noticed that the Moto G 4G had the same chipset as the Xperia M2.
    The Xperia M2 supports ANT+, so the 4G should too...

    I've managed to build Cyanogenmod with support for ANT+ by following the information at
    https://github.com/ant-wireless/ANT_in_Android.

    Here's the patch for https://github.com/CyanogenMod/android_device_motorola_msm8226-common:
    Code:
    diff --git a/msm8226.mk b/msm8226.mk
    index 5a27cf5..826f371 100644
    --- a/msm8226.mk
    +++ b/msm8226.mk
    @@ -251,3 +251,7 @@ PRODUCT_PACKAGES += \
     PRODUCT_COPY_FILES += \
         kernel/motorola/msm8226/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \
         kernel/motorola/msm8226/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
    +
    +#ANT
    +BOARD_ANT_WIRELESS_DEVICE := "qualcomm-smd"
    +$(call inherit-product, external/ant-wireless/build/ant-wireless.mk)

    Attached to this post is a flashable zip which includes all binaries which were added by my own build in comparison to a normal CM build.
    So you could add ANT+ support just by flashing it over CM(or probably every other rom).
    sha256sum: 42bb6f552b5150e1baab6f9b8f28cec8c7c2ab408b3fbca418490d71159c2cf4
    md5sum: c1c765acb10d0420a643bd4f84f714d5

    After you've flashed it, get the "ANT+ Plugin Sampler" from the Play Store and try to connect to any sensor.
    If a black window appears with the waiting circle on the upper left screen, then everything is working properly.
    I only have a 4G to test, but i'd be very interested whether it works on a Moto G or a Moto E.

    If you look at the patch, then you'll see that the driver for ANT+ is called "qualcomm-smd", so it's not specific to the chipset of the 4G but to a group of Qualcomm chips.

    Let's find out to which ones exactly!
    2
    An update, a similar approach seems to have worked on the Moto G 2015 Osprey on LineageOS 14.1. The zip from the original post here didn't work, but following the same template replacing each file with the identical version from another phone build with the same MSM8916 chip running LineageOS 14.1 (BQ Aquaris E5 4G) did work! ANT HAL shows as 'Not Found' on ANT checker, but multiple ANT devices are confirmed working.

    The phone I pulled the files from also used the same "qualcomm-smd" driver. This *should* work on any msm8916 phone running LineageOS14.1.

    You will need to install the official ANT Radio Service and ANT+ Plugin Service from the Play store.

    Flash at your own risk, I truly have no idea what I'm doing. You may need to mount /system in TWRP for the flashable zip to stick.

    *UPDATE - rev1, removed ANTPlusPlugins.apk and ANTRadioService.apk from the /system/app directory. They were outdated apks, and should be downloaded from the Play Store instead for the most current version.

    *rev2 - removed unnecessary xbin/antradio_app, and added "LOS" to the filename to clarify this only works on LineageOS.

    source: ported files from LineageOS 14.1 12/30/17 nightly for BQ Aquaris E5 4G
    2
    SUCCESS!

    Flashing lineageos to the moto e seemed to do the trick. I guess aosp extended and resurrection remix don't quite have all the proper components to make this work. Running RR on my axon 7 which works just fine with ant+ by just installing a few playstore components. I was going to stick with the stock rom on the g4 play, but suppose it really matter.

    I'll unlock and flash los to the g4 play later today or this weekend. I expect successful results since both of these are based on the snapdragon 410 soc. Thanks again!
    1
    [...]

    I've noticed that the Moto G 4G had the same chipset as the Xperia M2.
    The Xperia M2 supports ANT+, so the 4G should too...

    I've managed to build Cyanogenmod with support for ANT+ by following the information at
    https://github.com/ant-wireless/ANT_in_Android.

    [...]

    Attached to this post is a flashable zip which includes all binaries which were added by my own build in comparison to a normal CM build.
    So you could add ANT+ support just by flashing it over CM(or probably every other rom).
    sha256sum: 42bb6f552b5150e1baab6f9b8f28cec8c7c2ab408b3fbca418490d71159c2cf4
    md5sum: c1c765acb10d0420a643bd4f84f714d5

    After you've flashed it, get the "ANT+ Plugin Sampler" from the Play Store and try to connect to any sensor.
    If a black window appears with the waiting circle on the upper left screen, then everything is working properly.
    I only have a 4G to test, but i'd be very interested whether it works on a Moto G or a Moto E.

    If you look at the patch, then you'll see that the driver for ANT+ is called "qualcomm-smd", so it's not specific to the chipset of the 4G but to a group of Qualcomm chips.

    Let's find out to which ones exactly!

    Hi,

    Have you successfully tested it with a 2013 Moto G 4G? (It isn't clear from your posting above)

    Were you able to pair up actual ANT+ sensors (HRM, speed, cadence, power etc) to your 2013 Moto G 4G?

    Do apps like Tracks, Runtastic, IpBike etc work with these ANT+ sensors on the 2013 Moto G 4G, properly?

    Any issues?

    Does the original 2013 Moto G non-4G version have the same chipset/SoC as the 4G version (and the Xperia M2)? No reason to expect that it will work on the device otherwise...

    ---------- Post added at 05:10 PM ---------- Previous post was at 05:05 PM ----------

    I've flashed the zip on my moto g. The app seems to work. But i need to fin and ant+ device to know if it really work

    Is this a 2013 Moto G 4G or the original 3G-only 2013 model?

    Would be great to find out if pairing with an actual ANT+ device works.
    1
    WCN3680
    BRAND, PRODUCT NAME: ROMS

    [...]

    Just so you know they have the same Qualcomm WCN3680 chips so yes it does have ant+ capability

    Seems I was looking at the wrong chip. This is all very interesting.

    What is a WCN3680?

    How and where did you get all this information from?

    If I have a device, what do I do to get the info about the ANT+ support it may have? (I've just being searching for any similar device on gsmarena with the same SoC. I can see that isn't adequate now)

    ---------- Post added at 05:04 PM ---------- Previous post was at 04:29 PM ----------

    Seems I was looking at the wrong chip. This is all very interesting.

    What is a WCN3680?

    How and where did you get all this information from?
    [...]

    Ok, found something information in this thread. Replying to myself as the info could be useful for others reading this thread.