…TADAAA!
Used to control my ventilation system (second use for the PCB):
I fully assembled three of the PCBs (waiting for a delivery with more 2mm pin headers …)
Made several (minor) mistakes, but nothing some thread wire could not fix
Findings in a nutshell:
- I apparently suck at measuring things, but I guess 2 screws are enough to stabilize the PCB.
- Programming via UART (CH340) and native USB works. (Fun-fact: DOUBLE-crossing UART is not better than NOT crossing them, but that was thread-wire-able…)
- More minor stuff:
– Chose inductors for smoothing the power supply with too small current capability (3mA, should be >200mA).
– Switched Labels for USB Prog and UART
– connected wrong pin for the relay (fixed by thread wire…)
– RX Led is on by default, because the CAN bus RX is at logical ‘1’ when no dominant bits are send (–> invert LED)
- Alive LED should be driven by a transistor and not directly by Pin0
Will do some documentation / cleanup the next weeks. At the moment I am not sure, if I will do the next revision with EasyEDA or better try KiCAD. Compared to my bread-and-butter Altium designer EasyEDA was okay-ish at first while doing the Schematics but a nightmare routing…
I already implemented the second usage of the board (control my ventilation system. ESP32 sketch is here: GitHub - mkaiser/ESPHome_ventilation_system_ctrl: Control ventilation systems (e.g. Tecalor TVZ170 TVZ 370, Wolf CWL-300/400 Excellent)
Back to CAN-Bus:
- Connection to MCP2515 CAN controller works. Used a CAN-Listener sketch to sniff the Heatpump’s communication.
When trying to compile my code for the ESP32-C3, I get linker errors, because appartently there are issues with gcc vs.IDF data type declaration stuff:
Linking /data/heatpump-c3/.pioenvs/heatpump-c3/firmware.elf
/data/cache/platformio/packages/[email protected]+2021r2-patch5/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/heatpump-c3/.pioenvs/heatpump-c3/src/main.cpp.o: in function `esphome::api::ExecuteServiceArgument* std::__uninitialized_copy<false>::__uninit_copy<__gnu_cxx::__normal_iterator<esphome::api::ExecuteServiceArgument const*, std::vector<esphome::api::ExecuteServiceArgument, std::allocator<esphome::api::ExecuteServiceArgument> > >, esphome::api::ExecuteServiceArgument*>(__gnu_cxx::__normal_iterator<esphome::api::ExecuteServiceArgument const*, std::vector<esphome::api::ExecuteServiceArgument, std::allocator<esphome::api::ExecuteServiceArgument> > >, __gnu_cxx::__normal_iterator<esphome::api::ExecuteServiceArgument const*, std::vector<esphome::api::ExecuteServiceArgument, std::allocator<esphome::api::ExecuteServiceArgument> > >, esphome::api::ExecuteServiceArgument*)':
/data/cache/platformio/packages/[email protected]+2021r2-patch5/riscv32-esp-elf/include/c++/8.4.0/bits/stl_uninitialized.h:82: undefined reference to `long esphome::api::get_execute_arg_value<long>(esphome::api::ExecuteServiceArgument const&)'
/data/cache/platformio/packages/[email protected]+2021r2-patch5/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/heatpump-c3/.pioenvs/heatpump-c3/src/main.cpp.o: in function `std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::vector(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)':
/data/cache/platformio/packages/[email protected]+2021r2-patch5/riscv32-esp-elf/include/c++/8.4.0/bits/stl_vector.h:462: undefined reference to `long esphome::api::get_execute_arg_value<long>(esphome::api::ExecuteServiceArgument const&)'
/data/cache/platformio/packages/[email protected]+2021r2-patch5/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/heatpump-c3/.pioenvs/heatpump-c3/src/main.cpp.o: in function `void esphome::api::UserServiceBase<long, long, long>::execute_<0, 1, 2>(std::vector<esphome::api::ExecuteServiceArgument, std::allocator<esphome::api::ExecuteServiceArgument> >, esphome::seq<0, 1, 2>)':
/config/esphome/.esphome/build/heatpump-c3/src/esphome/components/api/user_services.h:57: undefined reference to `long esphome::api::get_execute_arg_value<long>(esphome::api::ExecuteServiceArgument const&)'
/data/cache/platformio/packages/[email protected]+2021r2-patch5/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/heatpump-c3/.pioenvs/heatpump-c3/src/main.cpp.o: in function `esphome::api::ListEntitiesServicesArgument::ListEntitiesServicesArgument()':
/config/esphome/.esphome/build/heatpump-c3/src/esphome/components/api/api_pb2.h:836: undefined reference to `esphome::api::enums::ServiceArgType esphome::api::to_service_arg_type<long>()'
/data/cache/platformio/packages/[email protected]+2021r2-patch5/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/heatpump-c3/.pioenvs/heatpump-c3/src/main.cpp.o: in function `esphome::api::UserServiceBase<long, long, long>::encode_list_service_response()':
/config/esphome/.esphome/build/heatpump-c3/src/esphome/components/api/user_services.h:35: undefined reference to `esphome::api::enums::ServiceArgType esphome::api::to_service_arg_type<long>()'
/data/cache/platformio/packages/[email protected]+2021r2-patch5/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/heatpump-c3/src/esphome/components/api/user_services.h:35: undefined reference to `esphome::api::enums::ServiceArgType esphome::api::to_service_arg_type<long>()'
collect2: error: ld returned 1 exit status
*** [/data/heatpump-c3/.pioenvs/heatpump-c3/firmware.elf] Error 1
========================= [FAILED] Took 211.38 seconds =========================
It looks like the issues described here, but I did not have time to investigate / test more.
Any help would be much appreciated and I could focus more on the fun-hardware-stuff
My test yaml is here: ESPHome config for CAN at ESP32 C3 . Results in linker errors :/ · GitHub
Just copy / paste the yaml and compile it. The error should be the one shown above
~Martin