muzzley / muzzley-alljoyn-integration-demo

A demo project showing how Muzzley can be used to transport AllJoyn Notifications through the Internet.
9 stars 3 forks source link

not able to communicate between two android devices using this app over internet #1

Closed vineetpant closed 9 years ago

vineetpant commented 9 years ago

Hi, First of all i would like to thank you for this great job.

I am going through the sample code of "https:// github.com/muzzley/muzzley-alljoyn-integration-demo" i am able to communicate between two devices when they are connected to same wifi hotspot but i couldn't commnunicate when the devices were connected to different networks . Is it supposed to work like this in case of this demo?

Please find the adb logs @http://paste.ubuntu.com/11783068/

Thanks & Regards

tiagoalves commented 9 years ago

Hi,

I can see in our log files that you ran the Muzzley / AllJoyn activity but I can't see any connection from another smartphone using Muzzley to it.

Did you run this project on an Android device (A) and the Muzzley application (for iOS, Android or WP8) on another device (B)? In the Muzzley application on device (B) you should be able to scan the QR Code this project generated on device (A).

Please tell me more details of your setup and the steps you took so I can get a better idea.

Thank you.

vineetpant commented 9 years ago

Hi , Actually when i am starting the app bar code and activity id is not showing on the screen, I went through the code and following piece of code i think is supposed to get dynamic activity id which is not coming in callback .

Muzzley.connectApp( APP_TOKEN, new Action() { @Override public void invoke(Activity activity) { // Muzzley App Connected participants.clear();

                activity.onQuit.add(new Action<Void>() {
                    @Override
                    public void invoke(Void arg0) {
                        muzActivity = null;
                    }
                });

                Log.i(TAG, "Initializing Muzzley3a");
                if (listener != null) {
                    listener.onActivityCreated(activity);                       
                }

                Log.i(TAG, "Initializing Muzzley4a");
                activity.onParticipant.add(participantHandler);

// activity.on muzActivity = activity;

            }
        },
        new Action<Exception>() {
            @Override
            public void invoke(Exception ex) {
                Log.i(TAG, "Initializing Muzzley Exception: " + ex.getMessage());                   
            }
        }
    );

I am running the app on android tablet , and i am building the project using eclipse ide . It is building fine and working when i run the application on two devices connected to same wifi , and notifications are visible on both devices but I am not able to figure out how to communicate over internet.

Regards, Vineet Pant

tiagoalves commented 9 years ago

Hi Vineet,

It should be possible to use WiFi and 3G/LTE to connect to Muzzley without any difference (other than latency). We have a 10 or 15s connection timeout which you might be hitting if your 3G/LTE connection is slow.

Which apps described in the demo are you running on your devices? The "AllJoyn Notification Demo" application (which is shown in the first image of our README documentation) is running on one device? And then you have the "Home Notification Gateway" on another device?

Both these applications must be run on the same network so that the second application can see the AllJoyn notifications emitted by the first application.

You can then run Muzzley on a third device, connected to 3G/LTE and pair it with the second application (read its QR code). The notifications emitted by the first device (that simulates an AllJoyn device) should appear on the second device and should then be transported through Muzzley to the internet and appear on the third device.

vineetpant commented 9 years ago

Hi , I am using "muzzley-alljoyn-integration-demo" and "Muzzley's Home Notification Gateway" is not showing any barcode image and activity id, callback is not coming inside the Action parameter and it is not throwing any exception as mentioned in the documentation .

My internet speed is good and i don't think it is happening because of Internet connection. I have uploaded the code which i am running on the android tablet , please have a look if it is possible for you:-

https://www.dropbox.com/s/7gr4pm22yxkogjs/MuzzleyNotifier.zip?dl=0

Regards, Vineet Pant

tiagoalves commented 9 years ago

From your description, you should be able to connect to Muzzley and see a QR Code on the Android screen. However, the Muzzley application performs a WebSocket connection and we had some issues with some mobile phone carriers in the past.

Can you tell me which mobile phone carrier you're using?

I've also rebuilt the application and just tested it with a 3G connection and I was able to connect. Can you download and install the APK from the following page https://github.com/muzzley/muzzley-alljoyn-integration-demo/releases/tag/v1.0.0 and try again?

vineetpant commented 9 years ago

Hi , I downloaded and installed the apk on my phone, It is still not showing. I tried using 3G and Wifi , none of them is working . I am using Airtel and Vodafone mobile carriers. Can there be some work around .

I have copied some error logs from logcat below , I think these might help you as they seem to be related to connection failure..

07-01 05:35:47.020: E/UTIL(17333): 0.267 ** ERROR UTIL common/os/posix/osUtil.cc:307 | 0x1010 07-01 05:35:47.021: E/HTTP(17333): 0.267 ** ERROR HTTP DiscoveryManager .../ice/HttpConnection.cc:296 | 0x1010 07-01 05:35:47.021: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.267 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:390 | 0x1010 07-01 05:35:47.021: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.267 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:315 | 0x1010 07-01 05:35:47.021: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.267 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:227 | 0x1010 07-01 05:35:47.021: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.267 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:130 | 0x1010 07-01 05:35:47.021: E/ICE_DISCOVERY_MANAGER(17333): 0.267 ** ERROR ICE_DISCOVERY_MANAGER DiscoveryManager ...nager.cc:1067 | 0x90cd 07-01 05:35:47.022: I/System.out(17333): ioeAboutServiceImplInfo: BusAttachment.registerSignalHandlers(AnnouncmentReceiver) status = 'OK' 07-01 05:35:47.025: I/System.out(17333): ioeAboutServiceImplInfo: BusAttachment.addMatch() status = OK 07-01 05:35:47.026: I/ioeNotificationService(17333): Notification Service created 07-01 05:35:47.027: I/ioeTransport(17333): BusAttachment is stored successfully 07-01 05:35:47.037: E/UTIL(17333): 0.283 ** ERROR UTIL common/os/posix/osUtil.cc:307 | 0x1010 07-01 05:35:47.038: E/HTTP(17333): 0.284 ** ERROR HTTP DiscoveryManager .../ice/HttpConnection.cc:296 | 0x1010 07-01 05:35:47.038: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.284 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:390 | 0x1010 07-01 05:35:47.038: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.284 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:315 | 0x1010 07-01 05:35:47.038: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.284 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:227 | 0x1010 07-01 05:35:47.038: E/RENDEZVOUS_SERVER_CONNECTION(17333): 0.284 ** ERROR RENDEZVOUS_SERVER_CONNECTION DiscoveryManager ...cc:130 | 0x1010 07-01 05:35:47.038: E/ICE_DISCOVERY_MANAGER(17333): 0.284 ** ERROR ICE_DISCOVERY_MANAGER DiscoveryManager ...nager.cc:1067 | 0x90cd

Regards, Vineet Pant

vineetpant commented 9 years ago

Hi , Now i am able to get qrcode and activity id with the apk you shared, i will check the code .

Thanks & Regards, Vineet Pant

tiagoalves commented 9 years ago

Great. I'm glad it worked out.

We use Android Studio for our development and that APK you tested was also compiled with Android Studio. Maybe it could help you to use that instead of Eclipse when working with Muzzley-related projects.

vineetpant commented 9 years ago

Thanks, It sometimes fetches qrcode and activity id but sometimes it doesn't work, Please let me know if there is some cloud server downtime .

tiagoalves commented 9 years ago

We had no downtime in the last few days and when we do it's usually just for a few brief instances. But I will let you know if we have some downtime in the near future.