Git Product home page Git Product logo

adafruit_nrf8001's Issues

Compile fails on Arduino Due

Error thrown:

fatal error: util/delay.h: No such file or directory

Cause:
The Due operates on a ARM chip rather than a AVR chipset while delay.h is specifically for the AVR chipset only

when ever i try to upload or verify the file i keep getting this

home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp: In function ‘void hal_aci_tl_init()’:
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:323:9: error: ‘class SPIClass’ has no member named ‘usingInterrupt’
SPI.usingInterrupt(HAL_IO_RADIO_IRQ); // add checking for spi conflicts
^
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp: In function ‘hal_aci_data_t* hal_aci_tl_poll_get()’:
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:366:7: error: ‘class SPIClass’ has no member named ‘beginTransaction’
SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0)); // gain control of SPI bus
^
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:366:64: error: ‘SPISettings’ was not declared in this scope
SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0)); // gain control of SPI bus
^
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:407:7: error: ‘class SPIClass’ has no member named ‘endTransaction’
SPI.endTransaction(); // release the SPI bus
^

Multiple BTLEserial.write() inside an Arduino Loop

Hi everyone,
i'm having a problem using multiple write() inside a loop void with Arduino Mega.
I need to send data over BLE to external devices and the limit of 20 char is a problem for my project.
To avoid this i thought to split my data in multiple messages and sending them inside the same loop but after 5-6 loop the write doesn't work anymore.
Can you help me?
Thanks in advance!

print() with strings > 20 characters drops data

Sending strings longer than 20 characters causes chunks of the strings to be dropped and ACI errors to be output. I think this is because data_credit_available isn't checked anywhere before sending data. To reproduce, send some strings whose lengths are > 20 characters using print() one after the other. Some of them will be missing parts.

If I modify line 257 of Adafruit_BLE_UART.cpp to include a check that there is at least one data credit:

if(!lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX) || aci_state.data_credit_available == 0)

Then it will remain polling until the pipe is available and it has a data credit. (Line 281 needs a similar change.) The downside is this ends up wasting cycles, waiting for a data credit to become available. I also wrote the following function so I can check the pipe and data credit status, before I call print() or write():

bool Adafruit_BLE_UART::ready(void) {
  return lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX) && aci_state.data_credit_available > 0;
}

Code is in Debug mode

the #define BLE_RW_DEBUG macro is set. As far as I can see this shouldn't be defined since this is a debug only configuration.

Multiple connection not available when module advertising!

I use Adafruit Bluefruit LE SPI Friend module in my device, when I create my custom services and characteristics and then advertising the services.
During advertising the services I want to connect via some mobile devices (iOS and Android). but when one device find the service and connect to module (when blue led on module turn on), others cannot find module.
Is it possible to connect to module via more than one devices?

Having SPIClass' has no member named 'endTransaction' problem

I only got one code file in my library

screen shot 2015-05-05 at 11 38 50 pm

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno"
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp: In function 'void hal_aci_tl_init()':
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:317: error: 'class SPIClass' has no member named 'usingInterrupt'
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp: In function 'hal_aci_data_t* hal_aci_tl_poll_get()':
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:360: error: 'class SPIClass' has no member named 'beginTransaction'
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:360: error: 'SPISettings' was not declared in this scope
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:401: error: 'class SPIClass' has no member named 'endTransaction'

A stray `break` in write(uint8_t * buffer, uint8_t len) prevents any data from sending.

This break on this line in write(uint8_t * buffer, uint8_t len):
https://github.com/adafruit/Adafruit_nRF8001/blob/master/Adafruit_BLE_UART.cpp#L211

It seems to break out of the while loop when it shouldn't, preventing any data from sending.

if(!lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX))
{
  pollACI();
  break; // Breaks universe
}

The implementation of the single byte write(uint8_t buffer) method has no such short circuit and seems to work just fine.

After removing the offending break from the library, my data is actually coming through to my iPhone.

I'm no expert on the libraries used here, but it seems this line should be removed. Whatever it's supposed to be guarding against doesn't seem to be working as intended.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.