Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.

Overview

Documentation Status

Espressif IoT Solution Overview

ESP-IoT-Solution contains device drivers and code frameworks for the development of IoT system, which works as extra components of ESP-IDF and much easier to start.

ESP-IoT-Solution contains following contents:

  • Device drivers for sensors, display, audio, input, actuators, etc.
  • Framework and documentation for Low power, security, storage, etc.
  • Guide for espressif open source solutions from practical application point.

Documentation Center

Versions

ESP-IoT-Solution Dependent ESP-IDF Major Change User Guide Support State
master release/v4.3 code structure change, add support for ESP32-S2 Docs online active, new feature develop
release/v1.1 v4.0.1 IDF version update, remove no longer supported code v1.1 Overview limited support
release/v1.0 v3.2.2 legacy version v1.0 Overview archived

Quick Reference

Development Board

You can choose any of the ESP32/ESP32-S series development boards to use ESP-IoT-Solution, or choose one of the boards supported in boards component to quick start.

Powered by 40 nm technology, ESP32/ESP32-S series SOC provides a robust, highly integrated platform, which helps meet the continuous demands for efficient power usage, compact design, security, high performance, and reliability.

Setup Build Environment

Setup ESP-IDF Environment

ESP-IoT-Solution is developed based on ESP-IDF functions and tools, so ESP-IDF development environment must be setup first, you can refer Setting up Development Environment for the detailed steps.

Please note that different versions of ESP-IoT-Solution may depend on different versions of ESP-IDF, please refer to Versions for details.

Get ESP-IoT-Solution

  • If select the master version, open terminal, and run the following command:

    git clone --recursive https://github.com/espressif/esp-iot-solution
    
  • If select the release/v1.1 version, open terminal, and run the following command:

    git clone -b release/v1.1 --recursive https://github.com/espressif/esp-iot-solution
    

For other versions, replace release/v1.1 with the target branch name

Create Your Project

You can use the components of ESP-IoT-Solution in the following methods:

Method 1. Add all components' PATH of ESP-IoT-Solution to the project

Add the following code directly to the project's CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

include($ENV{IOT_SOLUTION_PATH}/component.cmake)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

project(empty-project)

Method 2. Add specified components' PATH of ESP-IoT-Solution to the project

Add the following code directly to the project's CMakeLists.txt, please add the REQUIRES components also:

set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} ${IOT_SOLUTION_PATH}/components/{component_you_choose}")

Method 3. Copy specified components of ESP-IoT-solution to the project's components directory

Please copy the REQUIRES components together.

Note: CMake based build system is recommended (default in IDF v4.0 and later). If using GNU Make, you can refer legacy build system based on GNU Make.

Set up the environment variables

Add ESP-IDF environment variables:

  • For Windows CMD terminal, run the following command:

    %userprofile%\esp\esp-idf\export.bat
    
  • For Linux or macOS terminal, run the following command:

    . $HOME/esp/esp-idf/export.sh
    

Add IOT_SOLUTION_PATH environment variables:

  • For Windows CMD terminal, run the following command:

    set IOT_SOLUTION_PATH=C:\esp\esp-iot-solution
    
  • For Linux or macOS terminal, run the following command:

    export IOT_SOLUTION_PATH=~/esp/esp-iot-solution
    

Note:

  1. Please replace the example path with your actual installation path.
  2. The environment variables set above only valid for the current terminal. please re-run the command if open new terminal.

Resources

Issues
  • Unable to use I2S LCD mode with 8-bit parallel

    Unable to use I2S LCD mode with 8-bit parallel

    I have ported over an ILI9488 display with an init sequence that's known to work on other libraries. However I'm noticing the code expects 16 bit commands/registers, and there are no provisions on the code to check for 8 bit data paths for registers. In fact it seems that the 8 bit defines are just plain wrong for the combination of displays with 8 bit commands and 8 bit bus (https://github.com/espressif/esp-iot-solution/blob/db36832d90b0077bc7fa5a455b789497f8a12911/components/i2s_devices/lcd_common/i2s_lcd_com.c#L36 is pretty telling in this regard).

    When connected via a 16 bit bus the top byte/8 lines are ignored, but as far as I can tell on 8 bits bus the ILI commands are seemingly being cancelled by NOPs when the bytes are swapped (high byte is 0x0). I unfortunately can't follow up on this suspicion right now as I don't have a logic analyser handy. I do know that the connections are right and I do know that bit banging the GPIOs as a bus works. I suspect there could be something weird with the WS clock but first I'd like to make sure that my reading of i2s_lcd_com makes any sense...

    For kicks, I also attempted to port over ILI9341 as 8-bit parallel I2S; everything is royally garbled there but I can see some thin strips with parts of what the original image is supposed to be. So I'm still hoping it's just misconfigured somehow...

    opened by classic-gentleman 26
  • No output on OLED on i2c using ESP32-Azure-IoT Kit (ESP32-WROVER-B)

    No output on OLED on i2c using ESP32-Azure-IoT Kit (ESP32-WROVER-B)

    Environment

    • Development Kit: ESP32-Azure IoT Kit
    • Kit version:
    • Module or chip used: ESP32-Wrover-B
    • IDF version: v3.2-2
    • Build System: Make
    • Compiler version: xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0
    • Operating System: Linux (via WSL)
    • Power Supply: USB

    Problem Description

    Hi, I have the Azure IoT board and I am having an issue with the OLED displaying the output from the example application from esp32_azure_iot_kit from the examples in the esp-iot-solution repo. I am using the sample as is without any changes as yet but I am planning to enhance this application to write to Azure IoT using the esp-azure sdk.

    Before I do this I need to ensure that the board and all sensors are working correctly. Looking at the monitor the application is working correctly and I can see the data being captured from sensors and shown in monitor. The issue is that this data it is not showing up on the OLED. Please Note before I used the example from this repo and powered the board the OLED was working and displaying data/output as it should. It was only when I started using the example so that I could develop against it (have not as yet) did I start having issues.

    I have run i2cdetect and it is not showing anything. (see screenshots I have attached)

    Expected Behavior

    Application to run and sensor data to display on OLED

    Actual Behavior

    Application runs but no sensor data is displayed on OLED

    Steps to repropduce

    1. Clone esp-iot-solution repo and make flash monitor application
    2. Review monitor to see data is coming through accurately, push button to see that application changes to different sensor data and monitor displays data
    3. Notice that no data is displayed at all on OLED.

    // It helps if you attach a picture of your setup/wiring here. Pictures attached below, as well as zip file with .elf file and sdkconfig.

    Other items if possible

    • [X ] sdkconfig file (attach the sdkconfig file from your project folder)
    • [ X] elf file in the build folder (note this may contain all the code details and symbols of your project.)
    • [ ] coredump (This provides stacks of tasks.)

    esp-iot-solution
i2cdetect
-monitor2 esp-iot-solution-wiring esp-iot-solution-monitor1

    FileforDebug.zip i2cdetect

    opened by tawalke 25
  • Support for TK043F1569 (16 bit parallel RGB mode)

    Support for TK043F1569 (16 bit parallel RGB mode)

    Problem Description

    I recently purchased 2x displays with adapters to use with the ESP32 DevKit V4 (WROVER-IE) and the Espressif LCDKit v1.1 Based on advice from EspressIf (TK043F1508 ) and from users (link below) I ordered what I thought was the correct module. https://github.com/espressif/esp-iot-solution/issues/89#issue-674226075

    I purchased the display modules from the following link: https://buy.tbfocus.com/item.php?id=560872117142#3512775208514

    Upon receiving the modules I find that the pins are (slightly different) but more important that the controller has changed from NT35510 or RM68120 to LG4572

    Expected Behavior

    Any chance to get a driver adapted to support the LG4572 when used together with the DevKit and LCDKit mentioned above?

    Photo of modules I purchased: FC_20210408_0026

    Datasheet of controller: Datasheet.hk_lg4572b_8093633.pdf

    opened by ammaree 19
  • Db/access user data from callbacks

    Db/access user data from callbacks

    As of now the user does not have a way to access their own data in the callbacks. This solves that problem.

    The problem arose when i was trying to queue a button event to a queue that was owned by a class.

    opened by bennettbe 10
  • programming esp-01

    programming esp-01

    i want to use esp-prog to program esp-01

    connection are:

    esp-prog / esp-01

    TX / rx RX / tx I00 / i00 EN / RST (tryed also on CH_PD) GND / GND usb conn. / +V (external source) -- / CH-PD with pullup 10k -- / i02 to pullup 10k

    the blue light flash when i start to program

    i try with program like esp8266flasher, inside visual studio (with visualmicro),ESPFlashDownloadTool_v3.6.4

    when the green light flash, also on the esp01 flash the blue light

    noone of this can program, what is the trick?

    thanks

    opened by fastlink30 10
  • about USB CDC 4G Module 示例程序 :  HCD_PIPE_EVENT_ERROR_STALL

    about USB CDC 4G Module 示例程序 : HCD_PIPE_EVENT_ERROR_STALL

    I (24) boot: ESP-IDF v4.4-dev-2184-g166c30e7b-dirty 2nd stage bootloader I (24) boot: compile time 16:02:41 I (24) boot: chip revision: 0 I (28) qio_mode: Enabling default flash chip QIO I (33) boot.esp32s2: SPI Speed : 80MHz I (38) boot.esp32s2: SPI Mode : QIO I (43) boot.esp32s2: SPI Flash Size : 4MB I (48) boot: Enabling RNG early entropy source... I (53) boot: Partition Table: I (57) boot: ## Label Usage Type ST Offset Length I (64) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (71) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (79) boot: 2 factory factory app 00 00 00010000 00100000 I (86) boot: End of partition table I (91) esp_image: segment 0: paddr=00010020 vaddr=3f000020 size=1912ch (102700) map I (117) esp_image: segment 1: paddr=00029154 vaddr=3ffcbc30 size=031ech ( 12780) load I (119) esp_image: segment 2: paddr=0002c348 vaddr=40024000 size=03cd0h ( 15568) load I (126) esp_image: segment 3: paddr=00030020 vaddr=40080020 size=79844h (497732) map I (216) esp_image: segment 4: paddr=000a986c vaddr=40027cd0 size=13f5ch ( 81756) load I (235) esp_image: segment 5: paddr=000bd7d0 vaddr=50000000 size=00010h ( 16) load I (246) boot: Loaded app from partition at offset 0x10000 I (246) boot: Disabling RNG early entropy source... I (258) cache: Instruction cache : size 16KB, 4Ways, cache line size 16Byte I (258) cpu_start: Pro cpu up. I (260) cache: flash_count=1, size=16, spiram_count=0, size=0,together=0 I (268) cache: Flash wrap enabled, size = 16. I (284) cpu_start: Pro cpu start user code I (284) cpu_start: cpu freq: 240000000 I (284) cpu_start: Application information: I (289) cpu_start: Project name: cdc_4g I (294) cpu_start: App version: e7f7cda-dirty I (299) cpu_start: Compile time: Aug 3 2021 19:11:48 I (305) cpu_start: ELF file SHA256: b0b44e1ee0f79092... I (311) cpu_start: ESP-IDF: v4.4-dev-2184-g166c30e7b-dirty I (318) heap_init: Initializing. RAM available for dynamic allocation: I (326) heap_init: At 3FF9E000 len 00002000 (8 KiB): RTCRAM I (332) heap_init: At 3FFD35E8 len 00028A18 (162 KiB): DRAM I (338) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (344) spi_flash: detected chip: generic I (349) spi_flash: flash io: qio I (356) cpu_start: Starting scheduler on PRO CPU. I (614) main: ==================================== I (614) main: ESP 4G Cat.1 Wi-Fi Router I (614) main: ==================================== I (619) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (628) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (637) gpio: GPIO[16]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (647) USB_HCDC: Waitting 4G_moudle AT response I (652) USB_HCDC: usb driver install suceed I (657) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (666) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (927) USB_HCDC: Resetting Port

    I (987) USB_HCDC: Port speed = 1

    I (987) USB_HCDC: Pipe Default Created I (987) USB_HCDC: 1. Set Device Addr = 1 I (989) USB_HCDC: Set Device Addr Done I (993) USB_HCDC: 2. Sending set_config = 1 I (998) USB_HCDC: Config is set I (1002) USB_HCDC: 3. Sending set_line state itf= 0 dtr=1 rts=0 W (1008) USB_HCDC: line 400 Pipe: default HCD_PIPE_EVENT_ERROR_STALL E (1176) esp-modem-dte: esp_modem_dte_send_cmd(192): process command timeout response timeoutm_dce: esp_modem_dce_generic_command(31): Command:AT I (1181) modem_board: Current timeouts: 1 and errors: 0 E (6187) esp-modem-dte: esp_modem_dte_send_cmd(192): process command timeout W (6187) esp_modem_dce: esp_modem_dce_generic_command(31): Command:+++ response timeout E (6692) esp-modem-dte: esp_modem_dte_send_cmd(192): process command timeout response timeoutm_dce: esp_modem_dce_generic_command(31): Command:AT E (7197) esp-modem-dte: esp_modem_dte_send_cmd(192): process command timeout response timeoutm_dce: esp_modem_dce_generic_command(31): Command:AT I (7202) modem_board: Current timeouts: 2 and errors: 0 I (7208) modem_board: Restart to connect modem........ I (7214) modem_board: modem_board_reset!

    ===================================================================== the AT command timeout, and through 'lsusb -v' get the cat.1 module info as below

    bEndpointAddress 0x01 EP 1 OUT bEndpointAddress 0x82 EP 2 IN

    Bus 003 Device 055: ID 1782:4e00 Spreadtrum Communications Inc. Couldn't open device, some information will be missing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1782 Spreadtrum Communications Inc. idProduct 0x4e00 bcdDevice 0.00 iManufacturer 1 iProduct 2 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x00b4 bNumInterfaces 6 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 400mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 2 Communications bFunctionSubClass 6 Ethernet Networking bFunctionProtocol 0 iFunction 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 6 Ethernet Networking bInterfaceProtocol 0 iInterface 5 CDC Header: bcdCDC 1.10 CDC Union: bMasterInterface 0 bSlaveInterface 1 CDC Ethernet: iMacAddress 6 (??) bmEthernetStatistics 0x00000000 wMaxSegmentSize 1514 wNumberMCFilters 0x0000 bNumberPowerFilters 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 7 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 7 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x03 EP 3 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 4 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 7 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x04 EP 4 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 5 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 7 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x05 EP 5 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0

    =====================================================================

    opened by qq0901001 9
  • unit-test-app don't work.

    unit-test-app don't work.

    I tried unit-test-app, but error occure.

    Environment

    freeRTOS version:V8.2.0
    NEWLIB version:2.2.0
    lwIP version:2-0-3-255
    ESP-IDF version:v4.0-dev-311-g70eda3d22-dirty
    

    Problem Description

    unit-test-app don't work.

    Steps to repropduce

    $ cd MY_IOT_SOLUTION_PATH/tools/unit-test-app
    $ make erase_flash
    $ make defconfig
    $ make flash IOT_TEST_ALL=1 monitor
    
    --- idf_monitor on /dev/ttyUSB0 115200 ---
    --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
    Enabling RNG e?ets Jun  8 2016 00:22:57
    
    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:0x3fff0018,len:4
    load:0x3fff001c,len:5888
    ho 0 tail 12 room 4
    load:0x40078000,len:9188
    load:0x40080000,len:6084
    0x40080000: _WindowOverflow4 at /home/robotics/esp-iot-solution/submodule/esp-idf/components/freertos/xtensa_vectors.S:1779
    
    entry 0x4008032c
    0x4008032c: _KernelExceptionVector at ??:?
    
    I (30) boot: ESP-IDF v3.1.3 2nd stage bootloader
    I (30) boot: compile time 10:12:34
    I (30) boot: Enabling RNG early entropy source...
    I (34) boot: SPI Speed      : 40MHz
    I (39) boot: SPI Mode       : DIO
    I (43) boot: SPI Flash Size : 4MB
    I (47) boot: Partition Table:
    I (50) boot: ## Label            Usage          Type ST Offset   Length
    I (58) boot:  0 nvs              WiFi data        01 02 00009000 00004000
    I (65) boot:  1 otadata          OTA data         01 00 0000d000 00002000
    I (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000
    I (80) boot:  3 ota_0            OTA app          00 10 00010000 00100000
    I (87) boot:  4 ota_1            OTA app          00 11 00110000 00100000
    I (95) boot: End of partition table
    I (99) boot: No factory image, trying OTA 0
    I (104) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x269354 (2528084) map
    I (998) esp_image: segment 1: paddr=0x0027937c vaddr=0x3ffc0000 size=0x04350 ( 17232) load
    I (1005) esp_image: segment 2: paddr=0x0027d6d4 vaddr=0x40080000 size=0x00400 (  1024) load
    0x40080000: _WindowOverflow4 at /home/robotics/esp-iot-solution/submodule/esp-idf/components/freertos/xtensa_vectors.S:1779
    
    I (1006) esp_image: segment 3: paddr=0x0027dadc vaddr=0x40080400 size=0x02534 (  9524) load
    I (1018) esp_image: segment 4: paddr=0x00280018 vaddr=0x400d0018 size=0xfdc08 (1039368) map
    0x400d0018: _flash_cache_start at ??:?
    
    I (1387) esp_image: segment 5: paddr=0x0037dc28 vaddr=0x40082934 size=0x17580 ( 95616) load
    0x40082934: _xt_medint3 at /home/robotics/esp-iot-solution/submodule/esp-idf/components/freertos/xtensa_vectors.S:1323
    
    I (1427) esp_image: segment 6: paddr=0x003951b0 vaddr=0x400c0000 size=0x00064 (   100) load
    I (1427) esp_image: segment 7: paddr=0x0039521c vaddr=0x50000200 size=0x00008 (     8) load
    E (1434) esp_image: Image length 3691088 doesn't fit in partition length 1048576
    E (1442) boot: OTA app partition slot 0 is not bootable
    E (1448) esp_image: image at 0x110000 has invalid magic byte
    W (1454) esp_image: image at 0x110000 has invalid SPI mode 141
    W (1461) esp_image: image at 0x110000 has invalid SPI size 7
    E (1467) boot: OTA app partition slot 1 is not bootable
    E (1473) boot: No bootable app partitions in the partition table
    Fatal exception (0): IllegalInstruction
    epc1=0x40080354, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
    0x40080354: _UserExceptionVector at ??:?
    
    opened by nopnop2002 8
  • Some problem with i2s_lcd_write_data()

    Some problem with i2s_lcd_write_data()

    Environment

    • Development Kit: [ESP32-PICO-Kit]

    • Kit version(PicoKit): Not sure

    • Module or chip used: [ESP32-PICO-D4]

    • IDF version : v3.3-beta1-179-ge931fe9f5

    • Build System: [CMake]

    • Compiler version: (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 5.2.0

    • Operating System: [Windows]

    • Power Supply: [USB]

    repeat sending data from i2s_lcd_write_data() not correct

    expect: 0xab 0xab 0xab 0xab for the first 4 bytes at least

    actual: 0xab 0xab 0xaf 0a51

    I am trying to understand how 8080 output from i2s work. To do this I have copied 5 files from \esp-iot-solution-master\components\i2s_devices\lcd_common to the root directory of a hello-world program with structure as below. All i2s_lcd_xxx.c and .h files in the same directory as hello_world_main.c for simplicity.

    • i2s_8080_lcd -CMakeLists -Makefile -sdkconfig -main |- CMakelists |- hello_world_main.c |- i2s_lcd.c |- i2s_lcd_com.c |- i2s_lcd_com.h |- iot_i2s_lcd.h

    Code to reproduce this issue (hello_world_main.c) as below

    #include <stdio.h>
    #include "freertos/FreeRTOS.h"
    #include "freertos/task.h"
    #include "esp_system.h"
    #include "esp_spi_flash.h"
    #include "sdkconfig.h"
    #include "../components/drv/dummy.h"
    #include "i2s_lcd_com.h"
    #include "iot_i2s_lcd.h"
    
    #define I2S_PORT_NUM	(0)
    #define LCD_D0_PIN  (19)
    #define LCD_D1_PIN  (21)
    #define LCD_D2_PIN  (0)
    #define LCD_D3_PIN  (22)
    #define LCD_D4_PIN  (23)
    #define LCD_D5_PIN  (33)
    #define LCD_D6_PIN  (32)
    #define LCD_D7_PIN  (27)
    #define LCD_D8_PIN  (25)
    #define LCD_D9_PIN  (26)
    #define LCD_D10_PIN (12)
    #define LCD_D11_PIN (13)
    #define LCD_D12_PIN (14)
    #define LCD_D13_PIN (15)
    #define LCD_D14_PIN (2)
    #define LCD_D15_PIN (4)
    #define LCD_WR_PIN  (18)
    #define LCD_RS_PIN  (5)
    
    void app_main()
    {
        dummy_init();
    
        i2s_lcd_config_t d2805_conf={
        		16,	//data_width = 16
    			{
    			        LCD_D0_PIN, LCD_D1_PIN, LCD_D2_PIN, LCD_D3_PIN,
    			        LCD_D4_PIN, LCD_D5_PIN, LCD_D6_PIN, LCD_D7_PIN,
    			        LCD_D8_PIN, LCD_D9_PIN, LCD_D10_PIN,LCD_D11_PIN,
    			        LCD_D12_PIN, LCD_D13_PIN, LCD_D14_PIN, LCD_D15_PIN
    			},
    			LCD_WR_PIN,
    			LCD_RS_PIN
        };
    
        i2s_lcd_handle_t d2805_handle = i2s_lcd_create(I2S_PORT_NUM, &d2805_conf);
        DRAM_ATTR static const char fb[10] = {0xab, 0xab, 0xab, 0xab, 0x55, 0xaf, 0x3d, 0x6f, 0x44, 0x78};
    
        for(;;){
        	i2s_lcd_write_data(d2805_handle, (char *)&fb, sizeof(fb), portTICK_PERIOD_MS, false);
        }
    }
    

    Pins [0:15] are wired to a logic analyzer to visualize the bus. This program only send a fixed byte pattern of 10. It was expected the pattern should match the byte array defined in fb[10] but the actual waveform is shown below.

    image

    The first two bytes are always correct. They match the first two elements 0xab 0xab, but the 3rd and 4th elements started to corrupt. It should be 0xab 0xab. I have scripted them to be the same as the 1st and 2nd byte to avoid any mistake in jumper wires. Since the 1st and 2nd bytes are correct, it means my wiring should be OK. Inconsistency is very "consistent"! I mean after a restart or power removal, the 3rd and 4th bytes are always 0xaf 0x51. So the error is a systematic one.

    What is the mistake? How to achieve a simple result like repeat sending some byte array like above?

    opened by techtoys 8
  • 在USB例子里面,esp32-s2-kaluga 开发板无法点亮LCD。

    在USB例子里面,esp32-s2-kaluga 开发板无法点亮LCD。

    Environment

    • Development Kit: esp32-s2-kaluga-Kit V1.2 , ESP-LyraP-LCD32 v1.1
    • IDF version :v4.4-dev-2184-g166c30e7b2
    • Build System: CMake
    • Compiler version: xtensa-esp32-elf-gcc (crosstool-NG esp-2021r1) 8.4.0
    • Operating System: Linux
    • Power Supply: USB
    • project : examples /usb /host /usb_camera_lcd_display

    Problem Description

    在usb_camera_lcd_display例子里面,已经按照 README 文档里面按照好 ESP-IDF 环境,并且打好了补丁。

    但是在 esp32-s2-kaluga 开发板无法正常驱动LCD屏幕,开启了使能 boot animation 开启开机动画,但依然无法点亮。

    下面是设备运行日志:

    I (21) boot: ESP-IDF v4.4-dev-2184-g166c30e7b2-dirty 2nd stage bootloader
    I (21) boot: compile time 23:33:05
    I (21) boot: chip revision: 0
    I (23) qio_mode: Enabling default flash chip QIO
    I (27) boot.esp32s2: SPI Speed      : 80MHz
    I (31) boot.esp32s2: SPI Mode       : QIO
    I (35) boot.esp32s2: SPI Flash Size : 4MB
    I (39) boot: Enabling RNG early entropy source...
    I (43) boot: Partition Table:
    I (46) boot: ## Label            Usage          Type ST Offset   Length
    I (52) boot:  0 nvs              WiFi data        01 02 00009000 00006000
    I (59) boot:  1 phy_init         RF data          01 01 0000f000 00001000
    I (65) boot:  2 factory          factory app      00 00 00010000 00177000
    I (72) boot:  3 storage          Unknown data     01 82 00187000 001f4000
    I (78) boot: End of partition table
    I (82) esp_image: segment 0: paddr=00010020 vaddr=3f000020 size=0ec4ch ( 60492) map
    I (99) esp_image: segment 1: paddr=0001ec74 vaddr=3ffc1d90 size=013a4h (  5028) load
    I (101) esp_image: segment 2: paddr=00020020 vaddr=40080020 size=43ed4h (278228) map
    I (152) esp_image: segment 3: paddr=00063efc vaddr=3ffc3134 size=00b20h (  2848) load
    I (152) esp_image: segment 4: paddr=00064a24 vaddr=40024000 size=0dd88h ( 56712) load
    I (168) esp_image: segment 5: paddr=000727b4 vaddr=50000000 size=00010h (    16) load
    I (175) boot: Loaded app from partition at offset 0x10000
    I (175) boot: Disabling RNG early entropy source...
    I (186) cache: Instruction cache 	: size 8KB, 4Ways, cache line size 32Byte
    I (186) cache: Data cache 		: size 8KB, 4Ways, cache line size 32Byte
    I (188) spiram: Found 16MBit SPI RAM device
    I (192) spiram: SPI RAM mode: sram 40m
    I (195) spiram: PSRAM initialized, cache is in normal (1-core) mode.
    I (201) cpu_start: Pro cpu up.
    I (614) spiram:€槝0f捞槅榝f
    R玍隟W仮曂褋z-5R蘒 (623) cpu_start: Pro cpu start user code
    I (623) cpu_start: cpu freq: 240000000
    I (623) cpu_start: Application information:
    I (623) cpu_start: Project name:     uvc_mjpeg_lcd
    I (628) cpu_start: App version:      b643b6a-dirty
    I (632) cpu_start: Compile time:     Aug 19 2021 23:35:26
    I (638) cpu_start: ELF file SHA256:  75fae21acf144609...
    I (643) cpu_start: ESP-IDF:          v4.4-dev-2184-g166c30e7b2-dirty
    I (649) heap_init: Initializing. RAM available for dynamic allocation:
    I (655) heap_init: At 3FF9E000 len 00002000 (8 KiB): RTCRAM
    I (660) heap_init: At 3FFC48A8 len 00037758 (221 KiB): DRAM
    I (665) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
    I (671) spiram: Adding pool of 2048K of external SPI memory to heap allocator
    I (678) spi_flash: detected chip: gd
    I (681) spi_flash: flash io: qio
    I (684) cpu_start: Starting scheduler on PRO CPU.
    I (688) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
    I (688) spi_bus: SPI2 bus created
    I (698) spi_bus: SPI2 bus device added, CS=11 Mode=0 Speed=40000000
    I (898) lcd st7789: MADCTL=60
    I (898) uvc_demo: Screen name:ST7789 | width:320 | height:240
    I (4408) UVC_STREAM: UVC Streaming Config Succeed
    I (4458) UVC_STREAM: UVC Streaming Starting
    
    
    opened by xuhongv 7
  • LCD Portrait/Landscape

    LCD Portrait/Landscape

    This is giving me a headache. How do I switch between portrait and landscape with these drivers. Does the calibration only work in portrait ?

    Here is my init function, I want to pass either (320, 240) or (240,320) and have the display come up in landscape or portrait. Can anyone advise what I am doing wrong.

    I can get the calibration screen in landscape but the bottom left circle seems to be outside the display area, touching the screen gives this.

    E (373311) lcd ili9341: .... /ili9341/ili9341.c:199 (lcd_ili9341_set_window):The set coordinates exceed the screen size
    
    // Inil lcd display and touch screen
    void lcd_init(int w, int h)
    {
            int p                           = TRUE;                         // default to portrait
            spi_bus_handle_t                bus_handle;
            scr_interface_driver_t          *iface_drv;
    
            if (w >h)                                                       // screen wider than tall ?
                    p=FALSE;                                                // then landscape
    
            led_pwm_init();
            led_pwm_set(255);                                               // turn backlight on
            spi_config_t            bus_conf =
            {
                    .miso_io_num    = GPIO_MISO,
                    .mosi_io_num    = GPIO_MOSI,
                    .sclk_io_num    = GPIO_SCLK,
                    //.max_transfer_sz= 32,
            };
            //bus_handle = spi_bus_create(SPI3_HOST, &bus_conf);            // or SPI2_HOST ?
            bus_handle = spi_bus_create(SPI2_HOST, &bus_conf);              // or SPI2_HOST ?
    
            scr_interface_spi_config_t spi_lcd_cfg =
            {
                    .spi_bus    = bus_handle,
                    .pin_num_cs = GPIO_LCDCS,
                    .pin_num_dc = GPIO_DATACMD,
                    .clk_freq   = SPI_SPEED_LCD_HZ,
                    .swap_data  = true,
            };
            scr_interface_create(SCREEN_IFACE_SPI, &spi_lcd_cfg, &iface_drv);
    
            // possible rotations SCR_DIR_TBLR  SCR_DIR_LRBT   SCR_DIR_BTRL
            scr_controller_config_t lcd_cfg =
            {
                    .interface_drv          = iface_drv,
                    .pin_num_rst            = GPIO_LCDRESET,
                    .pin_num_bckl           = -1,
                    .rst_active_level       = 0,
                    .bckl_active_level      = 1,
                    .offset_hor             = 0,
                    .offset_ver             = 0,
                    .width                  = w,
                    .height                 = h,
                    .rotate                 = SCR_DIR_LRBT,
            };
    
            if (p != TRUE)                                                  // landscape ?
            {
                    //lcd_cfg.width  = h;
                    //lcd_cfg.height = w;
                    lcd_cfg.rotate = SCR_DIR_TBLR;
            }
    
            scr_find_driver(SCREEN_CONTROLLER_ILI9341, &lcd_drv);
            ESP_LOGI(TAG, "JA doing lcd_drv init");
            lcd_drv.init(&lcd_cfg);
    
    
            // Same SPI MISO MOSI CLK pins as LCD
            touch_panel_config_t touch_cfg =
            {
                    .interface_spi =
                    {
                            //.spi_bus = spi2_bus,
                            .spi_bus = bus_handle,
                            .pin_num_cs = GPIO_TCS,
                            .clk_freq = SPI_SPEED_TOUCH_HZ,
                    },
                    .interface_type = TOUCH_PANEL_IFACE_SPI,
                    .pin_num_int    = GPIO_TIRQ,
                    .width          = w,
                    .height         = h,
                    .direction      = TOUCH_DIR_LRBT,
            };
            if (p != TRUE)
            {
                    //touch_cfg.width  = h;
                    //touch_cfg.height = w;
                    touch_cfg.direction = SCR_DIR_TBLR;
            }
    
            touch_panel_find_driver(TOUCH_PANEL_CONTROLLER_XPT2046, &touch_drv);
            ESP_LOGI(TAG, "doing touch_drv init");
    
            touch_drv.init(&touch_cfg);
            touch_drv.calibration_run(&lcd_drv, false);             // true=force, false read from flash if possible
            gpio_intr_disable(36);                                  // common issue
    
            ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());
            ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size());
    }
    

    https://docs.espressif.com/projects/espressif-esp-iot-solution/en/latest/display/screen.html

    This documentation is as clear as mud, if you rotate the display the width and height should also swap over ? Looking at ili9341.c I see that the width and height are compared to "ILI9341_RESOLUTION_HOR" etc, so the width and height must always be width=240 height=320 regardless of the rotation? I can't see how this works, the calibration routine looks as confused as I am, the shipped examples shed no light on this at all ......

    opened by jonshouse1 6
  • Contribution: faster    painter_draw_char()

    Contribution: faster painter_draw_char()

    I don't really know how to use github well.

    I've been using the basic painter routines to make a simple GUI, but i've found the font code too slow.

    I've written a faster font routine for "components/display/touch_panel/calibration/basic_painter.c" could somebody add it to the project and test it a little more. Thanks.

    void painter_draw_char(int x, int y, char ascii_char, const font_t *font, uint16_t color)
    {
       PAINTER_CHECK(ascii_char >= ' ', "ACSII code invalid");
       PAINTER_CHECK(NULL != font, "Font pointer invalid");
       int i, j;
       uint16_t char_size = font->Height * (font->Width / 8 + (font->Width % 8 ? 1 : 0));
       unsigned int char_offset = (ascii_char - ' ') * char_size;
       const unsigned char *ptr = &font->table[char_offset];
       uint16_t *buf = malloc(font->Width*font->Height*sizeof(uint16_t));
       int ox=0;
       int oy=0;
    
       for (i=0;i<font->Width*font->Height;i++)
          buf[i]=g_back_color;
    
       for (j = 0; j < char_size; j++) {
          uint8_t temp = ptr[j];
          for (i = 0; i < 8; i++) {
             if (temp & 0x80)
                  buf[ox+(font->Width*oy)]=g_point_color;
    
             temp <<= 1;
             ox++;
             if (ox == font->Width) {
                ox=0;
                oy++;
                break;
             }
         }
       }
       g_lcd.draw_bitmap(x, y, font->Width, font->Height, buf);                      // Draw NxN char
       free(buf);
    }
    
    opened by jonshouse1 6
Owner
Espressif Systems
Espressif Systems
ESP-IDF is the development framework for Espressif SoCs supported on Windows, Linux and macOS.

Espressif IoT Development Framework 中文版 ESP-IDF is the development framework for Espressif SoCs supported on Windows, Linux and macOS. ESP-IDF Release

Espressif Systems 8.9k Aug 5, 2022
designed for debug Espressif's ESP series chips, include ESP32/ESP32-S2/ESP32-C3/ESP32-S3...

ESPLink 中文 ESPLink Introduce Features Pin Description esplink-tool Product Link Reference ESPLink Introduce ESPLink is a debug tool build for Expressi

wuxx 26 Jul 31, 2022
Intel Wi-Fi Drivers for macOS

An Intel Wi-Fi Adapter Kernel Extension for macOS, based on the OpenBSD Project.

OpenIntelWireless 5.6k Aug 4, 2022
Introduction to AWS IoT Core and a Post Messaging demo

IoT_Message_Box_Workshop Introduction to programming microcontrollers for IoT applications and interfacing them with AWS IoT Core This workshop was pr

Raw Matter 5 Dec 1, 2021
Run SSH on iOS 12 device.

Shelly12 Run SSH on iOS 12 device. Only worked on iPad Air 1, iOS 12.4 Working Get root Set tfp0 to hsp4 Escape Sandbox Restore/Remount RootFS Defeat

null 6 May 11, 2021
WiFi scanner with visual persistence, intended to find the idlest channel e.g. to assign to a ZigBee device

WiFiChanViz Motivation This tool was initially coded to help find the idlest 2.4GHz channel in order to connect a ZigBee device to HomeAssistant in id

tobozo 12 May 3, 2022
Open Source IoT Operating System

IoTaaP OS Open Source IoT Operating System Usage Include IoTaaP_OS.h to your project and define IoTaaP OS object Usage example #include <IoTaaP_OS.h>

IoTaaP 38 Nov 23, 2021
Iot smart weighting concept code

iot-smart-sensory-weighing Iot smart weighting concept code - Coded in C language [ Hardware assembly code ] - Module for Arduino In this project we h

Ashutosh Rana 1 Nov 17, 2021
Google IOT MQTT Sample

This is an adaptation of Zephyr's Google Cloud IoT Core MQTT sample samples/net/cloud/google_iot_mqtt for the nRF9160-DK, using modem features to offload certificate storage, TLS and JWT calculation.

Jeffrey Urban 5 Jan 27, 2022
SNIF ~ e2e TLS trust for IoT

/************************************************************************** * _________ * /````````_\ S N I F ~ e2e TLS trus

VESvault 11 Apr 24, 2022
Hyelicht is an IoT/embedded project for home decoration/automation.

Hyelicht is an IoT/embedded project for home decoration/automation. Its software allows you to do colorful painting and animations on a LED-b

Eike Hein 7 Jan 17, 2022
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 8.6k Aug 8, 2022
Ole Christian Eidheim 737 Aug 6, 2022
A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio.

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.

Ole Christian Eidheim 2.3k Aug 2, 2022
C Hypertext Library - A library for writing web applications in C

CHL C Hypertext Library - A library for writing web applications in C #include <chl/chl.h> int main() { chl_set_default_headers(); chl_print_header

null 272 Jun 20, 2022
The C++ Network Library Project -- cross-platform, standards compliant networking library.

C++ Network Library Modern C++ network programming libraries. Join us on Slack: http://slack.cpp-netlib.org/ Subscribe to the mailing list: https://gr

C++ Network Library 1.9k Aug 9, 2022
Cross-platform, efficient, customizable, and robust asynchronous HTTP/WebSocket server C++14 library with the right balance between performance and ease of use

What Is RESTinio? RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server. It is based on standalone version of ASIO

Stiffstream 871 Aug 9, 2022
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution

CppServer Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and

Ivan Shynkarenka 867 Aug 8, 2022