dbinfrago / dbinfrago/libpax

Always receiving a BLE count of zero when using Arduino IDE

Open
#17 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
35
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## Environment :
- Windows 10 (also reproduced on Linux)
- Arduino IDE 1.8.19
- ESP32 espressif arduino boards packages 1.0.6
- T-Beam v1.0 dev board (reproduced on many different other boards)

## Steps to reproduce :
- clone libpax branch master
- edit _lib/libpax/libpax_api.h_ to uncomment build-time options _LIBPAX_WIFI_ and _LIBPAX_BLE_
- copy _lib/libpax_ in arduino libraries folder
- copy the sample program _src/main.cpp_ as _src/main.ino_ and open it in arduino ide
- modify it like this (removing non-arduino version for clarity, and defining _LIBPAX_ARDUINO_ as instructed in README.md) :
```
#define LIBPAX_ARDUINO
#include
#include

struct count_payload_t count_from_libpax;

void process_count(void) {
printf("pax: %d; %d; %d;\n", count_from_libpax.pax, count_from_libpax.wifi_count, count_from_libpax.ble_count);
}

void init() {
struct libpax_config_t configuration;
libpax_default_config(&configuration);
configuration.blecounter = 1;
configuration.blescantime = 0; // infinit
configuration.wificounter = 1;
configuration.wifi_channel_map = WIFI_CHANNEL_ALL;
configuration.wifi_channel_switch_interval = 50;
configuration.wifi_rssi_threshold = -80;
configuration.ble_rssi_threshold = -80;
libpax_update_config(&configuration);

// internal processing initialization
libpax_counter_init(process_count, &count_from_libpax, 10, 1);
libpax_counter_start();
}

void setup() {
init();
}

void loop() {}
```
- build and upload, open the serial monitor.

## Expected output:
Receiving values for both wifi and ble counts.

## Actual output:
16:25:09.268 -> pax: 3; 3; 0;
... 10 minutes later
16:25:19.262 -> pax: 7; 7; 0;
BLE count is always zero.

Note that running the BLE_scan sample sketch included with ESP32 arduino package finds around 15 BLE devices at the same location, same time on the same board.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.