ESPEasy Basics
Moderators: grovkillen, Stuntteam, TD-er
ESPEasy Basics
Hi - newby here!
I have been playing with ESPEasy/OpenHAB for the last couple of days and not getting very far. I am using ESPEasy Build 70 with Arduino IDE 1.6.5 and successfully uploaded the sketch to my 8266.
It connects to the network, connects to the MQTT broker but does not subscribe to any topics - see log output below :
INIT : Booting Build nr:70
IP : Static IP :192.168.1.71
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
MQTT : Connected to broker
Subscribed to:
INIT : Boot OK
INIT : Normal boot
WD : Uptime 0 ConnectFailures 0 FreeMem 26128
WD : Uptime 1 ConnectFailures 0 FreeMem 26064
WD : Uptime 1 ConnectFailures 0 FreeMem 26048
1) I understood that it should subscribe to the topic /ESP8266-01/# where ESP8266-01 is the name of my device - any ideas what I might be doing wrong here?
2) How can I increase the verbosity of the log output?
3) I would like to test this properly with MQTT.fx before I move on to OpenHAB. Exactly what do I have to publish and to which topic to switch my LED on or off. In the tutorial it mentions something like "ESP8266-01/gpio/2:command:ON:1" but it's not quite clear to me.
Thanks for any help
N
I have been playing with ESPEasy/OpenHAB for the last couple of days and not getting very far. I am using ESPEasy Build 70 with Arduino IDE 1.6.5 and successfully uploaded the sketch to my 8266.
It connects to the network, connects to the MQTT broker but does not subscribe to any topics - see log output below :
INIT : Booting Build nr:70
IP : Static IP :192.168.1.71
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
MQTT : Connected to broker
Subscribed to:
INIT : Boot OK
INIT : Normal boot
WD : Uptime 0 ConnectFailures 0 FreeMem 26128
WD : Uptime 1 ConnectFailures 0 FreeMem 26064
WD : Uptime 1 ConnectFailures 0 FreeMem 26048
1) I understood that it should subscribe to the topic /ESP8266-01/# where ESP8266-01 is the name of my device - any ideas what I might be doing wrong here?
2) How can I increase the verbosity of the log output?
3) I would like to test this properly with MQTT.fx before I move on to OpenHAB. Exactly what do I have to publish and to which topic to switch my LED on or off. In the tutorial it mentions something like "ESP8266-01/gpio/2:command:ON:1" but it's not quite clear to me.
Thanks for any help
N
Re: ESPEasy Basics
As far as i understand it, the option to subscribe to a Topic is not implemented, ESPEasy only sends MQTT Messages
Try it with an Android App, you will see the Messages
To control LEDs, Relais,..., you Need to sent HTTP Commands
Try it with an Android App, you will see the Messages
To control LEDs, Relais,..., you Need to sent HTTP Commands
Re: ESPEasy Basics
The ESP will both subscribe and publish to the MQTT broker service. But it looks like the MQTT templates are empty in your case.
Could you navigate to tools/advanced and check these fields, they should contain something and these should be the default settings:
If they are empty you can enter the data manually and submit.
Could you navigate to tools/advanced and check these fields, they should contain something and these should be the default settings:
If they are empty you can enter the data manually and submit.
Re: ESPEasy Basics
If subscribing to a template, how could i use it to control a GPIO or to get some text on a lcd ?
Re: ESPEasy Basics
If I want to turn on the blue led on the NodeMCU V1 board with the system name "DemoESP" I publish the message "0" to:kr0815 wrote:If subscribing to a template, how could i use it to control a GPIO or to get some text on a lcd ?
/DemoESP/GPIO/16
This will pull GPIO-16 low and the led will start to shine...
You can also use PWM. On a NodeMCU V1 board, to let the other blue led shine just a tiny bit, publish "900" to:
/DemoESP/PWM/2
But MQTT subscribing implementation is very limited and we only implemented a quick and dirty way to control GPIO states.
Only supports GPIO on/off and PWM values.
Re: ESPEasy Basics
Thanks Martinus - that fixed it. I wonder why the defaults were blank?Martinus wrote:The ESP will both subscribe and publish to the MQTT broker service. But it looks like the MQTT templates are empty in your case.
Could you navigate to tools/advanced and check these fields, they should contain something and these should be the default settings:
If they are empty you can enter the data manually and submit.
Re: ESPEasy Basics
Thanks - I'm make small progress but it is sooo frustrating!
I have finally managed to get EasyESP talking nicely to OpenHAB via mosquito and I can switch on and off the leds on the board. I can also read from EasyESP to detect whether the gpio pins are high or low. I am now trying to use the pwm commands to adjust the brightness of the leds but failing dismally. Can anybody give me example entries for my sitemap and items files which will do the job?
Another little problem is that the Android app does not refresh after a change is detected by mqtt - the events log shows that the change has been detected but the screen does not refresh. Any ideas where I should look for the problem?
Perhaps these are questions better asked on the openhab forum??
Thanks
N
I have finally managed to get EasyESP talking nicely to OpenHAB via mosquito and I can switch on and off the leds on the board. I can also read from EasyESP to detect whether the gpio pins are high or low. I am now trying to use the pwm commands to adjust the brightness of the leds but failing dismally. Can anybody give me example entries for my sitemap and items files which will do the job?
Another little problem is that the Android app does not refresh after a change is detected by mqtt - the events log shows that the change has been detected but the screen does not refresh. Any ideas where I should look for the problem?
Perhaps these are questions better asked on the openhab forum??
Thanks
N
Re: ESPEasy Basics
Hi Martinus.Martinus wrote:If I want to turn on the blue led on the NodeMCU V1 board with the system name "DemoESP" I publish the message "0" to:kr0815 wrote:If subscribing to a template, how could i use it to control a GPIO or to get some text on a lcd ?
/DemoESP/GPIO/16
This will pull GPIO-16 low and the led will start to shine...
You can also use PWM. On a NodeMCU V1 board, to let the other blue led shine just a tiny bit, publish "900" to:
/DemoESP/PWM/2
But MQTT subscribing implementation is very limited and we only implemented a quick and dirty way to control GPIO states.
Only supports GPIO on/off and PWM values.
Is there any plan to implement MQTT support for pulse and servo output? HTTP works as per the wiki but it is very slow. Surely that must be a common requirement?
Thanks
N
Re: ESPEasy Basics
I have similar problem and i don't want to start other topic. I start to explain:
I have version 120 512 kb.
I correctly connect to broker and subscrive to "/esp1/#" (esp1 is system name) but i can't command the gpio.
I tried to send on topic "/esp1/gpio/12" the message "0" or "1" without any success.
Then i tried to topic "/esp1/GPIO/12", to topic "esp1/gpio/12", to topic "esp1/GPIO/12". nothing appens, seems that esp cant read broker messages... on esp log nothing appens but on mqqt server log all messages are published correctly.
I tried also to subscrive to "esp1/#" (without the initial "/") and made again all tests sending message "0" , "1", "on", "ON", "off", "OFF" to all topic mentioned above but still nothing.
I can regularly control gpio with REST sending form a browser "http://Local_ESP_IPaddress/control?cmd=GPIO,12,0" and " "http://Local_ESP_IPaddress/control?cmd=GPIO,12,1".
Can suggest me some other test to understand why it can't read MQTT message even if regularly connected and subscribed ??
I have version 120 512 kb.
I correctly connect to broker and subscrive to "/esp1/#" (esp1 is system name) but i can't command the gpio.
I tried to send on topic "/esp1/gpio/12" the message "0" or "1" without any success.
Then i tried to topic "/esp1/GPIO/12", to topic "esp1/gpio/12", to topic "esp1/GPIO/12". nothing appens, seems that esp cant read broker messages... on esp log nothing appens but on mqqt server log all messages are published correctly.
I tried also to subscrive to "esp1/#" (without the initial "/") and made again all tests sending message "0" , "1", "on", "ON", "off", "OFF" to all topic mentioned above but still nothing.
I can regularly control gpio with REST sending form a browser "http://Local_ESP_IPaddress/control?cmd=GPIO,12,0" and " "http://Local_ESP_IPaddress/control?cmd=GPIO,12,1".
Can suggest me some other test to understand why it can't read MQTT message even if regularly connected and subscribed ??
-
- New user
- Posts: 8
- Joined: 20 May 2017, 07:23
Re: ESPEasy Basics
Hi Cerino
I am also experiencing the same with stable release 120. Did you find a solution to your problem?
My nodemcu does not act on broker messages - using OpenHAB MQTT solution, despite it's not stable (looses connection to the broker)
I am playing with a linknode R8 and espeasy 120
Thanks
I am also experiencing the same with stable release 120. Did you find a solution to your problem?
My nodemcu does not act on broker messages - using OpenHAB MQTT solution, despite it's not stable (looses connection to the broker)
I am playing with a linknode R8 and espeasy 120
Thanks
-
- New user
- Posts: 8
- Joined: 20 May 2017, 07:23
Re: ESPEasy Basics
I think I found an answer!
Once I upgraded to 147 RC8 using the flash.cmd method, I can control my relays using mosquitto_pub -t "{devicename}/gpio/16" -m "1" [or "0"].
My MQTT broker receives the same message, so I am able to keep track of what is ON of OFF.
At least the board is able to listen to the broker! Now my next challenge is to send a more user-friendly command such as: mosquitto_pub -t "{devicename}/LivingRoomLight/switch" -m "1" [or "0"]. I just don't want to remember the pin mapping.
Any hints?
The documentation is very poor and I wouldn't mind updating it. I am sure others have the same struggle.
Thanks!
Once I upgraded to 147 RC8 using the flash.cmd method, I can control my relays using mosquitto_pub -t "{devicename}/gpio/16" -m "1" [or "0"].
My MQTT broker receives the same message, so I am able to keep track of what is ON of OFF.
At least the board is able to listen to the broker! Now my next challenge is to send a more user-friendly command such as: mosquitto_pub -t "{devicename}/LivingRoomLight/switch" -m "1" [or "0"]. I just don't want to remember the pin mapping.
Any hints?
The documentation is very poor and I wouldn't mind updating it. I am sure others have the same struggle.
Thanks!
Who is online
Users browsing this forum: No registered users and 46 guests