Author Topic: SimbleeCom onReceive super slow  (Read 1289 times)


  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
SimbleeCom onReceive super slow
« on: May 13, 2016, 07:55:44 AM »
I am not able to reliably receive more than two bytes ever 20ms using the SimbleeComm_onReceive function due to timing issues.

I am building a system that requires at least 4khz transmission from a bluetooth node (simblee node) to a computer. The bluetooth protocol is at 1Mbit/s so I assumed this would be no issue.

I am trying to use two simblee modules and use the simbleeCom library. I have one remote node, and one base node connected via serial to my laptop (will eventually interface with matlab/python over serial). The base node will send instructions to the remote node that it receives from the matlab script so I need two way communication. For example it will send a control character and a time and the remote node will stream the ADC for the desired time.

matlab <-> (serial) -> simblee <-> (SimbleeCom) <-> simblee

Working Portion
I have the remote node working. I wrote a timer ISR that reads the ADCs and calls SimbleeCOM.send every millisecond. I checked this by toggleing a gpio port when the isr starts and ends as well as ADC time and it was a consistent 1ms with a 400uS ADC read and transmit. I will be changing the structure to move the ADC outside the ISR eventually.

Not working
I wrote a receive script for the second simblee that receives the message from the node and writes it as serial message. The issue is the time it takes for the Simblee_onReceive callback to respond.

The onReceive hits every 10ms (gpio pin indicator) as long as you don't do anything inside the function. If you write the message over serial it is less reliable as to timing. I am not able to reliably receive more than two bytes ever 20ms using the onReceive function.
1. If I send from remote every 1ms I get tons of dropped packets at base.
2. If I send it every 20ms I get every packet as expected
3. If I send a packet larger than 16bits the message is corrupted.
4. The issue is not the time for the serial to write. That is less than 1ms.
5. I also increased the transmission rate

1. Is it possible to somehow send larger packets using SimbleCom_send? If I could send a large packet every 20ms I would have no issues.
2. Can I increase the onReceive callback frequency to every 5ms, or 1ms?
3. Is there a way of getting a transmission higher than 16bits every 20ms?

I checked the library files and found nothing related to the actual callback as to timing. I have attached a simplified version of the files. Flash one to the base, and one to the remote and using the Serial monitor send "x" and it will respond with data. Is there a solution to allow quicker transmission. I know this can be done - I am 90% sure the issue is the SimbleeCom library.