maximkulkin / esp32-homekit-camera

Firmware for esp32-camera module to act as Apple Homekit IP camera
MIT License
394 stars 78 forks source link

Compiling error #47

Closed okanduzyel closed 4 years ago

okanduzyel commented 4 years ago

Hi maxim,

I installed esp idf tools correctly and then, I can erase or flash esp32. I tried hello_world example of espif, it works.

However, when I compile your esp32-homekit-camera example, I got that error:

error: incompatible type for argument 1 of 'camera_accessory_set_ip_address' camera_accessory_set_ip_address(event->event_info.got_ip.ip_info.ip);


In file included from /home/vagrant/esp-homekit-demo/examples/esp32-homekit-camera/main/app_main.c:14:
/home/vagrant/esp-homekit-demo/examples/esp32-homekit-camera/main/accessory.h:7:49: note: expected 'ip4_addr_t' {aka 'struct ip4_addr'} but argument is of type 'esp_ip4_addr_t' {aka 'struct esp_ip4_addr'}
 void camera_accessory_set_ip_address(ip4_addr_t ip);

Could you check it please? 
okanduzyel commented 4 years ago

Addition:

I installed xtensa toolchains to new clean vagrant ubuntu machine and cloned esp32-homekit-camera example again. It still gives same error. But, all esp32 espif examples work without any problem. Could you check it please Maxim?

maximkulkin commented 4 years ago

Just checked: mine builds just fine on latest esp-idf

okanduzyel commented 4 years ago

Does it depend on menu configuration? Or board?

It also gives a lot of warnings. (Not used function etc.)

By the way, I flashed Arduino's camera example on my board. Its camera hardware also works.

My board: https://tr.aliexpress.com/item/32963016501.html?spm=a2g0s.9042311.0.0.565b4c4dZe2zhO

okanduzyel commented 4 years ago

I tried it 3rd different computer and got same result. I install the esp idf from here;

https://docs.espressif.com/projects/esp-idf/en/latest/get-started/linux-setup.html

with building instructions. Cloning your example from here with;

git clone -recursive https://github.com/maximkulkin/esp32-homekit-camera.git .

make menuconfig

and changing what you say about configuration requirements:

Partition Table (OK)
Partition Table = Custom partition table CSV (OK)
Custom partition CSV file = partitions.csv (OK)
Component config
ESP32-specific
Support for external, SPI-connected RAM = check (OK)
SPI RAM config
Initialize SPI RAM when booting the ESP32 = check (OK)
SPI RAM access method = Make RAM allocatable using malloc() as well (OK)
Camera configuration
OV2640 Support = check (OK)
HomeKit
SPI flash address for storing HomeKit data = 0x3A0000 (OK)
ESP32 HomeKit Camera
WiFi SSID and WiFi Password (written my said and password)
Camera Pins
Select Camera Pinout = your variant of module (AI-thinker)

And its response always like that:

CC build/x264/x264-snapshot-20181221-2245-stable/encoder/lookahead.o
CC build/x264/x264-snapshot-20181221-2245-stable/encoder/macroblock.o
CC build/x264/x264-snapshot-20181221-2245-stable/encoder/me.o
CC build/x264/x264-snapshot-20181221-2245-stable/encoder/ratecontrol.o
CC build/x264/x264-snapshot-20181221-2245-stable/encoder/set.o
CC build/x264/x264-snapshot-20181221-2245-stable/encoder/slicetype-cl.o
AR build/x264/libx264.a
CC build/main/accessory.o
CC build/main/app_main.o
In file included from /home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:8:
/home/vagrant/esp/esp-idf/components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
 #warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
  ^~~~~~~
/home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c: In function 'event_handler':
/home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:30:77: error: incompatible type for argument 1 of 'camera_accessory_set_ip_address'
             camera_accessory_set_ip_address(event->event_info.got_ip.ip_info.ip);
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:14:
/home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/accessory.h:7:49: note: expected 'ip4_addr_t' {aka 'struct ip4_addr'} but argument is of type 'esp_ip4_addr_t' {aka 'struct esp_ip4_addr'}
 void camera_accessory_set_ip_address(ip4_addr_t ip);
                                      ~~~~~~~~~~~^~
/home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c: In function 'wifi_init':
/home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:45:5: warning: 'tcpip_adapter_init' is deprecated [-Wdeprecated-declarations]
     tcpip_adapter_init();
     ^~~~~~~~~~~~~~~~~~
In file included from /home/vagrant/esp/esp-idf/components/esp_netif/include/esp_netif.h:31,
                 from /home/vagrant/esp/esp-idf/components/esp_event/include/esp_event_legacy.h:22,
                 from /home/vagrant/esp/esp-idf/components/esp_event/include/esp_event.h:26,
                 from /home/vagrant/esp/esp-idf/components/esp_wifi/include/esp_wifi.h:64,
                 from /home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:6:
/home/vagrant/esp/esp-idf/components/tcpip_adapter/include/tcpip_adapter.h:30:6: note: declared here
 void tcpip_adapter_init(void)  __attribute__ ((deprecated));
      ^~~~~~~~~~~~~~~~~~
/home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:46:5: warning: 'esp_event_loop_init' is deprecated [-Wdeprecated-declarations]
     ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
     ^~~~~~~~~~~~~~~
In file included from /home/vagrant/esp/esp-idf/components/esp_event/include/esp_event.h:26,
                 from /home/vagrant/esp/esp-idf/components/esp_wifi/include/esp_wifi.h:64,
                 from /home/vagrant/esp/esp-idf/examples/esp32-homekit-camera/main/app_main.c:6:
/home/vagrant/esp/esp-idf/components/esp_event/include/esp_event_legacy.h:227:11: note: declared here
 esp_err_t esp_event_loop_init(system_event_cb_t cb, void *ctx) __attribute__ ((deprecated));
           ^~~~~~~~~~~~~~~~~~~
make[1]: *** [app_main.o] Error 1
make: *** [component-main-build] Error 2
vagrant@vagrant-ubuntu-trusty-64:~/esp/esp-idf/examples/esp32-homekit-camera$

At the end of compiling, it gives that error and if I make that line to comment like below inside of app_main.c:

//camera_accessory_set_ip_address(event->event_info.got_ip.ip_info.ip);

it passes the compiling and it can flash the esp32. (but fails when it boots itself because of camera).

okanduzyel commented 4 years ago

@maximkulkin Could you share your all configurations of make menuconfig please?

Rafal74 commented 4 years ago

Hello Maxim, I admire your projects very much. I have same problem like @okanduzyel. What do you advise to check ? Thank You

fxday commented 4 years ago

Me, too. @maximkulkin

Should I need to patch esp32-camera.patch?

Hello Maxim, I admire your projects very much. I have same problem like @okanduzyel. What do you advise to check ? Thank You

okanduzyel commented 4 years ago

esp-idf v3.2 it works!

ryan99alero commented 4 years ago

I went in on my own repo and commented out the original line and just edited the line to be what its looking for. This allowed it to compile and flash. Will test when I get home if the module actually works.

// void camera_accessory_set_ip_address(ip4_addr_t ip); void camera_accessory_set_ip_address(esp_ip4_addr_t ip);