Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT Radio Service keeps stopping (running antPlusPluginSampler ANT+ SDK sample code)

Rank

Total Posts: 2

Joined 2017-10-09

PM

Hi,
I'm new to ANT+ development and I'm having trouble getting the demo code "ANT+ Plugin Sampler" in the ANT+ Android SDK running.
I followed the steps from this thread

I have an ANT USB stick and followed the github Android_ANTEmulatorPackage steps to get the Emulator running
I run the Emulator and connect to the USB fine, my tray icon is white which according to the USERGUIDE.txt means everything is connected fine.

* White icon:
Both ANT and the emulator are connected, the program is
bridging ANT traffic.
And the Status says :
Connected to ANT device USB 0
Listening for emulator on port 9050
Found emulator


My AVD is a galaxy nexus API 25 (running Android 7.1.1), all the required radio services are installed.
When I run the ANT+ Plugin Sampler code on the AVD I get the error message: "ANT Radio Service keeps stopping"
And on the ANT emulator bridge it keeps saying:
New client is attempting to connect. Checking if it is the emulator reconnecting
Emulator found reconnecting, disposing of previous connection
Reconnected to emulator


I have run the Ant Emulator Configuration on the AVD before running the sample code. I've tried my IP address, localhost and also 127.0.0.1 but nothing seems to work
I've looked at the debug logs in Android studio for the Application and I can see this stack trace
11-12 22:31:04.851 1679-1690/system_process I/ActivityManagerSTART u0 {cmp=com.dsi.ant.antplus.pluginsampler/.Activity_BikePowerSampler} from uid 10085 on display 0
11
-12 22:31:04.858 1361-1389/? W/audio_hw_genericNot supplying enough data to HALexpected position 1225710 only wrote 1225440
11
-12 22:31:04.888 1679-1722/system_process I/InputDispatcherDropping event because there is no touchable window at (391355).
11-12 22:31:05.036 6384-6384/? W/artUnexpected CPU variant for X86 using defaultsx86
11
-12 22:31:05.038 1679-2288/system_process I/ActivityManagerStart proc 6384:com.dsi.ant.service.socket/u0a86 for service com.dsi.ant.service.socket/com.dsi.ant.service.AntRadioService
11
-12 22:31:05.060 6384-6384/? W/SystemClassLoader referenced unknown path: /data/app/com.dsi.ant.service.socket-1/lib/x86
11
-12 22:31:05.122 6384-6384/com.dsi.ant.service.socket D/AndroidRuntimeShutting down VM
11
-12 22:31:05.122 6384-6384/com.dsi.ant.service.socket E/AndroidRuntimeFATAL EXCEPTIONmain
                                                                          Process
com.dsi.ant.service.socketPID6384
                                                                          android
.os.NetworkOnMainThreadException
                                                                              at android
.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
                                                                              
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
                                                                              
at java.net.SocketOutputStream.write(SocketOutputStream.java:145)
                                                                              
at com.dsi.ant.chip.socket.AntSocketManagerThread.ANTTxMessage(AntSocketManagerThread.java:396)
                                                                              
at com.dsi.ant.chip.socket.AntSocketManagerThread$1.run(AntSocketManagerThread.java:508)
                                                                              
at android.os.Handler.handleCallback(Handler.java:751)
                                                                              
at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                              
at android.os.Looper.loop(Looper.java:154)
                                                                              
at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                              
at java.lang.reflect.Method.invoke(Native Method)
                                                                              
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                              
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
11-12 22:31:05.173 2823-2847/com.dsi.ant.antplus.pluginsampler D/EGL_emulationeglMakeCurrent0x9e7cda60ver 2 0 (tinfo 0x9e7c2de0)
11-12 22:31:05.312 1679-1700/system_process I/ActivityManagerDisplayed com.dsi.ant.antplus.pluginsampler/.Activity_BikePowerSampler: +446ms
11
-12 22:31:05.312 1679-4213/system_process I/OpenGLRendererInitialized EGLversion 1.4
11
-12 22:31:05.312 1679-4213/system_process D/OpenGLRendererSwap behavior 1
11
-12 22:31:05.314 1679-4213/system_process D/EGL_emulationeglCreateContext0xa2f87d00maj 2 min 0 rcv 2
11
-12 22:31:05.340 1679-4213/system_process D/EGL_emulationeglMakeCurrent0xa2f87d00ver 2 0 (tinfo 0x8a8172c0)
11-12 22:31:05.366 2823-2823/com.dsi.ant.antplus.pluginsampler W/AntPluginPccBBD30500RequestAccess failedADAPTER_NOT_DETECTED 


Has anybody run into similar problems to this before with getting the Emulator bridge working?
Have I missed some steps?
I've followed what documents I can find and I assume that the example code does run so I must have mis-configured something or missed a step somewhere along the line.

Any help appreciated. My end game is to be able pair with and read the Garmin Speed/Cadence sensor but I was starting easy and just trying to get the sample code running.
     
Rank

Total Posts: 2

Joined 2017-10-09

PM

Small update on my progress.
If I generate the antPlusPluginSampler-debug.apk in Android studio and install it on my personal phone it works fine and picks up a test broadcast I run with SimulANT.
This means there must be an issue with the Emulator bridge configuration.

When I run the ANT Emulator Configuration on the AVD I now see the following in
11-15 16:13:42.470 4172-4172/com.dsi.ant.service.socket.tcp.config W/ANTRadioEmulator_Configlog onClickANT service not connected
11
-15 16:13:42.473 1358-1376/? W/audio_hw_genericNot supplying enough data to HALexpected position 3832621 only wrote 3832560
11
-15 16:13:43.330 1692-2479/system_process D/SntpClientrequest time failedjava.net.SocketTimeoutExceptionReceive timed out
11
-15 16:13:43.330 1692-2479/system_process E/GnssLocationProviderrequestTime failed
11
-15 16:13:43.330 1692-2479/system_process I/GnssLocationProviderWakeLock acquired by sendMessage(100null)
11-15 16:13:43.331 1692-2479/system_process I/GnssLocationProviderWakeLock released by handleInjectNtpTime()
11-15 16:13:43.332 1692-1705/system_process I/GnssLocationProviderWakeLock released by handleMessage(100null)
11-15 16:13:45.699 1358-1377/? W/audio_hw_genericNot supplying enough data to HALexpected position 4140141 only wrote 3987360 

I have tried reinstall the Android_ANTRadioService_4-12-0.apk on the AVD but it makes no difference.
Now when I run the ANT Emulator Configuration it comes up straight away "ANT Radio Service has stopped"

When I try reconnect to ANT Radio Service I get this exception:
11-15 16:40:51.870 26406-26406/? W/SystemClassLoader referenced unknown path: /data/app/com.dsi.ant.service.socket-2/lib/x86
11
-15 16:40:51.928 26406-26406/? D/AndroidRuntimeShutting down VM
11
-15 16:40:51.929 26406-26406/? E/AndroidRuntimeFATAL EXCEPTIONmain
                                                   Process
com.dsi.ant.service.socketPID26406
                                                   android
.os.NetworkOnMainThreadException
                                                       at android
.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
                                                       
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
                                                       
at java.net.SocketOutputStream.write(SocketOutputStream.java:145)
                                                       
at com.dsi.ant.chip.socket.AntSocketManagerThread.ANTTxMessage(AntSocketManagerThread.java:396)
                                                       
at com.dsi.ant.chip.socket.AntSocketManagerThread$1.run(AntSocketManagerThread.java:508)
                                                       
at android.os.Handler.handleCallback(Handler.java:751)
                                                       
at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       
at android.os.Looper.loop(Looper.java:154)
                                                       
at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                       
at java.lang.reflect.Method.invoke(Native Method)
                                                       
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                       
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
11-15 16:40:52.007 1692-5305/system_process I/OpenGLRendererInitialized EGLversion 1.4
11
-15 16:40:52.007 1692-5305/system_process D/OpenGLRendererSwap behavior 1
11
-15 16:40:52.010 1692-5305/system_process D/EGL_emulationeglCreateContext0x98ea1d80maj 2 min 0 rcv 2
11
-15 16:40:52.030 1692-5305/system_process D/EGL_emulationeglMakeCurrent0x98ea1d80ver 2 0 (tinfo 0x88e6cbb0)
11-15 16:40:52.052 1692-5305/system_process D/EGL_emulationeglMakeCurrent0x98ea1d80ver 2 0 (tinfo 0x88e6cbb0)
11-15 16:40:55.026 1358-1377/? W/audio_hw_genericNot supplying enough data to HALexpected position 10420721 only wrote 10268640 
     
Rank

Total Posts: 1

Joined 2017-02-13

PM

I have the exact same issue (also using the nexus API 25 (running Android 7.1.1). Any help to solve this would be appreciated