Tutorial ESPEasy / OpenHAB problem
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 103
- Joined: 16 Sep 2015, 20:32
Tutorial ESPEasy / OpenHAB problem
I am having a test setup with Raspi2, TP-link wifi router, ESP8266-12, OpenHAB, Mosquitto and of course ESPEasy
I'm using the router as a dedicated home automation wifi.
It has no Internet connection,just using it as switch
I have connected the Raspi with a wifi stick to the router.
The Ethernet from the raspi goes to my home network so I can manage the raspi also from there.
The serial from the ESP8266-12 is also connected to my work PC
I have connected a laptop to the Home Automation wifi so I can communicate to the ESP8266-12 via the webinterface
I have installed OpenHAB and Mosquitto MQTT on the raspi with the demo site from OpenHAB.
Then I used the EasyESP tutorial for OpenHAB (LED on/off)
I'm using ESPEasy build 20 from Github
I can reach the ESP8266-12 with the webinterface and have it configured for my home automation wifi, I called it "TestESP"
I have managed to let OpenHAB speak to MQTT following the tutorial, I've monitored the MQTT messages to /TestESP/gpio/2 and it is sending 0 and 1 as expected.
The only thing that does not happen is that the LED on gpio 2 responds
Is there somebody out there who has this tutorial working?
Or somebody who has an advice how to trace/tackle the problem?
I'm using the router as a dedicated home automation wifi.
It has no Internet connection,just using it as switch
I have connected the Raspi with a wifi stick to the router.
The Ethernet from the raspi goes to my home network so I can manage the raspi also from there.
The serial from the ESP8266-12 is also connected to my work PC
I have connected a laptop to the Home Automation wifi so I can communicate to the ESP8266-12 via the webinterface
I have installed OpenHAB and Mosquitto MQTT on the raspi with the demo site from OpenHAB.
Then I used the EasyESP tutorial for OpenHAB (LED on/off)
I'm using ESPEasy build 20 from Github
I can reach the ESP8266-12 with the webinterface and have it configured for my home automation wifi, I called it "TestESP"
I have managed to let OpenHAB speak to MQTT following the tutorial, I've monitored the MQTT messages to /TestESP/gpio/2 and it is sending 0 and 1 as expected.
The only thing that does not happen is that the LED on gpio 2 responds
Is there somebody out there who has this tutorial working?
Or somebody who has an advice how to trace/tackle the problem?
Re: Tutorial ESPEasy / OpenHAB problem
Hello,
Nice to see that someone is actually trying to use the openhab with ESP Easy. We did a test some time ago and it did work at that time (R16). But maybe later development did break something here.
Do you get this message on serial out when the ESP starts:
I checked the code, but the debugging part has been commented out. Have to improve this in some newer release. You might be able to enable this yourself for time being. If you navigate to the "controller" tab and find lines 387 & 388, should look like this:
and change it to:
Upload to ESP and see if it shows the received MQTT topic split into separate lines.
Nice to see that someone is actually trying to use the openhab with ESP Easy. We did a test some time ago and it did work at that time (R16). But maybe later development did break something here.
Do you get this message on serial out when the ESP starts:
Code: Select all
MQTT : Connected to broker
Code: Select all
//for (byte x = 0; x <= count; x++)
//Serial.println(topicSplit[x]);
Code: Select all
for (byte x = 0; x <= count; x++)
Serial.println(topicSplit[x]);
-
- Normal user
- Posts: 103
- Joined: 16 Sep 2015, 20:32
Re: Tutorial ESPEasy / OpenHAB problem
Yes and no, I want to work with OpenHab and Mosquitto.Martinus wrote: Nice to see that someone is actually trying to use the openhab with ESP Easy
I think this problem has to do with the interface Mosquitto <> ESP8266
Yes it is thereMartinus wrote: Do you get this message on serial out when the ESP starts:Code: Select all
MQTT : Connected to broker
I have uncommented the lines for the debug print, but no result in the serial terminal.
In the sketch i see that the MQTT port is hardcoded (1883).
I do not think thats correct, it can have another one if configured in Mosquitto, (not in this case).
Maybe that there is a mixup in names/ip's and ports for the use with Domoticz
I have also problems with the AP key / Sta key and the initializing of ESPEasy in espeasy.ino
I cannot get my finger behind this at the moment.
It looks like the login code of the ESP is persistant between new flashes, if true then it's probably by design .
I think that there is a problem in the logins, usernames, passwords, ports.
But that's not for this thread, i will open another one for that (once I can describe the problem.)
I continue the search
Re: Tutorial ESPEasy / OpenHAB problem
Now you have me confused. You do have an ESP buy you're not going to use it with openhab/ESPEasyNietGiftig wrote:Yes and no, I want to work with OpenHab and Mosquitto.Martinus wrote: Nice to see that someone is actually trying to use the openhab with ESP Easy
Would have been nice... We need more people to help testing/debugging/etc.
You're right about the hardcoded portnumber. That's a bug, but it should still work if you're using the default port on Mosquitto.NietGiftig wrote:In the sketch i see that the MQTT port is hardcoded (1883).
It's fixed it R21.
I've had a chance to boot up the openhab testlab and tested against ESPEasy R20. Still works in my testlab (can blink the blue led on/off), so we haven't broken things since R16. Your unit connects anyway or you would not see the "connected to broker message"
So what's wrong in your environment?
In case of OpenHab we decided to have the ESP listen to all topics address to it's name
Code: Select all
/<espname>/#
R21 is available now on github. Maybe you can use this version, so we know that we're using the same sketch...
This is my serial log:
Code: Select all
INIT : I2C
MQTT : Connected to broker
Subscribed to: /openhabdemo/#
INIT : Boot OK
Boot
0
normal boot
MQTT : Topic /openhabdemo/gpio/2
gpio,2,1
-
- Normal user
- Posts: 103
- Joined: 16 Sep 2015, 20:32
Re: Tutorial ESPEasy / OpenHAB problem
Sorry, my fault, of course I want to use ESPEasy otherwise I would not be here.Martinus wrote: Now you have me confused. You do have an ESP buy you're not going to use it with openhab/ESPEasy
Would have been nice... We need more people to help testing/debugging/etc.
Not good at RTFMMartinus wrote: I've had a chance to boot up the openhab testlab and tested against ESPEasy R20. Still works in my testlab (can blink the blue led on/off), so we haven't broken things since R16. Your unit connects anyway or you would not see the "connected to broker message"
So what's wrong in your environment?
In case of OpenHab we decided to have the ESP listen to all topics address to it's nameCode: Select all
/<espname>/#
I had called my lovely little ESP8266 E12 "ESPTestboard", because it is sitting in my testboard.
After setting the serial debug to level 4, i did see some lines more in the serial monitor.
(Advice for everybody, set the level high)
That's when I saw the problem, because in the openhabdemo it has a different name, and so a different message topic in Mosquitto.
I have, problem has been solvedMartinus wrote: R21 is available now on github. Maybe you can use this version, so we know that we're using the same sketch...
Th next one is comming, but not ESPEasy.
When I change the buttonstate in OpenHAB a couple of times quick, mosquitto stops responding for a few seconds.
When I do the same in the Raspi terminal console it keeps working.
Code: Select all
mosquitto_pub -d -t /ESPTestboard/gpio/2 -m "1"
mosquitto_pub -d -t /ESPTestboard/gpio/2 -m "0"
Re: Tutorial ESPEasy / OpenHAB problem
Hi guys. I too have set this demo up today with R78. I am using MQTT.fx to get status updates from the ESP every 60s on the channel /PetesESP8266/# and this works flawlessly. Tonight I wanted to try publishing to turn the internal blue LED on but when I publish this , the blue LED turns on (no payload sent) and I cannot turn it off without hitting reset on the board.
The MQTT server is running on my Synology NAS and the ESP can see it.
Am I doing something wrong?
P.S I'm still learning OH2 so wanted to get familiar with MQTT before delving deeper into OH.
Code: Select all
/PetesESP8266/gpio/2
The MQTT server is running on my Synology NAS and the ESP can see it.
Am I doing something wrong?
P.S I'm still learning OH2 so wanted to get familiar with MQTT before delving deeper into OH.
Numerous Sonoff's and Shelly's, Home Assistant on Intel NUC i3, Aeotec Z-Stick (Gen 5), deCONZ Zigbee Stick, 3 x Echo Dot's and 5 x Google Home
Re: Tutorial ESPEasy / OpenHAB problem
So what do you expect when you send no payload? I wouldn't even expect that it switches on.xbmcnut wrote:when I publish this, the blue LED turns on (no payload sent)Code: Select all
/PetesESP8266/gpio/2
Try to send payload 1 for on and payload 0 for off
I have it running for dimming a RGB LED String and it works well. I can see everything in MQTTfx and Mosquitto and OpenHAB is running on my Synology.
Re: Tutorial ESPEasy / OpenHAB problem
@dabe5 Yes, that is why I'm puzzled. When I publish without anything else, the internal blue LED turns on. Sending 0 or 1 in the payload makes no difference and I have to reset the board to get the LED to turn off.
Code: Select all
/PetesESP8266/gpio/2
Numerous Sonoff's and Shelly's, Home Assistant on Intel NUC i3, Aeotec Z-Stick (Gen 5), deCONZ Zigbee Stick, 3 x Echo Dot's and 5 x Google Home
Re: Tutorial ESPEasy / OpenHAB problem
I have no problems to switch the gpio on/off with
and payload 0 / 1
or and payload from 0 to 1000 for dimming the LED
but I never tried with GPIO 2.
I use GPIO 12, 13 and 14
Code: Select all
/ESP-OG01/gpio/14
or
Code: Select all
/ESP-OG01/pwm/14
but I never tried with GPIO 2.
I use GPIO 12, 13 and 14
Re: Tutorial ESPEasy / OpenHAB problem
Thanks for the advice. I'll try that tomorrow.
Numerous Sonoff's and Shelly's, Home Assistant on Intel NUC i3, Aeotec Z-Stick (Gen 5), deCONZ Zigbee Stick, 3 x Echo Dot's and 5 x Google Home
Re: Tutorial ESPEasy / OpenHAB problem
Hi,
something is wrong in R93 or me...
I set gpio15 at ON, 1 or 255 via openhab/mgtt -> it works
but after reboot ESP, gpio15 starts with 0 -> and goes not to ON, 1 or 255.
I would like the same state before reboot...
How can i fix that?
should i set gpio15 as switch?
Thanks
something is wrong in R93 or me...
I set gpio15 at ON, 1 or 255 via openhab/mgtt -> it works
but after reboot ESP, gpio15 starts with 0 -> and goes not to ON, 1 or 255.
I would like the same state before reboot...
How can i fix that?
should i set gpio15 as switch?
Thanks
Code: Select all
Mar 29 16:45:58 10.1.1.181 ESP Unit: 1 : MQTT : Topic: /ESP_01/gpio/15
Mar 29 16:45:58 10.1.1.181 ESP Unit: 1 : MQTT : Payload: 255
Mar 29 16:45:58 10.1.1.181 ESP Unit: 1 : SW : GPIO 15 Set to 255
Mar 29 16:46:00 10.1.1.181 ESP Unit: 1 : MQTT : Topic: /ESP_01/gpio/12
Mar 29 16:46:00 10.1.1.181 ESP Unit: 1 : MQTT : Payload: 155
Mar 29 16:46:00 10.1.1.181 ESP Unit: 1 : SW : GPIO 12 Set to 155
Mar 29 16:46:01 10.1.1.181 ESP Unit: 1 : MQTT : Topic: /ESP_01/gpio/13
Mar 29 16:46:01 10.1.1.181 ESP Unit: 1 : MQTT : Payload: 155
Mar 29 16:46:01 10.1.1.181 ESP Unit: 1 : SW : GPIO 13 Set to 155
Mar 29 16:46:06 10.1.1.181 ESP Unit: 1 : : Rebooting...
Mar 29 16:46:11 10.1.1.181 ESP Unit: 1 : WIFI : Connected!
Mar 29 16:46:11 10.1.1.181 ESP Unit: 1 : MQTT : Connected to broker
Mar 29 16:46:11 10.1.1.181 ESP Unit: 1 : Subscribed to: /ESP_01/#
Mar 29 16:46:11 10.1.1.181 ESP Unit: 1 : UDP : Send Sysinfo message
Mar 29 16:46:12 10.1.1.181 ESP Unit: 1 : INIT : Boot OK
Mar 29 16:46:12 10.1.1.181 ESP Unit: 1 : INIT : Normal boot
Mar 29 16:46:12 10.1.1.181 ESP Unit: 1 : EVENT: System#Boot
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : MQTT : Topic: /ESP_01/gpio/13
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : MQTT : Payload: 0
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : SW : GPIO 13 Set to 0
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : MQTT : Topic: /ESP_01/gpio/12
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : MQTT : Payload: 0
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : SW : GPIO 12 Set to 0
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : MQTT : Topic: /ESP_01/gpio/15
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : MQTT : Payload: 0
Mar 29 16:46:13 10.1.1.181 ESP Unit: 1 : SW : GPIO 15 Set to 0
Re: Tutorial ESPEasy / OpenHAB problem
Thanks for your help. Works flawlessly now.dabe5 wrote:I have no problems to switch the gpio on/off withand payload 0 / 1Code: Select all
/ESP-OG01/gpio/14
orand payload from 0 to 1000 for dimming the LEDCode: Select all
/ESP-OG01/pwm/14
but I never tried with GPIO 2.
I use GPIO 12, 13 and 14
Numerous Sonoff's and Shelly's, Home Assistant on Intel NUC i3, Aeotec Z-Stick (Gen 5), deCONZ Zigbee Stick, 3 x Echo Dot's and 5 x Google Home
Re: Tutorial ESPEasy / OpenHAB problem
am using esp and openhab with mosquitto. it is working fine...
Setup
Esp GPIO pin 12 is connected to relay
My ESPeasy Config
----------------------
Name = sonoff
Controller = OpenHabMQTT
IP=192.168.0.8
My OpenHab Setup
----------------------
default.items
-----------------
Switch LED3W "Ceiling" <light> (FF_Corridor) { mqtt=">[azurebroker:/sonoff/gpio/12:command:ON:1],>[azurebroker:/sonoff/gpio/12:command:OFF:0],<[azurebroker:/sonoff/relay/switch:state:default" }
openhab.cfg
----------------
mqtt:azurebroker.url=tcp://192.168.0.8:1883
mqtt:azurebroker.clientId=openHAB
this setup is working fine
Setup
Esp GPIO pin 12 is connected to relay
My ESPeasy Config
----------------------
Name = sonoff
Controller = OpenHabMQTT
IP=192.168.0.8
My OpenHab Setup
----------------------
default.items
-----------------
Switch LED3W "Ceiling" <light> (FF_Corridor) { mqtt=">[azurebroker:/sonoff/gpio/12:command:ON:1],>[azurebroker:/sonoff/gpio/12:command:OFF:0],<[azurebroker:/sonoff/relay/switch:state:default" }
openhab.cfg
----------------
mqtt:azurebroker.url=tcp://192.168.0.8:1883
mqtt:azurebroker.clientId=openHAB
this setup is working fine
P.Kannan
Whatsapp: +91-9488557777
HAM CallSign: KD0NER
Echolink: KD0NER
Whatsapp: +91-9488557777
HAM CallSign: KD0NER
Echolink: KD0NER
Who is online
Users browsing this forum: Ahrefs [Bot] and 134 guests