Giter Site home page Giter Site logo

ct-open-source / basecamp Goto Github PK

View Code? Open in Web Editor NEW
254.0 66.0 48.0 245 KB

An Arduino library to ease the use of the ESP32 in IoT projects

License: GNU General Public License v3.0

C++ 90.70% CSS 2.16% JavaScript 4.89% HTML 0.52% Shell 1.72%
esp32 iot iot-framework iot-device arduino-library smarthome mqtt

basecamp's Introduction

Basecamp is deprecated now. And only for archival purposes. If you want to take over this project contact me at: [email protected]

There are a lot of alternatives for the ESP32 by now that also work with the ESP8266

Here are alternatives that are in active development:

https://github.com/tzapu/WiFiManager/tree/development

https://github.com/plapointe6/EspMQTTClient

Basecamp

Basecamp - ESP32 library to simplify the basics of IoT projects Originally written by Merlin Schumacher ([email protected]) for c't magazin für computer technik Licensed under GPLv3. See LICENSE for details.

Attention: Do not use the master-branch for production use! Use only the releases!

Dependencies

This library has few dependencies:

ESPAsyncWebServer

ArduinoJSON

Async MQTT Client

AsyncTCP

Documentation

Exhaustive documentation will provided in the next few weeks. An example can be found inside the example folder.

First Setup:

At the first start - when you initially flash the device, the ESP32 will generate an unique password which is displayed at the debug console upon every start. In setup mode (when the ESP32 is acting as an access point for setup), the password for the "ESP_$macOfEsp32" wifi network will be set to this value. It will never change, except the configuration gets broken - then a new password will be generated.

Basic example

#include <Basecamp.hpp>
Basecamp iot;

void setup() {
	iot.begin();
    //The mqtt object is an instance of Async MQTT Client. See it's documentation for details.
    iot.mqtt.subscribe("test/lol",2);

    //Use the web object to add elements to the interface
    iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor");
    iot.web.setInterfaceElementAttribute("color", "type", "text");

}

void loop() {
	//your code
}

basecamp's People

Contributors

ahinrichs avatar dehein avatar dirk007 avatar dreckiger-dan avatar floedelmann avatar fuempel avatar geeks-r-us avatar ivankravets avatar jdede avatar kolbyjack avatar merlinschumacher avatar mutzmann avatar obrain17 avatar peastone avatar per1234 avatar pinae avatar polygontwist avatar sebeichholz avatar toldotechnik 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  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

basecamp's Issues

Keine Webseite angezeigt und kein Akkubetrieb

Hallo,

ich habe mir nach lesen des c't-Artikels umgehend alle Teile besorgt, die Software eingerichtet und konnte Ihren Code auch erfolgreich auf den Lolin32 laden. Nun stehe ich jedoch vor zwei Problemen:

  1. Ich bekomme mit keinem Browser unter http://192.168.4.1 eine Seite angezeigt, nur dass die Seite nicht geladen werden konnte.
  2. Der Lolin32 gibt mit angeschlossenem 18650-Akku kein Lebenszeichen von sich. Über USB funktioniert alles normal. Wird für den Akkubetrieb noch ein Zusatzbauteil benötigt, oder ist der Code dahingehend anzupassen?

Ich würde mich sehr über Ihre Unterstützung freuen, denn das Projekt ist wirklich gelungen!

Schöne Grüße

Missing File: DNSServer.h

Trying to use this library for DoorsignEPD on LOLIN32 leads to an Error in Basecamp.hpp:18:23
DNSServer.h: No such file or direrctory

multiple definition of `JSON_MIMETYPE'

Hi zusammen,
zuerst vielen Dank für das coole und (wenn es denn läuft :-)) nützliche Projekt.

Leider bekomme ich es nicht gelinkt. Bei mir werden - sowohl in der Arduino IDE als auch bei PlatformIO - folgende Fehlermeldungen angezeigt. Ich habe sowohl das "doorsensor" Beispielprojekt als auch das "Minimal-Projekt" für die Einbindung von Basecamp versucht.

\arduino_build_991465\libraries\Basecamp\Basecamp.cpp.o:(.data.JSON_MIMETYPE+0x0): multiple definition of `JSON_MIMETYPE'

\arduino_build_991465\sketch\sketch_aug02b.ino.cpp.o:(.data.JSON_MIMETYPE+0x0): first defined here

\arduino_build_991465\libraries\Basecamp\WebServer.cpp.o:(.data.JSON_MIMETYPE+0x0): multiple definition of `JSON_MIMETYPE'

\arduino_build_991465\sketch\sketch_aug02b.ino.cpp.o:(.data.JSON_MIMETYPE+0x0): first defined here

\arduino_build_991465\libraries\Basecamp\WifiControl.cpp.o:(.data.JSON_MIMETYPE+0x0): multiple definition of `JSON_MIMETYPE'

\arduino_build_991465\sketch\sketch_aug02b.ino.cpp.o:(.data.JSON_MIMETYPE+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

Ich habe auch schon mehrere unterschiedliche Versionen der abhängigen Libs verwendet.

  • ArduinoJson v5.13.2 ... v5.9.x (und auch der v6 beta)
  • Basecamp v0.1.8 .. 0.1.6

Alle Libs sowohl per zip-Import importiert, als auch direkt über die Arduino bzw. PlatfomIO LibManager. Alles ohne erfolgt.

Für Hilfe oder einen Tipp wäre ich sehr dankbar.
Viele Grüße.

Serial.begin() called again - system freezes

I stumbled across a strange problem. I use Basecamp in my own library, under PlatformIO on the ESP-WROVER-KIT. It happens that when "Serial.begin(115200)" is called again, everything gets stuck. Since I called "Serial.begin(115200)" in my library before calling "iot.begin()", the program flow just gets stuck in the method. When I comment out the "Serial.begin", everything runs wonderfully. The problem occurs both on the ESP-WROVER-KIT and on a generic ESP32 dev board. For now, I'll help myself by commenting out the line, but in the long run a configuration option would be helpful. But I will post the behaviour in the ESP32 forum, let's see what they think about it...

Externer Broker nicht erreichbar

ich möchte einen ESP32 mit basecamp mit einem externen MQTT-Broker verbinden.
Getestet habe ich dies mit test.mosquitto.org
Leider kommt keine Verbindung zustande, auch nicht wenn ich statt dem Domainnamen
die zugehörige IP-Adresse eintrage.
Der ESP erreicht dagegen den Mosquitto_Broker auf einem Raspberry pi im selben WLAn problemols.
Mit mosquitto_sub und mosquitto_pub auf einem Raspberry im selben WLAN funktioniert die Verbindung zu test.mosquitto.org problemlos.

Leider komme ich bei dem Problem nicht weiter und bitte um Hilfe.
Gruß
Ulrich Frei

Unstable OTA

When using Basecamp 0.1.8 with PlatformIO / Atom, the OTA feature works very easily. However it is not stable and not successful in a high number of attempts.

I guess, main reason for this is the excessive delay in Basecamp.cpp:

void Basecamp::OTAHandling(void * OTAParams) {

    ...

    // The while loop checks if OTA requests are received and sleeps for a bit if not
    while (1) {
      ArduinoOTA.handle();
      vTaskDelay(100);
    }
}

The original value of 100 ms is way too high for the UDP based transmission, for high speed connections. Changing the value to 5 solved the problem for me for the moment.

But I am not sure on the side effects (runtime consumption) and if 5 ms is sufficiently low. Can you please check ?

webinterface nicht erreichbar

Ich habe das Minimalbeispiel aus c't 18.05 auf den ESP32 übertragen und wollte die Konfiguration unter http://192.168.4.1 vornehmen, aber die Seite ist nicht erreichbar.
Im der Seriellen Monitor werden keine Fehler angezeigt...

Kann mir jemand weiterhelfen, bzw. sagen wo ich weiterführende Informationen finde.

Danke

ESP doesn't wake anymore

Hi,
ich have 4 doorsensors in use. I use 3.2 V batteries and which have to be charged every few month. The voltage check does not work till now, I think I have to change the config. But that's not the problem.
My sensors worked since month without any problems. A few weeks ago one of my sensors stopped working an so I changed the the battery. But that was not the solution. It still didn't work. Next I flashed the ESP again and now it works. But it send's only one time after restart and then it goes sleeping and didn´t wake.
Because my sensors are flashed with a slightly modified code I tried the original one, but that does not work too.
I thought maybe the ESP is broken and flashed an new one, same problem here.
A week after the first sensors a second stopped working, I flashed it, same problem.

Now I don't know what to do. I made everything like a few month ago. The only difference is my notebook os, but I cannot imagine that can be the problem.

I hope someone has an idea.

Thanks
Alex

Fehler beim Kompilieren

Hallo,

ich bekomme Basecamp nicht kompiliert. Ich wollte den Sensor aus dem Artikel PalimPalim nachbauen und kompilieren. Problem scheint die Umstellung auf ArduinoJson 5/6 zu sein. Wo finde ich die nowendigen Bibliotheken in der richtigen Version ? Irgendwie passt zum heutigen Zeitpunkt nichts mehr zusammen, selbst ein einfaches Programm kompiliert nicht mehr

Frage: ESP8266

Hallo,
Ist dies für ESP8266 geeignet oder nur für ESP32?

PlatformIO dependency reference error

Could not build on PlatformIO. It seems the library.json has a wrong library reference in it.
Real library name: ArduinoJson
Library name in library.json: ArduinoJSON

insecure WLAN-Client Configuration

Hi Merlin,

thanks for Basecamp - it's a convenient way to start with the whole "IoT thing"... :)

But i've got a little problem with the decision you choose on how to configure the WLAN-Client in the Device. Today it's not a good idea to "force" newcomers/users to expose their WiFi Preshared-Key (PSK) by sending it plain over a insecure and public transport medium. Unfortunately they won't use a Test-AP, they use their "include-all-devices_with-unresctricted-internet-access" AP

It would be better if the AccessPoint would use WPA2 with a default PSK, use TLS for the Webserver or even hardcode the PSK.

BG Matthias

MQTT credentials

Code is prepared for credentials, but the Interface provides no possibility to change it.

I haven't understood the initconf.json, it seems to be not neccessary.

Add in Basecamp.cpp

web.addInterfaceElement("MQTTUser", "input", "MQTT User:", "#configform", "MQTTUser"); 
web.addInterfaceElement("MQTTPass", "input", "MQTT Password:", "#configform", "MQTTPass");

No PR because I changed already more stuff for compatibility with PlatformIO.

Accesspoint-Modus aktivieren (mit PW)

Zunächst danke für das nette Tülchen - hilft sehr.
Kann man Basecamp auch so konfigurieren, dass es einen mit PW verschlüsselten Acces Point selbst auf macht - also nicht in eine andere Infrastruktur einklinkt, sondern die Infrastruktur selbst ist. Der Start-Hotspot ist im Prinzip schon genau das, nur dass es halt als dauerhafte Lösung mit PW gedacht wäre.

1.configurationsaufruf klappt nicht mit ipad

mit einem ipad3 (altes) und einem alten Handy(Lumina mit windows8.1) habe ich probiert drauf zukommen:
-WLAN "ESP32" Verbindung hat geklappt
-im Webbrowser blieb nach http://192.168.4.1/ der Bildschirm weiß
-http://192.168.4.1/basecamp.css bzw. .js ließ sich aufrufen, der Inhalt war zu sehen

mein Basisscript:
`#define DEBUG 1
#include <Basecamp.hpp>

Basecamp iot;

void setup() {
iot.begin();
}

void loop() {}`

Ausgaben in der Seriellen:

O, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0
Basecamp V.0.1.2
Factory reset was forced.
Rebooting.
ets Jun 8 2016 00:22:57

rst:0xc
(SW_CPU_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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0
Basecamp V.0.1.2
Failed to open config file
Configuration empty

Auf 192.168.4.1 wird Folgendes angezeigt Configuration could not be saved

Hallo bei der WlanGardine/Basecamp

Ich versuche nach dem Artikel in der ct 2/2018 einen ESP32 an Mosquitto unter Win7 anzuschliessen.
Mosquitto läuft, tests mit mosquitto_pub und mosquitto_sub funktionieren wie erwartet.
Ich habe die entsprechenden ESP-Bibliotheken für den Arduino angeschlossen und ein WifiScanner auf den ESP32 geladen und er zeigt mir auch alle Wifi-Netze meiner Umgebung an.
Dann habe ich mir über Git merlinschumachers basecamp (version 0.1.8)(incl. der abhängigen Bibliotheken) besorgt. Dann die WlanGardine.ino und compiliert und auf den esp32 geladen. Soweit so gut. Damit spannt der ESP32 dann auch WiFi-Netz mit ssid ESP32 auf. Wenn ich dieses mit meinem Smartphone verbinde und die angegebene 192.168.4.1 ansteuere erhalte ich(z.T. nach 7maligem Reset) eine Maske die anders aussieht wie im Artikel beschrieben:
Ich werde gefragt nach
Device name (meine Antwort: WlanGardine)
WIFI SSID (meine Antwort: Saftladen)
WIFI Password (meine Antwort: ***********)
MQTT Host (meine Antwort: 192.168.178.21 = Rechner IP des Mosquitto-Service)
MQTT Port (meine Antwort: 1883)
MQTT Username (meine Antwort: joern)
MQTT Password (nicht eingefüllt)
Steps per cm (eingefüllt ist 2496.000000, unverändert)
Travel distance vor a open curtain in cm: (meine Antwort: 100)
Nach Betätigen von 'Save' meldet das Smartphone nach gefühlt 2min:
"Auf 192.168.4.1 wird Folgendes angezeigt
Configuration could not be saved"
Eine Verbindung mit dem Fritzbox-Verwaltungsprogramm zum Saftladen kann folgerichtig nicht nachgewiesen werden.
Was ist/mache ich falsch?

Vielen Dank für jede Hilfe.

Release 0.1.8 meldet sich noch als 0.1.6

Kein funktionales Problem, aber in die Irre führend: im Basecamp-0.1.8 Release wird beim Starten weiterhin die Version "0.1.6" angezeigt ... kann ziemlich verwirrend sein. ;-)

Boolean value inconsistencies in the configuration

I noticed that Boolean values for various configuration settings are used quite inconsistently. For example,
config.set("OTAActive", "false");
does not work with "False", yet
config.set("WifiConfigured", "True");
does not work with "true" since string comparisons are used. It would be great if Basecamp could be updated such that all versions are accepted, by using a string comparison that ignores the case of the strings. That would ensure backward compatibility.

How to access config Variables.

Hi,

i have added a config variable to the configuration web page:
iot.mqtt.onConnect(onMqttConnect);
iot.web.addInterfaceElement("color", "input", "Defaultfarbe [#RRGGBB]:", "#configform", "LampColor");
iot.web.setInterfaceElementAttribute("color", "type", "text");

Ho can I access this String "LampColor" in the setup() routine ?

No TLS for MQTT

async-mqtt-client seems to be reffering to AsyncTCP for ESP32 for TLS support. At the moment, this is not part of the ESP32 implementation (the ESP8266 has TLS support).
If there is a way to activate TLS support pleas let me know. So long I sadly can not use Basecamp, which is sad since it seams to be a promising platform for an easy project start. However, my sensors have to upload the data to a server on the internet and I will no transmit credentials without TLS.

Kind regards,
André

Fehlermeldung beim Compilieren von ESP-Temp-Sensor.ino

Hallo Hr. Schumacher,

bekomme nach Installation aller notwendigen LIBs und dem Compilieren des Beispiels ESP-Temp-Sensor.ino folgende Fehlermeldung:

C:\Users\Erich\Documents\Arduino\libraries\Basecamp\Basecamp.cpp: In static member function 'static void Basecamp::OTAHandling(void*)':
C:\Users\Erich\Documents\Arduino\libraries\Basecamp\Basecamp.cpp:395:2: error: invalid use of 'void'

.onEnd( {

^

Haben Sie einen Tipp an was es liegen kann?

Grüße
Erich Rauscher

Frage zur Dokumentation

In der README.md wird geschrieben:

Exhaustive documentation will provided in the next few weeks.

Ist das noch geplant? ;-)

Frequent MQTT posts, stopped MQTT connection, and task watchdog crashes on CPU0

Hi all,

After about a year of tinkering I think I have now figured out a major issue, not just with Basecamp, but with the ESP and MQTT in general. If not fixed this issue repeatedly crashes the ESP32 and prevents 24/7 use. Here are my observations (and the fix):

I run my ESP32 with Basecamp continuously and it crashed at random times (2--4 times a week), not to a reboot but simply to a never-ending watchdog feedback loop which could only be stopped by power-cycling it. Specifically, this is about the task watchdog which complains about a blocked CPU0. Yet this is strange since the user programs run on CPU1 as far as I understand. I tried everything that is usually recommend in such situations, such as delays in the loop function etc.; see espressif/arduino-esp32#922 for more information. These changes, however, did not fix the problem.

At some point I suspected that posting to MQTT when the MQTT connection was down was the problem, and indeed by preventing such postings I could fix some of my crashes for one device. Yet another ESP32 to which I also applied this fix still caused crashes.

A few days ago I upgraded to the new ESP32 board libraries (to 1.0.1), and now observed in my debug log that now the MQTT connection was frequently reset. I am not sure if the crashes disappeared (they can take hours to days to happen), they may or may not have gone as the new libraries changed the watchdog behavior but I did not test for a long time because this observation led me to the actual problem: posting several messages to MQTT too fast after each other (e.g., because several sensor readings needed to be communicated to MQTT).

So I ultimately fixed the issue by implementing a local mqttPublish function as follows which I call instead of directly calling iot.mqtt.publish:

// check if mqtt is connected before publishing, and add delay after each message
uint16_t mqttPublish(const char* topic, uint8_t qos, bool retain, const char* payload = nullptr, size_t length = 0, bool dup = false, uint16_t message_id = 0) {
  if (iot.mqtt.connected()) {
    iot.mqtt.publish(topic, qos, retain, payload, length, dup, message_id);
    delay(100); // it is essential to wait a bit after each message
  }
  else {
    DEBUG_PRINTLN("Tried to publish >" + String(payload) + "< to >" + String(topic) + "<. But MQTT is offline. Message lost.");
  }
}

Adding this 0.1s delay time (I am not sure what would be the minimum delay time) ultimately solved the problem for me, I have not seen a crash since. And now also the watchdog issue on CPU0 makes sense: CPU0 was blocked because of the too frequent MQTT calls caused parallel Wifi activity on CPU0 which probably lead to the problems.

So in case some of you have similar issues I would recommend to also use such a function. This also helps with devices that only do a few things and then sleep---without the delay they can cause issues as well if multiple messages are sent to MQTT. Depending on the use case I also sometimes use a different mqttPublish function that, if the MQTT is not connected, first waits a bit and tries again, but the gist is the same. Also note that you should not call this local function from your MQTT onConnect callback, that can lead to crashes as well.

License

Just a small question, don't want to start a license war here...

Was it a conscious decision to license this as GPL3 ( I know there are reasons to), and if not would not LGPL (or even MIT) provide more opportunities for this library to be used?

[Errno 13] Permission denied: '/dev/ttyUSB0'

Ich versuche auf einem Linux-Rechner (Antergos; Arch-based; 64-Bit) einen ganz simplen Sketch per Sketch - Hochladen aus der Arduino-IDE an mein Board zu senden.

Leider erhalte ich folgenden Fehler:

Der Sketch verwendet 893146 Bytes (68%) des Programmspeicherplatzes. Das Maximum sind 1310720 Bytes.
Globale Variablen verwenden 46848 Bytes (15%) des dynamischen Speichers, 248064 Bytes für lokale Variablen verbleiben. Das Maximum sind 294912 Bytes.
esptool.py v2.1
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/achim/Arduino/hardware/espressif/esp32/tools/esptool.py", line 2524, in <module>
    _main()
  File "/home/achim/Arduino/hardware/espressif/esp32/tools/esptool.py", line 2517, in _main
    main()
  File "/home/achim/Arduino/hardware/espressif/esp32/tools/esptool.py", line 2246, in main
    esp = chip_class(args.port, initial_baud)
  File "/home/achim/Arduino/hardware/espressif/esp32/tools/esptool.py", line 177, in __init__
    self._port = serial.serial_for_url(port)
  File "/usr/lib/python3.6/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "/usr/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Der ausgewählte serielle Port serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
 ist nicht vorhanden oder das Board ist nicht angeschlossen

Arch verwendet Python 3. Könnte da ein Problem liegen?

Ich bin für jeden Hinweis dankbar!

Guru Meditation Error: Core 0 panic'ed (LoadProhibited)

I repeatedly get "Guru Meditation Error: Core 0 panic'ed (LoadProhibited)" errors on boot after a deep sleep with Basecamp:

`rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13256
entry 0x40078a90

Basecamp V.0.1.6
Guru Meditation Error: Core 0 panic'ed (LoadProhibited)
. Exception was unhandled.
Core 0 register dump:
PC : 0x400014dc PS : 0x00060a30 A0 : 0x800ea8eb A1 : 0x3ffe8a00
A2 : 0x0000000f A3 : 0x0000000b A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00060023 A9 : 0x3ffd8398
A10 : 0x00000001 A11 : 0x00000001 A12 : 0x8008d140 A13 : 0x3ffe8870
A14 : 0x00000000 A15 : 0x3ffe7f40 SAR : 0x0000000b EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000000f LBEG : 0x4000142d LEND : 0x4000143a LCOUNT : 0xffffffdf

Backtrace: 0x400014dc:0x3ffe8a00 0x400ea8e8:0x3ffe8a10 0x400e875f:0x3ffe8a30 0x400d6fad:0x3ffe8a50

Rebooting...`

I traced this down to the OTA behavior, the exception decoder shows:
`PC: 0x400014dc
EXCVADDR: 0x0000000f

Decoding stack results
0x400ea8e8: String::operator=(char const*) at C:\Users*\Documents\Arduino\hardware\espressif\esp32\cores\esp32\WString.cpp line 267
0x400e875f: ArduinoOTAClass::setHostname(char const
) at C:\Users*
\Documents\Arduino\hardware\espressif\esp32\libraries\ArduinoOTA\src\ArduinoOTA.cpp line 63
0x400d6fad: Basecamp::OTAHandling(void
) at C:\Users*****\Documents\Arduino\libraries\Basecamp\Basecamp.cpp line 380`

The error can be prevented by setting
config.set("OTAActive", "false");
in setup(). Interestingly, an alternative definition of
#define BASECAMP_NOOTA 1
at the top of the sketch (i.e., before any other code or include) does not prevent the error, despite full recompile.

Weboberfläche, ERR_CONNECTION_REFUSED

Hallo,
ich habe das Beispiel aus der CT 2018/05 mit dem Temperatursensor aufgebaut, kompeliert und in den ESP32 geladen. Temperatur wird mir auf der Serial Console angezeigt.
Ich habe auf dem Captive Portal meinen AP SSID & PW eingetragen und der ESP scheint sich auch zu verbinden. Zumindest kann ich den ESP unter der zugewiesenen IP 192.168.1.23 anpingen.

Ich kann aber nicht die Weboberfläche unter 192.168.1.23 aufmachen. Chrome & Firefox sagen ERR_CONNECTION_REFUSED. Was mach ich falsch?

Danke

Hier noch ein paar Debug Mgs:

Loading config file 
/basecamp.json
Settting APSecret to hnh$v4/M(was )
Settting DeviceName to esp32-test2(was )
Settting WifiConfigured to True(was )
Settting WifiEssid to MYAP(was )
Settting WifiPassword to mypwmypwmypwmypwmypwmypw(was )
Settting my-Temperature to 23.50(was )
Config value for DeviceName: esp32-test2
esp32-test2
esp32-test2
Reset reason: 1
Unsuccessful boots: 1
Config value for APSecret: hnh$v4/M
Secret: hnh$v4/M
Config value for WifiEssid: MYAP
Config value for WifiPassword: mypwmypwmypwmypwmypwmypw
Config value for WifiConfigured: True
Config value for APSecret: hnh$v4/M
Connecting to Wifi
Wifi is configured
Connecting to MYAP
[WiFi-event] event. Bootcounter is 1
[WiFi-event] event: 2
Config value for APSecret: hnh$v4/M
MAC-Address: 30:ae:a4:35:d1:a8, Hardware MAC: 30:ae:a4:35:d1:a8
*******************************************
* ACCESS POINT PASSWORD: hnh$v4/M
*******************************************

Config value for my-Temperature: 23.50
Settting my-Temperature to 23.50(was 23.50)
Config value for my-Temperature: 23.50
Cowardly refusing to overwrite existing key with the same value
Saving config file
{
  "APSecret": "hnh$v4/M",
  "DeviceName": "esp32-test2",
  "WifiConfigured": "True",
  "WifiEssid": "MYAP",
  "WifiPassword": "mypwmypwmypwmypwmypwmypw",
  "my-Temperature": "23.50"
}Config value for my-Temperature: 23.50
Settting my-Temperature to 23.50(was 23.50)
Config value for my-Temperature: 23.50
Cowardly refusing to overwrite existing key with the same value
Saving config file
{
  "APSecret": "hnh$v4/M",
  "DeviceName": "esp32-test2",
  "WifiConfigured": "True",
  "WifiEssid": "MYAP",
  "WifiPassword": "mypwmypwmypwmypwmypwmypw",
  "my-Temperature": "23.50"
}[WiFi-event] event. Bootcounter is 1
[WiFi-event] event: 4
[WiFi-event] event. Bootcounter is 1
[WiFi-event] event: 7
Wifi IP address: 192.168.1.23
Temperatur: Config value for my-Temperature: 23.50
Settting my-Temperature to 23.50(was 23.50)
Config value for my-Temperature: 23.50
Cowardly refusing to overwrite existing key with the same value

Standardwerte für hinzugefügte Elemente setzen

Hallo,

wie kann man Standardwerte für hinzugefügte Elemente setzen?

Bei den vorgegebenen Werten funktioniert das mit dem .set Kommando echt gut, aber wenn man Felder hinzufügt und anschließend auf die gleiche Weise setzt, erscheinen die Default Werte offenbar nicht in der Konfigurationsoberfläche in den hinzugefügten Feldern.

Dankeschön vorab. 😊

Viele Grüße Axel

#define DEBUG 1 no output from basecamp

I just created this basic project:

#include <Arduino.h>

//Define DEBUG to get the Output from DEBUG_PRINTLN
#define DEBUG 1
#include <Basecamp.hpp>

Basecamp iot;

void setup() {
    iot.begin();
    DEBUG_PRINTLN("TEST");
    Serial.println("Setup Complete");
}

void loop() {
}

Output on the serial is:

rst:0xc (SW_CPU_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:812
load:0x40078000,len:0
load:0x40078000,len:11404

entry 0x40078aa0
Basecamp V.0.1.60.1.5
MAC-Address: 30:ae:a4:1a:c7:dc
TEST
Setup Complete

I see some uses of DEBUG_PRINTLN in the base file (Basecamp.cpp), but I get no output from them.
Only the DEBUG_PRINTLN I inserted after iot.begin() is working.

I'm using PlatformIO, installed Basecamp via internal library manger.
The Board I'm using is a bare ESP-WROOM-32.

Any Ideas?

Anzeige der MAC-Adresse beim Einrichten

das als Anzeige wäre noch eine gute Option. Ich hab z.B. einen MAC-Filter im WLAN, da wär's hilfreich wenn man einfach dran kommt.
per Serielle:

#include <WiFi.h>
byte mac[6];
...
WiFi.macAddress(mac);
Serial.print("MAC: ");
Serial.print(mac[0],HEX);
Serial.print(":");
Serial.print(mac[1],HEX);
Serial.print(":");
Serial.print(mac[2],HEX);
Serial.print(":");
Serial.print(mac[3],HEX);
Serial.print(":");
Serial.print(mac[4],HEX);
Serial.print(":");
Serial.println(mac[5],HEX);

in der Oberfläche:

WiFi.macAddress(mac);
String stringOne = String(mac[0], HEX)+ ":" + String(mac[1], HEX)+ ":" + String(mac[2], HEX)+ ":" +
String(mac[3], HEX) + ":" + String(mac[4], HEX)+ ":" + String(mac[5], HEX);
iot.web.addInterfaceElement("", "p", "MAC= "+stringOne,"#wrapper");

Ich hab das so beim void setup() { drin, in der Basecamp Klasse ist die Schreibweise evtl. einfacher...

IP-Adresse ist ggf. auch in der Seriellen interessant.

Factory reset was forced nach Power off

Hallo,

ich beschäftige mich seit einigen Tagen mit meinen ESP32 und nutze in diesem Zusammenhang Basecamp als Bibliothek. Ersteinmal vielen Dank für diese tolle Arbeitserleichterung!!!

In meinem ersten Projekt versuche ich Temperatur und Luftfeuchte mittels DHT22 zu messen und die erfassten Daten via MQTT an Openhab zu senden. Darüber hinaus betreibe ich am ESP32 ein OLED Display, welches die gemessenen Werte ausgibt. Weiterhin versende ich eine Information über zu hohe Luftfeuchte via Telegram.

Die Implementierung ist weitestgehend abgeschlossen. Ich würde den ESP nun gerne betreiben, habe aber folgendes Problem:

Immer wenn ich den ESP32 spannungsfrei hatte (USB entfernt) und danach wieder anstecke, sehe ich keine Infos auf dem Display. Auch das Betätigen des EN Tasters scheint keine Auswirkungen zu haben. Erst wenn ich mit der Arduino IDE den „Seriellen Monitor“ öffne, scheint sich etwas zu tun. Leider wird in dem Fall offensichtlich ein Factory Reset mit anschließendem Neustart ausgeführt. Dabei gehen die gespeicherten Konfigurationsdaten (WLAN Settings) verloren. Hier mal die Ausgaben:

x1 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310

Basecamp V.0.1.6
Factory reset was forced.
Rebooting.
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310

Basecamp V.0.1.6
Failed to open config file
Configuration empty
Generating access point secret.
MAC-Address: 3c:71:bf:0f:c9:a8, Hardware MAC: 3c:71:bf:0f:c9:a8
*******************************************
* ACCESS POINT PASSWORD: jdc:CnZV
*******************************************

WiFi.status() = WL_NO_SHIELD
Temperatur: 23.10 Humidity: 35.60

Ich habe dann mal versucht, die Konfigurationsdaten über die configuration.set Setter „einzubrennen“. Leider läuft der ESP auch nach Power off hier erst los, wenn ich den Seriellen Monitor öffne. Hier die Ausgaben:

x1 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310

Basecamp V.0.1.6
Resetting the WiFi configuration.
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310

Basecamp V.0.1.6
MAC-Address: 3c:71:bf:0f:c9:a8, Hardware MAC: 3c:71:bf:0f:c9:a8
*******************************************
* ACCESS POINT PASSWORD: jdc:CnZV
*******************************************

WiFi.status() = WL_DISCONNECTED
Temperatur: 24.50 Humidity: 29.20

Was kann das Problem sein?

Ich benutze hier gerade einen in China gekauften ESP32 in der DOIT Version. Komischerweise kann ich auch beliebig oft den EN Taster drücken. Es wird lediglich jedes Mal ein Neustart ausgeführt aber ansonsten keinerlei Resets. Werder bei 5 Mal noch bei 7 Mal.

Ich habe zudem noch eine weitere Frage zum OTA Update. Die Konfiguration dazu muss ich von Hand über die Schlüssel iot.configuration.set("OTAActive", „???“) und iot.configuration.set("OTAPassword", „MyPasswd“) setzten? Auf was setzte ich „OTAActive“?

Schon einmal Danke für euren Support und VG
Mario

Text Input for an e-paper door sign

Hi,
I love this project and I wanted to use it for my first diy project. Unfortunately, I can't find everything I need in the documentation or in the ct magazine.

My goal is to have a text input on the http page, where you can set your door message. That message should be shown on the display. I startet like this:

`#include <Basecamp.hpp>
Basecamp iot{
};
String doormessage = "Test Message !";
void setup() {

iot.begin();
iot.configuration.set("my-DoorMessage", doormessage);
iot.web.addInterfaceElement("DoorMessageDisplay", "input", "Türschildnachricht:", "#configform", "my-DoorMessage");
iot.web.setInterfaceElementAttribute("my-DoorMessage", "type", "text");
}

void loop() {
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
Serial.println("Türschildnachricht: ");
Serial.println(doormessage);

delay(5000);
}`

I don't think it's the right way, because when I click "Save", it gets resetted to the standard message. Also, I don't want to show the wireless and mqqt settings page, once the wireless has been set up. Not using MQTT for now. How would you do it? Is Basecamp the right base to start from?

Parameter dem Konfig Webinterface hinzufügen

Weiss jemand, wie man dem Türsensor Beispiel weitere Parameter im Webinterface hinzufügen kann (z.B. mehrere MQTT Topics) und wie man diese dann im Source Code abfragen/verwenden kann?

Gibt es irgendwo eine Doku zu Basecamp?

Danke im Voraus.

Helmar

Nicht mehr kompatibel zu den ct-Projekten

Hallo, nur zur Info:

die ct-Projekte sind nicht mehr kompatibel (oder ich habs falsch ausgecheckt...)

Die Methode configuration.getCString gibts nicht mehr, dachte man könnte es jetzt auf .get ändern ... da passt aber dann der Typ nicht mehr usw... für die interessierten Nachbastler nicht so schön.

How is the data.hpp created?

Hi Merlin,
First of all: Really great and solid work! Thanks a lot for this project. 👍
Just bought the new c't magazine today 😄
Question: How do you create the data.hpp? Why is the logo_svg_gz not in use?

Basecamp stoppt vor doorsensor

moin,

...blutender Anfänger kommt nicht so recht vom Platz....
Kompiler lief brav durch, keine Fehler oder Warnungen.... Hardware: SBC-NodeMCU-ESP32 auf dev-board.

Auf der Konsole Folgendes:

18:10:04.256 -> ets Jun 8 2016 00:22:57
18:10:04.256 ->
18:10:04.256 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
18:10:04.256 -> configsip: 0, SPIWP:0xee
18:10:04.256 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
18:10:04.256 -> mode:DIO, clock div:1
18:10:04.256 -> load:0x3fff0018,len:4
18:10:04.289 -> load:0x3fff001c,len:1100
18:10:04.289 -> load:0x40078000,len:10088
18:10:04.289 -> load:0x40080400,len:6380
18:10:04.289 -> entry 0x400806a4
18:10:04.627 ->
18:10:04.627 -> Basecamp V.0.1.6
18:10:04.828 -> MAC-Address: 80:7d:3a:fd:db:b4, Hardware MAC: 80:7d:3a:fd:db:b4
18:10:04.828 -> *******************************************
18:10:04.828 -> * ACCESS POINT PASSWORD: QQxZCVS3
18:10:04.862 -> *******************************************
18:10:04.862 ->

Der ESP ist erreichbar und das Basecamp-UI wird brav angezeigt. Edit und Neustart alles soweit fein... nur scheint es damit auch schon erledigt zu sein.

Hat jemand eine Idee ?

gruss vom fpg

If data.json gets too large it gets corrupted

Hi,

when there are too many interface elements or attributes to interface elements, data.json gets corrupted. Looks like a buffer overflow. There is no warning or check anywhere.

Regards

findEndHeader off-by-one-error?

In der Funktion findEndHeader laeuft die Schleife bis len-4, sollte das ein len-3 sein?

Generell finde ich das Handling der einkommenden Daten ungluecklich: das Ganze funktioniert nur, wenn der gesamte HTTP-Header komplett im ersten Datenpaket ankommt.

MQTT Probleme

Leider funktioniert die MQTT Kommunikation mit Basecamp nicht so wie sie soll oder ich mache irgendwas falsch..

Wenn ich das FullyFeatured-ESP32 Beispielprogramm von der AsyncMqttClient Bibliothek lade, kann ich problemlos MQTT Messages über den Broker iot.eclipse.org (IP 198.41.30.241) senden und empfangen:

Connecting to MQTT...
Connected to MQTT.
Session present: 0
Subscribing at QoS 2, packetId: 1
Publishing at QoS 0
Publishing at QoS 1, packetId: 2
Publishing at QoS 2, packetId: 3
Subscribe acknowledged.
  packetId: 1
  qos: 2
Publish received.
  topic: test/lol
  payload: myTest 2�
  qos: 1
  dup: 0
  retain: 1
  len: 8
  index: 0
  total: 8
Publish received.
  topic: test/lol
  payload: test 1@�
  qos: 0
  dup: 0
  retain: 0
  len: 6
  index: 0
  total: 6
Publish acknowledged.
  packetId: 2
Publish received.
  topic: test/lol
  payload: test 2P�
  qos: 1
  dup: 0
  retain: 0
  len: 6
  index: 0
  total: 6
Publish acknowledged.
  packetId: 3
Publish received.
  topic: test/lol
  payload: test 3
  qos: 2
  dup: 0
  retain: 0
  len: 6
  index: 0
  total: 6

Wenn ich dasselbe mittels der Basecamp Bibliothek ausprobiere (Gist zum Beispielprogramm), kommen die Messages mit payload myTest 1 und qos 0 sowie payload myTest 2 und qos 1 am broker an. Jedoch wird die Funktion onMqttPublish und onMqttSubscribe nicht aufgerufen, und es kommen weder manuell gesendete Messages an, noch welche wo eigenlich eine subscription auf das Topic besteht:

Connected to MQTT.
Session present: 0
Subscribing at QoS 2, packetId: 1
Publishing at QoS 0
Publishing at QoS 1, packetId: 2
Publishing at QoS 2, packetId: 3
Disconnected from MQTT.
Connected to MQTT.
Session present: 0
Subscribing at QoS 2, packetId: 0
Publishing at QoS 0
Publishing at QoS 1, packetId: 0
Publishing at QoS 2, packetId: 0
Connected to MQTT.
Session present: 0
Subscribing at QoS 2, packetId: 0
Publishing at QoS 0
Publishing at QoS 1, packetId: 0
Publishing at QoS 2, packetId: 0

Die Message myTest 3 mit qos 2 kommt im Gegensatz zu myTest 1 und myTest 2 gar nicht am Broker an.. (habe ich mittles der Chrome WebApp MQTTlens getestet)
Ausserdem wird, aus welchem Grund auch immer, die Verbindung zum MQTT Broker 3x aufgebaut..

OTA über Webserver (Beispiel)

Hallo,

ich baue gerade den Doorsensor aus der ct nach. Ich würde den Sourcecode gerne um folgende Funktion erweitert:
Wenn der ESP durch die Setup Routine läuft soll er eine Prozedur aufrufen, in der er auf einem Webserver "nachschaut" ob dort ein Firmware (.bin Datei) liegt. Wenn die Datei vorhanden ist, soll er diese laden und ein Update durchführen.

Hat so was schon jemand implementiert und könnte man den Beispielcode haben?

Danke im voraus

Helmar

No Reconnect after MQTT Broker restart

Hello,

I have a problem that my Basecamp device doesn't automaticall reconnect to the MQTT Broker after the broker was restarted (e.g. after a server update).

Is there a possibility to configure Basecamp to automatically reconnect WiFi and MQTT after a connection lost?

Thank you very much.

Fehler beim Kompilieren von Basecamp mit Beispielsketch und Asynctcp.h

Hi,

Ich versuche folgenden Sketch zu kompilieren:

#include <Basecamp.hpp>
Basecamp iot;

void setup() {
  iot.begin();
    //The mqtt object is an instance of Async MQTT Client. See it's documentation for details.
    iot.mqtt.subscribe("test/lol",2);

    //Use the web object to add elements to the interface
    iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor");
    iot.web.setInterfaceElementAttribute("color", "type", "text");

}

void loop() {
  //your code
}

Nun bekomme ich eine Reihe von Kompilierfehlern:

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:27: error: field 'call' has incomplete type 'tcpip_api_call'

     struct tcpip_api_call call;

                           ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: forward declaration of 'struct tcpip_api_call'

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_output(tcp_pcb*)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:291:65: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_output_api, (struct tcpip_api_call*)&msg);

                                                                 ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:291:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_write(tcp_pcb*, const char*, size_t, uint8_t)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:307:64: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_write_api, (struct tcpip_api_call*)&msg);

                                                                ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:307:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_recved(tcp_pcb*, size_t)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:322:65: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_recved_api, (struct tcpip_api_call*)&msg);

                                                                 ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:322:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_connect(tcp_pcb*, ip_addr_t*, uint16_t, tcp_connected_fn)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:338:66: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_connect_api, (struct tcpip_api_call*)&msg);

                                                                  ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:338:66: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_close(tcp_pcb*)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:352:64: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_close_api, (struct tcpip_api_call*)&msg);

                                                                ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:352:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_abort(tcp_pcb*)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:367:64: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_abort_api, (struct tcpip_api_call*)&msg);

                                                                ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:367:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_bind(tcp_pcb*, ip_addr_t*, uint16_t)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:382:63: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_bind_api, (struct tcpip_api_call*)&msg);

                                                               ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:382:63: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'tcp_pcb* _tcp_listen_with_backlog(tcp_pcb*, uint8_t)':

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:397:65: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]

     tcpip_api_call(_tcp_listen_api, (struct tcpip_api_call*)&msg);

                                                                 ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:397:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

     struct tcpip_api_call call;

            ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: At global scope:

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:624:6: error: prototype for 'void AsyncClient::_dns_found(ip_addr_t*)' does not match any in class 'AsyncClient'

 void AsyncClient::_dns_found(ip_addr_t *ipaddr){

      ^

In file included from C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:24:0:

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.h:84:10: error: candidate is: void AsyncClient::_dns_found(_ip_addr*)

     void _dns_found(struct _ip_addr *ipaddr);

          ^

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:946:6: error: prototype for 'void AsyncClient::_s_dns_found(const char*, ip_addr_t*, void*)' does not match any in class 'AsyncClient'

 void AsyncClient::_s_dns_found(const char * name, ip_addr_t * ipaddr, void * arg){

      ^

In file included from C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:24:0:

C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.h:164:17: error: candidate is: static void AsyncClient::_s_dns_found(const char*, _ip_addr*, void*)

     static void _s_dns_found(const char *name, struct _ip_addr *ipaddr, void *arg);

                 ^

Mehrere Bibliotheken wurden für "WiFi.h" gefunden
 Benutzt: C:\Users\Andreas\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
 Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Fehler beim Kompilieren für das Board ESP32 Wrover Module.

Ich verwende folgende Versionen der Module:
Arduino 1.8.7
Basecamp 0.1.8 (Downgrade auf 0.1.6 brachte die selben Fehler wie oben)
ESPAsyncWebServer (Masterbranch vom 1.11.18)
ArduinoJSON (Masterbranch vom 1.11.18, ArduinoJson-5.13.3 keine Änderung, ArduinoJson-6.5.0-beta keine Änderung)
Async MQTT Client 0.8.1 (Anpassung in AsyncMqttClient.hpp der Includedatei ESPAsynctcp.h auf Asynctcp.h)
AsyncTCP (Masterbranch vom 1.11.18)

Ich hoffe sie können mir weiterhelfen. Ich hab die selben Fehlermeldungen auf zwei unterschiedlichen Rechnern so reproduzieren können.

Grüße
Andreas

OTA problem

I'm trying to get OTA running with VSC but without success so far.
I've tried 0.1.8 and also current master (as #52 seems to have found a fix for the problem).
Unfortunately it doesn't work for me. The IP address is correct. Here's the code:

`#include <Arduino.h>
#include <Basecamp.hpp>

Basecamp iot{
Basecamp::
SetupModeWifiEncryption::
secured
};

void setup() {
iot.configuration.set("OTAPassword", "qwe");
iot.configuration.set("OTAActive", "true");
iot.begin();
}

void loop() {
// put your main code here, to run repeatedly:
}`

PlatformIO.ini:
`[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino

lib_deps =
ArduinoJson@<6.0

monitor_speed = 115200

upload_protocol = espota
upload_port = 192.168.0.39`

and the output from esptool:
Checking size .pioenvs/esp-wrover-kit/firmware.elf Memory Usage -> http://bit.ly/pio-memory-usage DATA: [= ] 14.2% (used 46368 bytes from 327680 bytes) PROGRAM: [======== ] 79.3% (used 1038776 bytes from 1310720 bytes) esptool.py v2.6 Configuring upload protocol... AVAILABLE: esp-prog, espota, esptool, ftdi, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa CURRENT: upload_protocol = espota Uploading .pioenvs/esp-wrover-kit/firmware.bin 17:17:06 [DEBUG]: Options: {'timeout': 10, 'esp_ip': '192.168.0.39', 'host_port': 16367, 'image': '.pioenvs/esp-wrover-kit/firmware.bin', 'host_ip': '0.0.0.0', 'auth': '', 'esp_port': 8266, 'spiffs': False, 'debug': True, 'progress': True} 17:17:06 [INFO]: Starting on 0.0.0.0:16367 17:17:06 [INFO]: Upload size: 1038896 Sending invitation to 192.168.0.39 .......... 17:18:46 [ERROR]: No response from the ESP *** [upload] Error 1

Can someone help me? Thanks!

Guru Meditation Error: Core 0 panic'ed (LoadProhibited)

Hallo, ich bekomme manchmal beim Aufwachen aus dem Deep-Sleep eine Exception. Er startet dann zwar neu, aber das sollte ja nicht passieren. Ich bin auf dem aktuellen Bootcamp master (f8ce5cd) und mit einem LOLIN32 unterwegs.

[...]
suspendESP: esp_deep_sleep_start()
ets Jun  8 2016 00:22:57

rst:0x5 (DEEPSLEEP_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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078a58

Basecamp V.0.1.6
Guru Meditation Error: Core  0 panic'ed (LoadProhibited)
. Exception was unhandled.
Register dump:
PC      : 0x400d2296  PS      : 0x00050030  A0      : 0x00000000  A1      : 0x3ffdf6a0  
A2      : 0x3ffd35b8  A3      : 0x411d9da6  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x00000000  
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x00060023  A13     : 0x3ffcfd54  
A14     : 0x00000001  A15     : 0x00000001  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  

Backtrace: 0x400d2296:0x3ffdf6a0 0x7ffffffd:0x3ffdf710

Rebooting...

WLan Accesspoint

Hi, erstmal vielen dank für Basecamp, ist eine sehr schöne und programier Erleichterung.

Nach der Installation meiner Software, bleibt der AccessPoint dauerhaft an, an sich ist das nicht schlimm, allerdings verbindet sich mein Laptop dauerhaft mit dem, da er ein stärkeres Signal hat als mein Router. Ich hab dazu allerdings auch nichts im Netz gefunden.

MfG Lukas

0.1.8 broken?

Ich scheitere gerade nachhaltig beim Versuch, basecamp zu nutzen. Eigentlich bin ich ganz naiv: Basecamp und die Abhängigkeiten eingebunden und das Beispiel kompiliert.

`#include <Basecamp.hpp>
Basecamp iot;

void setup() {
iot.begin();
//The mqtt object is an instance of Async MQTT Client. See it's documentation for details.
iot.mqtt.subscribe("test/lol",2);

//Use the web object to add elements to the interface
iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor");
iot.web.setInterfaceElementAttribute("color", "type", "text");

}

void loop() {
//your code
}`

Leider liefert das Fehlermeldungen, los geht es mit "undefined reference to Basecamp::begin(String)", wobei das Beispiel mit iot.begin() ja gar nichts übergibt.

sketch/sketch_apr16a.ino.cpp.o:(.literal._Z5setupv+0x2c): undefined reference to Basecamp::begin(String)'
sketch/sketch_apr16a.ino.cpp.o:(.literal._Z5setupv+0x30): undefined reference to WebServer::addInterfaceElement(String const&, String, String, String, String)' sketch/sketch_apr16a.ino.cpp.o:(.literal._Z5setupv+0x34): undefined reference to WebServer::setInterfaceElementAttribute(String const&, String const&, String)'
sketch/sketch_apr16a.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_iot+0x4): undefined reference to Basecamp::Basecamp(Basecamp::SetupModeWifiEncryption, Basecamp::ConfigurationUI)' sketch/sketch_apr16a.ino.cpp.o: In function setup()':
/home/patrick/Arduino/sketch_apr16a/sketch_apr16a.ino:5: undefined reference to Basecamp::begin(String)'

Vor zwei Monaten hat das alles besser funktioniert, da war ich aber bei den Abhängigkeiten sicherlich auf älteren Versionsständen. Mit welchen Versionen ganz konkret ist die Bibliothek getestet?

Viele Grüße
Patrick

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.