Ich hab da mal was "gebastelt"...
Villeicht kann jemand damit was anfangen.
Aufgabenstellung:
wenn Jemand an der Tür klingelt soll das (DECT) Telefon klingeln, da auch im Garten häufig dabei oder in Hörweite ist.
Da ich das Türsteuerungsmodul nicht dazu bewegen konnte per SIP/Fritzbox einen Rundruf zu starten habe ich einen Arduino dazwischen geschaltet.
Jetzt sendet der Miniserver einen UDP Befehl an den Arduino und dieser wählt per SIP über die Fritzbox **9, also den Rundruf.
Vorraussetzung:
- SIP account in der Fritzbox
- Arduino mit Ethernet Shield
Vorlage für das Arduino Sketch: http://forum.arduino.cc/index.php?topic=234204.0
Vorlage UDP Server: http://www.meintechblog.de/2015/06/a...udp-ansteuern/
Mein Sketch:
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <MD5.h>
#include "SIPRinger.h"
// Enter a MAC address for your controller below.
// Adapt to your local network.
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEA
};
boolean reading = false;
boolean ring = false;
char sipUser[20]; // sip user/pwd to connect to the SIP server
char sipPwd[20]; // sip user/pwd to connect to the SIP server
char sipNrToDial[20]; // telephone nr. to dial
byte sipServerIp[4]; // SIP server IP
int sipPort; // port to connect to the SIP server (standard is 5060)
int useTcp; // use TCP to connect to the SIP server (instead of UDP)
int ringDurationInSeconds; // phone ring time
SIPRinger sipRinger;
// Recipient IP
IPAddress RecipientIP("--MiniserverIP--");
// Recipient UDP Port
// Local UDP port to listen on
unsigned int localPort = 7007;
// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE];
// An EthernetUDP instance to send and receive packets over UDP
EthernetUDP Udp;
void setup() {
Serial.begin(115200);
// disable SD
// http://forum.freetronics.com/viewtopic.php?f=4&t=176&start=50
pinMode(53, OUTPUT); // set the SS pin as an output (necessary!)
digitalWrite(53, LOW); // ? (not sure)
pinMode(4, OUTPUT); // SD select pin
digitalWrite(4, HIGH); // Explicitly disable SD
pinMode(10, OUTPUT); // Ethernet select pin
digitalWrite(10, LOW); // Explicitly enable Network
initEthernet();
// Start UDP
Udp.begin(localPort);
//FritzBox IP
// Adapt to your local configuration
sipServerIp[0] = 192;
sipServerIp[1] = 168;
sipServerIp[2] = 178;
sipServerIp[3] = 1;
IPAddress sipServerIpBin(sipServerIp);
sipPort = 5060;
useTcp = true;
strcpy( sipUser, "620");
strcpy( sipPwd, "geheim");
strcpy( sipNrToDial, "**9");
ringDurationInSeconds = 30;
sipRinger.init(sipServerIpBin, sipPort, useTcp, sipUser, sipPwd, sipNrToDial, ringDurationInSeconds);
// if analog input pin 0 is unconnected, random analog
// noise will cause the call to randomSeed() to generate
// different seed numbers each time the sketch runs.
// randomSeed() will then shuffle the random function.
// -> hoepfully less predictable IDs generated in SIP
randomSeed(analogRead(0));
}
void loop() {
if (Serial.available() > 0) {
Serial.read();
sipRinger.ring();
}
if (ring)
{
sipRinger.ring();
ring = false;
}
// update() must be called regularyly to actively maintain the calls progress.
sipRinger.update();
// warten auf Anfragen von Miniserver
checkUDP();
}
void initEthernet() {
Serial.println(F("Configuring Ethernet using DHCP..."));
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println(F("Failed to initialize Ethernet with DHCP"));
// no point in carrying on, so do nothing forevermore:
for (;;)
;
}
// print local IP address
Serial.print("DHCP succesfull: IP=");
for (byte thisByte = 0; thisByte < 4; thisByte++) {
// print the value of each byte of the IP address:
Serial.print(Ethernet.localIP()[thisByte], DEC);
Serial.print(F("."));
}
Serial.println();
Serial.flush();
}
// Function to check for new incoming UDP packets
void checkUDP()
{
// if there's data available, read a packet
int packetSize = Udp.parsePacket();
if(packetSize)
{
// read the packet into packetBufffer
Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);
// For debug only
// Write packetBuffer to serial
Serial.print("ReceiveUDP: ");
Serial.println(packetBuffer);
if (!strcmp(packetBuffer, "ring"))
{
ring = true;
}
// send "ACK" as reply
//Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
//Udp.write("ACK");
//Udp.endPacket();
}
}

Grübel schon wieder über weitere Möglichkeiten nach
Kommentar