Google Play services ButtonClicker app issue with multiplayer mode - google-play-services

I test ButtonClicker app, so I publish it on Google Play under my dev account https://play.google.com/store/apps/details?id=com.dimakoles.clickbutton
Now I try to play in multiplayer mode ("Quick game" button) and get the problem. In screenshot below you can see waiting room screen where "Start Playing" menu option is inactive on both devices while two players already meet one another
I also provide logs with principle method invocations on both devices
First device:
1) getGamesClient().createRoom(config);
2) onRoomCreated
3) startActivityForResult(getGamesClient().getRealTimeWaitingRoomIntent(room, 2), RC_WAITING_ROOM);
Second device:
1) getGamesClient().createRoom(config);
First device:
4) onPeerJoined
5) onRoomConnecting
Second device:
2) onRoomCreated
3) startActivityForResult(getGamesClient().getRealTimeWaitingRoomIntent(room, 2), RC_WAITING_ROOM);
4) onPeerJoined
5) onRoomConnecting
Thanks for your time!

Looks like a network issue. The callback that signals that the room is ready for playing is onRoomConnected(). It looks like your connection is going all the way up to onRoomConnecting() but doesn't proceed any further. The connectivity is a P2P network so there must be something preventing the two devices from communicating properly. I'd check network settings (NAT, etc) to make sure that you're in an environment where one device can actually open a socket to the other device directly.
It looks like you're running one of the apps in an emulated environment... maybe the networking emulation isn't properly configured?

Related

BLE Mesh: Multi Device connect to mesh network

I'm working with ESP32 (ESP-IDF) BLE Mesh and now I can work with it really well but there are some problems with it.
I have 5 nodes that All nodes are config in Proxy/relay mode. with one phone I can scan All of them and provision, and make a mesh network everything is ok, But if I provision nodes with device e.g."Phone-A" I cant see other nodes with any other device e.g."Phone-B". even I disconnect from mesh network.
1 - I cant connect Multi device phone to mesh Network and I dont know how can Handle it
2 - I dont know which mesh parameter should I Save in NVS flash that after reset esp32 the node can join network again automatically.
3 - and when a device "phone-A" is disconnected from network it's true that device "phone-B" join network and/or two device join mesh network simultaneously? if yes how? should I change nodes mode?
my code is exactly like this : esp32 ble mesh Fast prov server Example and I change it for my project and add some more code for pwm & led & ...
I asked this question in ESP32.com forums but theres no one that answer me.
Open "menuconfig" in your IDE or terminal, then follow this: Bluetooth Mesh support --> Store Bluetooth Mesh key and configuration persistently
Just enable it and your code should work just fine

Issues communicating with devices over usb hub

I'm facing issues when communicating with devices over USB hub. When enumerating devices directly to host port, it does work, some devices over usb hub have issues.
Setup: STM32F103C8 - MAX3421E - LUFA (usb stack) (ported to MAX3421E (host) and STM32F103C8T6 (device)) - USB Full-Speed setup
Scenario:
When I attach device directly to host, I don't experience any issues enumerating almost all (some devices seems to be faulty and have weird/nonstandard behavior) devices. But when I try to enumerate over usb hub, devices starts to behave very strangely. I'm receiving much more NAK's from devices than when connected directly to host. Some devices are able to return Device Descriptor, but retrieving Configuration Descriptor fail. Some devices return Toggle Error after several NAK's, this could be remedied so far by delaying retry IN token. Also there is different behavior of devices when connected over different hubs. I.e. one device has no problems when connected to HUB1, but have issues when connected to HUB2. Then I have HUB3 (7 port) which internally acts as HUB in HUB. On this HUB3 device working fine on port behind secondary internal hub, but not on primary ports exposed over "root" hub.
I'm in suspicion that hub's TT could be somehow interfering with usb communication, but according to information I have found, TT should not be enabled under Full-Speed setup.
I have checked (many times) that I'm setting correct device address assigned during SetAddress phase (which is proved by returning Device Descriptor). When I step debug it seems that I can get Configuration Descriptor also, but while in normal system run, it isn't retrieved, but only over hub.
Does anyone has any ideas, what to look after? I've run out of ideas here after week of trying to find a root cause.
Thanks
so...
- as usual after searching for root cause, solution after days of trying comes naturally after asking on somewhere (this is hapenning to me always, but I do try prior asking always)
- when using hubs, make sure you don't suspend SOF generation during control transfers. LUFA just resume bus inside control transfer routines, so make sure you don"t stops and reenable SOF within (my fault as I'm using ported version to MAX)
- if you have tight main loop make sure you don"t reinitialize usb transfer without completion of previous try, but if you do so, check you don't owerwrite data which haven"t been processed yet fully (especially when using interrupt-driven transfer complete processing) [things seems to work when you have quite some debug output, as it delay that time critical transfers]
Enumeration over hub isuues are now second to none. Small glitches are subject for tweaking.
Unfortunately as I was in question for electrical issues, I had to unsolder usb host shield and soldered another one, which in light of new information seems unneeded. Nevermind, I have trained my soldering skills.

Communication is lost on wifi toggle and onDisconnect and onPeersDisconnected not being fired

I'm using code from Google's sample game "ButtonClicker2000" found here: https://github.com/playgameservices/android-basic-samples
I have 3 androids running this game in genymotion plus one on my own phone, debugging them all from android studio. I've gotten to a point where I'm trying to gracefully handle disconnect in the event of network issues. The way I'm simulating network issues is toggling the wifi on my phone. (on or off, same behavior) After that, real time messages from my phone are no longer being received by the virtual devices, and my phone is no longer receiving real time messages from the other devices. However, my phone never enters onDisconnect() and the other devices never enter onPeersDisconnected. If I exit the app on my phone after communication ceases, onPeerLeft fires on the other devices.
How can I either ensure communication between devices in a game isn't lost in the likely event that a user at some point comes in or out of range of their wifi? If that's not possible, how can I at least ensure the onDisconnect event is firing from the offending device and onPeersDisconnected event is firing on the others?
If we're going with what the documentation states, onDisconnect usually happens when there's a problem with the remote services (crash or resource problem). having the WiFi turned off doesn't look like it fits with those criteria. [onPeersDisconnected](https://developers.google.com/android/reference/com/google/android/gms/games/multiplayer/realtime/RoomStatusUpdateListener#onPeersDisconnected(com.google.android.gms.games.multiplayer.realtime.Room, java.util.List)) is called when the participants are disconnected from the room.
Determine if the onP2PConnected is called when its connected and onP2PDisconnected when disconnected (hopefully this can catch WiFi toggling cases) since I think its more appropriate when you're using real-time multiplayer.
You can also read more about it in the Real-time Multiplayer section of the documentaiton.
Hope this helps!

iOS CoreBluetooth operating as a peripheral and central simultaneously in the background

I'm writing an app using CoreBluetooth in iOS8 that detects and connects to other phones using the app. I'm trying to figure out the best way to be able to create a connection while both apps are backgrounded, but have been having difficulty in the scenario where both phones are backgrounded + locked. I've followed the suggestions of this post:
How to detect nearby devices with Bluetooth LE in iOS 7.1 both in background and foreground?
I haven't been able to establish a connection when both phones are backgrounded + locked, but I've been able to get a connection where the peripheral and central are backgrounded + locked and I then unlock the central (central still in the background). When I unlock the peripheral though nothing happens. It also works when they are backgrounded but not locked.
So in order to allow a connection to be established when I unlock the "peripheral", I decided to create a central and peripheral on both phones to simultaneously scan and advertise. Whichever discovers the other first will then stop scanning/advertising and connect. I've run into problems with this method that are detailed in the following two questions:
Peripheral and central at the same time on iOS
iOS CoreBluetooth Simultaneous Peripheral and Central Managers
Basically, I think that when both of my devices try to connect to each other simultaneously, they get hung up on attempting to connect and didConnectPeripheral is never called on either of them (the last thing both of them displays is a message saying that they are attempting to connect). It has worked occasionally though so I'm also a little confused as to why there is a probabilistic nature to the connection. Does anyone have any suggestions on how to approach the problem? If there's a better way to establish a connection when both apps are backgrounded + locked, please let me know because that was my original problem.
Thanks!
Declare bluetooth-central and bluetooth-peripheral background modes in your Info.plist to act in both Central and Peripheral roles in background.

Manual testing for GPS on ios

I'm a newbie in testing area. I have an application which has the facility to use gps and I don't have garmin tracker. I have done few tests on gps but i don't feel it's sufficient.
How to test gps manually?
What are the ways and methods to test it? please, suggest some testcases for it.
1.Need to test while traveling how the application is working with Gps connection.
2.How the Application is behaving while we got a call/Message.
3.How the Application is behaving while battery low /Automatic turn off u r phone,the current data is saved in data base properly or not
4.Need to check Battery life while using GPS
I am sure your done with smoke testing!, In that case start with Interruption testing.
Keep moving in a place, check the your GPS connectivity.
Travel to remote places where you feel the GPS can't be tracked. Check how your application responds.
Try receiving call while using the Application.
Place an alarm, check how your application responds during alarm work.
Check when your device is about to die, how the application responds. Since you'l be using GPS, chances of u'r battery drain is too high.
Check with Notification. how your application behaves.
Switch off your GPS, see if an appropriate alert is provided.