Page 1 of 1

espeasy on ESP32

Posted: 24 Jun 2021, 15:13
by tchi59
hi
i am new in espeasy. i flashed my esp32 with espeasy. i was able to connect my esp32 on my wifi network and thus connect to it through http.
My first test is to light on or off a small led.
I connected my led to GPIO32 on the esp32 throught a resistor and the other leg of the led to the gnd.
i did create a controller DOMOTICZ HTTP and a device switch on GPIO32

on domoticz in my dummy switch i added :

http:///192.168.1.44/control?cmd=GPIO,32,1
http:///192.168.1.44/control?cmd=GPIO,32,0

I tested ,clicking on the dummy switch in domoticz server and i can see the log in the ESP32

1212487 : Info : HTTP: GPIO,32,0
1212491 : Info : GPIO : port#32: set to 0
1213819 : Info : HTTP: GPIO,32,1
1213823 : Info : GPIO : port#32: set to 1
1213892 : Info : SW : GPIO=32 State=1 Output value=0

The issue is that the LED do not light on or off. The led is lighting up when i put 5V on the positive leg

Can you help me ?
thx

Re: espeasy on ESP32

Posted: 24 Jun 2021, 15:36
by Ath
2 possible issues:
- (I think that GPIO32 is input-only) That is only true from GPIO-34 and up, reference
- A GPIO port can't deliver much current when high (few mA only), but it can draw some current to ground (up to ~25 mA) when low

To elaborate on that seconds point, if you connect the LED and resistor to +3.3 V (GPIO's are 3.3V!) and the cathode of the LED to f.e. GPIO 5, you should be able to light the LED by setting that pin to 0, and stop it lighting up by setting the pin to 1

Re: espeasy on ESP32

Posted: 24 Jun 2021, 15:57
by tchi59
thx
when i want to choose GPIO 5 in the http interface into device , it is not possible for switch , it is grey

Re: espeasy on ESP32

Posted: 24 Jun 2021, 15:59
by tchi59
i flashed my ESP32 VROOM-32 with that code : Binary Filename:⋄ ESP_Easy_mega_20210503_normal_ESP32_4M316k
is it the correct code ?

Re: espeasy on ESP32

Posted: 24 Jun 2021, 16:52
by TD-er
Maybe better to flash a newer build: https://td-er.nl/ESPEasy/
The 'May' build does have a number of issues with WiFi stability.

About the LED and which pin to use:
See: https://espeasy.readthedocs.io/en/lates ... e-on-esp32

On the latest build I also improved the selection of pins.
A pin if grayed out if it cannot be used for a specific purpose (e.g. for output you cannot use the input-only pins)
But also if a pin is used for something else like I2C or Ethernet (and Ethernet is enabled)
In the latest build I linked the reason for being grayed out should also be present in the combo box.

Re: espeasy on ESP32

Posted: 24 Jun 2021, 17:45
by tchi59
Thx you SO MUCH !!!!!!!!
It is working now with your code

Re: espeasy on ESP32

Posted: 27 Jun 2021, 10:58
by tchi59
Hi-again
now it is working i did a rule and i am able to run the rule from domoticz with this command : http://192.168.1.44/control?cmd=event,startwatering

my rules is :

On startwatering do
GPIO,23,1 // set gpio0 high
GPIO,2,0 // turn on blue led
Delay 5000
GPIO,23,0 //turn off blue led
SendToHTTP 192.168.1.6,8080,/json.htm?type=command&param=switchlight&idx=28&switchcmd=Off
endon

Now, what if i want to use MQTT protocol instead of http ? is it possible to run my rule from a mqtt publish coming from domoticz ?
i saw some infos on the web about mqtt and espeasy with device call "generic mqtt import" , but on my esp_easy i don't have that mqtt import in the devices tab.
Do you know why ?

my code level is :

Build:⋄ 20114 - Mega32
System Libraries:⋄ ESP32 SDK v3.2.3-14-gd3e562907

thanks

Re: espeasy on ESP32

Posted: 27 Jun 2021, 11:28
by TD-er
You can use MQTT too, but the Domoticz MQTT controller does only receive a limited set of commands via MQTT.
You can use the MQTT import plugin, to subscribe to a topic.
The MQTT import can (now) only import numerical values, so you may need to act on the values from the rules.

Another point you may want to address in your rules is not to use delay as it blocks everything on the ESP for the set duration.
Better to set a timer and act on the timer to do whatever you need to do after the delay.

Re: espeasy on ESP32

Posted: 28 Jun 2021, 11:28
by tchi59
Hi
Thanks for your time
In fact i have already a mosquitto server running perfectly.
So i want to use it with espeasy and domoticz

>The MQTT import can (now) only import numerical values, so you may need to act on the values from the rules.
That is good for me numerical values,

My issue is that i can't find the choice "generic mqtt import" in device tab , do you know why?

Best Regards

Re: espeasy on ESP32

Posted: 28 Jun 2021, 11:45
by TD-er
What exact bin file did you flash (see sysinfo page) ?

In a previous comment you mentioned "ESP_Easy_mega_20210503_normal_ESP32_4M316k", which should contain the MQTT import plugin as it is part of the "stable" set.
Only a custom build may not have it included as far as I can see.

Re: espeasy on ESP32

Posted: 28 Jun 2021, 14:26
by tchi59
hi
i did load this (copy of sysinfo)

Build:⋄ 20114 - Mega32
System Libraries:⋄ ESP32 SDK v3.2.3-14-gd3e562907
Git Build:⋄ pygit2_not_installed
Plugin Count:⋄ 22
Build Origin: GitHub Actions
Build Time:⋄ Jun 15 2021 10:07:07
Binary Filename:⋄ ESP_Easy_mega_20210615_custom_ESP32_4M316k
Build Platform:⋄ Linux-5.4.0-54-generic-x86_64-with-glibc2.29
Git HEAD:⋄ pygit2_not_installed

Binary Filename:⋄ ESP_Easy_mega_20210615_custom_ESP32_4M316k , so it is "custom" i will load normal now
thx

Re: espeasy on ESP32

Posted: 28 Jun 2021, 14:33
by tchi59
Thx again
with "normal" code , i ve got now the option : "generic mqtt"
GOOD !!

Re: espeasy on ESP32

Posted: 28 Jun 2021, 14:49
by TD-er
Have fun :)