Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A16 - Own Arduino firmware
#1
I am waiting for the kc868-A16 to be delivered. My goal is to make a complete program in Arduino to support my own smart elements - the superior system is Domoticz/HomeAssistant. Are there any examples in Arduino that show how to implement access to all PCF and other in/out ports (pins, addresses) as well as the LAN module (pins, addresses) in the Arduino environment? If so, where can I find them. I know that you can do reverse engineering and laboriously check and test everything - but if someone has already figured it out - maybe they could share a few source files.
Reply
#2
if you want to use home assistant, you can use by ESPHome, we already supply yaml file. you can check at here: https://www.kincony.com/forum/showthread.php?tid=1628
if you MUST want to use arduino , here are all sample demo code for KC868-A16: https://www.kincony.com/forum/forumdisplay.php?fid=25
Reply
#3
When I try to compile the example I get the messageConfusedrc/WebServer_WT32_ETH01.h:63:4: error: #error This code is designed to run on ESP32 platform! Please check your Tools->Board setting.

Espressif ESP32 installed (boards). Selected board ESP32 S3 Box or WT32-ETH1. Regardless of which board variant I choose - I get the same message. Any tips?

Arduino:2.3.3, ESP 3.0.7. file: HelloServer.ino
Reply
#4
if you are using KC868-A16, it use ESP32 device, NOT ESP32-S3 device.
Reply
#5
but which one exactly, because there are many types of ESP32 boards in Espressif. There is no regular ESP32.
In the thread https://www.kincony.com/forum/showthread.php?tid=1613 it says to choose NodeMCU-32S - that's the name of the board but no changes - the same message.
Reply
#6
chose NodeMCU32 also is OK. your problem is not installed  WebServer_WT32_ETH01 arduino library. just install it.
   
   
Reply
#7
I have the WebServer_WT32_ETH01 library installed, the problem lies in the STM32 definition in the code of this library. Just change the line #if ESP32 to #if !ESP32 and the compiler goes on. However, there is another problem with the PCF8547 library.. in the second picture.


Attached Files Image(s)
       
Reply
#8
Probably you have to use Renzo Mischianti's PCF8574 library. Now the problem is the ETH.h library - which one to use? I have installed https://docs.arduino.cc/libraries/ethernet/ in newest version but I see that the esp32 library has its own ETH.h (so I uninstalled my) libraries. It says that constants should be defined, for example:
#ifndef ETH_PHY_TYPE
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#define ETH_PHY_ADDR 0
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER -1
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN
#endif
The compiler reports as follows:


PHP Code:
C:\Users\mkapski\Documents\Arduino\testy_kicony_v2_demo1\testy_kicony_v2_demo1.inoIn function 'void setup()'C:\Users\mkapski\Documents\Arduino\testy_kicony_v2_demo1\testy_kicony_v2_demo1.ino:288:12errorno matching function for call to 'ETHClass::begin(int, int)' 288 ETH.begin(ETH_PHY_ADDRETH_PHY_POWER);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
In file included from c:\Users\mkapski\Documents\Arduino\libraries\WebServer_WT32_ETH01\src/WebServer_WT32_ETH01.hpp:76from c:\Users\mkapski\Documents\Arduino\libraries\WebServer_WT32_ETH0 1\src/WebServer_WT32_ETH01.h:72from C:\Users\mkapski\Documents\Arduino\testy_kicony_v2_demo1\testy_kicony_v2_demo1.ino:23C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:126:8notecandidate'bool ETHClass::begin(eth_phy_type_t, int32_t, int, int, int, eth_clock_mode_t)' 126 bool begin(eth_phy_type_t typeint32_t phy_addrint mdcint mdioint powereth_clock_mode_t clk_mode);
| ^~~~~ 
C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:126:8notecandidate expects 6 arguments2 provided C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hard ware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:129:8notecandidate'bool ETHClass::begin(eth_phy_type_t, int32_t, int, int, int, SPIClass&, uint8_t)' 129 bool begin(eth_phy_type_t typeint32_t phy_addrint csint irqint rstSPIClass &spiuint8_t spi_freq_mhz ETH_PHY_SPI_FREQ_MHZ);
| ^~~~~ 
C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:129:8notecandidate expects 7 arguments2 provided C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hard ware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:131:8notecandidate'bool ETHClass::begin(eth_phy_type_t, int32_t, int, int, int, spi_host_device_t, int, int, int, uint8_t)' 131 bool begin( | ^~~~~ C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:131:8notecandidate expects 10 arguments2 provided C:\Users\mkapski\AppData\Local\Arduino15\packagesesp32\hardware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:136:8notecandidate'bool ETHClass::begin()' 136 bool begin() { | ^~~~~ C:\Users\mkapski\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Ethernet\src/ETH.h:136:8notecandidate expects 0 arguments2 provided exit status 1 Compilation errorno matching function for call to 'ETHClass::begin(int, int)' 
Reply
#9
here is PCF8574 arduino library we are using.

.zip   PCF8574_library.zip (Size: 23.8 MB / Downloads: 38)
Reply
#10
(11-14-2024, 12:36 PM)admin Wrote: here is PCF8574 arduino library we are using.

PCF problem solved. What about ETH.h library and compiler errors? Which library should I use? Currently the one built into the esp32 library is used, which can be seen in the error logs.

Interestingly, the example from the esp32 / Ethernet library called ETH_LAN8720 compiles without errors in the same Arduino environment. Request for support. Ultimately, I would like to use the MYSENSORS library, but I have to start with the network first.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)