ESP32 Long Range Mode 1 km

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ESP32 Long Range Mode 1 km

Post by pythoncoder » Sun Oct 06, 2019 5:44 pm

It's far from obvious to me how you'd do this ;) Note that the AP presumably creates one socket for each connected device, so presumably you'd need to create N sockets for the station interface to maintain a 1:1 mapping.

In many applications a lack of efficiency may not be an issue. Typical data rates from sensors to MQTT brokers are low.

I'll leave that one to someone who actually knows what they are doing.
Peter Hinch
Index to my micropython libraries.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP32 Long Range Mode 1 km

Post by kevinkk525 » Sun Oct 06, 2019 5:59 pm

It wouldn't be a direct bridge. I doubt that it is even possible to have a 1:1 socket mapping. Our tests for micropython-iot clearly showed that each device should better only have one outgoing socket open to be able to keep the connection reliable.
So on the ESP that is the bridge between AP and STA you would read the messages sent to the ESP by all n sockets and write those messages with the corresponding source IP/ID to the STA socket that is maybe connected to an MQTT broker.
The esp would then be an MQTT proxy and not a real bridge.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
iotman
Posts: 52
Joined: Sat Feb 02, 2019 4:06 pm
Location: Nanoose Bay, Canada
Contact:

Re: ESP32 Long Range Mode 1 km

Post by iotman » Sun Oct 06, 2019 7:40 pm

Hi, I was thinking it could work much the same as how we receive BLE data, then switch off BLE and transmit MQTT with Wifi, but instead of transmitting the BLE data with MQTT, we would forward the data via the new LR mode to another ESP32, which subsequently transmits the data via MQTT.

I suppose that's not terribly efficient but for sporadic sensor monitoring it may work just fine. I'm still waiting for the BLE solution for the ESP32 (which is apparently imminent), then I will try it (if it is possible to use LR mode with MicroPython). I guess I'm probably getting a bit ahead of my skiis here ...

By the way, I just heard from Andreas that he is publishing the second article today or tomorrow for Patreon users, so it should show up on Youtube later this week.

Regards, AB

User avatar
iotman
Posts: 52
Joined: Sat Feb 02, 2019 4:06 pm
Location: Nanoose Bay, Canada
Contact:

Re: ESP32 Long Range Mode 1 km

Post by iotman » Mon Oct 07, 2019 3:25 pm

Hi, so we did get the second video from Andreas Speiss on Patreon yesterday, but his results were not that encouraging. It seems that perhaps because the LR mode does not reduce bandwidth, it is not all that effective - certainly not in comparison to a LoRa board.

Nevertheless, he did get the claimed 1 km of range, so he confirmed that it does work. It may be useful, depending on the situation, but we will probably use a LoRa board instead.

The video does contain, as usual from Andreas, a lot of really useful information and it is certainly worth watching.

Regards, AB

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: ESP32 Long Range Mode 1 km

Post by devnull » Tue Oct 08, 2019 9:54 am

I could not find the second video, can you post a link ??

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: ESP32 Long Range Mode 1 km

Post by jimmo » Tue Oct 08, 2019 11:06 am

devnull wrote:
Tue Oct 08, 2019 9:54 am
I could not find the second video, can you post a link ??
I think they're saying it's only available to Patreon supporters, and will be publicly available in a few days time?

User avatar
iotman
Posts: 52
Joined: Sat Feb 02, 2019 4:06 pm
Location: Nanoose Bay, Canada
Contact:

Re: ESP32 Long Range Mode 1 km

Post by iotman » Tue Oct 08, 2019 12:44 pm

Hi, yes, we support Andreas on Patreon.com (and others). He releases the videos and articles there first, then later on youtube.

Regards, AB

uCTRL
Posts: 47
Joined: Fri Oct 12, 2018 11:50 pm

Re: ESP32 Long Range Mode 1 km

Post by uCTRL » Sun Nov 03, 2019 11:03 am

Bumping this thread.

Is there any information available on the status of micropython using WiFi Long range mode with ESP32?
As I understand it is a proprietary 802.11LR mode.
It is functional in the ESP-IDF and supported by Pycom micropython port.

quote from the link below.
Enabling the mode is a simple function call, with no other changes to your code needed to flip your ESP32 into the LR mode.
https://www.hackster.io/news/long-range ... 29ab89f450

More info links:

https://github.com/espressif/arduino-esp32/issues/1529

https://docs.espressif.com/projects/esp ... tocol-mode

https://github.com/jnogues/ESP32-Long-Range-WiFi

Link to Pycom-esp-idf, esp_wifi_types.h
  • #define WIFI_PROTOCOL_11B 1
    #define WIFI_PROTOCOL_11G 2
    #define WIFI_PROTOCOL_11N 4
    #define WIFI_PROTOCOL_LR 8
https://github.com/pycom/pycom-esp-idf/ ... fi_types.h

Assuming that micropython file "micropython/ports/esp32/modnetwork.c " contains relevant info then it looks like there is currently no inclusion of WIFI_PROTOCOL_LR mode?
  • #if MODNETWORK_INCLUDE_CONSTANTS
    { MP_ROM_QSTR(MP_QSTR_STA_IF), MP_ROM_INT(WIFI_IF_STA)},
    { MP_ROM_QSTR(MP_QSTR_AP_IF), MP_ROM_INT(WIFI_IF_AP)},

    { MP_ROM_QSTR(MP_QSTR_MODE_11B), MP_ROM_INT(WIFI_PROTOCOL_11B) },
    { MP_ROM_QSTR(MP_QSTR_MODE_11G), MP_ROM_INT(WIFI_PROTOCOL_11G) },
    { MP_ROM_QSTR(MP_QSTR_MODE_11N), MP_ROM_INT(WIFI_PROTOCOL_11N) },
https://github.com/micropython/micropyt ... dnetwork.c

poesel
Posts: 22
Joined: Sun Oct 20, 2019 4:58 pm

Re: ESP32 Long Range Mode 1 km

Post by poesel » Sun Nov 03, 2019 12:20 pm

iotman wrote:
Sun Oct 06, 2019 3:03 pm
We are using the ESP32 as a "range enhancer/converter" to aggregate sensors and convert the data to MQTT for cloud applications and Node-RED.
Not to derail this topic but this is just what I'm working on. Collecting data from several bee hive scales and send it per MQTT (per LoRa, LTE or WLAN).
Is your work public?
Thanks.

User avatar
iotman
Posts: 52
Joined: Sat Feb 02, 2019 4:06 pm
Location: Nanoose Bay, Canada
Contact:

Re: ESP32 Long Range Mode 1 km

Post by iotman » Sun Nov 03, 2019 5:07 pm

Hi, we are still waiting for the bluetooth BLE capability (Micropython version) to be available for the ESP32, so we really haven't started this project yet.

Someone has already done the Arduino version of it quite a while ago; here is a link, if you're interested:

https://www.instructables.com/id/ESP32- ... Bluetooth/

Cheers, AB

Post Reply