aiStarter running but app inventor doesn't know it. . . (OS X)

1,239 views
Skip to first unread message
Assigned to j...@mit.edu by halatmi...@gmail.com

Andrew Judkis

unread,
Aug 5, 2014, 9:10:10 AM8/5/14
to mitappinv...@googlegroups.com
Hello,

I have had no problems with any of the AI2 stuff working at home on my school laptop, which I run with an admin account.  I came in to school to verify that things will work out in my lab on the student accounts (which give user-level access), and it is not looking good. These are nice year-old Macs running OSX 10.8.5.  I've been using Chrome.

Last summer I installed the programs for App Inventor Classic (with the java-based blocks editor) on these computers.  I spent many hours working through the various security issues - proxy settings, read-write permission for the platforms directory, and some other things as well.  I got it to the point where I had a trial run with students, and I had two classes successfully complete HelloPurr and PaintPot, running them on the emulator.  Again, this was with AppInventor Classic, last year.

Using these same student computers, I am now trying to get AI2 to run, as I would -really- like to use it this year.

In a nutshell, the connection test page http://appinventor.mit.edu/test/ says that AIStarter2.2 is running.  But if I click on the Create button from that same test page, go to a project, and try to connect, it fails and says that it isn't running. Here's what I've seen:

1) I log in, bring up a project, and connect to the emulator
2) it says "starting emulator" for a moment, and then "Launch the aiStarter program and then try again"
3) I go to the commands-for-Appinventor directory and run aiStarter.  I get an error saying that the address is in use.
4) running lsof -i tcp:8004 reveals that the port is opened by aiStarter -- in this case the PID happens to be 3790.  I kill 3790 and it is restarted.
5) if I do run-emulator, it does in fact seem to start up just fine, but AI2 doesn't know it's there if I try to connect.
6) I've tried various combinations of restarting adb  (is that even involved?), doing a hard reset of the emulator, and various other things, hoping to find some magic, but it doesn't seem to help.

Can anyone help me out?  Could I have somehow messed things up when I got AI classic working?  What's different between how the test page determines if aiStarter is running and how AI2 determines that?

thanks,
Andy Judkis
Academy of Allied Health and Science
Neptune, NJ

SteveJG

unread,
Aug 5, 2014, 1:27:57 PM8/5/14
to mitappinv...@googlegroups.com
This is a guess Andy.  The school network is possibly blocking AI2.  The AIStarter behavior is the clue.   It is having difficulty with a port or needs a port which is used for something else in you school network most likely.  I would ask someone in the IT department (or whoever has responsibility for the school network) to give you a hand.

Some comments about  AI Classic versus AI2:
AI Classic  can run without an Internet connection.  AI2 must have an Internet connection.
AI Classic is being sunsetted; support is planned to disappear sometime in Fall 2014.  AI2 has new tools, can do more things and is where most if all schools will be this Fall.

Here are some boiler plate solutions:  
http://appinventor.mit.edu/explore/ai2/connection-help.html    Help with aiStarter  and connecting with a Mac
https://groups.google.com/forum/#!searchin/mitappinventortest/school$20network     a link to others working with school networks and how they solved their issues...this may be useful.  Be aware, the search was on terms school network, so there is also lots of stuff irrelevant to your issue.

Possibly you have visited all or some of these.?


1) I log in, bring up a project, and connect to the emulator
2) it says "starting emulator" for a moment, and then "Launch the aiStarter program and then try again"
3) I go to the commands-for-Appinventor directory and run aiStarter.  I get an error saying that the address is in use.
4) running lsof -i tcp:8004 reveals that the port is opened by aiStarter -- in this case the PID happens to be 3790.  I kill 3790 and it is restarted.
5) if I do run-emulator, it does in fact seem to start up just fine, but AI2 doesn't know it's there if I try to connect.
6) I've tried various combinations of restarting adb  (is that even involved?), doing a hard reset of the emulator, and various other things, hoping to find some magic, but it doesn't seem to help.


" Could I have somehow messed things up when I got AI classic working?"   I do not think so, both systems can run concurrently.

  What's different between how the test page determines if aiStarter is running and how AI2 determines that?
I would expect that a port is blocked, inhibiting the connection.

I realize this is not solving your problem.   I hope it can give you some ideas.   You have done some good detective work.  Now you need some help to find out what in the school's network is blocking ... there will be some hints in the links provided.

Try some more stuff.   Pull out some hair, possibly get things working.  Tell us what happens..we are interested in getting you running.   If you can not get started, someone here will have some more ideas.  We here do not know anything about your network, we will try to help and if you are not an IT person, an IT person would be able to help you solve the connectivity issue.

You got AI2 working at home; you are going to get it working in the classroom I expect.

Regards,
Steve

Andrew Judkis

unread,
Aug 5, 2014, 3:25:35 PM8/5/14
to mitappinv...@googlegroups.com
Steve,
Thanks very much for the reply. I don't think that the problem is some different program tying up port 8004. All the evidence I have suggests that AiStarter -is- running, and occupying the port -- and that that's why I'm unable to start another instance of it. The test page URL  http://appinventor.mit.edu/test/  thinks it's running too. But AppInventor itself doesn't see it for some reason.

One thing I haven't tried yet is to see whether an admin-level account will have the same problem. I can't get into the building today but will have a look tomorrow and let you know what I find.  I have already pulled out considerable hair and am willing to pull out more, but that's a sadly limited resource (at least on -my- head!) and all help is appreciated.

thanks,
Andy


SteveJG

unread,
Aug 5, 2014, 6:15:24 PM8/5/14
to mitappinv...@googlegroups.com
Tryin an admin account is a great idea.

However, I still expect port blocking ... here is a link to all the threads on the forum related to port blocking:   https://groups.google.com/forum/#!searchin/mitappinventortest/blocking$20aistarter          I should have sent that with the rest.

A heads up ... you will also have to solve the logins for the student accounts...depending on the age group, this could be a significant issue, logging into their AI2 Projects. Probably not an issue, the link to forum discussions are here:  https://groups.google.com/forum/#!searchin/mitappinventortest/student$20log$20in     and here  https://groups.google.com/forum/#!searchin/mitappinventortest/student$20account     

Also be aware, students can not use AI Classic projects with AI2.   AI Classis source code projects are like  Classis.zip where as the equivalent in AI2 would be AIClassic.aia.   The two are totally incompatible.  

Hoping for good news,

Steve

Andrew Judkis

unread,
Aug 7, 2014, 12:19:21 PM8/7/14
to mitappinv...@googlegroups.com
Hi Steve,
Well, I'm in my computer lab at school now, trying to figure out the deal with AiStarter we were talking about earlier.  I just tried an admin account and I got the same behavior -- so I'm thinking that you're right about port blocking.

More interesting still, I found that my school laptop (which works fine with AI2 at home) also works fine at school when connected to the school's wireless network, but NOT when connected to the ethernet.  So yeah, it's a network configuration thing.  The wireless network here is very tightly controlled, for teacher computers only.  The network admin people -may- be willing to help out but I need to be able to tell them what needs to be changed.

Can you give me more info on the chain of connections that need to work, so I can tell them what to unblock?
thanks,
Andy

SteveJG

unread,
Aug 7, 2014, 12:20:52 PM8/7/14
to
Hi Andy,

Andy posted this by email:  Hi Steve,
Well, I'm in my computer lab at school now, trying to figure out the deal with AiStarter that we were talking about earlier.  I tried an admin account and I got the same behavior -- so I'm thinking that you're right about port blocking.

More interesting still, I found that my school laptop (which works fine with AI2 at home) also works fine at school when connected to the school's wireless network, but NOT when connected to the ethernet.  So yeah, it's a network configuration thing.  The wireless network here is very tightly controlled, for teacher computers only.  The network admin people -may- be willing to help out but I need to be able to tell them what needs to be changed. 

Can you give me more info on the chain of connections that need to work, so I can tell them what to unblock?

thanks a million,
Andy


Much better to post on the forum Andy.  I am not always here and the other guys and gals here can give you help too if you post here.

Great detective work.  I am fairly certain now it is a port.

The port to check?    I do not know offhand.  Possibly 80 ?   I will look at the documentation and post.

--Steve


SteveJG

unread,
Aug 7, 2014, 12:39:04 PM8/7/14
to mitappinv...@googlegroups.com
Andy,
I think this will help:

Some people have reported getting the Emulator running and even the Companion, but then their blocks do not load. Instead you continue to see the “white screen” of the Companion claiming that it is waiting to get blocks.

The Companion listens on port 8001. If something is blocking that port, then it will not be able to receive any blocks. Similarly if another program is using port 8001 the same thing can happen.

To test if this is the problem, while in this state, use your browser to go to http://127.0.0.1:8001/

If you get a directory listing (it will start with “Directory /”) then you are talking to the Companion. Note: There may only be the line “Directory /” or you may *also* see a listing of files which you should recognize as project assets (images, sounds etc.). What you see isn’t important, it is the fact that you can see it.

If you cannot connect to http://127.0.0.1:8001/ then you will have to look at what other programs on your PC may be interfering with connecting to the Companion. This can be anything from a firewall, to another program using the same port.


This should also be helpful:  

What is aiStarter starter and how do I start it?

The aiStarter program is installed on your computer when you install the App Inventor Setup software. It provides communication between App Inventor running in the browser, and other parts of App Inventor. Whenever you want to use the emulator or the USB cable, you need to make sure that aiStarter is running. If it is not running, you'll get an error message saying that aiStarter does not appear to be running. On Windows, there should be a button on your desktop that starts aiStarter. On the Mac, aiStarter should start automatically, so Mac users should not have to worry about this. In case aiStarter somehow does need to be started manually on the Mac, find it using Spotlight, use the Finder to go to /Applications/AppInventor/commands-for-App, and double click on aiStarter. On GNU/Linux, this program is in /usr/local/bin. You should be able to start it by typing aiStarter from a terminal.


Try some things, that you can use your laptop with WIFI is encouraging  and indicative that something is probably blocking port 8001 .


Regards,

Steve


Andrew Judkis

unread,
Aug 7, 2014, 2:04:19 PM8/7/14
to mitappinv...@googlegroups.com
Thanks!  I did confirm that I can connect to 127.0.0.1:8001 when using wireless, but not when plugged into ethernet.

I'm not seeing exactly the behavior that you described -- the emulator won't even start when using ethernet.  lsof shows that aiStarter is listening on 8004, but that nothing is listening on 8001, so I assume that it isn't something running and tying up the port. I guess it's something about the firewall, but I don't know what to do about it.

I have my Mac network preferences set for no proxy on 127.0.0.1, but that doesn't fix it.  I sent some email to our network admin, crossed fingers and hope for a response.  Meanwhile, if you can think of anything else to try to help narrow it down, that would be great.

thanks very much for all your help,
Andy

SteveJG

unread,
Aug 7, 2014, 4:09:14 PM8/7/14
to mitappinv...@googlegroups.com
I'm at the limit of my knowledge of networks Andy.   I asked one of the development team to provide suggestions.  His response might take a while.  With what you have so far, I expect your network guy will figure this out when he gets with you.

My fingers also crossed, however, I have faith in the MIT guys too.

Regards,
Steve

Hal Abelson

unread,
Aug 7, 2014, 5:33:23 PM8/7/14
to mitappinv...@googlegroups.com
I don't know.  Jeff might have a suggestion.

Andrew Judkis

unread,
Aug 8, 2014, 9:49:29 AM8/8/14
to mitappinv...@googlegroups.com
Hi Steve, Hal:
It occurred to me to look at the javascript tools in chrome to see if there was any more info.
Attached are the logs when the connection does not work, using the wired network.  It looks like there's some HTTP header problem, but I don't understand beyond that.

It turns out that the IT person is going to be here this afternoon.  If we can understand what's going on before then, the principal said he would back me up in trying to get him to make the necessary changes in the network config.

thanks again,
Andy
connection failed js network log.png
connection failed js console log.png

SteveJG

unread,
Aug 8, 2014, 11:57:14 AM8/8/14
to mitappinv...@googlegroups.com
Thanks for the update Andy.

I interpret the browser logs to mean that port 8004 is blocked by the school's firewall/permissions.    I think that is the 'header problem'  but perhaps one of the other guys from MIT will chime in.  The extra information is appreciated and if the guy that knows about ports might show up with additional recommendations.

Hopefully, you will get favorable advice from the IT person and the network working with AI2 this afternoon.

Regards,
Steve

Andrew Judkis

unread,
Aug 8, 2014, 2:42:38 PM8/8/14
to mitappinv...@googlegroups.com
Problem solved!  It turns out that the "exclude simple hostnames" box was checked in my wireless network preferences, but not in the wired network preferences.  Once I checked that box, it worked.

Thanks -very- much for your help.  I am looking forward to using it with my students this fall.

SteveJG

unread,
Aug 8, 2014, 3:31:56 PM8/8/14
to mitappinv...@googlegroups.com
Thanks for letting us know Andy.    Celebrate.

The guys here are glad to help you and your students.

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages