HelloIOIOService based robot not listening for connections.

59 views
Skip to first unread message

Andrew Robinson

unread,
Mar 15, 2015, 3:55:04 PM3/15/15
to ioio-...@googlegroups.com
Im building a small remote control tank using an android and IOIO OTG. 

I found a similar robot build on the web, and decided to use code he posted on a blog. 

The author based the server end code on the HelloIOIOService, but they expanded it somewhat. You connect to the server/android/ioio combo with another android device running a client to turn the motors on off etc..effectively to allow internet or wifi remote control.

Im not a programmer, just an enthusiastic techie, and Im struggling to get the robot to respond. 

I think the IOIOservice is not running correctly on my android device. I started inserting logging messages in most of the code so I could see how its processed. 
I also put code in to blink the onboard led on and off, which seems to be happening in one loop of code. 
The code does not seem to drop into any loops where a network connection is established, nor can I telnet or connect to the android device running the ioio service. 

Can anyone give me a hand troubleshooting why the service does not listen on a tcp port, and should it? 

My github repository is here.



Thanks for any help, and remember Im a novice programmer, so go easy on me :-)

Ytai Ben-Tsvi

unread,
Mar 15, 2015, 11:09:29 PM3/15/15
to ioio-...@googlegroups.com

Does the stock HelloIOIOService work for you? I've recently made some changes to make things more reliable, which have not yet made it to a release. You can get the latest code from the master branch on the ioio GitHub repo.

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Andrew Robinson

unread,
Mar 16, 2015, 8:14:05 AM3/16/15
to ioio-...@googlegroups.com
Thanks Ytai, 

I will take a look at the new releases and see if those help. 

I think my problem is the version of the service Im running is not opening a tcp socket up to listen for incoming requests, this code to do this does not exist in the stock ioioService example, so it is a little different, and I dont have the brains to work it out!

BTW - thanks for creating all the docs/wiki/and ioio device, its great, keep it up!

Andy

Andrew Robinson

unread,
Mar 21, 2015, 8:33:06 PM3/21/15
to ioio-...@googlegroups.com
Hey...me and a friend are going through the code on the ioioService example and our onStart is not invoked...The same as our custom app which it's based on. Any ideas why our main loop is running but the onstart code does not run?

Ytai Ben-Tsvi

unread,
Mar 23, 2015, 1:03:43 AM3/23/15
to ioio-...@googlegroups.com
onStart is deprecated on API >= 5. Override onStartCommand() instead.

On Sat, Mar 21, 2015 at 5:33 PM, Andrew Robinson <mi16...@gmail.com> wrote:
Hey...me and a friend are going through the code on the ioioService example and our onStart is not invoked...The same as our custom app which it's based on. Any ideas why our main loop is running but the onstart code does not run?

Andrew Robinson

unread,
Mar 29, 2015, 9:38:05 AM3/29/15
to ioio-...@googlegroups.com
Thanks Ytai - that was my problem, this is what I did to fix....

    public int onStartCommand(Intent intent, int flags, int startId) 
    {
        super.onStartCommand(intent, flags, startId);
        Log.d(DEBUG_TAG, "onStart invoked"); 
        NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

        }
        return START_STICKY;
    }   //end onStart()
 

         
Reply all
Reply to author
Forward
0 new messages