Man-fred / culfw.esp8266

CUL/CUN 433/868 MHz CC1101 Transceiver mit WLAN-Schnittstelle für FHEM - originally forked from svn2github/culfw (https://github.com/svn2github/culfw)
GNU General Public License v2.0
8 stars 5 forks source link

rf_moritz compile failed #3

Closed kroon040 closed 4 years ago

kroon040 commented 4 years ago

Hi Manfred

I see that moritz you have enabled.

It fails when I compile

Multiple libraries were found for "WiFiUdp.h" /home/richard/Arduino/libraries/rf_moritz/rf_moritz.c:5:27: fatal error: avr/interrupt.h: No such file or directory Used: /home/richard/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi

include <avr/interrupt.h>

Not used: /home/richard/Downloads/arduino-1.8.12/libraries/WiFi

regards Richard

Man-fred commented 4 years ago

Hi Richard, it seems you have local a file rf_moritz.c, but there is no file on github. In the directory /libraries/rf_moritz should only be the files rf_moritz.h and rf_moritz.cpp regards Manfred

kroon040 commented 4 years ago

removed the .c file , and now compiled no errors. fhem start, but it doesn't have credits, i get no answer, that is required that he creates cul_max device(s)

credit10ms | No answer

and should be

credit10ms =>900

Man-fred commented 4 years ago

Hi, in my just now compiled version i get an answer on credit10ms: "ESP_CUL credit10ms => 786". Could it be, that the problems with fht8v consume all of the 1% credit?

kroon040 commented 4 years ago

Yes, on normal mode I get credits. But setting attribute rfmode MAX, than credits is N/A

Do you have credits when in rfmode MAX?

Man-fred commented 4 years ago

Hi, yes, I get credits. After a couple of minutes I get 900. I'm waiting for the delivery of the MAX!-devices and then I can test it.

kroon040 commented 4 years ago

Hi Manfred. I made a second espcul, and this one I tested first if I received something from fs20, and yes this works. Then I tried the moritz mode. De credits are working, but pairing nothing happens.

Did you already received you max products?

Man-fred commented 4 years ago

Hi Richard, yesterday I got my MAX!-devices. And I started the Debugging. I see packets from the MAX! but they are no valid MAX!-signals. It seems the timing is not correct. I will continue to work on this in the evening.

kroon040 commented 4 years ago

Hi Manfred,

Good to that you received the max devices. Good luck with debugging and troubleshooting. Let me know if I can do/test something

regards Richard

kroon040 commented 4 years ago

Hi,

Any progress with debugging/troubleshooten?

Man-fred commented 4 years ago

Hi, now i learned how interrupts work in esp8266 and the first test for MAX! is online. My wall thermostate and shutter contact are online and connected. But it seems that not all messages are sended. A raw "Zr" command seems to help, but I'am working on it.

kroon040 commented 4 years ago

Hi,

Tried your new version, but paring of my wallthermostat didn't work yet.

kroon040 commented 4 years ago

at starting fhem I get this

2020.05.30 22:59:33 0: Server started with 10 defined entities (fhem.pl:21952/2020-05-16 perl:5.026001 os:linux user:fhem pid:20800)
2020.05.30 22:59:33 5: CUL/RAW: /0D2E2D07D3913D04320000060021656A55E43023B900070018146C070090876BF85611
2020.05.30 22:59:33 5: CUL/RAW: 0D2E2D07D3913D04320000060021656A55E43023B900070018146C070090876BF85611/E92A001F4100Z on

2020.05.30 22:59:33 4: CUL_Parse: culesp 0D2E2D07D3913D04320000060021656A55E43023B900070018146C070090876BF85611E92A001F4100Z on
2020.05.30 22:59:33 5: culesp: dispatch 0D2E2D07D3913D04320000060021656A55E43023B900070018146C070090876BF85611E92A001F4100Z on
2020.05.30 22:59:33 3: culesp: Unknown code 0D2E2D07D3913D04320000060021656A55E43023B900070018146C070090876BF85611E92A001F4100Z on, help me!
2020.05.30 22:59:36 2: AttrTemplates: got 160 entries
2020.05.30 22:59:38 5: culesp sending Za123456
2020.05.30 22:59:38 5: SW: Za123456
2020.05.30 22:59:38 5: culesp sending Zw111111
2020.05.30 22:59:38 5: SW: Zw111111
kroon040 commented 4 years ago

Hi Manfred,

more progress already?

regards Richard

Man-fred commented 4 years ago

Hi Richard, now I get a stable release with readings from wall thermostate and shutter contact. After pairing fhem shows a reading "PairedTo". But it seems that I can't send to the thermostate.

Man-fred commented 4 years ago

I found my busware-cul :) and I use it parallel to the esp. Now I can analyse the differences. Like you says I get the acknowledgements for the sent messages and I can them see them on the esp8266. Now I'm curious what the busware see when I sent with the esp.

kroon040 commented 4 years ago

Nice, Let's hope everything is going to work.

I just received 4 max thermostat basics that I want to go to use instead of the fht8v's

I'm configuring it first with a busware-cul, and hopefully laster with the espcul

Man-fred commented 4 years ago

What I read and what I think is that there is a problem with the SPI-interface between esp8266 and cc1101. But I'm missing a logic analyser for examination. So i solder the next esp-cul and will test it without CRC and whitening. Let's see what this does.

Man-fred commented 4 years ago

Hi Richard, my esp-cul now sends :)) I haved uploaded the next version, but only for testing. In this version the 1%-rule is inactive (it sends every times immediately) and the output level is fixed to +10db. If it works with your esp8266/cc1101 I will set this to normal and programmable value .

You can ignore the debugging output between "Zs.." and "Z0..." on USB. If you get no connection please add the 6 rows in the comment.

kroon040 commented 4 years ago

Hi,

Tested als with wallthermostat, Autocreate failed but when editing it works with some values also write works. Below log of autocreate and log of same wallthermostat with espcul en buswarecul But already good job!

log of autocreate

2020.06.07 21:13:57 3: CULMAX0, Send Queue missing ack from MAX_1ade43 for PairPong, removing from queue
2020.06.07 21:13:34 1: MAX_Parse, ohne Namen msg: MAX,0,WallThermostatConfig,1ade43,17,21,30.5,4.5,444855084520452045204520452045204520452045204520452044485508452045204520452045204520452045204520452045204448546c44cc55144520452045204520452045204520452045204448546c44cc55144520452045204520452045204520452045204448546c44cc55144520452045204520452045204520452045204448546c44cc55144520452045204520452045204520452045204448546c44cc5514452045204520452045204520452045204520,80,5,0,12
2020.06.07 21:13:34 1: PERL WARNING: Use of uninitialized value $dev in hash element at fhem.pl line 3661.
2020.06.07 21:13:34 1:     main::CallFn                        called by fhem.pl (760)
2020.06.07 21:13:34 1:     main::CUL_Read                      called by fhem.pl (3789)
2020.06.07 21:13:34 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (831)
2020.06.07 21:13:34 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (953)
2020.06.07 21:13:34 1:     main::CUL_MAX_Parse                 called by fhem.pl (3985)
2020.06.07 21:13:34 1:     main::readingsBulkUpdate            called by ./FHEM/14_CUL_MAX.pm (865)
2020.06.07 21:13:34 1: stacktrace:
2020.06.07 21:13:34 1: readingsUpdate(,SerialNr,OEQ2099934) missed to call readingsBeginUpdate first.
2020.06.07 21:13:34 1:     main::CallFn                        called by fhem.pl (760)
2020.06.07 21:13:34 1:     main::CUL_Read                      called by fhem.pl (3789)
2020.06.07 21:13:34 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (831)
2020.06.07 21:13:34 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (953)
2020.06.07 21:13:34 1:     main::CUL_MAX_Parse                 called by fhem.pl (3985)
2020.06.07 21:13:34 1:     main::readingsBulkUpdate            called by ./FHEM/14_CUL_MAX.pm (864)
2020.06.07 21:13:34 1: stacktrace:
2020.06.07 21:13:34 1: readingsUpdate(,PairedTo,000000) missed to call readingsBeginUpdate first.
2020.06.07 21:13:34 1:     main::CallFn                        called by fhem.pl (760)
2020.06.07 21:13:34 1:     main::CUL_Read                      called by fhem.pl (3789)
2020.06.07 21:13:34 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (831)
2020.06.07 21:13:34 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (953)
2020.06.07 21:13:34 1:     main::CUL_MAX_Parse                 called by fhem.pl (3985)
2020.06.07 21:13:34 1:     main::readingsBulkUpdate            called by ./FHEM/14_CUL_MAX.pm (863)
2020.06.07 21:13:34 1: stacktrace:
2020.06.07 21:13:34 1: readingsUpdate(,testresult,255) missed to call readingsBeginUpdate first.
2020.06.07 21:13:34 1:     main::CallFn                        called by fhem.pl (760)
2020.06.07 21:13:34 1:     main::CUL_Read                      called by fhem.pl (3789)
2020.06.07 21:13:34 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (831)
2020.06.07 21:13:34 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (953)
2020.06.07 21:13:34 1:     main::CUL_MAX_Parse                 called by fhem.pl (3985)
2020.06.07 21:13:34 1:     main::readingsBulkUpdate            called by ./FHEM/14_CUL_MAX.pm (862)
2020.06.07 21:13:34 1: stacktrace:
2020.06.07 21:13:34 1: readingsUpdate(,firmware,1.0) missed to call readingsBeginUpdate first.
2020.06.07 21:13:34 1:     main::CallFn                        called by fhem.pl (760)
2020.06.07 21:13:34 1:     main::CUL_Read                      called by fhem.pl (3789)
2020.06.07 21:13:34 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (831)
2020.06.07 21:13:34 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (953)
2020.06.07 21:13:34 1:     main::CUL_MAX_Parse                 called by fhem.pl (3985)
2020.06.07 21:13:34 1:     main::readingsBeginUpdate           called by ./FHEM/14_CUL_MAX.pm (861)
2020.06.07 21:13:34 1: stacktrace:
2020.06.07 21:13:34 1: ERROR: empty name in readingsBeginUpdate
2020.06.07 21:13:34 1: MAX_Parse, ohne Namen msg: MAX,0,define,1ade43,WallMountedThermostat,OEQ2099934,0
2020.06.07 21:13:34 3: CULMAX0, Pairing device MAX_1ade43 of type WallMountedThermostat with serial OEQ2099934
2020.06.07 21:13:34 3: CULMAX0, source device 1ade43 has no name !

Log of espcul


fhem> l MAX_1ade43
Internals:
   CULMAX0_MSGCNT 4
   CULMAX0_TIME 2020-06-07 21:28:01
   DEF        WallMountedThermostat 1ade43
   FUUID      5eda811f-f33f-d772-d650-939d4b9382660fb3
   IODev      CULMAX0
   LASTInputDev CULMAX0
   MSGCNT     4
   NAME       MAX_1ade43
   NR         60
   NTFY_ORDER 50-MAX_1ade43
   STATE      15.0&deg;C
   SVN        22023
   TYPE       MAX
   TimeSlot   0
   addr       1ade43
   devtype    3
   type       WallMountedThermostat
   READINGS:
     2020-06-07 21:22:32   RSSI            -39.5
     2020-06-07 21:22:32   battery         ok
     2020-06-07 21:22:32   batteryState    ok
     2020-06-07 21:22:32   desiredTemperature 15.0
     2020-06-07 21:22:32   displayActualTemperature 1
     2020-06-07 21:28:01   error           Invalid command/argument  8119011E
     2020-06-07 21:22:32   gateway         1
     2020-06-07 21:22:13   groupid         0
     2020-06-07 21:22:13   lastcmd         set_desiredTemperature 15.0
     2020-06-07 21:22:32   mode            manual
     2020-06-07 21:22:13   msgcnt          1
     2020-06-07 21:22:32   panel           unlocked
     2020-06-07 21:22:32   peerIDs         000000
     2020-06-07 21:22:32   peerList        Broadcast
     2020-06-07 21:22:32   rferror         0
     2020-06-07 21:22:32   state           15.0&deg;C
   helper:
     io:
       cul:
         raw        Z0E3E02021ADE43123456008119011E
         rssi       -35.5
         time       1591558081.33684
Attributes:
   IODev      CULMAX0
   alias      Wandthermostaat
   group      Klimaat
   model      WallMountedThermostat
   room       Zolder

buswarecul


fhem> l MAX_1ade43
Internals:
   CULMAX_MSGCNT 45
   CULMAX_TIME 2020-06-07 21:31:40
   DEF        WallMountedThermostat 1ade43
   FUUID      5eda811f-f33f-d772-d650-939d4b9382660fb3
   IODev      CULMAX
   LASTInputDev CULMAX
   MSGCNT     45
   NAME       MAX_1ade43
   NR         184
   NTFY_ORDER 50-MAX_1ade43
   STATE      15.0&deg;C
   SVN        22023
   TYPE       MAX
   TimeSlot   1
   addr       1ade43
   devtype    3
   type       WallMountedThermostat
   READINGS:
     2020-06-07 21:13:34   PairedTo        000000
     2020-06-07 21:30:51   RSSI            -83
     2020-06-07 21:13:34   SerialNr        OEQ2099934
     2020-06-07 21:24:22   battery         ok
     2020-06-07 21:24:22   batteryState    ok
     2020-06-07 21:13:34   boostDuration   25
     2020-06-07 21:13:34   boostValveposition 80
     2020-06-07 21:13:34   comfortTemperature 21.0
     2020-06-07 21:30:51   desiredTemperature 15.0
     2020-06-07 21:30:51   deviation       7.5
     2020-06-07 21:24:22   displayActualTemperature 1
     2020-06-07 21:13:34   ecoTemperature  17.0
     2020-06-07 21:31:40   error           Invalid command/argument  8119011E
     2020-06-07 21:13:34   firmware        1.0
     2020-06-07 21:24:22   gateway         1
     2020-06-05 19:30:07   groupid         0
     2020-06-07 21:13:36   lastTimeSync    2020-06-07 21:13:36
     2020-06-07 21:13:34   lastcmd         WallThermostatConfig
     2020-06-07 21:13:34   maximumTemperature on
     2020-06-07 21:13:34   measurementOffset 0.0
     2020-06-07 21:13:34   minimumTemperature off
     2020-06-07 21:24:22   mode            manual
     2020-06-07 21:13:36   msgcnt          64
     2020-06-07 21:24:22   panel           unlocked
     2020-06-07 21:30:51   peerIDs         000000,1b0e7a,1b972d
     2020-06-07 21:30:51   peerList        Broadcast,MAX_1b0e7a,MAX_1b972d
     2020-06-05 19:33:33   peers           1b972d
     2020-06-07 21:24:22   rferror         0
     2020-06-07 21:30:51   state           15.0&deg;C
     2020-06-07 21:30:51   temperature     22.5
     2020-06-07 21:13:34   testresult      255
     2020-06-07 21:13:34   weekprofile-0-Sat-temp 17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-0-Sat-time 00:00-06:00  /  06:00-22:00  /  22:00-24:00
     2020-06-07 21:13:34   weekprofile-1-Sun-temp 17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-1-Sun-time 00:00-06:00  /  06:00-22:00  /  22:00-24:00
     2020-06-07 21:13:34   weekprofile-2-Mon-temp 17.0 °C  /  21.0 °C  /  17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-2-Mon-time 00:00-06:00  /  06:00-09:00  /  09:00-17:00  /  17:00-23:00  /  23:00-24:00
     2020-06-07 21:13:34   weekprofile-3-Tue-temp 17.0 °C  /  21.0 °C  /  17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-3-Tue-time 00:00-06:00  /  06:00-09:00  /  09:00-17:00  /  17:00-23:00  /  23:00-24:00
     2020-06-07 21:13:34   weekprofile-4-Wed-temp 17.0 °C  /  21.0 °C  /  17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-4-Wed-time 00:00-06:00  /  06:00-09:00  /  09:00-17:00  /  17:00-23:00  /  23:00-24:00
     2020-06-07 21:13:34   weekprofile-5-Thu-temp 17.0 °C  /  21.0 °C  /  17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-5-Thu-time 00:00-06:00  /  06:00-09:00  /  09:00-17:00  /  17:00-23:00  /  23:00-24:00
     2020-06-07 21:13:34   weekprofile-6-Fri-temp 17.0 °C  /  21.0 °C  /  17.0 °C  /  21.0 °C  /  17.0 °C
     2020-06-07 21:13:34   weekprofile-6-Fri-time 00:00-06:00  /  06:00-09:00  /  09:00-17:00  /  17:00-23:00  /  23:00-24:00
     2020-06-07 21:13:34   windowOpenTemperature 12.0
   helper:
     dt         21.0
     myday      1
     io:
       cul:
         raw        Z0E3F02021ADE43123456008119011E
         rssi       -84
         time       1591558300.20565
Attributes:
   IODev      CULMAX
   alias      Wandthermostaat
   group      Klimaat
   model      WallMountedThermostat
   mqttPublish desiredTemperature|temperature:topic={"/Zolderkamertemp/$name"} desiredTemperature|temperature:retain=1
   room       Zolder
Man-fred commented 4 years ago

My test with a WallMountedThermostat:

I have simplified the code a little bit and removed the debug-messages. The only change to the original bahavior is that I set the max. credits to 3600. I think in the pairing and initializing phase, also after restart of the cul, fhem needs more than 900.

regards, Manfred

Man-fred commented 4 years ago

Hi Richard, an updated esp8266 - core is available in the arduino-ide. I now use 2.7.1, previos one was 2.6.3. But I think this should make no differences by MAX!. My interaction with MAX!-devices is further without problems, FS20 also.

Off topic:

  1. A disruptive change are the commands Wis, Wik and WiD, these are absolutely necessary for using wlan.
  2. I activated over-the-air updates, see readme.md or Wiki
  3. The repository I forked from is inactive. i separated it, but this is only possible with a new name. Please change to https://github.com/Man-fred/culfw.esp8266. After your answer I will also move this issue. From now on, all changes can only be found there.

Regards, Manfred

kroon040 commented 4 years ago

Manfred , ok I will try the new version this weekend on the new location

I let you know on the new location if everything works

kroon040 commented 4 years ago

Manfred

I compiled the new version. Setting the network was a little difficult , dhcp didn't work, so static went ok.

I have now 4 thermostat basics 1 wallthermostat and 1 fakewallthermostat, and looks like it works

Good job. I will check tomorrow late if everything is stable

Man-fred commented 4 years ago

Hi Richard, great that it works for you, my MAX!-devices seems also running, so I can rollout it in all rooms. Regards, Manfred

kroon040 commented 4 years ago

Manfred,

It looks stable. Only the the hostname (devicename) is not working. In the console commad Rid I get esp-cul, but on the network it shows still ESP-F44XXXX. Also reboot and/erased reflashed but not working.

regards Richard

Man-fred commented 4 years ago

Hi, the problem with the hostname is a problem in dns/dhcp. Perhaps it helps to delete the name in the dns-server and then restart the esp. Then it should show the new and correct name.

kroon040 commented 4 years ago

Hi,

Removed everything from dns/dhcp entries, erased the the esp, and reprogrammed. Tried both esps, and both gives ESP-F****

With the old private.h it worked

Man-fred commented 4 years ago

Hi, I will test it. I have two more esp and will upload the sketch. Maybe then I can see the problem myself.

Man-fred commented 4 years ago

Good news: I found the error in setting the hostname. But i changed something more and must test if the changes are stable.

kroon040 commented 4 years ago

Good to hear. Let me know when I can test it.

My 4 thermostat basic and 1 wandthermostat works fine at the moment.

Man-fred commented 4 years ago

Hi Richard, I pushed the changes in testing the hostname to master. Nothing else is changed, so the stability shouldn't be affected. Regards, Manfred

kroon040 commented 4 years ago

Manfred,

Now it works. the hostname comes correct in the wifi router

thnx , I close this issue. Thnx for all the support.