Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

esp32_bt.h: No such file or directory

khoazanykhoazany Singapore
edited August 10 in Mongoose OS

I'm trying to scan Bluetooth devices in esp32. I've already included bt-common library in the mos.yml of the project and included the header in my main.c:

#include "mgos.h"

However when I click "Rebuild app firmware" the build was failed due to this error:
/fwbuild-volumes/1.13/apps/smart-signage-app-1.13/esp32/build_contexts/build_ctx_221970878/src/main.c:2:22: fatal error: esp32_bt.h: No such file or directory

Anyone know what's the reason? This seems to happen after I've updated mos.

Comments

  • SergeySergey Dublin, Ireland

    might be related to the recent 1.13 build bug, could update and retry please?

  • khoazanykhoazany Singapore

    Are you referring to updating by using the command "mos update"? This one actually happen after I update yesterday (I had to update to use some of methods mentioned in the Bluetooth documentation).

  • SergeySergey Dublin, Ireland

    Ok, is that still happening ?

  • khoazanykhoazany Singapore
    edited August 12

    Now has a different error:
    [Aug 12 09:35:21.549] /app/build/objs/src/libsrc.a(main.o):(.text.mgos_app_init+0xc): undefined reference to esp32_bt_init'
    [Aug 12 09:35:21.549] /app/build/objs/src/libsrc.a(main.o):(.text.mgos_app_init+0x13): undefined reference to esp32_bt_init'

    My main.c is as follow:
    #include "mgos.h"
    #include "esp32_bt.h"

    static void ble_cb (int num_res, const struct mgos_bt_ble_scan_result *res, void *arg) {
    for (int i = 0; i < num_res; i++) {
    // LOG(LL_INFO, (" addr: %2d, name: %2d, rssi: %2d",
    // res[i].addr, res[i].name, res[i].rssi));
    }

    LOG(LL_INFO, ("BLE scan done."));
    }

    enum mgos_app_init_result mgos_app_init(void) {
    if (esp32_bt_init()) {
    mgos_bt_ble_scan(ble_cb, NULL);
    } else {
    LOG(LL_INFO, ("BLE isn't initiated"));
    }

    return MGOS_APP_INIT_SUCCESS;
    }

    This probably a stupid question but I really can't figure out.

  • khoazanykhoazany Singapore

    Never mind I just don't use that method then. Seems Bluetooth will be auto init if I include esp32_bt.h?

  • SergeySergey Dublin, Ireland

    You need to include bt-common lib in your mos.yml

Sign In or Register to comment.