Skip to content

Instantly share code, notes, and snippets.

@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)
[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
#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);
/* 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;
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"
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
@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 >
@sticilface
sticilface / SPIFFShelper.h
Created November 26, 2015 12:12
Use SPIFFS like EEPROM
struct spiffs_helper_t {
File f;
spiffs_helper_t(const char * _path ) {
f = SPIFFS.open(_path, "r+"); // try to open if there... for read and write
if (!f) {
f = SPIFFS.open(_path, "w+"); // if fail open for read/write but new
}
};
#pragma once
class handler
{
public:
virtual ~handler() {
Serial.println("[handler] Deconstructor Called");
}
private:
@sticilface
sticilface / ESP_asyncJSON.ino
Last active January 26, 2016 13:05
demonstrates crash with large JSONs
/*
*
* Demonstrates crash using chuncked print and large Json
* Requires
* https://github.com/me-no-dev/ESPAsyncWebServer
* https://github.com/me-no-dev/ESPAsyncTCP
* https://github.com/bblanchon/ArduinoJson
*
* use curl to make request...
* http://ip/json -> Will make request and send results async... causes crash. Works if lines are removed from json.. see addJson function