Closed pvint closed 3 years ago
Original comment by Paul Vint (Bitbucket: pvint, GitHub: pvint).
I’m having trouble tracing back to see why it’s trying to remove it twice, so for now I’ve done this:
340a341
>
342,348c343,344
< if(_tcpClients[i] != NULL) {
< _tcpClients[i]->free();
< _tcpClients[i] = NULL;
< }
< else {
< DEBUG_MSG_FAUXMO("[FAUXMO] Client %d already disconnected\n", i);
< }
---
> _tcpClients[i]->free();
> _tcpClients[i] = NULL;
This seems to be functioning fine.
For reference, I’m using this in an esp-idf project, specifically: https://github.com/pvint/Starfish-idf/blob/master/main/starfish_main.cpp and it’s been controlling the lighting on my boat for a couple years. This is really a great project, and thanks!
Paul
Hi, I have recently been facing a new issue: Devices don't discover . And I think it might be slightly related to this issue.
Here's the Faxmo Debug Output:
addDevice
:[FAUXMO] UDP server started
[FAUXMO] Device 'matrix 1' added as #0
[FAUXMO] Device 'matrix 2' added as #1
[FAUXMO] Device 'matrix 3' added as #2
[FAUXMO] Device 'matrix 4' added as #3
[FAUXMO] Device 'matrix 5' added as #4
discover devices
:[FAUXMO] Client #0 connected
[FAUXMO] Handling list request
[FAUXMO] Sending device info for "matrix 1", uniqueID = "e19e23ea6249"
[FAUXMO] Sending device info for "matrix 2", uniqueID = "73e1eff10d85"
[FAUXMO] Sending device info for "matrix 3", uniqueID = "2204d4759ed4"
[FAUXMO] Sending device info for "matrix 4", uniqueID = "53c083e13819"
[FAUXMO] Sending device info for "matrix 5", uniqueID = "8542c5f4db51"
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling devicetype request
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling list request
[FAUXMO] Sending device info for "matrix 1", uniqueID = "e19e23ea6249"
[FAUXMO] Sending device info for "matrix 2", uniqueID = "73e1eff10d85"
[FAUXMO] Sending device info for "matrix 3", uniqueID = "2204d4759ed4"
[FAUXMO] Sending device info for "matrix 4", uniqueID = "53c083e13819"
[FAUXMO] Sending device info for "matrix 5", uniqueID = "8542c5f4db51"
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling devicetype request
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling list request
[FAUXMO] Sending device info for "matrix 1", uniqueID = "e19e23ea6249"
[FAUXMO] Sending device info for "matrix 2", uniqueID = "73e1eff10d85"
[FAUXMO] Sending device info for "matrix 3", uniqueID = "2204d4759ed4"
[FAUXMO] Sending device info for "matrix 4", uniqueID = "53c083e13819"
[FAUXMO] Sending device info for "matrix 5", uniqueID = "8542c5f4db51"
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling devicetype request
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling list request
[FAUXMO] Sending device info for "matrix 1", uniqueID = "e19e23ea6249"
[FAUXMO] Sending device info for "matrix 2", uniqueID = "73e1eff10d85"
[FAUXMO] Sending device info for "matrix 3", uniqueID = "2204d4759ed4"
[FAUXMO] Sending device info for "matrix 4", uniqueID = "53c083e13819"
[FAUXMO] Sending device info for "matrix 5", uniqueID = "8542c5f4db51"
[FAUXMO] Client #0 disconnected
The code is fairly simple,
Have used all necessary init stuff (setPort, .enable)
and everything, I run fauxmo.handle()
in the loop without fail.
Please help me fix this ASAP, not able to discover/ Turn devices on/off
@Tejas-MD
First thing I need to be sure of is that you're using version 3.1.2 or latest pull from master branch.
Failing that: ESP32 or ESP8266?
Can you test with a minimal sketch like the Basic example?
Hi, I ran a few more tests, and it was fixed!!!
Had to add this to the platform.ini:
board_build.f_flash = 80000000L
build_flags= -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
Board: Esp8266
Also btw, since this relates to this issue fix: Thanks for giving the grouping and switch operation thing priority! I just saw it pair under "Lights" And has a cool UI for turning lights on and off on the alexa app itself!
I wanted to know: Does the library support the ON/OFF status on the alexa app? Cause my app says: Device does not support requested value
and turns the switch(That button with a glowing white) off 5-6 seconds after the switch operation is successful, though it triggers the callback on my mcu!
Good news!
It's a bit "new" in the master branch (showing up as a proper light in Alexa App), so there's some quirks.
I'm testing that and more on the 'colour' branch - if you're feeling adventurous, try it out https://github.com/vintlabs/fauxmoESP/tree/colour
Original report by Paul Vint (Bitbucket: pvint, GitHub: pvint).
I’ve been having occasional crashes for months, and I had thought it was taken care of when I updated AsyncTCP, but it has come back, but today I was lucky to have a consistent way to reproduce it and got some info.
Right now, if I tell Alexa “Turn on White Lights”, it sends commands to turn on fauxmo devices 0,1 and 2 (which actually works), however when fauxmo is closing connections and cleaning up, it is trying to call
_tcpClients[0]->free();
an extra time for device 0 (zero). (Tested with 2nd gen and 3rd gen Echo Dot with same results)Here is my console output when it occurs (I added a couple printf statements in fauxmoESP.cpp and AsyncTCP.cpp for more info), along with a backtrace:
(The
I (12337) starfish: fauxmo device_id = 1 state = 1 val = 255 v = 4080
lines are from my software showing where it receives info from fauxmoESP)
The critical part seems to be:
Note that near the end, it frees client 0, then client 1, and then tries to free client 0 again.
Debugging statements I added around line 343 in fauxmoESP.cpp:
I’ll keep digging and update as I have more info.
Thanks