Sooo,
ich hab den Sketch mal etwas umgebaut.
so wie ich das recherchiert habe, brauch ich die WiFiMulti nicht.Mein ich zumindest.
Klingeln will die Fritzbox aber immer noch nicht.
hat wer ne Idee?
//https://tttapa.github.io/ESP8266/Chap07%20-%20Wi-Fi%20Connections.html
#include <Arduino.h>
#include <ESP8266WiFi.h> // Include the Wi-Fi library
//#include <ESP8266HTTPClient.h>
#include <tr064.h>
#define TASTER D3
//Wifi network name (SSID) and WLAN-Password
const char* ssid = "FRITZ!Box xxxx";
const char* password = "yyyyyyyyyyyyyyyyyyy";
//The username and password you created for login (Anmeldung aus dem Heimnetz mit Benutzername und Passwort)
const char* fuser = "xxxx";
const char* fpass = "yyyyyyyyy";
//IP address of your router. This should be "192.168.178.1" for most FRITZ!Boxes
const char* IP = "192.168.178.1";
//Port of the API of your router. This should be 49000 for all TR-064 devices.
const int PORT = 49000;
TR064 connection(PORT, IP, fuser, fpass);
void setup() {
Serial.begin(115200); // Start the Serial communication to send messages to the computer
delay(10);
Serial.println('\n');
WiFi.begin(ssid, password); // Connect to the network
Serial.print("Connecting to ");
Serial.print(ssid); Serial.println(" ...");
int i = 0;
while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
delay(1000);
Serial.print(++i); Serial.print(' ');
}
Serial.println('\n');
Serial.println("Connection established!");
Serial.print("IP address:\t");
Serial.println(WiFi.localIP()); // Send the IP address of the ESP8266 to the computer
delay(2000);
}
void loop() {
int taste = digitalRead(TASTER);
if (digitalRead(TASTER)== LOW)
{
//USE_SERIAL.println();
Serial.println();
//USE_SERIAL.printf("Taste gedrueckt");
Serial.println("Taste gedrueckt");
// callWahlhilfe();
Serial.println("Initialize TR-064 connection");
delay(20000);
}
else
{
//USE_SERIAL.println();
Serial.println();
//USE_SERIAL.printf("Taste nicht gedrueckt");
Serial.println("Taste nicht gedrueckt");
delay(50);
}
//delay(100);
}
int callWahlhilfe() {
// Maybe the WLAN connection is lost, so testing an reconnect if needed
// if ((WiFiMulti.run() != WL_CONNECTED)) {
// WiFiMulti.addAP(wifi_ssid, wifi_password);
// while ((WiFiMulti.run() != WL_CONNECTED)) {
// delay(100);
// }
// }
// (Re-) Initialize the TR-064 library - it is done every time, as maybe the connection has lost before
connection.init();
String params[][2] = {{"NewX_AVM-DE_PhoneNumber", "**610"}};
//String params[][2] = {{"X_AVM-DE_DialNumber", "**701"}};
String req[][2] = {{}};
connection.action("urn:dslforum-org:service:X_VoIP:1", "X_AVM-DE_DialNumber", params, 1, req, 0);
}
Die ausdokumentierten Zeilen sind Versuche von mir bzw. Teile die ich rausgenommen habe.
Ich weiss z.Zt. nimmer weiter.


