I’m working on using Lora module with Esp32, I have added the library from the original code provided bt NiceRF here
Library Compiles fine and the mongoose app compiles fine and uploads to ESP32.
The Problem is that I keep getting these line when the program reaches the point it will setup the Lora Module, which uses SPI for communication.
[Jul 15 07:01:26.812] esp32_gpio.c:79 GPIO9 is used by SPI flash, don't use it
[Jul 15 07:01:26.812] esp32_gpio.c:79 GPIO8 is used by SPI flash, don't use it
[Jul 15 07:01:26.812] esp32_gpio.c:79 GPIO7 is used by SPI flash, don't use it
[Jul 15 07:01:26.813] esp32_gpio.c:79 GPIO10 is used by SPI flash, don't use it
in my mos.yml i made sure i have enables the SPI and set the configration as follow:
#SPI
- ["spi", "o", {title: "SPI settings"}]
- ["spi.enable", "b", true, {title: "Enable SPI"}]
- ["spi.debug", "b", false, {title: "Debug SPI bus activity"}]
- ["spi.unit_no", "i", 3, {title: "Which SPI unit to use, 2 or 3"}]
- ["spi.miso_gpio", "i", 19, {title: "GPIO to use for MISO"}]
- ["spi.mosi_gpio", "i", 23, {title: "GPIO to use for MOSI"}]
- ["spi.sclk_gpio", "i", 18, {title: "GPIO to use for SCLK"}]
- ["spi.cs0_gpio", "i", 5, {title: "GPIO to use for CS0"}]
The cal for SPI is in the Lora.cpp file under this function:
void LORA::spiInit()
{
SPI.begin();
//init slave select pin
pinMode(_NSSPin, OUTPUT);
digitalWrite(_NSSPin, HIGH);
// depends on LORA spi timing
SPI.setBitOrder(MSBFIRST);
// too fast may cause error
//SPI.setClockDivider(SPI_CLOCK_DIV16);
SPI.setDataMode(SPI_MODE0);
}
I can’t figre out why the SPI zero being used insted of three even thogh SPI3 is initialized as see in the next line.
[Jul 15 05:00:55.335] esp32_spi_master.c:93 SPI3 init ok (MISO: 19, MOSI: 23, SCLK: 18; CS0/1/2: 5/-1/-1; native? yes)
I appreciate the help.
for reference libraries included are:
- origin: https://github.com/mongoose-os-libs/spi
#Arduino Lib
- origin: https://github.com/mongoose-os-libs/arduino-compat
- origin: https://github.com/mongoose-os-libs/arduino-onewire
- origin: https://github.com/mongoose-os-libs/arduino-spi