This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Try it out by opening https://ide.kaitai.io/ and copying this file there | |
# Based on an article by @angelcarve about ESP8266 binary image parsing with Kaitai Struct: | |
# https://carvesystems.com/news/parsing-binaries-with-kaitai-struct/ | |
meta: | |
id: esp | |
file-extension: bin | |
endian: le | |
seq: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <PubSubClient.h> | |
#include <ESP8266WiFi.h> | |
const char* ssid = "................."; | |
const char* password = "................"; | |
char* topic = "esp8266_arduino_out"; | |
char* server = "iot.eclipse.org"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include "soc/rtc_cntl_reg.h" | |
#include "esp32/ulp.h" | |
#include "driver/rtc_cntl.h" | |
#include "esp_log.h" | |
#include "ulp_main.h" | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/semphr.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I (437) example: Opening file | |
I (457) example: File written | |
I (467) example: Renaming file | |
I (467) example: Reading file | |
I (467) example: Read from file: 'Hello SU04G!' | |
This line will be written into the log file, not to UART |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This sample illustrates how to go back to deep sleep from the | |
* deep sleep wake stub. | |
* | |
* Consider the use case of counting pulses from an external sensor, | |
* where the pulses arrive at a relatively slow rate. | |
* | |
* ESP32 is configured to go into deep sleep mode, and wake up from | |
* a GPIO pin connected to the external pulse source. | |
* Once the pulse arrives, ESP32 wakes up from deep sleep and runs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ABOUT_PAGE_H | |
#define ABOUT_PAGE_H | |
#include <ESP8266WebServer.h> | |
class AboutPage : public RequestHandler { | |
public: | |
AboutPage(const char* uri = "about") | |
: _uri(uri) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# this script will push an OTA update to the ESP | |
# | |
# use it like: python ota_server.py <ESP_IP_address> <sketch.bin> | |
# | |
# on the ESP side you need code like this: https://gist.github.com/igrr/43d5c52328e955bb6b09 to handle the update | |
# | |
import socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD | |
* | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include "esp_err.h" | |
#include "esp_log.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/espressif/newlib-esp32.git && | |
cd newlib-esp32 && \ | |
./configure \ | |
--with-newlib \ | |
--enable-multilib \ | |
--disable-newlib-io-c99-formats \ | |
--disable-newlib-supplied-syscalls \ | |
--enable-newlib-nano-formatted-io \ | |
--enable-newlib-reent-small \ | |
--enable-target-optspace \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ESP32-S2 (beta) "dedicated GPIO" peripheral example */ | |
#include <stdio.h> | |
#include "sdkconfig.h" | |
#include "soc/system_reg.h" | |
#include "esp32s2beta/rom/gpio.h" | |
#include "soc/gpio_sig_map.h" | |
#include "driver/gpio.h" | |
/* The header file is not yet in IDF; however this is the only register we need. */ |
NewerOlder