Beauty!
Looking forward to hear more about your alexa integration.
By the way, what firmware are you using on the ESP8266 side? ESPEasy? How stable is your MQTT communication?
Yes, ESPEasy. It really is fun, I'll probably structure whatever I want to do with an ESP around it from now on
MQTT messages from the ESP to my CHIP are working fine, but I haven't finished making stuff go the other way since I'm blindly poking things in Node-Red and ESPEasy. I'm not sure how to create the message properly into the MQTT server for the ESP to pick up the topic. If you've got a pointer, I'm all eyes/ears. It's quite possible that I haven't found the right manual to read yet.
I got sidetracked on the Alexa thing because I didn't have my Amazon dev login info handy. Maybe today?
Did not had the chance to try MQTT with ESPEasy firmware but will do it.
As server I have used mosquitto on RPI2, just subscribe your ESP to a topic and if all OK you should be able to receive and send messages on the MQTT Server like:
Create topic:
mosquitto_sub -h localhost -v -t test/topic
Send message from server:
mosquitto_pub -h localhost -t test/topic -m "Whatever test msg you want to send to ESP"
UPDATE - Lunch break fun
Basic testing - ESPEasy + MQTT + RPI2 mosquitto:
- start your mosquitto server :
sudo service mosquitto restart
- upload ESPEasy on your ESP8266 :
version 147_RC8
- reboot ESP8266
- connect with a terminal on your serial to receive ESP8266 board debug messages
- configure your WIFI on your ESP8266 and connect to network :
192.168.1.36
- set in ESPEasy config page:
http://192.168.1.36/config
- a unique name for your ESP8266 : ESP871
- protocol : OPENHAB MQTT
- Controller IP/port : 192.168.1.16 1883
- save config and reboot ESP board
- you should see in the Serial Terminal something like:
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
INIT : SPI not enabled
MQTT : Connected to broker
Subscribed to: /ESP871/#
INIT : Boot OK
INIT : Normal boot
- subscribe also from RPi console :
mosquitto_sub -d -t /ESP871/#
- from another console keep an eye on log file :
tail -f /var/log/mosquitto/mosquitto.log
- 3rd console, let's publish something:
mosquitto_pub -d -t /ESP871/gpio/5 -m "1"
mosquitto_pub -d -t /ESP871/gpio/5 -m "0"
If you have a LED connected at GPIO5 you should see the result as a ON/OFF command on your LED.
Also in the Serial terminal window you will see:
SW : GPIO 5 Set to 1
SW : GPIO 5 Set to 0
I hope it helps as a starting point to your own tests.