no module named 'ble_advertising'

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Thanatos
Posts: 5
Joined: Wed Dec 02, 2020 6:21 pm

no module named 'ble_advertising'

Post by Thanatos » Wed Dec 02, 2020 6:59 pm

Hello

When following the steps in the introduction to ESP32 and MicroPython, I was able to erase my original firmware and flash new firmware on it.
However, when trying to use the `advertising_payload` like so:

Code: Select all

from ble_advertising import advertising_payload
I receive this output:

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5148
load:0x40078000,len:12880
load:0x40080400,len:3484
entry 0x40080630
I (539) cpu_start: Pro cpu up.
I (539) cpu_start: Application information:
I (539) cpu_start: Compile time:     Sep  2 2020 03:04:09
I (542) cpu_start: ELF file SHA256:  0000000000000000...
I (548) cpu_start: ESP-IDF:          v4.0.1
I (553) cpu_start: Starting app cpu, entry point is 0x40082830
I (0) cpu_start: App cpu up.
I (564) heap_init: Initializing. RAM available for dynamic allocation:
I (570) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (576) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (583) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (589) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
I (595) heap_init: At 3FFCAD78 len 00015288 (84 KiB): DRAM
I (601) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (607) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (614) heap_init: At 4009E9D8 len 00001628 (5 KiB): IRAM
I (620) cpu_start: Pro cpu start user code
I (638) spi_flash: detected chip: generic
I (639) spi_flash: flash io: dio
I (639) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Traceback (most recent call last):
  File "main.py", line 3, in <module>
ImportError: no module named 'ble_advertising'
MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more information.
>>>
I have an Espressif ESP32_DevKitc_V4 and I tried literally every firmware version on this page, as well as even a TinyPICO version (which gives the same result as well as an additional error).

Output of `CTRL-D`:

Code: Select all

MPY: soft reboot
Traceback (most recent call last):
  File "main.py", line 3, in <module>
ImportError: no module named 'ble_advertising'
MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more information.
What am I doing wrong here?

maveric100
Posts: 1
Joined: Thu Dec 03, 2020 1:13 am

Re: no module named 'ble_advertising'

Post by maveric100 » Thu Dec 03, 2020 1:15 am

You must upload that file (found on the github examples) to the board.

Something like: ampy -p /dev/ttyUSB0 put ble_advertising.py

Your port may vary.

Thanatos
Posts: 5
Joined: Wed Dec 02, 2020 6:21 pm

Re: no module named 'ble_advertising'

Post by Thanatos » Thu Dec 03, 2020 8:48 am

Thanks, that solved my problem. Two questions however:
  1. Is this step documented somewhere?
  2. Why is this essential file located in the examples folder?

Thanks!

Post Reply