libretiny-eu / esphome-kickstart

Precompiled LibreTiny-ESPHome firmware allowing identification of device pins and OTA upgrading
39 stars 5 forks source link

ESPHome via UART #4

Closed Onepamopa closed 11 months ago

Onepamopa commented 1 year ago

Hey there,

I'm trying to flash image_bk7231t_app.ota.ug.bin via UART on an already cloud-cut device (using OpenBK7231T_App), but I'm not seeing a wifi network to connect to the device....?

Reason I want to try esphome-kickstart is mainly because OpenBK7231T's IR implementation sucks, and I know esphome uses IRRemoteESP8266 library which is a hell of a lot better....

Any ideas?

kuba2k2 commented 1 year ago

If you're flashing via UART (using wires), you should flash the Kickstart UF2 file using ltchiptool. The UG file is only used for Cloudcutter.

Be aware that some users reported that IR doesn't compile properly on LibreTiny - that applied to "HeatpumpIR" library IIRC. You might have better success with IRremote.

Onepamopa commented 1 year ago

IRRemote doesn't recognise most air conditioneers .... which is why I'm trying to get an image with irremote8266 which has a lot more support..

Also: image

For some reason it's reporting a virus... none of the other flashers I've downloaded resulted in that..

kuba2k2 commented 1 year ago

The ltchiptool application is open source, if you want you can install it using pip install ltchiptool[gui]. It doesn't contain malware, it's a false-positive because of how it works (decompresses Python files to launch them).

Onepamopa commented 1 year ago

It's probably because it's not signed, I've scanned it with kaspersky - no threats. Flashing at the moment..

Onepamopa commented 1 year ago

Now... I've set the network and password, it connected. I connected to it via browser and ... there's no config or anything? It's just displaying the same page to select a wifi network and OTA update. What do I do next?

kuba2k2 commented 1 year ago

If it connected to your wifi, and you still see the wifi setup page - power-cycle it. This is probably an ESPHome bug.

Onepamopa commented 1 year ago

Power-cycled... now I see a very basic page that can set the gpio's to input/output low/high but.. that's about all? No IR no anything?

image

kuba2k2 commented 1 year ago

Yes, that's what Kickstart is - a basic firmware allowing to test GPIO inputs and outputs. It can also work with UPK2ESPHome to generate YAML for some devices.

What did you actually expect? ESPHome is made possible by writing custom configs. Refer to https://esphome.io/ for guides on how to do so.

Onepamopa commented 1 year ago

The problem is... how do I tell Home Assistant about the kickstarted device... it doesn't see it. I've generated a yaml profile in esphome @ HA, but can't find a way to upload it to the device (Tuya S06 Pro)

kuba2k2 commented 1 year ago

On the Kickstart web panel, you can upload UF2 files OTA. To "convert" YAML to a firmware binary, you choose "Install" option in HA. It will compile everything and give you the UF2 file to download.

Onepamopa commented 1 year ago

Thank you. I'll try later.

Onepamopa commented 1 year ago

By the way.... any ideas where can I get the "esp-ized" pinout for the Beken board? Trying to add i2c sda/scl but it doesn't seem to accept either P1/P2 or D1/D2 ....?

kuba2k2 commented 1 year ago

Yes, for example: https://docs.libretiny.eu/boards/cb3s/ You can find everything in the docs.

There's no P2 pin on Beken. D1 and D2 is deprecated mapping and should not be used. Additionally, I2C is not yet implemented in LibreTiny.

Onepamopa commented 1 year ago

This is what I'm getting when doing "install" via HA:

INFO ESPHome 2023.9.3 INFO Reading configuration /config/esphome/ac.yaml... INFO Generating C++ source... INFO Compiling app... Processing upk2esphome-bk7231t (board: generic-bk7231t-qfn32-tuya; framework: arduino; platform: libretiny)

Warning! Non-Git installations are NOT SUPPORTED. HARDWARE: BK7231T 120MHz, 256KB RAM, 1.03MB Flash

kuba2k2 commented 1 year ago

This can happen if your machine does not have enough RAM free - the system is killing resource-intensive processes.

amedeodivito commented 1 year ago

I have installed kickstart-bk7231n but I don't use home assistant, how can I control a MINI SMART SWITCH via NODE-RED? with mqtt or with http request or in another way? Thank you Amedeo

Cossid commented 1 year ago

kickstart doesn't provide device functionality, but instead a way to possibly reverse Tuya's config so you can generate a more specific ESPHome config with device control via pin scanning or pairing with ltchiptool. You can add MQTT to an ESPHome config that you would replace kickstart with, and that is covered in ESPHome's documentation.

amedeodivito commented 1 year ago

Thanks for the reply I'm not very familiar with ESPHome, I'll try to understand more. Amedeo