Esp32 cam login attempt or request with invalid authentication from

Hi!

My new TTGO T-Camera plus is finally up and running. Unfortunately it is having some trouble. When it tries to connect to hass.io to show a live feed or a picture it’s not showing anything and I get a login attempt or request with invalid authentication from (ip). It’s like it is trying to connect from outside the network. Also when I’m trying the OTA it first connects than disconnects saying “WARNING Disconnected from API: Timeout while waiting for message response!”
I don’t know what to do anymore. It works via usb and is giving me Got Image: len=11017 and so on.

This is my latest try on the config:

esphome:
  name: ttgo
  platform: ESP32
  board: esp-wrover-kit

wifi:
  ssid: ""
  password: ""
  manual_ip:
    static_ip: 
    gateway: 
    subnet: 
  fast_connect: true
logger:

api:
  port: 
  
ota:
  password: 
  
esp32_camera:
  name: TTGO
  external_clock:
    pin: GPIO4
    frequency: 20MHz
  i2c_pins:
    sda: GPIO18
    scl: GPIO23
  data_pins: [GPIO34, GPIO13, GPIO26, GPIO35, GPIO39, GPIO38, GPIO37, GPIO36]
  vsync_pin: GPIO5
  href_pin: GPIO27
  pixel_clock_pin: GPIO25
  resolution: 640x480
  jpeg_quality: 10
  test_pattern: false
  vertical_flip: false

If it is a connection from outside your network then it is nothing to do with esphome.

It only appears when the camera is trying to show a feed or connect via ota in esphome. It’s like the esphome api isn’t working? Or am I suppose to move this question to another thread?

Have you used “Integrations” to get the camera into home assistant?

Yes I have.

What is the ip address it says the invalid auth is from?

83.252.180.107

That appears to be in Sweden, or in any event controlled there

Com Hem AB
Box 8093
104 20 STOCKHOLM
SWEDEN

Yes that is my internet provider here in Sweden.

It’s possibly your own IP address? You can google whatsmyip to find out. In which case it is your router or something misconfigured somewhere. (Or someone else in Sweden trying to look at your camera!)

It is my own ip. When trying to see it from my phone outside the network I’m getting a similar ip warning. It’s so weird that my other esp multi sensor is working just fine but the camera is “blocked”

I think I have found the problem. I did a log on it via OTA and it seems like it disconnects from the api after initial setup and from there it tries to connect again but isn’t allowed.

Hi all,

It looks like I am on the same boat here.

I also got my TTGO Cam Plus and I am running into the same issues just that on my side I am getting invalid logon from the IP of the computer I use to browse the HA page.

I have another ESP32 camera flashed a while ago that is running fine. Unfortunately I do not have the same development environment to test with. I did tried reverting the ESPHome to 1.13.0 and 1.13.6 the behaviour was similar. Maybe the 37000+ byte image payload is too much for the API.

The original FW on the board worked for the demo purposes ok.
Maybe I have an hardware issue. I don’t know how to track this API disconnections.

Best regards.

I have exactly the same problem. I have tried different kind of things for 3 weeks. The api keeps bugging out everytime. I tried running it as a webserver and connecting but still not working. I think the best thing to do is buy the ttgo and not the plus.

Hi,

I think I got this working a bit better. It is just too late to watch how it performs, but I did added the following lines to the configuration:

i2c:
  sda: 18
  scl: 23
  scan: False

spi:
  clk_pin: GPIO21
  mosi_pin: GPIO19
  miso_pin: GPIO22

output:
  - platform: gpio
    pin: GPIO0
    id: CS_GPIO0
  - platform: gpio
    pin: GPIO12
    id: CS_GPIO12
  - platform: gpio
    pin: GPIO2
    id: CS_GPIO2

I think that some pins needed a better default state than what the normal default is.

It is still running a bit slow and I am not seeing any increase on the frame rate once it is streaming but there are no more API disconnections, or at least as long as it took this to write this.

Let me know if is not just a coincidence.
:slight_smile:

Wonderful! I will try this as soon as I get home! :slight_smile:

I’m just geting an error while uploading. Can you please show the whole camera config? :slight_smile: @COX

Hi, if you are trying to OTA update it will fail because of the API issues. You will have to use an USB cable.

I did it via usb-cable. Did you just add it to the bottom and keep the rest or did you change anything?

No,

I added this at the end of the
esp32_camera:
element.

Like this:

esp32_camera:
  name: TTGoCam
  external_clock:
    pin: GPIO4
    frequency: 20MHz
  i2c_pins:
    sda: GPIO18
    scl: GPIO23
  data_pins: [GPIO34, GPIO13, GPIO26, GPIO35, GPIO39, GPIO38, GPIO37, GPIO36]
  vsync_pin: GPIO5
  href_pin: GPIO27
  pixel_clock_pin: GPIO25
  resolution: 800x600
  jpeg_quality: 16
  vertical_flip: true
  horizontal_mirror: true

i2c:
  sda: 18
  scl: 23
  scan: False

spi:
  clk_pin: GPIO21
  mosi_pin: GPIO19
  miso_pin: GPIO22
  id: SDCard

output:
  - platform: gpio
    pin: GPIO0
    id: CS_GPIO0
  - platform: gpio
    pin: GPIO12
    id: CS_GPIO12
  - platform: gpio
    pin: GPIO2
    id: CS_GPIO2

switch:
  - platform: restart
    name: "TTGoCam Restart"

sensor:
  - platform: wifi_signal
    name: "TTGoCam dB"
    update_interval: 60s