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

antftw

New member
Sep 12, 2014
3
12
0
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

MiyagiSan

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

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
0
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
0
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?
 

MiyagiSan

Senior Member
Sep 18, 2014
632
167
0
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
0
Hanoi
WCN3680
BRAND, PRODUCT NAME: ROMS
Amazon, Fire Phone
HTC, One (M8)
Motorola, Moto G 4G (http://forum.xda-developers.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
0
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
0
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://forum.xda-developers.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
0
Å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
28
5
0
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
0
[...] 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
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

Last edited: