-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting data rate doesn't work on ESP32 #30
Comments
There is no implementation in esp_espnow.c
|
From the ESP-IDF example I found here, it appears that the build project needs to be set with some configuration, I am not sure how this is handled in this micropython setup. On a separate note, I tested the long range mode as described in the ESP-IDF example, I would say that it is pretty disappointing, a device just operating on micropython without long range mode and the ESP-IDF with long range mode - more or less have the same coverage. i.e with brick walls and concrete floors, just with the on board antenna i covers approximately 15 ft with the micropython code, the ESP NOW long range example is no different in range - unless there is something terribly iwrong with the code or the board. |
The 'rate' config option is available in the PR for IDF versions above 4.3.0 (see esp_now.c). The necessary functionality is only available for IDF > 4.3.0. However, generic ESP32 images are still built with idf 4.2.2 by default due to some memory fragmentation issues (the esp32[cs][0-9] images are built with idf 4.4 as they need the newer IDF versions.) Soooo, my pre-compiled images for generic ESP32 lack 'rate' support. You can compile your own image using IDF 4.3+ and it'll probably be absolutely fine (eg. I do all my dev on 4.4), but there are known to be issues which may affect some people. I'll think about making some 4.4 images available when I do my next build (probably after 1.20 comes out). |
There is - look a few lines above this for the setting code. The ESP IDF provides no support for querying the current rate (only setting it), so I don't support |
You can see some prior discussion on LR_MODE in another issue at: #20. That includes a link to a video showing some people's experiments using LR_MODE. I haven't seen any reports of increased range for LR_MODE on micropython. |
Hello Glenn Thank you for engaging and helpful. I am using ESP-IDF 4.4.2 to build your code and I am not using your pre-built binaries. May be I am missing some configuration parameters to let micropython use 4.4.2 features. Do you know where should I look in to I have w0.config(protocol=network.MODE_LR) - no errors w0.config(rate=41), - throws unknown param That thing aside, I have realised why there was NO difference in LR mode and normal mode when I compiled the esp-idf 4.4.2 example of espnow . The Long range mode works only between two devices (its mentioned in one of the espressif blogs) that possibly means it doesn't work in broadcast mode. The example given in esp-idf uses broadcast mode address. I just changed this now to unicast from the start. The documented sensitivity at LR is only -105dBm at 125Kbps and -97 dBm with standard espnow operating at 1Mbps. -3dB shift in sensitivity means half the power is needed by the transmitter to cover the same range, even though theoretically there is a 8dB shift which should mean that same range should achieved with 1/4th of the power. I am able to see a difference, now the data is crossing over another brick wall in LR mode, this is with just the on board antenna's in both the devices. If I do a power test then what Espressif claim would be correct, but for practical purpose its just one more brick wall that you may be able to cross without external antennas |
Mmm - that's puzzling. I just checked on freshly compiled image from espnow-g20 branch and Are you using the To do a completely clean build I do: cd ~/projects/micropython/micropython
source ../IDF/v4.4/export.sh
make -C mpy-cross clean
make -C mpy-cross
cd ports/esp32
make BOARD=GENERIC clean
make BOARD=GENERIC submodules
make BOARD=GENERIC (of course this is all in a complex set of scripts). |
Regarding your query of espnow_config() yes it does have a check
But I get the error on line 40 I have I just did a clean build and I get this message at the start which says IDF target not set, how is it set?
|
And I have done idf export before calling build (and performed all the other steps you have described)
|
I have done the following test with the esp idf esp now C code
With LORA 250K explicitly set, there is NO difference to the sensitivity with the PCB antennas. But there is a definite increase in sensitivity with LR enabled - as per the espressif doc's it is stated as 4dB gain - which is more or less what I am experiencing. Now I can forget about the datarate bug in micropython and see whether I get the same range with just the LR mode enabled in your code. I tested it with just w0.config(protocol=network.MODE_LR) This is most likely due to the fact that the Long range has to be specifically enabled during compile time - that is what I did using menuconfig on ESP IDF SDK CONFIG_ESPNOW_ENABLE_LONG_RANGE=y Checking the micropython build file sdkconfig.base this parameter is not present in my source code - can you check whether you have that parameter enabled in that file or any other file by doing a grep -r "keyword" * under ports/esp32 I added this parameter in sdkconfig.base - micropython compiled and flashed to the device without any error. When I execute a previous esp_now send/receive program - the device crashes with a GURU meditation error. This is only on ONE hardware. The other hardware has no issues and works. I look forward to your thoughts |
Ok - I finally spotted the problem (not the first time I and others have been caught out by this :)). It should be |
Spot on :) that has got rid of the error - However when I use data rate 0x1f - the range is drastically reduced, i.e it works only with in the same room or line of sight as the data rate is 72Mbps on a 20MHz channel. Now I tried the Lora 250K and 500K settings, they both throw OSError: [Errno 1] EPERM: ESP_FAIL Using micropython, "the setting WiFi protocol long range has no sensitivity gain i.e there is NO 4dB gain as it happens with ESP-IDF The Lora rate settings have no effect in ESP-IDF as well so we have to settle for 1Mbps data rate at ESPNow |
Excellent.
Yes - because
Excellent - thanks for picking up on this. Can you tell me if setting this in sdkconfig.base fixed the problem (you may need to do a make clean to force a full rebuild). |
No there is no difference if I set the CONFIG_ESPNOW_ENABLE_LONG_RANGE=y - I have done all make cleans. Does this entry CONFIG_ESPNOW_ENABLE_LONG_RANGE=y appear in any of the sdkconfig in your build setup? You can check the rssi of the received packet - it should show a significant increase in its value in long range mode. |
Well, that is disappointing....
No - not that I can find.
Do you have a small IDF example code which works? I could inspect that to see if there are any magic initialisation steps required. |
https://github.com/espressif/esp-idf/tree/master/examples/wifi/espnow - I have compiled this example, attached is the binary with and without long range enabled - so you just flash and test. I tried to print RSSI using your code from micropython, it prints the correct RSSI when in broadcast mode but ones they shift to unicast transmission, the code keeps printing -96 as rssi, which either means that the protocol has changed and the rssi is no longer in the header or something else. However your espnow inmicropython keeps printing the correct RSSI which probably means that the long range mode is not enabled |
Great - thanks. Also - can you tell me which version of the IDF you are using to build these examples and which esp32 devices these are compiled for? These bins just reboot continuously. I have built them fresh using your source code and IDF from master and from v4.4 - and I see no significant difference between the reported RSSI when LR mode is enable or not enabled. (However that is for several devices placed fairly close together - maybe the difference is only significant for low RSSI signals). Oh - BTW, CONFIG_ESPNOW_ENABLE_LONG_RANGE=y is only used in the example code - it is not used when building any other code (ie. it has no effect when building micropython). |
I built it using esp-idf-4.4.2. - its my fault I haven't sent the
bootloader and partition files` (See attached)
It has to be flashed like this
/home/krishnak/.espressif/python_env/idf4.4_py3.10_env/bin/python
../../../../../esp-idf-4.4.2/components/esptool_py/esptool/esptool.py -p
(PORT) -b 460800 --before default_reset --after hard_reset --chip esp32
write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000
build/bootloader/bootloader.bin 0x8000
build/partition_table/partition-table.bin 0x10000 build/espnow_example.bin
Can you let me know did you change anything in the source code I sent to
get the RSSI - I print the rssi in two places, one of them is incorrect.
If you did not have CONFIG_ESPNOW_ENABLE_LONG_RANGE=y when building this
esp-now, then your chip will not have LR enabled - can you see the output
log statements printed at the start (It will say whether LR is enabled or
not)
If NO LR is enabled then rssi will remain the same, when LR is enabled -
broadcast will be done in normal mode, so rssi will appear correctly. When
unicast data starts - rssi will become -96. Please check and let me know.
…On Fri, 30 Sept 2022 at 10:41, glenn20 ***@***.***> wrote:
espnow_example_withoutlr.zip
<https://github.com/glenn20/micropython-espnow-images/files/9675950/espnow_example_withoutlr.zip>
espnow_example_withLR.zip
<https://github.com/glenn20/micropython-espnow-images/files/9675951/espnow_example_withLR.zip>
Great - thanks. Also - can you tell me which version of the IDF you are
using to build these examples and which esp32 devices these are compiled
for? These bins just reboot continuously.
I have built them fresh using your source code and IDF from master and
from v4.4 - and I see no significant difference between the reported RSSI
when LR mode is enable or not enabled. (However that is for several devices
placed fairly close together - maybe the difference is only significant for
low RSSI signals).
Oh - BTW, CONFIG_ESPNOW_ENABLE_LONG_RANGE=y is only used in the example
code - it is not used when building any other code (ie. it has no effect
when building micropython).
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTPNZ5GN7USEWINUSQV3TWAZY7PANCNFSM6AAAAAAQWNNAP4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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:0x3fff0030,len:6660
load:0x40078000,len:14848
ho 0 tail 12 room 4
load:0x40080400,len:3792
0x40080400: _init at ??:?
entry 0x40080694
I (29) boot: ESP-IDF v4.4.2 2nd stage bootloader
I (29) boot: compile time 11:14:15
I (29) boot: chip revision: 1
I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (39) boot.esp32: SPI Speed : 40MHz
I (43) boot.esp32: SPI Mode : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (52) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (61) boot: ## Label Usage Type ST Offset Length
I (69) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (76) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (83) boot: 2 factory factory app 00 00 00010000 00100000
I (91) boot: End of partition table
I (95) boot_comm: chip revision: 1, min. application chip revision: 0
I (102) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1352ch (
79148) map
I (139) esp_image: segment 1: paddr=00023554 vaddr=3ffb0000 size=03814h (
14356) load
I (145) esp_image: segment 2: paddr=00026d70 vaddr=40080000 size=092a8h (
37544) load
I (161) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=6eff0h
(454640) map
I (326) esp_image: segment 4: paddr=0009f018 vaddr=400892a8 size=0b238h (
45624) load
I (345) esp_image: segment 5: paddr=000aa258 vaddr=50000000 size=00010h (
16) load
I (355) boot: Loaded app from partition at offset 0x10000
I (355) boot: Disabling RNG early entropy source...
I (367) cpu_start: Pro cpu up.
I (368) cpu_start: Starting app cpu, entry point is 0x40081198
0x40081198: call_start_cpu1 at
/home/krishnak/esp-idf-4.4.2/components/esp_system/port/cpu_start.c:160
I (0) cpu_start: App cpu up.
I (384) cpu_start: Pro cpu start user code
I (384) cpu_start: cpu freq: 160000000
I (384) cpu_start: Application information:
I (388) cpu_start: Project name: espnow_example
I (394) cpu_start: App version: 1
I (398) cpu_start: Compile time: Sep 29 2022 21:32:59
I (404) cpu_start: ELF file SHA256: b0fad6e6595063f7...
I (410) cpu_start: ESP-IDF: v4.4.2
I (415) heap_init: Initializing. RAM available for dynamic allocation:
I (422) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (428) heap_init: At 3FFB7528 len 00028AD8 (162 KiB): DRAM
I (435) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (441) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (448) heap_init: At 400944E0 len 0000BB20 (46 KiB): IRAM
I (455) spi_flash: detected chip: generic
I (458) spi_flash: flash io: dio
I (464) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (542) wifi:wifi driver task: 3ffbfca0, prio:23, stack:6656, core=0
I (542) system_api: Base MAC address is not set
I (542) system_api: read default base MAC address from EFUSE
I (552) wifi:wifi firmware version: eeaa27d
I (552) wifi:wifi certification version: v7.0
I (552) wifi:config NVS flash: enabled
I (552) wifi:config nano formating: disabled
I (562) wifi:Init data frame dynamic rx buffer num: 32
I (562) wifi:Init management frame dynamic rx buffer num: 32
I (572) wifi:Init management short buffer num: 32
I (572) wifi:Init dynamic tx buffer num: 32
I (582) wifi:Init static rx buffer size: 1600
I (582) wifi:Init static rx buffer num: 10
I (582) wifi:Init dynamic rx buffer num: 32
I (592) wifi_init: rx ba win: 6
I (592) wifi_init: tcpip mbox: 32
I (602) wifi_init: udp mbox: 6
I (602) wifi_init: tcp mbox: 6
I (602) wifi_init: tcp tx win: 5744
I (612) wifi_init: tcp rx win: 5744
I (612) wifi_init: tcp mss: 1440
I (622) wifi_init: WiFi IRAM OP enabled
I (622) wifi_init: WiFi RX IRAM OP enabled
I (632) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (742) wifi:mode : sta (0c:b8:15:f2:db:3c)
I (742) wifi:enable tsf
I (742) espnow_longrange: Next line should print Long range enabled, if
compiled with correct option
I (752) espnow_longrange: Long range enabled
I (752) wifi:enable tsf
I (752) ESPNOW: espnow [version: 1.0] init
I (1612) espnow_longrange: RSSI:-58 : data length is 100
I (2612) espnow_longrange: RSSI:-57 : data length is 100
I (3612) espnow_longrange: RSSI:-58 : data length is 100
I (4612) espnow_longrange: RSSI:-57 : data length is 100
I (5612) espnow_longrange: RSSI:-58 : data length is 100
I (5762) espnow_longrange: Start sending broadcast data
I (5762) espnow_longrange: RSSI:0
I (5762) espnow_longrange: Receive 2th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5762) espnow_longrange: RSSI:-91
I (5772) espnow_longrange: Receive 3th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5782) espnow_longrange: RSSI:-34
I (5782) espnow_longrange: Receive 4th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5792) espnow_longrange: RSSI:56
I (5792) espnow_longrange: Receive 5th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5802) espnow_longrange: RSSI:-95
I (5812) espnow_longrange: Receive 6th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (6612) espnow_longrange: RSSI:-59 : data length is 100
I (6812) espnow_longrange: send data to ff:ff:ff:ff:ff:ff
I (6812) espnow_longrange: RSSI:0
I (6812) espnow_longrange: Receive 7th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (7612) espnow_longrange: RSSI:-58 : data length is 100
I (7632) espnow_longrange: RSSI:-96 : data length is 100
I (7812) espnow_longrange: send data to ff:ff:ff:ff:ff:ff
I (7812) espnow_longrange: RSSI:0
I (7812) espnow_longrange: Receive 8th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (7812) espnow_longrange: RSSI:9
I (7822) espnow_longrange: Receive 0th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (8622) espnow_longrange: RSSI:-96 : data length is 100
I (8622) espnow_longrange: RSSI:0
I (8622) espnow_longrange: Receive 1th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (9622) espnow_longrange: RSSI:-96 : data length is 100
I (9622) espnow_longrange: RSSI:0
I (9622) espnow_longrange: Receive 2th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (10622) espnow_longrange: RSSI:-96 : data length is 100
I (10622) espnow_longrange: RSSI:0
I (10622) espnow_longrange: Receive 3th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (11622) espnow_longrange: RSSI:-96 : data length is 100
I (11622) espnow_longrange: RSSI:0
I (11622) espnow_longrange: Receive 4th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (12622) espnow_longrange: RSSI:-96 : data length is 100
I (12622) espnow_longrange: RSSI:0
On Fri, 30 Sept 2022 at 11:44, Krishna Kumar ***@***.***>
wrote:
… I built it using esp-idf-4.4.2. - its my fault I haven't sent the
bootloader and partition files` (See attached)
It has to be flashed like this
/home/krishnak/.espressif/python_env/idf4.4_py3.10_env/bin/python
../../../../../esp-idf-4.4.2/components/esptool_py/esptool/esptool.py -p
(PORT) -b 460800 --before default_reset --after hard_reset --chip esp32
write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000
build/bootloader/bootloader.bin 0x8000
build/partition_table/partition-table.bin 0x10000 build/espnow_example.bin
Can you let me know did you change anything in the source code I sent to
get the RSSI - I print the rssi in two places, one of them is incorrect.
If you did not have CONFIG_ESPNOW_ENABLE_LONG_RANGE=y when building this
esp-now, then your chip will not have LR enabled - can you see the output
log statements printed at the start (It will say whether LR is enabled or
not)
If NO LR is enabled then rssi will remain the same, when LR is enabled -
broadcast will be done in normal mode, so rssi will appear correctly. When
unicast data starts - rssi will become -96. Please check and let me know.
On Fri, 30 Sept 2022 at 10:41, glenn20 ***@***.***> wrote:
> espnow_example_withoutlr.zip
> <https://github.com/glenn20/micropython-espnow-images/files/9675950/espnow_example_withoutlr.zip>
> espnow_example_withLR.zip
> <https://github.com/glenn20/micropython-espnow-images/files/9675951/espnow_example_withLR.zip>
>
> Great - thanks. Also - can you tell me which version of the IDF you are
> using to build these examples and which esp32 devices these are compiled
> for? These bins just reboot continuously.
>
> I have built them fresh using your source code and IDF from master and
> from v4.4 - and I see no significant difference between the reported RSSI
> when LR mode is enable or not enabled. (However that is for several devices
> placed fairly close together - maybe the difference is only significant for
> low RSSI signals).
>
> Oh - BTW, CONFIG_ESPNOW_ENABLE_LONG_RANGE=y is only used in the example
> code - it is not used when building any other code (ie. it has no effect
> when building micropython).
>
> —
> Reply to this email directly, view it on GitHub
> <#30 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAJTPNZ5GN7USEWINUSQV3TWAZY7PANCNFSM6AAAAAAQWNNAP4>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Please check whether you are receiving broadcast data or unicast data -
broadcast data can't be sent using Long Range. Only unicast can be sent via
Long range.
The code is not 100% correct, for some reason if you connect both the
clients to USB port, it gets confused. You need to see receiving unicast
data on your screen after initial broadcast. It needs some juggling to get
there,
On Fri, 30 Sept 2022 at 12:45, Krishna Kumar ***@***.***>
wrote:
…
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:0x3fff0030,len:6660
load:0x40078000,len:14848
ho 0 tail 12 room 4
load:0x40080400,len:3792
0x40080400: _init at ??:?
entry 0x40080694
I (29) boot: ESP-IDF v4.4.2 2nd stage bootloader
I (29) boot: compile time 11:14:15
I (29) boot: chip revision: 1
I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (39) boot.esp32: SPI Speed : 40MHz
I (43) boot.esp32: SPI Mode : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (52) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (61) boot: ## Label Usage Type ST Offset Length
I (69) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (76) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (83) boot: 2 factory factory app 00 00 00010000 00100000
I (91) boot: End of partition table
I (95) boot_comm: chip revision: 1, min. application chip revision: 0
I (102) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1352ch (
79148) map
I (139) esp_image: segment 1: paddr=00023554 vaddr=3ffb0000 size=03814h (
14356) load
I (145) esp_image: segment 2: paddr=00026d70 vaddr=40080000 size=092a8h (
37544) load
I (161) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=6eff0h
(454640) map
I (326) esp_image: segment 4: paddr=0009f018 vaddr=400892a8 size=0b238h (
45624) load
I (345) esp_image: segment 5: paddr=000aa258 vaddr=50000000 size=00010h (
16) load
I (355) boot: Loaded app from partition at offset 0x10000
I (355) boot: Disabling RNG early entropy source...
I (367) cpu_start: Pro cpu up.
I (368) cpu_start: Starting app cpu, entry point is 0x40081198
0x40081198: call_start_cpu1 at
/home/krishnak/esp-idf-4.4.2/components/esp_system/port/cpu_start.c:160
I (0) cpu_start: App cpu up.
I (384) cpu_start: Pro cpu start user code
I (384) cpu_start: cpu freq: 160000000
I (384) cpu_start: Application information:
I (388) cpu_start: Project name: espnow_example
I (394) cpu_start: App version: 1
I (398) cpu_start: Compile time: Sep 29 2022 21:32:59
I (404) cpu_start: ELF file SHA256: b0fad6e6595063f7...
I (410) cpu_start: ESP-IDF: v4.4.2
I (415) heap_init: Initializing. RAM available for dynamic allocation:
I (422) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (428) heap_init: At 3FFB7528 len 00028AD8 (162 KiB): DRAM
I (435) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (441) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (448) heap_init: At 400944E0 len 0000BB20 (46 KiB): IRAM
I (455) spi_flash: detected chip: generic
I (458) spi_flash: flash io: dio
I (464) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (542) wifi:wifi driver task: 3ffbfca0, prio:23, stack:6656, core=0
I (542) system_api: Base MAC address is not set
I (542) system_api: read default base MAC address from EFUSE
I (552) wifi:wifi firmware version: eeaa27d
I (552) wifi:wifi certification version: v7.0
I (552) wifi:config NVS flash: enabled
I (552) wifi:config nano formating: disabled
I (562) wifi:Init data frame dynamic rx buffer num: 32
I (562) wifi:Init management frame dynamic rx buffer num: 32
I (572) wifi:Init management short buffer num: 32
I (572) wifi:Init dynamic tx buffer num: 32
I (582) wifi:Init static rx buffer size: 1600
I (582) wifi:Init static rx buffer num: 10
I (582) wifi:Init dynamic rx buffer num: 32
I (592) wifi_init: rx ba win: 6
I (592) wifi_init: tcpip mbox: 32
I (602) wifi_init: udp mbox: 6
I (602) wifi_init: tcp mbox: 6
I (602) wifi_init: tcp tx win: 5744
I (612) wifi_init: tcp rx win: 5744
I (612) wifi_init: tcp mss: 1440
I (622) wifi_init: WiFi IRAM OP enabled
I (622) wifi_init: WiFi RX IRAM OP enabled
I (632) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (742) wifi:mode : sta (0c:b8:15:f2:db:3c)
I (742) wifi:enable tsf
I (742) espnow_longrange: Next line should print Long range enabled, if
compiled with correct option
I (752) espnow_longrange: Long range enabled
I (752) wifi:enable tsf
I (752) ESPNOW: espnow [version: 1.0] init
I (1612) espnow_longrange: RSSI:-58 : data length is 100
I (2612) espnow_longrange: RSSI:-57 : data length is 100
I (3612) espnow_longrange: RSSI:-58 : data length is 100
I (4612) espnow_longrange: RSSI:-57 : data length is 100
I (5612) espnow_longrange: RSSI:-58 : data length is 100
I (5762) espnow_longrange: Start sending broadcast data
I (5762) espnow_longrange: RSSI:0
I (5762) espnow_longrange: Receive 2th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5762) espnow_longrange: RSSI:-91
I (5772) espnow_longrange: Receive 3th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5782) espnow_longrange: RSSI:-34
I (5782) espnow_longrange: Receive 4th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5792) espnow_longrange: RSSI:56
I (5792) espnow_longrange: Receive 5th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (5802) espnow_longrange: RSSI:-95
I (5812) espnow_longrange: Receive 6th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (6612) espnow_longrange: RSSI:-59 : data length is 100
I (6812) espnow_longrange: send data to ff:ff:ff:ff:ff:ff
I (6812) espnow_longrange: RSSI:0
I (6812) espnow_longrange: Receive 7th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (7612) espnow_longrange: RSSI:-58 : data length is 100
I (7632) espnow_longrange: RSSI:-96 : data length is 100
I (7812) espnow_longrange: send data to ff:ff:ff:ff:ff:ff
I (7812) espnow_longrange: RSSI:0
I (7812) espnow_longrange: Receive 8th broadcast data from:
58:bf:25:9f:c0:60, len: 100
I (7812) espnow_longrange: RSSI:9
I (7822) espnow_longrange: Receive 0th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (8622) espnow_longrange: RSSI:-96 : data length is 100
I (8622) espnow_longrange: RSSI:0
I (8622) espnow_longrange: Receive 1th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (9622) espnow_longrange: RSSI:-96 : data length is 100
I (9622) espnow_longrange: RSSI:0
I (9622) espnow_longrange: Receive 2th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (10622) espnow_longrange: RSSI:-96 : data length is 100
I (10622) espnow_longrange: RSSI:0
I (10622) espnow_longrange: Receive 3th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (11622) espnow_longrange: RSSI:-96 : data length is 100
I (11622) espnow_longrange: RSSI:0
I (11622) espnow_longrange: Receive 4th unicast data from:
58:bf:25:9f:c0:60, len: 100
I (12622) espnow_longrange: RSSI:-96 : data length is 100
I (12622) espnow_longrange: RSSI:0
On Fri, 30 Sept 2022 at 11:44, Krishna Kumar ***@***.***>
wrote:
> I built it using esp-idf-4.4.2. - its my fault I haven't sent the
> bootloader and partition files` (See attached)
>
> It has to be flashed like this
> /home/krishnak/.espressif/python_env/idf4.4_py3.10_env/bin/python
> ../../../../../esp-idf-4.4.2/components/esptool_py/esptool/esptool.py -p
> (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32
> write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000
> build/bootloader/bootloader.bin 0x8000
> build/partition_table/partition-table.bin 0x10000 build/espnow_example.bin
>
> Can you let me know did you change anything in the source code I sent to
> get the RSSI - I print the rssi in two places, one of them is incorrect.
>
> If you did not have CONFIG_ESPNOW_ENABLE_LONG_RANGE=y when building this
> esp-now, then your chip will not have LR enabled - can you see the output
> log statements printed at the start (It will say whether LR is enabled or
> not)
>
> If NO LR is enabled then rssi will remain the same, when LR is enabled -
> broadcast will be done in normal mode, so rssi will appear correctly. When
> unicast data starts - rssi will become -96. Please check and let me know.
>
> On Fri, 30 Sept 2022 at 10:41, glenn20 ***@***.***> wrote:
>
>> espnow_example_withoutlr.zip
>> <https://github.com/glenn20/micropython-espnow-images/files/9675950/espnow_example_withoutlr.zip>
>> espnow_example_withLR.zip
>> <https://github.com/glenn20/micropython-espnow-images/files/9675951/espnow_example_withLR.zip>
>>
>> Great - thanks. Also - can you tell me which version of the IDF you are
>> using to build these examples and which esp32 devices these are compiled
>> for? These bins just reboot continuously.
>>
>> I have built them fresh using your source code and IDF from master and
>> from v4.4 - and I see no significant difference between the reported RSSI
>> when LR mode is enable or not enabled. (However that is for several devices
>> placed fairly close together - maybe the difference is only significant for
>> low RSSI signals).
>>
>> Oh - BTW, CONFIG_ESPNOW_ENABLE_LONG_RANGE=y is only used in the example
>> code - it is not used when building any other code (ie. it has no effect
>> when building micropython).
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#30 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AAJTPNZ5GN7USEWINUSQV3TWAZY7PANCNFSM6AAAAAAQWNNAP4>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
Here is the output from running the code you sent me (with a few minor additions - like printing out the protocol bitmask). With LR_MODE on (see the line Protocol=15):
With LR_MODE off (see the line Protocol=7)
|
I confess that I don't understand LR_MODE sufficiently to know what effect we should be seeing in the RSSI values. I also don't understand why the RSSI values drop to -94 (-92 on another device) when receiving unicast messages. I don't see that behaviour in micropython. These teste were with IDF 4.4, but I get the same results with idf from master. |
That RSSI dropping to -94 is just an indication that the promiscuous mode
packets are no longer present and not necessarily an indication that LONG
range is in action.
I added that log statement inside parse data method - where it is always
showing -94 or 96 or -92 depending on the board, so I assume that if there
is some error in the getrssi method it just returns a random value < -90
I might have been wrong in saying that I am seeing an increased range (as
it is only an extra brick wall and 10 ft distance - it could have been a
chance position of the direction of the board etc.
…On Fri, 30 Sept 2022 at 14:09, glenn20 ***@***.***> wrote:
I confess that I don't understand LR_MODE sufficiently to know what effect
we should be seeing in the RSSI values.
I also don't understand why the RSSI values drop to -94 (-92 on another
device) when receiving unicast messages. I don't see that behaviour in
micropython.
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTPN6KZEMIUFXW3WDWNCDWA2RK7ANCNFSM6AAAAAAQWNNAP4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I actually avoided the broadcast address altogether by compiling two
different codes with the appropriate mac_id's of the other device. That is
when I felt I had that extra range. The RSSI experiment was to prove that
my belief of extra range is correct.
On Fri, 30 Sept 2022 at 16:31, Krishna Kumar ***@***.***>
wrote:
… That RSSI dropping to -94 is just an indication that the promiscuous mode
packets are no longer present and not necessarily an indication that LONG
range is in action.
I added that log statement inside parse data method - where it is always
showing -94 or 96 or -92 depending on the board, so I assume that if there
is some error in the getrssi method it just returns a random value < -90
I might have been wrong in saying that I am seeing an increased range (as
it is only an extra brick wall and 10 ft distance - it could have been a
chance position of the direction of the board etc.
On Fri, 30 Sept 2022 at 14:09, glenn20 ***@***.***> wrote:
> I confess that I don't understand LR_MODE sufficiently to know what
> effect we should be seeing in the RSSI values.
>
> I also don't understand why the RSSI values drop to -94 (-92 on another
> device) when receiving unicast messages. I don't see that behaviour in
> micropython.
>
> —
> Reply to this email directly, view it on GitHub
> <#30 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAJTPN6KZEMIUFXW3WDWNCDWA2RK7ANCNFSM6AAAAAAQWNNAP4>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
@krishnak - thanks for investigating this issue. Unfortunately, I think it is sufficiently unclear what, if any, effect we will see on the measured rssi values of engaging LR_MODE. I am thinking that the ony definitive method for checking if LR_MODE is successfully engaged (and what benefit it provides) will
I will close this issue since we have resolved the initial issue about setting the rate and I'm not sure that continuing the discussion about the meaning of the RSSI values will be producitive without the kind of range testing described above (although I am still puzzled about why the unicast rssi values in the example codes jump down to less than -90) - but that is not happening with my micropython images). Feel free to respond or continue the discussion here and I will keep following it, but this will be marked as a closed Issue. |
I looked at the video, and also the code - the broadcast code is writtenin C and the receiver in Arduino. Nothing fancier than what we have tried, he has used an older SDK - his code doesn't compile with SDK 4.4.2. Coming to the video and their claims, they all are "Youtube videos". A lightwave can have have as much range as possible if it has sufficient signal strength, the criteria is that it works in line of sight. The boards have a receiver sensitivity of around -90dB - no signal is received if the signal strength is below this value in long range or regular mode. I was hoping that there will be an increased signal sensitivity by enabling long range. It may be the case that it can be measured only if it is in line of sight for microwave tower builders and not for indoor use. Ti's CC1120 sub GHz module has a sensitivity of around -125dB, ofcourse it is not possible to achieve that sensitivity with 2.4Ghz frequencies. With that module, if the Tx is inside a room with brickwalls and a small window, you can receive data with 0 packet loss up to 300m - they claim to have a range of over 100Km - I have those development boards :) |
gives
The text was updated successfully, but these errors were encountered: