2014년 12월 11일 목요일

[App Inventor Open Source Development] Communication between AI Companion and Web Page

I am curious how the communication between the companion and the browser happens. After we generate the six digit alpha code and feed it in the companion, how does the companion connect to and communicate with the browser? Is it mediated by the server?



By monitoring traffic on port 8004.  Just lie like the NSA :-)



There are several parts to this communication, but simplifying it,
it's something like this:

The code is just a handshake for security reasons, and it's
acknowledged by the rendezvous server (a bespoke microservice that
serves only for this function).
We actually run a web server on the phone (as part of the Companion),
and the browser pulls from there. So the real communication is the
browser doing long polling to the phone.

There's a paper coming out soon with many details of this; once it's
published I can share the URL.



Thanks. Now it makes more sense. I have been using app inventor in a classroom like setting. After a few students connect to the LAN, the connectivity between the companion and the Web app becomes unreliable. Is this expected from the architecture?



It depends on your wifi, and the number of people you need connected.
If you don't have a powerful link, I'd suggest trying USB instead
(sertup tools need to be installed, and if working under windows, you
might need drivers for each device).



It's pretty common for school networks to use some sort of a NAT box that can support only a limited number of connections, say, because the NAT table overflows.   You ought to check this.  Keep in mind that you will be using two connections per student -- one for the laptop and one for the phone.   As Jos says, you can use the USB cable (which requires installing software).



Although it is a classroom setting, I am running it over my home wifi box. There are 6-7 students connecting so a total of 14 connections. The wifi box is a Cisco Linksys router. We use the same at my office to connect up to 30 laptops.


댓글 없음:

댓글 쓰기