Author Topic: Simblee for Mobile and SimbleeCOM - Dual Mode  (Read 1358 times)

RFD_Nelson

  • RFduino Team
  • *****
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Simblee for Mobile and SimbleeCOM - Dual Mode
« on: January 12, 2017, 05:53:29 AM »
<a href="http://youtube.com/v/OOWy8Ds_PAY" target="_blank" class="new_win">http://youtube.com/v/OOWy8Ds_PAY</a>
« Last Edit: January 12, 2017, 07:15:59 AM by RFD_Nelson »

KCeng

  • RFduino Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #1 on: May 11, 2017, 05:32:16 AM »
This code does not work using Arduino 1.6.9 and Simblee 1.1.2.  The clients (multiple can be used) will control each other as advertised.  However, the DualMode host will not control the client units.  The mobile interface makes no difference.  The mobile interface will control the host; however, it does not control the client units.  :(

KCeng

  • RFduino Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #2 on: May 15, 2017, 07:41:24 AM »
Has anyone else tried this code lately and gotten it to work like the video shows?

tolson

  • Global Moderator
  • *****
  • Posts: 859
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #3 on: May 15, 2017, 08:52:53 AM »
Hi kceng,

I don't know about this specific issue. But Arduino has deprecated 1.6.9. Arduino is at least 1.8.1 now.


KCeng

  • RFduino Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #4 on: May 16, 2017, 06:45:05 AM »
Thank you for the reply!  I went ahead and updated to the latest Arduino 1.8.2.  Still no joy to be had...

Using the code straight off this thread:
  • I only see the host and mobile communicating...
  • The clients (if multiple) also communicate with each other...
  • However, the host and client have NO communication between each other...
Has anyone actually duplicated the results on the video?  All of the other built-in Simblee demos have worked fine without issues.   I am hoping something key is missing in the host or client code.

tolson

  • Global Moderator
  • *****
  • Posts: 859
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #5 on: May 16, 2017, 10:34:52 AM »
Hopefully RFD_nelson will answer your concerns.

anyholic

  • RFduino Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #6 on: June 04, 2017, 04:51:55 AM »
I succeeded.
this code is no problem in operation.
However, the code must be modified.

I also have two computers, but I only need to upload one of them.
I do not know why this is happening.

KCeng

  • RFduino Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #7 on: June 08, 2017, 05:58:40 AM »
Sorry, your reply is very very very appreciated but confuses me.  The code "no problem" but "must be modified"?  Please tell us more.

Tim

  • RFduino Sr. Member
  • ****
  • Posts: 124
  • Karma: +2/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #8 on: July 15, 2017, 02:28:44 PM »
Hi all ...

Seeing the how-to video spark more hope that dual mode might be helpful for our project. I can get COM<->COM working, no problem. But BLE+dualMode <-> COM, as shown in the video, appears not to work.

I created very simple sketches to test: Once (sender) sends a COM message every second. The other (replier) sends a reply COM message half a second after receiving a COM message. The replier is straight COM. If the sender is straight COM, all works well. Here are the sender and replier sketches:

Sender - straight COM:

Code: [Select]
#include <SimbleeCOM.h>

void setup() {
  Serial.begin(9600);
  SimbleeCOM.mode = LONG_RANGE;
  SimbleeCOM.begin();
}

void loop() {
  delay(1000);
  SimbleeCOM.send("ABC", 4);
  Serial.println("sent ABC");
}

void SimbleeCOM_onReceive(unsigned int esn, const char *payload, int len, int rssi) {
  Serial.print("received ");
  Serial.println(payload);
}

The replier - straight COM:

Code: [Select]
#include <SimbleeCOM.h>

volatile bool sendAReply = false;

void setup() {
  Serial.begin(9600);
  SimbleeCOM.mode = LONG_RANGE;
  SimbleeCOM.begin();
}

void loop() {
  if (sendAReply) {
    sendAReply = false;
    // Wait half a second before sending reply.
    delay(500);
    SimbleeCOM.send("DEF", 4);
    Serial.println("sent DEF");
  }
}

void SimbleeCOM_onReceive(unsigned int esn, const char *payload, int len, int rssi)
{
  Serial.print("received ");
  Serial.println(payload);
  // Send a reply in loop().
  sendAReply = true;
}

If I replace the sender (straight COM) with a sender that uses BLE plus dualMode COM, the replier does not receive any COM messages from the sender. I've also verified that the sender (BLE+dualMode COM) does not receive COM messages.

Sender - BLE+dualMode:

Code: [Select]
#include <SimbleeBLE.h>

volatile bool sendAMessage = false;

void setup() {
  Serial.begin(9600);
  SimbleeCOM.mode = LONG_RANGE;
  SimbleeBLE.begin();
}


void loop() {
  // Send a message every second.
  delay(1000);
  sendAMessage = true;
}


void SimbleeBLE_onConnect() {
 
  // Once connected to BLE central, start dual mode.
  // SimbleeBLE_onDualModeStart() / SimbleeBLE_onDualModeStop() will be called
  // repeatedly. Only inside SimbleeBLE_onDualModeStart() is it safe to send
  // a COM message (my understanding).
 
  SimbleeBLE.dualModeBegin();
  Serial.println("dual mode started");
}


void SimbleeBLE_onDisconnect() {

  // When disconnected from BLE central, stop dual mode.
  SimbleeBLE.dualModeEnd();
  Serial.println("dual mode ended");
}


void SimbleeBLE_onDualModeStart() {
  // SimbleeBLE_onDualModeStart is called frequently. Send a message only
  // when sendAMessage is true (once a second, see loop()).
  if (sendAMessage) {
    sendAMessage = false;
    SimbleeCOM.send("ABC", 4);
    Serial.println("sent ABC");
  }
}


void SimbleeCOM_onReceive(unsigned int esn, const char *payload, int len, int rssi) {
  Serial.print("received ");
  Serial.println(payload);
}

As you can see, when using dualMode, SimbleeCOM.send() can be only in the SimbleeBLE_onDualModeStart() routine.

Anyone have any better luck? I will send this to RF Digital support.

The ideal for our project would be:

- A single BLE central (iOS app) connects to 3 Simblees and uses BLE to communicate with them.
- Periodically, one of the Simblees, while still connected to BLE central, sends low latency COM message to other two Simblees, also while still connected to BLE central.

Currently when periodic COM messaging is needed, Simblees are disconnected from BLE central, COM messaging occurs, then all 3 Simblees are reconnected to BLE central. Unfortunately the reconnection process can take a while so that the whole process (disconnect, COM messaging, reconnect) takes as long as 10-15 seconds, sometimes longer.

We choose Simblee on the bases that simultaneous BLE+COM messaging was supported. The how-to video posted by RFD_Nelson gives me hope that it actually might work.

Thanks for any insights.

Cheers,

Tim

RFD_Nelson

  • RFduino Team
  • *****
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #9 on: July 28, 2017, 05:06:18 AM »
Hi Tim,

Thanks for contacting RF Digital support.

Regarding dual-mode, you must use the LOW_LATENCY mode of SimbleeCOM. Also, since the timing between BLE advertisements is very short, there is time only for a message to be sent and received. Therefore, the half-second delay on the replier will cause your message not to be received.

Thanks,

Nelson

RFD_Nelson

  • RFduino Team
  • *****
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #10 on: July 28, 2017, 05:10:17 AM »
Hi All,

Please take a look at this new sketch that we've created regarding dual-mode capabilities. I think it will answer some questions.

Thanks,

Nelson

Tim

  • RFduino Sr. Member
  • ****
  • Posts: 124
  • Karma: +2/-0
    • View Profile
Re: Simblee for Mobile and SimbleeCOM - Dual Mode
« Reply #11 on: July 30, 2017, 09:14:31 PM »
Thanks Nelson. I posted additional info in this thread:

http://forum.rfduino.com/index.php?topic=1782.msg6407#msg6407

Might be helpful to others.

Tim

 

anything