-->
Page 5 of 6

Re: GPIO not switching..code issue?

PostPosted: Tue Jan 14, 2020 3:58 pm
by Bonzo
I have just done a test:
Uploaded the code un altered from https://randomnerdtutorials.com/alexa-e ... more-53313
Connected a LED and resistor to GPIO14 (D5)
Found devices on the echo (Phillips lamps)
LED was already on
Told echo to turn lamp 2 on and LED goes off
Turn lamp off and LED comes on

I think it is always better to get the code working and then add or remove code as you have a good starting point.

Re: GPIO not switching..code issue?

PostPosted: Tue Jan 14, 2020 4:53 pm
by GreenBlood
Still, no joy. That code runs fine but the println statements are not triggering in the state machine.

Re: GPIO not switching..code issue?

PostPosted: Tue Jan 14, 2020 4:56 pm
by GreenBlood
I’ve just done the same but removed the rf functionality. I can’t get alexa to register the lamps.

Of course, I started with this, maybe removing the rf code, I wonder if I’ve removed something essential....

Bonzo wrote:I have just done a test:
Uploaded the code un altered from https://randomnerdtutorials.com/alexa-e ... more-53313
Connected a LED and resistor to GPIO14 (D5)
Found devices on the echo (Phillips lamps)
LED was already on
Told echo to turn lamp 2 on and LED goes off
Turn lamp off and LED comes on

I think it is always better to get the code working and then add or remove code as you have a good starting point.

Re: GPIO not switching..code issue?

PostPosted: Tue Jan 14, 2020 5:25 pm
by Bonzo
My echo is new and all I have added to it is a Sinric skill which I used for the other Alexa code.

I have found two devices with this code; both "Royal Philips Electronics smart device". I had other fauxmo code I tried last weekend which didn't find a device. This code gave me a compile error but that was down to an old version of fauxmo and obviously that is not your problem as you can compile and upload your code.

This the output I am getting from the serial monitor:
[MAIN] Free heap: 49584 bytes
[MAIN] Free heap: 49080 bytes
[MAIN] Free heap: 49080 bytes
[MAIN] Device #1 (lamp two) state: ON value: 255
RELAY 2 switched by Alexa
[MAIN] Free heap: 49080 bytes
[MAIN] Device #1 (lamp two) state: OFF value: 255
RELAY 2 switched by Alexa
[MAIN] Free heap: 49080 bytes
[MAIN] Free heap: 49080 bytes
[MAIN] Free heap: 49080 bytes


I assume the registering of the lamps is not hardware dependant as I only have one LED connected. I am afraid I can not help further and just wanted to let you know the code will work ;) All very frustrating.