Coder Social home page Coder Social logo

esp-idf-template's Introduction

ESP-IDF template app

This is a template application to be used with Espressif IoT Development Framework.

Please check ESP-IDF docs for getting started instructions.

Code in this repository is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

esp-idf-template's People

Contributors

david-cermak avatar igrr avatar liuzfesp avatar mahavirj avatar projectgus avatar spritetm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-idf-template's Issues

Template for a more complex project

The available documentation and the examples seriously lack any real-world use case examples when it comes to complex directory structures. Would it be possible to add a template that consists of a main component, plus one (or more) additional components located in components/ dir?

Example structure that could show different arrangements
esp-idf/
project/

  • CMakeLists.txt
  • Makefile
  • main/
    • CMakeLists.txt
    • component.mk
    • main_file.c
    • main_file.h
  • components/
    • component1/
    • CMakeLists.txt
    • component.mk
    • src/
      • comp1_src1.c
      • comp1_src2.c
    • inc/
      • comp1_src1.h
      • comp1_src2.h
    • Kconfig
  • component2/
    • CMakeLists.txt
    • component.mk
    • comp2_src.c
    • comp2_src.h
    • module1/
      • module1_scr1.c
      • module1_scr1.h
    • module2/
      • module2_scr1.c
      • module2_scr1.h

Add nvs_flash_init Retry

In example esp-idf/examples/wifi/wps/main/wps.c, there is a retry if nvs_flash_init returns specific failure codes.

esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
    ESP_ERROR_CHECK(nvs_flash_erase());
    ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);

I was really lucky to read a specific example that had the retry. Many of the other examples do not have the retry.

I asked about this retry as a best practice on the ESP32 forum. @igrr responded that the retry as above is the correct thing to do for a production code.

The source code for this template does not have the retry. If the template is a common starting point for writing production code then it would help if the retry was present in the template.

unable to make all: unorderable types

When I run make all in the folder I have downloaded this template to, it gives me the following error:

make[1]: Entering directory '/home/hrishi/esp/esp-idf/tools/kconfig'
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o mconf.o mconf.c
flex -L -P zconf -o zconf.lex.c zconf.l
zconf.l:255: warning, -s option given but default rule can be matched
bison -t -l -p zconf -o zconf.tab.c zconf.y
sed -E "s/\\x0D$//" zconf.gperf | gperf -t --output-file zconf.hash.c -a -C -E -g -k '1,3,$' -p -t
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o zconf.tab.o zconf.tab.c
lxdialog/check-lxdialog.sh -check cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE -lncurses -ltinfo
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o lxdialog/checklist.o lxdialog/checklist.c
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o lxdialog/util.o lxdialog/util.c
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o lxdialog/inputbox.o lxdialog/inputbox.c
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o lxdialog/textbox.o lxdialog/textbox.c
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o lxdialog/yesno.o lxdialog/yesno.c
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o lxdialog/menubox.o lxdialog/menubox.c
cc -o mconf mconf.o zconf.tab.o lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o -lncurses -ltinfo
cc  -D_GNU_SOURCE -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o conf.o conf.c
cc -o conf conf.o  zconf.tab.o -lncurses -ltinfo
make[1]: Leaving directory '/home/hrishi/esp/esp-idf/tools/kconfig'
GENCONFIG
Building partitions from /home/hrishi/esp/esp-idf/components/partition_table/partitions_singleapp.csv...
Traceback (most recent call last):
  File "/home/hrishi/esp/esp-idf/components/partition_table/gen_esp32part.py", line 346, in <module>
    main()
  File "/home/hrishi/esp/esp-idf/components/partition_table/gen_esp32part.py", line 335, in main
    table.verify()
  File "/home/hrishi/esp/esp-idf/components/partition_table/gen_esp32part.py", line 80, in verify
    for p in sorted(self):
TypeError: unorderable types: PartitionDefinition() < PartitionDefinition()
/home/hrishi/esp/esp-idf/components/partition_table/Makefile.projbuild:35: recipe for target '/home/hrishi/esp/myapp/build/partitions_singleapp-unsigned.bin' failed
make: *** [/home/hrishi/esp/myapp/build/partitions_singleapp-unsigned.bin] Error 1

I'm running a Ubuntu 16.04 machine and have reached this stage after following the instructions on this page.

I have been unable to resolve this problem and look forward to a response. Thank you.

Can I update the template?

The latest idf version currently in use is 5.1.2.
Can you update the template? For example, adding custom component usage demos, reference structures, or compiling chain CMakeLists.txt associated use cases. I think these should be very useful, if they can be updated. ๐Ÿ˜„

Remove sdkconfig file

I think it would be a good idea to remove the sdkconfig file as it is almost always deprecated when using the esp-idf master branch.
When the sdkconfig file is missing make menuconfig is started on make automatically. So why not remove the file altogether?

wifi: mode : sta (30:ae:a4:1a:5b:e0) but transmitting

From my week understanding, I believe this template sets up a WiFi station, transmitting whatever name you give for the SSID.. Is that correct?

If so, I am not seeing the network on any of my devices.. am I missing something?

Here is what I see in terminal when screening into the device and restarting it:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_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:4668
load:0x40078000,len:0
load:0x40078000,len:13228
entry 0x40078d64
I (192) cpu_start: Pro cpu up.
I (192) cpu_start: Single core mode
I (193) heap_init: Initializing. RAM available for dynamic allocation:
I (196) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (202) heap_init: At 3FFB81C0 len 00027E40 (159 KiB): DRAM
I (209) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (215) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (221) heap_init: At 4008D984 len 0001267C (73 KiB): IRAM
I (227) cpu_start: Pro cpu start user code
I (21) cpu_start: Starting scheduler on PRO CPU.
I (44) wifi: wifi firmware version: c202b34
I (44) wifi: config NVS flash: enabled
I (44) wifi: config nano formating: enabled
I (44) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (54) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (68) wifi: Init dynamic tx buffer num: 32
I (68) wifi: Init data frame dynamic rx buffer num: 32
I (72) wifi: Init management frame dynamic rx buffer num: 32
I (78) wifi: wifi driver task: 3ffbde90, prio:23, stack:3584
I (83) wifi: Init static rx buffer num: 10
I (87) wifi: Init dynamic rx buffer num: 32
I (91) wifi: wifi power manager task: 0x3ffc28e0 prio: 21 stack: 2048
I (157) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0
I (158) wifi: mode : sta (30:ae:a4:1a:5b:e0)

How to build and flash to ESP32?

Hi everyone, I just bought my ESP32 and I want to make a wifi-repeater and after 3 days of searching this is the closest I got to have a working one. https://github.com/jonask1337/esp-lwip/blob/2.0.3-esp/README.md but I don't know how to build the project. Can anyone please help me step by step? I already installed esp-idf and I'm sure it's working. I already replaced original esp-idf's lwip folder by his. I want to build the project and flash it to ESP32. Somebody please. Thank you very much!

esp_event_loop.h not present in esp-idf, causes compliation to fail

Hi
When using the template yesterday, the app compiled fine.
When cloning and using tonight I get
/Users/xxx/esp32/myeclipseesp32app2/main/./main.c:5:28: fatal error: esp_event_loop.h: No such file or directory
#include "esp_event_loop.h"
And sure enough, the file isn't anywhere on my system.
Am I missing something ? This is OS X btw

Cannot use Menuconfig due to old libncurs dependency

When I do make menuconfig, you can see below why it fails -- I'm having a very recent setup under Gentoo Linux and I'm using Ncurses 6. So what can I do?

MENUCONFIG                                                                                                                                                                              
/esp/esp-idf/tools/kconfig/mconf: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory                     
/esp/esp-idf/make/common.mk:10: /esp/loratracker/build/include/config/auto.conf: No such file or directory                                              
make: *** [/esp/esp-idf/make/project_config.mk:59: menuconfig] Error 127


user@client11 ~/esptest/loratracker $ ldd /esp/esp-idf/tools/kconfig/mconf
        linux-vdso.so.1 (0x00007ffe2b7de000)
        libncursesw.so.5 => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007f987f324000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f987f6bd000)
user@client11 ~/esptest/loratracker $ 

Symbol & variable can not be resolved in ESP-IDF template

There is no errors
s1
to build ESP-idf template in eclipse, Ubuntu BUT some symbols and variables in main() can not be resolved with warning sign.

#includes are all good with no error and waning sign
#include "freertos"/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
#include "nvs_flash.h"
#include "drive/gpio.h"

Restrictive license on this template

So EVERY project built with this template has to use the Apache License???

Seems like reference designs are supposed to be unlicensed or PD to actually be useful to businesses.

Please clarify.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.