ESP-12E moduł bramowy dodatkowy przekaźnik
Witam wszystkich. Od dłuższego czasu używam ESP-12E do sterowania bramą wjazdową i garażową, wszystko działa świetnie, więc pomyślałem o kolejnej modyfikacji. Chciałbym sterować dodatkowo jednym gniazdkiem. Czy jest możliwe dodanie sterowania gniazdkiem do softu od modułu bramowego, aby wykorzystać już posiadane esp? Wiem, że w raspberry pi zmian dokonuje się w supla.cgf, a w esp nie. Pobrałem maszynę wirtualną zapoznałem się z firmware jednak mnie to przerosło Dlatego prosiłbym o pomoc lub wskazówki.
Z wersją 1.8 jest to dużo prostsze. Wystarczy jak tu
https://github.com/SUPLA/supla-core/blo ... dule.c#L48
dodasz
tu
https://github.com/SUPLA/supla-core/blo ... dule.c#L53
zmieniasz na
i tu
https://github.com/SUPLA/supla-core/blo ... dule.c#L98
dodajesz
Jeszcze tylko musisz zdefiniować na jakim porcie będzie przekaźnik np w tym miejscu:
https://github.com/SUPLA/supla-core/blo ... dule.c#L12
problem może być z wolnym portem
https://github.com/SUPLA/supla-core/blo ... dule.c#L48
dodasz
Kod: Zaznacz cały
supla_relay_cfg[2].gpio_id = B_RELAY3_PORT;
supla_relay_cfg[2].flags = RELAY_FLAG_RESTORE;
supla_relay_cfg[2].channel = 5;
https://github.com/SUPLA/supla-core/blo ... dule.c#L53
zmieniasz na
Kod: Zaznacz cały
srd->channel_count = 6;
https://github.com/SUPLA/supla-core/blo ... dule.c#L98
dodajesz
Kod: Zaznacz cały
srd->channels[0].Number = 5;
srd->channels[0].Type = SUPLA_CHANNELTYPE_RELAY;
srd->channels[0].FuncList = SUPLA_BIT_RELAYFUNC_POWERSWITCH \
| SUPLA_BIT_RELAYFUNC_LIGHTSWITCH;
srd->channels[0].Default = SUPLA_CHANNELFNC_POWERSWITCH
srd->channels[0].value[0] = supla_esp_gpio_relay_on(B_RELAY3_PORT);
Jeszcze tylko musisz zdefiniować na jakim porcie będzie przekaźnik np w tym miejscu:
https://github.com/SUPLA/supla-core/blo ... dule.c#L12
Kod: Zaznacz cały
#define B_RELAY2_PORT 13
Dziękuje za szybką pomoc. Dokonałem zmian w plikach jednak mam problem z kompilacją. Pobrałem wersję 1.8 beta podmieniłem ją z ze starszą w folderze devel/supla-core i teraz po uruchomieniu pliku build z folderu esp8266 na pulpicie mam: https://zapodaj.net/d20b3368ae169.png.html i po wydaniu komendy nic się nie dzieje. Gdzie robię błąd?
Nie modyfikowałeś build.sh ?
Za pierwszym razem nie, za kolejnym sugerowałem się viewtopic.php?f=18&t=272&hilit=build.sh&start=10#p3014 i też nic to nie zmieniło.
Uruchom skrypt z konsoli pomijając skrót na pulpicie
Teraz mam coś takiego. Nie mam folderu ESP8266_Bin154 w espressif tylko ESP8266_Bin
Edit:
Ściągnąłem SDK154 podmieniłem jednak dalej nie działa. Chyba poczekam na maszynę wirtualną z nowszy sdk jeśli jest przewidziana.
Edit:
Ściągnąłem SDK154 podmieniłem jednak dalej nie działa. Chyba poczekam na maszynę wirtualną z nowszy sdk jeśli jest przewidziana.
- Załączniki
-
- Przechwytywanie.PNG (136.85 KiB) Przejrzano 4876 razy
-
- Przechwytywanie.PNG (35.7 KiB) Przejrzano 4879 razy
Dziś spróbowałem jeszcze raz. Postawiłem nowa maszynę wirtualna od zera. Nie edytowałem nic w bibliotekach sdk anie w folderze espressif. Następnie ściągnąłem cale repozytorium supla-core z githuba i wklejłem do folderu supla-core w wirtualnej maszynie. W build.sh w esp8266_IOT_1.8-Beta zmieniłem tylko ścieżki na właściwe i sdk154=0 i wygląda to teraz tak
Dalej nic nie ruszałem. I teraz po probie kompilacji otrzymuje coś takiego, dodam tylko ze nie edytowałem tez nic w plikach bety na początek.
Kod: Zaznacz cały
DEP_LIBS="-lssl"
CFG_SECTOR=0xBC
SDK154=0
UPGRADE_1024=1
NOSSL=0
export PATH=/home/supla/Devel/Espressif/xtensa-lx106-elf/bin:$PATH
export COMPILE=gcc
export SDK_PATH=/home/supla/Devel/Espressif/ESP8266_IOT_SDK
export BIN_PATH=/home/supla/Devel/Espressif/ESP8266_BIN
Kod: Zaznacz cały
supla@supla-iotsdk:~/Devel/supla-core/ESP8266_IOT_1.8-BETA$ ./build.sh gate_module
make -C user clean; make -C driver clean; make -C supla-dev clean;
make[1]: Entering directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/user'
rm -f -r .output/eagle/debug
make[1]: Leaving directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/user'
make[1]: Entering directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/driver'
rm -f -r .output/eagle/debug
make[1]: Leaving directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/driver'
make[1]: Entering directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/supla-dev'
rm -f -r .output/eagle/debug
make[1]: Leaving directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/supla-dev'
rm -f -r .output/eagle/debug
./build.sh: 197: [: Illegal number:
make[1]: Entering directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_esp_cfgmode.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_esp_cfg.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle user_main.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_ds18b20.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_esp_pwm.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_esp_devconn.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_esp_gpio.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_w1.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle supla_dht.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_dht.o -c supla_dht.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_w1.o -c supla_w1.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_esp_gpio.o -c supla_esp_gpio.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_esp_devconn.o -c supla_esp_devconn.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_esp_pwm.o -c supla_esp_pwm.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_ds18b20.o -c supla_ds18b20.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/user_main.o -c user_main.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_esp_cfg.o -c supla_esp_cfg.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/supla_esp_cfgmode.o -c supla_esp_cfgmode.c
xtensa-lx106-elf-ar ru .output/eagle/debug/lib/libuser.a .output/eagle/debug/obj/supla_dht.o .output/eagle/debug/obj/supla_w1.o .output/eagle/debug/obj/supla_esp_gpio.o .output/eagle/debug/obj/supla_esp_devconn.o .output/eagle/debug/obj/supla_esp_pwm.o .output/eagle/debug/obj/supla_ds18b20.o .output/eagle/debug/obj/user_main.o .output/eagle/debug/obj/supla_esp_cfg.o .output/eagle/debug/obj/supla_esp_cfgmode.o
xtensa-lx106-elf-ar: creating .output/eagle/debug/lib/libuser.a
make[1]: Leaving directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/user'
make[1]: Entering directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/driver'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle dht22.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/dht22.o -c dht22.c
xtensa-lx106-elf-ar ru .output/eagle/debug/lib/libdriver.a .output/eagle/debug/obj/dht22.o
xtensa-lx106-elf-ar: creating .output/eagle/debug/lib/libdriver.a
make[1]: Leaving directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/driver'
make[1]: Entering directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/supla-dev'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle proto.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle srpc.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle lck.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle log.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/log.o -c log.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/lck.o -c lck.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/srpc.o -c srpc.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DESP8266 -D__SINGLE_THREAD -D__EH_DISABLED -D__BOARD_gate_module -DCFG_SECTOR=0xBC -DNOSSL=0 -I include -I ./ -I ../include/supla-dev -I ../include -I ../include -I ../include/eagle -o .output/eagle/debug/obj/proto.o -c proto.c
xtensa-lx106-elf-ar ru .output/eagle/debug/lib/libsupladev.a .output/eagle/debug/obj/log.o .output/eagle/debug/obj/lck.o .output/eagle/debug/obj/srpc.o .output/eagle/debug/obj/proto.o
xtensa-lx106-elf-ar: creating .output/eagle/debug/lib/libsupladev.a
make[1]: Leaving directory '/home/supla/Devel/supla-core/ESP8266_IOT_1.8-BETA/supla-dev'
xtensa-lx106-elf-gcc -L/home/supla/Devel/Espressif/ESP8266_IOT_SDK/lib -Wl,--gc-sections -nostdlib -T/home/supla/Devel/Espressif/ESP8266_IOT_SDK/ld/eagle.app.v6.new.1024.app1.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lgcc -lpp -lphy -lnet80211 -lwpa -lmain -llwip -lcrypto -lssl user/.output/eagle/debug/lib/libuser.a driver/.output/eagle/debug/lib/libdriver.a supla-dev/.output/eagle/debug/lib/libsupladev.a -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out
!!!
-128992991
128992990
Support boot_v1.2 and +
Generate user1.1024.new.2.bin successully in folder /home/supla/Devel/Espressif/ESP8266_BIN/upgrade.
boot.bin------------>0x00000
user1.1024.new.2.bin--->0x01000
!!!
cp: cannot create regular file ‘/media/sf_Public/gate_module_user1.1024.new.2.bin’: No such file or directory
supla@supla-iotsdk:~/Devel/supla-core/ESP8266_IOT_1.8-BETA$
Kompiluje się tylko w build.sh musisz zmienić miejsce docelowe gdzie mają lądować pliki do wgrania