Support Seeed SenseCAP Indicator
Legend!
Very nice!
That diagram is quite nice at detailing how this device makes use of the esp32-s3 and pico and other stuff
Feel free to do this in another patch, just noting that it looks like the SenseCAP Indicator can accept UF2 files, so we should be sure to generate those.
Ed -- there are two versions of the device, the meshtastic one is ESP2. It does still offer the drag-and-drop file interface, but I am not sure what file type it may take :)
Ed -- ESP32-S3 and RP2040 Dual-MCU head explodes
Ed -- ESP32-S3 and RP2040 Dual-MCU head explodes
I have this D1L version with esp32-s3 and rp2040. Meshtastic is running on the esp32-s3. The rp2040 can be used for custom sensors that can be programmed individually by the user (e.g. home automation stuff). Only the rp2040 will accept uf2 files which are therefore not provided by the meshtastic project.
OK, I've now got everything setup on my end -- let me know if you need any testing or if I can save you time by looking into anything
OK, I've now got everything setup on my end -- let me know if you need any testing or if I can save you time by looking into anything
The LoRa radio needs to be implemented and tested, especially the DIO GPIOs. They sit behind an IO expander port...
And you can try to figure out why it is saying "Write direction reg failed"
INFO | ??:??:?? 2 Radio freq=869.525, config.lora.frequency_offset=0.000
INFO | ??:??:?? 2 Set radio: region=EU_868, name=LongFast, config=0, ch=0, power=27
INFO | ??:??:?? 2 Radio myRegion->freqStart -> myRegion->freqEnd: 869.400024 -> 869.650024 (0.250000 MHz)
INFO | ??:??:?? 2 Radio myRegion->numChannels: 1 x 250.000kHz
INFO | ??:??:?? 2 Radio channel_num: 1
INFO | ??:??:?? 2 Radio frequency: 869.525024
INFO | ??:??:?? 2 Slot time: 77 msec
INFO | ??:??:?? 2 Set radio: final power level=22
[ 2715][D][esp32-hal-gpio.c:110] __pinMode(): esp_io_expander_set_dir(IO00, 1)
E (4783) tca95xx_16: write_direction_reg(131): Write direction reg failed
E (4783) io_expander: esp_io_expander_set_dir(55): Write direction reg failed
[ 3733][D][esp32-hal-gpio.c:163] __digitalWrite(): esp_io_expander_set_level(IO00 --> 1)
E (5805) tca95xx_16: write_direction_reg(131): Write direction reg failed
E (5805) io_expander: esp_io_expander_set_level(82): Overwrite direction reg failed
https://github.com/mverch67/arduino-esp32/blob/4de91179859a97e3c2777988901947c335b06f15/cores/esp32/esp_io_expander.c#L33
maybe this helps?
In file included from C:/Users/thomas/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-dac.h:28,
from C:/Users/thomas/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:85,
from C:/Users/thomas/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36,
from src/configuration.h:27,
from src/sleep.cpp:1:
src/sleep.cpp: In function 'void doDeepSleep(uint32_t, bool)':
C:/Users/thomas/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/driver/include/driver/gpio.h:52:87: warning: left shift count >= width of type [-Wshift-count-overflow]
#define GPIO_IS_VALID_OUTPUT_GPIO(gpio_num) ((gpio_num & 0x40) || (((1ULL << (gpio_num)) & SOC_GPIO_VALID_OUTPUT_GPIO_MASK) != 0))
^
src/sleep.cpp:268:9: note: in expansion of macro 'GPIO_IS_VALID_OUTPUT_GPIO'
if (GPIO_IS_VALID_OUTPUT_GPIO(LORA_CS)) {
maybe this helps?
This is not an issue. The problem is that all I2C communication to the IO expander fails with timeout error (263).
INFO | ??:??:?? 4 Radio freq=869.525, config.lora.frequency_offset=0.000
INFO | ??:??:?? 4 Set radio: region=EU_868, name=LongFast, config=0, ch=0, power=27
INFO | ??:??:?? 4 Radio myRegion->freqStart -> myRegion->freqEnd: 869.400024 -> 869.650024 (0.250000 MHz)
INFO | ??:??:?? 4 Radio myRegion->numChannels: 1 x 250.000kHz
INFO | ??:??:?? 4 Radio channel_num: 1
INFO | ??:??:?? 4 Radio frequency: 869.525024
INFO | ??:??:?? 4 Slot time: 77 msec
INFO | ??:??:?? 4 Set radio: final power level=22
[ 4916][I][esp32-hal-gpio.c:110] __pinMode(): esp_io_expander_set_dir(IO00, 1)
[ 4932][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=0
[ 4940][I][esp32-hal-gpio.c:163] __digitalWrite(): esp_io_expander_set_level(IO00 --> 1)
[ 4949][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=0
[ 4957][D][esp_io_expander_tca95xx_16bit.c:149] read_output_reg(): value=65535
[ 4965][I][esp32-hal-gpio.c:110] __pinMode(): esp_io_expander_set_dir(IO03, 0)
[ 4973][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=0
[ 4981][I][esp_io_expander.c:188] write_reg(): reg=0x02 -> 00000008
[ 4988][D][esp_io_expander_tca95xx_16bit.c:159] write_direction_reg(): i2c(0) write values: 6 8 0
[ 5998][D][esp_io_expander_tca95xx_16bit.c:164] write_direction_reg(): *** result: 263
[ 6006][I][esp32-hal-gpio.c:110] __pinMode(): esp_io_expander_set_dir(IO02, 0)
[ 6014][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=8
[ 6022][I][esp_io_expander.c:188] write_reg(): reg=0x02 -> 0000000c
[ 6029][D][esp_io_expander_tca95xx_16bit.c:159] write_direction_reg(): i2c(0) write values: 6 12 0
[ 7039][D][esp_io_expander_tca95xx_16bit.c:164] write_direction_reg(): *** result: 263
[ 7048][I][esp32-hal-gpio.c:110] __pinMode(): esp_io_expander_set_dir(IO01, 1)
[ 7056][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=12
[ 7064][I][esp32-hal-gpio.c:163] __digitalWrite(): esp_io_expander_set_level(IO01 --> 0)
[ 7073][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=12
[ 7081][D][esp_io_expander_tca95xx_16bit.c:149] read_output_reg(): value=65535
[ 7089][I][esp_io_expander.c:188] write_reg(): reg=0x01 -> 0000fffd
[ 7096][D][esp_io_expander_tca95xx_16bit.c:136] write_output_reg(): i2c(0:0x20) write values: 2 253 255
[ 8106][E][esp_io_expander_tca95xx_16bit.c:139] write_output_reg(): [tca95xx_16] write_output_reg(139): Write output reg failed
[ 8119][E][esp_io_expander.c:104] esp_io_expander_set_level(): [io_expander] esp_io_expander_set_level(104): Write Output reg failed
[ 8132][I][esp32-hal-gpio.c:163] __digitalWrite(): esp_io_expander_set_level(IO01 --> 1)
[ 8141][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=12
[ 8149][D][esp_io_expander_tca95xx_16bit.c:149] read_output_reg(): value=65535
[ 8158][I][esp32-hal-gpio.c:163] __digitalWrite(): esp_io_expander_set_level(IO00 --> 0)
[ 8166][D][esp_io_expander_tca95xx_16bit.c:187] read_direction_reg(): value=12
[ 8174][D][esp_io_expander_tca95xx_16bit.c:149] read_output_reg(): value=65535
[ 8183][I][esp_io_expander.c:188] write_reg(): reg=0x01 -> 0000fffe
[ 8190][D][esp_io_expander_tca95xx_16bit.c:136] write_output_reg(): i2c(0:0x20) write values: 2 254 255
[ 9199][E][esp_io_expander_tca95xx_16bit.c:139] write_output_reg(): [tca95xx_16] write_output_reg(139): Write output reg failed
[ 9212][E][esp_io_expander.c:104] esp_io_expander_set_level(): [io_expander] esp_io_expander_set_level(104): Write Output reg failed
[ 10224][E][esp_io_expander_tca95xx_16bit.c:123] read_input_reg(): [tca95xx_16] read_input_reg(123): Read input reg failed
[ 10236][E][esp_io_expander.c:119] esp_io_expander_get_level(): [io_expander] esp_io_expander_get_level(119): Read input reg failed
The problem is that all I2C communication to the IO expander fails with timeout error (263).
Reason for the non-functional I2C seems lovyanGFX. I've seen this before when I tried to get T-Deck running with lovyanGFX. It has some weird impact on SPI/I2C...
The problem is that all I2C communication to the IO expander fails with timeout error (263).
Reason for the non-functional I2C seems lovyanGFX. I've seen this before when I tried to get T-Deck running with lovyanGFX. It has some weird impact on SPI/I2C...
If we can figure it out, they've been open to PRs in the past.
DEBUG | ??:??:?? 3 SX126xInterface(cs=64, irq=67, rst=65, busy=66)
DEBUG | ??:??:?? 3 SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage
INFO | ??:??:?? 3 Starting meshradio init...
DEBUG | ??:??:?? 3 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=0, time 231 ms
DEBUG | ??:??:?? 3 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=253, time 2115 ms
INFO | ??:??:?? 3 Radio freq=869.525, config.lora.frequency_offset=0.000
INFO | ??:??:?? 3 Set radio: region=EU_868, name=LongFast, config=0, ch=0, power=27
INFO | ??:??:?? 3 Radio myRegion->freqStart -> myRegion->freqEnd: 869.400024 -> 869.650024 (0.250000 MHz)
INFO | ??:??:?? 3 Radio myRegion->numChannels: 1 x 250.000kHz
INFO | ??:??:?? 4 Radio channel_num: 1
INFO | ??:??:?? 4 Radio frequency: 869.525024
INFO | ??:??:?? 4 Slot time: 77 msec
INFO | ??:??:?? 4 Set radio: final power level=22
INFO | ??:??:?? 4 SX126x init result 0
INFO | ??:??:?? 4 Frequency set to 869.525024
INFO | ??:??:?? 4 Bandwidth set to 250.000000
INFO | ??:??:?? 4 Power output set to 22
DEBUG | ??:??:?? 4 Current limit set to 140.000000
DEBUG | ??:??:?? 4 Current limit set result 0
DEBUG | ??:??:?? 4 Setting DIO2 as RF switch
DEBUG | ??:??:?? 4 SX126X_RXEN not defined, defaulting to RADIOLIB_NC
DEBUG | ??:??:?? 4 SX126X_TXEN not defined, defaulting to RADIOLIB_NC
DEBUG | ??:??:?? 4 Using MCU pin -1 as RXEN and pin -1 as TXEN to control RF switching
INFO | ??:??:?? 4 Set RX gain to boosted mode; result: 0
INFO | ??:??:?? 4 SX126xInterface<T>::startReceive()
INFO | ??:??:?? 4 SX126xInterface<T>::setStandby()
INFO | ??:??:?? 4 SX1262 Radio init succeeded, using SX1262 radio
I have tested this and it works!
For the display support (CS pin behind IO expander) I needed to tweak a little the lovyanGFX lib. It looks for esp32 the authors used some code optimizations, but this avoids using the arduino hal which is a problem, because I added the IO expander stuff under the hood of the arduino hal layer so that libraries are usually not affected by the IO expander and can transparently pass the GPIO pins.