Skip to content

Instantly share code, notes, and snippets.

#pragma once
class handler
{
public:
virtual ~handler() {
Serial.println("[handler] Deconstructor Called");
}
private:
@sticilface
sticilface / espmanagertemplate.cpp
Created May 14, 2016 17:50
templated version of espmanager
#pragma once
#include <functional>
class AsyncWebServer;
class ESP8266WebServer;
using namespace std::placeholders;
template <class RESPONSE, class HTTP >
root@test:/opt/Espressif/crosstool-NG # ./bootstrap && ./configure --prefix=`pwd` && make && make install
Running autoconf...
Done. You may now run:
./configure
checking build system type... x86_64-unknown-freebsd9.2
checking host system type... x86_64-unknown-freebsd9.2
checking for a BSD-compatible install... /usr/bin/install -c
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
sudo: false
language: bash
os:
- linux
env:
global:
- BUILD_FOLDER=$TRAVIS_BUILD_DIR/build.tmp
- SKETCH_LOCATION="$TRAVIS_BUILD_DIR"
#- LIBRARIES_LOCATION="-l $HOME/Arduino/libraries"
- BOARD_TYPE="-b generic"
/* Base temaplte for ESP8266 */
/* PlatformIO modifications: please search for "*.pioenvs" */
/* This linker script generated from xt-genldscripts.tpp for LSP . */
/* Linker Script for ld -N */
PHDRS
{
dport0_0_phdr PT_LOAD;
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
const char* ssid = "xxx";
const char* password = "xxx";
void setup() {
Serial.begin(1000000);
@sticilface
sticilface / PROGMEM.md
Last active July 23, 2023 11:38
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR
[HTTP-Client][begin] url: http://192.168.1.42/esp/local/MySONOFF/debugsonoff/manifest.json
[HTTP-Client][begin] host: 192.168.1.42 port: 80 url: /esp/local/MySONOFF/debugsonoff/manifest.json
[hostByName] Host: 192.168.1.42 is a IP!
:ref 1
[HTTP-Client] connected to 192.168.1.42:80
:wr 183 183 0
:wrc 183 183 0
:sent 183
:rn 240
:rch 240, 946
@sticilface
sticilface / test.h
Created June 23, 2017 07:14
Error when using PROGMEM strings and DEBUG with PSTR() in template functions
#ifndef TEST_H
#define TEST_H
#define TEST Serial
const char testString[] PROGMEM = "Test String";
#if defined(TEST)
@sticilface
sticilface / speedtests.md
Last active July 28, 2018 20:31
speed tests results PJON Serial

Speed Tests

ThroughSerial

Leonado to Leonado (115200 baud)

1 second communication speed test:
Packet Overhead: 10B - Total: 190B
Bandwidth: 570.00B/s