Can't fetch messages from GoTenna Mesh in Android


#1

Dear all,

I’m having troubles running a simple app I wrote for Android.

I’m sending a simple letter in broadcast with:

sendToGT = (Button) findViewById(R.id.sendToGotenna);
sendToGT.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            try {
                GTTextOnlyMessageData message = new GTTextOnlyMessageData("a");
                gtCommandCenter.sendBroadcastMessage(message.serializeToBytes(),gtCommandResponseListener,errorone);
            } catch (Exception e) {
                Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_SHORT).show();
            }
        }
    });

And my callback is simply:

@Override
public void onIncomingMessage(GTBaseMessageData gtBaseMessageData)
{
    Toast.makeText(getApplicationContext(), gtBaseMessageData.getText(), Toast.LENGTH_SHORT).show();
}

It works, when I press the button I see the message getting sent and the receiving GoTenna lightning up, but the message doesn’t get delivered from the GoTenna to the app.
This is my trace:

11-16 14:11:37.425 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.438 9668-10514/com.example.root.gotennaapp I/GTEventNotifier: COMMAND 174 STARTING: SENDING GET MESSAGE
11-16 14:11:37.496 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.556 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.617 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.619 9668-9680/com.example.root.gotennaapp I/GTEventNotifier: GET MESSAGE via KEEP ALIVE - RESPONSE POSITIVE
11-16 14:11:37.653 9668-9668/com.example.root.gotennaapp I/GTEventNotifier: COMMAND 175 STARTING: DELETE LAST MESSAGE
11-16 14:11:37.888 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.891 9668-10514/com.example.root.gotennaapp I/GTEventNotifier: DELETE LAST MESSAGE - RESPONSE POSITIVE
11-16 14:11:37.891 9668-10514/com.example.root.gotennaapp I/GTEventNotifier: COMMAND 176 STARTING: SENDING GET MESSAGE
11-16 14:11:37.977 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.978 9668-9679/com.example.root.gotennaapp I/GTEventNotifier: GET MESSAGE - RESPONSE NEGATIVE

What is the problem here?
Thank you for your help.


#2

Hello WiseLudo,

From your Android logs it looks like the receiving Android app is able to pull the sent message. Are you filtering the logs by GTEventNotifier? If so could you check if there are any other Warning or Error logs that might have a different log tag?

It would also help to print a log in both onIncomingMessage(GTBaseMessageData baseMessageData) as well as onIncomingMessage(GTMessageData messageData) of the GTMessageListener. If the SDK was able to de-serialize the message into a GTBaseMessageData object then onIncomingMessage(GTBaseMessageData baseMessageData) otherwise it will fallback to onIncomingMessage(GTMessageData messageData).

Thanks


#3

Hi dhan,

all other GTEventNotifier events in the log look fine and there aren’t any particular warnings I’m receiving.

The logs I’ve posted aren’t filtered on GTEventNotifier, in fact there’s a series of
11-16 14:11:37.496 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.556 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data
11-16 14:11:37.617 9350-9396/? E/bt_btif: bta_gattc_cmpl_cback unknown conn_id = 4, ignore data

Is that a issue with the BLE connection with the GoTenna?

Both onIncomingMessage(GTBaseMessageData gtBaseMessageData) and onIncomingMessage(GTMessageData messageData) never trigger (I run in debug mode).

I ovverride those two methods in my MainActivity that is defined as follows:

public class MainActivity extends AppCompatActivity implements GTConnectionManager.GTConnectionListener, GTCommandCenter.GTMessageListener {

}

I just want the onIncomingMessage() to Toast the content of the message.

Am I missing something?

Thank you all!


#4

If you google that string you’ll see it does appear to be an issue with Bluetooth and a number of pages that talk about it.


#5

Hello aspexin,

I did my fair share of googling before posting on the forum. Yes, it looks like there is some lower level problem, but why is it happening?
Is there a lower bound on the API SDK and Android OS version to use the GoTenna SDK?
Could it be that my token expired? I really can’t find a solution to this.


#6

Hello WiseLudo,

Could you specify which version of Android and which phones you are testing this on? Also is the issue reproducible on a different Android phone?

Thanks


#7

Hello dhan,

I’m using a Samsung S6 (Android 6.01, API 23) and a LG Rebel 2 (Android 6.01, API 23).
It’s still happening, onMessageReceived() keeps not triggering.