mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Publish TCP 80 for mDNS
This commit is contained in:
parent
c4d6a1008f
commit
ce3946c9e6
6 changed files with 9 additions and 6 deletions
12
Network.cpp
12
Network.cpp
|
|
@ -65,7 +65,9 @@ void Network::loop() {
|
||||||
// We are doing this every 60 seconds because of the BS related to
|
// We are doing this every 60 seconds because of the BS related to
|
||||||
// the MDNS library. The original library required manual updates
|
// the MDNS library. The original library required manual updates
|
||||||
// to the MDNS or it would lose its hostname after 2 minutes.
|
// to the MDNS or it would lose its hostname after 2 minutes.
|
||||||
if(this->lastMDNS != 0) MDNS.setInstanceName(settings.hostname);
|
//if(this->lastMDNS != 0) MDNS.setInstanceName(settings.hostname);
|
||||||
|
|
||||||
|
|
||||||
// Every 60 seconds we are going to look at wifi connectivity
|
// Every 60 seconds we are going to look at wifi connectivity
|
||||||
// to get around the roaming issues with ESP32. We will try to do this in an async manner. If
|
// to get around the roaming issues with ESP32. We will try to do this in an async manner. If
|
||||||
// there is a channel that is better we will stop the radio and reconnect
|
// there is a channel that is better we will stop the radio and reconnect
|
||||||
|
|
@ -153,7 +155,7 @@ void Network::emitSockets() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Network::emitSockets(uint8_t num) {
|
void Network::emitSockets(uint8_t num) {
|
||||||
char buf[128];
|
//char buf[128];
|
||||||
if(this->connType == conn_types::ethernet) {
|
if(this->connType == conn_types::ethernet) {
|
||||||
JsonSockEvent *json = sockEmit.beginEmit("ethernet");
|
JsonSockEvent *json = sockEmit.beginEmit("ethernet");
|
||||||
json->beginObject();
|
json->beginObject();
|
||||||
|
|
@ -175,8 +177,8 @@ void Network::emitSockets(uint8_t num) {
|
||||||
JsonSockEvent *json = sockEmit.beginEmit("wifiStrength");
|
JsonSockEvent *json = sockEmit.beginEmit("wifiStrength");
|
||||||
json->beginObject();
|
json->beginObject();
|
||||||
json->addElem("ssid", WiFi.SSID().c_str());
|
json->addElem("ssid", WiFi.SSID().c_str());
|
||||||
json->addElem("strength", (uint32_t)WiFi.RSSI());
|
json->addElem("strength", (int32_t)WiFi.RSSI());
|
||||||
json->addElem("channel", (uint32_t)this->channel);
|
json->addElem("channel", (int32_t)this->channel);
|
||||||
json->endObject();
|
json->endObject();
|
||||||
sockEmit.endEmit(num);
|
sockEmit.endEmit(num);
|
||||||
/*
|
/*
|
||||||
|
|
@ -339,7 +341,7 @@ void Network::setConnected(conn_types connType) {
|
||||||
SSDP.setActive(0, true);
|
SSDP.setActive(0, true);
|
||||||
if(MDNS.begin(settings.hostname)) {
|
if(MDNS.begin(settings.hostname)) {
|
||||||
Serial.printf("MDNS Responder Started: serverId=%s\n", settings.serverId);
|
Serial.printf("MDNS Responder Started: serverId=%s\n", settings.serverId);
|
||||||
//MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
//MDNS.addServiceTxt("http", "tcp", "board", "ESP32");
|
//MDNS.addServiceTxt("http", "tcp", "board", "ESP32");
|
||||||
//MDNS.addServiceTxt("http", "tcp", "model", "ESPSomfyRTS");
|
//MDNS.addServiceTxt("http", "tcp", "model", "ESPSomfyRTS");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4495,7 +4495,7 @@ void Transceiver::emitFrame(somfy_frame_t *frame, somfy_rx_t *rx) {
|
||||||
json->addElem("address", (uint32_t)frame->remoteAddress);
|
json->addElem("address", (uint32_t)frame->remoteAddress);
|
||||||
json->addElem("rcode", (uint32_t)frame->rollingCode);
|
json->addElem("rcode", (uint32_t)frame->rollingCode);
|
||||||
json->addElem("command", translateSomfyCommand(frame->cmd).c_str());
|
json->addElem("command", translateSomfyCommand(frame->cmd).c_str());
|
||||||
json->addElem("rssi", (uint32_t)frame->rssi);
|
json->addElem("rssi", (int32_t)frame->rssi);
|
||||||
json->addElem("bits", rx->bit_length);
|
json->addElem("bits", rx->bit_length);
|
||||||
json->addElem("proto", static_cast<uint8_t>(frame->proto));
|
json->addElem("proto", static_cast<uint8_t>(frame->proto));
|
||||||
json->addElem("valid", frame->valid);
|
json->addElem("valid", frame->valid);
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1884,6 +1884,7 @@ class Wifi {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
procWifiStrength(strength) {
|
procWifiStrength(strength) {
|
||||||
|
//console.log(strength);
|
||||||
let ssid = strength.ssid || strength.name;
|
let ssid = strength.ssid || strength.name;
|
||||||
document.getElementById('spanNetworkSSID').innerHTML = !ssid || ssid === '' ? '-------------' : ssid;
|
document.getElementById('spanNetworkSSID').innerHTML = !ssid || ssid === '' ? '-------------' : ssid;
|
||||||
document.getElementById('spanNetworkChannel').innerHTML = isNaN(strength.channel) || strength.channel < 0 ? '--' : strength.channel;
|
document.getElementById('spanNetworkChannel').innerHTML = isNaN(strength.channel) || strength.channel < 0 ? '--' : strength.channel;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue