Delete Pycom Firmware from Lopy and use it as native ESP32 platform?
-
Is it possible to clear the Pycom Bootloader/Firmware on a Lopy, and use it as native ESP32 platform? I would like to program it with my familiar toolchain (C++, using PlatformIO IDE) using either ESP-IDF or ESP32 Arduino framework.
Currently i'm developing on chinaboards with similar features (ESP32, Wifi, LoRa, Bluetooth) like Heltec Lora-32 and TTGO, but those chinaboards have too many quality issues. That's why i want to try LoPy, but i need to get my C++ code based on LMiC from arduino framework running on the LoPy. So no Python wanted.
-
@Verkehrsrot did you manage to get lopy4 work with platformio ? if yes how did you access teh sigfox or lora functions from cpp ?
thanks for your hints
-
I found the c++ code for switching the wifi antenna here:
Implemented this in my c++ application, and it works.
Thank you for helping on this.
-
On the LoPy, SiPy and WiPy2 the WiFi antenna select is on
GPIO16
, on the LoPy4, GPy, FiPy and WiPy 3.0 its connected toGPIO21
.There is a currently a bug in the firmware where all modules are using
GPIO16
, this is being fixed in the next release.
-
@verkehrsrot Pretty sure. Look into the Pin-Outs for LoPy; https://docs.pycom.io/chapter/datasheets/development/lopy.html
and LoPy4:
https://docs.pycom.io/chapter/datasheets/development/lopy4.html
or the source code around https://github.com/pycom/pycom-micropython-sigfox/blob/master/esp32/main.c#L132
-
@robert-hh said in Delete Pycom Firmware from Lopy and use it as native ESP32 platform?:
Take care to enabel the WiFi antenna. On Lopy, the switch is connected to GPIO16, on LoPy4 to GPIO12.
Sure that GPIO16 is the Wifi antenna switch, and NOT the LoRa RX/TX switch?
-
@verkehrsrot I do not know PlatformIO so I cannot tell what to do. I would just use a similar board.
As for LoPy vs Lopy4, go for LoPy4. It has a larger flash and the external RAM, and supports Low Power modes. And it is the actual device. I do not expect LoPy's to me manufactured again after the devices on stock have bee sold.
-
Thank you for your reply! That's good news, looks like i can get rid of that crappy china boards this way.
Do you know how to add the Lopy board to PlatformIO? Unfortunately it's not in the board list yet.
Is it useful to buy a Lopy4 instead of a Lopy? Price is nearly the same, but i don't need Sigfox, since i am using LoRa with TheThingsNetwork.
-
@verkehrsrot After a flash erase it's a ESP32 module with an additional LoRa chip connected to GPIO5, 19 and 27. You can always switch between the firmware versions. A LoPy4 has additional PSRAM.
Take care to enabel the WiFi antenna. On Lopy, the switch is connected to GPIO16, on LoPy4 to GPIO12.