unreality / LGTV-HK

Control your older LG TV via HomeKit
MIT License
10 stars 3 forks source link

ESP32-C3-PICO-A for nodeMCU problem #6

Open vmarks opened 3 weeks ago

vmarks commented 3 weeks ago

Hi,

I have a ESP32-C3-PICO-A that doesn't use USB for serial, so I use a FTDI for serial. I have it loading the ESP32 C3 with this code

Connecting... Detecting chip type... ESP32-C3 Chip is ESP32-C3 (QFN32) (revision v0.4) Features: WiFi, BLE Crystal is 40MHz MAC: ec:da:3b:b7:01:78 Stub is already running. No upload is necessary. Changing baud rate to 460800 Changed. Configuring flash size... Flash will be erased from 0x00000000 to 0x00101fff... Warning: Image file at 0x0 doesn't look like an image file, so not changing any flash settings. Compressed 1055136 bytes to 604106... Writing at 0x0008a69a... (45 %)Traceback (most recent call last): File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/__init__.py", line 1314, in _main main() File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/__init__.py", line 1036, in main operation_func(esp, args) File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/cmds.py", line 646, in write_flash esp.flash_defl_block(block, seq, timeout=timeout) File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/loader.py", line 127, in inner return func(*args, **kwargs) File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/loader.py", line 1132, in flash_defl_block self.check_command( File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/loader.py", line 510, in check_command val, data = self.command(op, data, chk, timeout=timeout) File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/loader.py", line 479, in command p = self.read() File "/Users/victormarks/Library/Python/3.9/lib/python/site-packages/esptool/loader.py", line 412, in read return next(self._slip_reader) StopIteration

is what I have.

What is needed to send the ESP32 C3? I was trying to use esp tool in terminal.

unreality commented 3 weeks ago

If you are trying to flash to prebuilt image to the C3 it will not work - the image is built for the ESP32 only.

You will need to compile and upload your built image, and im unsure if the code will work correctly on the C3 (its never been tested)

vmarks commented 3 weeks ago

Hi!

The ESP32 image should be working with the ESP32 I used - the one I used is the ESP32 - C3-Pico-A for its specific ESP32, but it's the same ESP32 used in it. The M5 Atom Lite is the ESP32 has an IR led, a switch, but have the same RAM and rs232 serial.

While I work at the code, can I ask a different we have asking... which ESP32 is the part that is used for this code? https://shop.m5stack.com/products/atom-lite-esp32-development-kit?srsltid=AfmBOopJptDZlE3sMYjrhcykoYtDj8Cna70wTHCDZyCdpceHfs205umq&variant=32259605200986 is the M5 atom lite - what are other ones that might be used?

unreality commented 3 weeks ago

The ESP32-C3 uses a RISC-V CPU, and the ESP32 uses an Xtensa - the prebuilt image is compiled for Xtensa and so it will not work on the C3.

Any ESP32 based module should work (ie the original ESP32, and not any variant such as C3, S2, S3, H2, P4, C6, etc) - but the image is built specifically for the M5AtomLite and the Pins available on that module.

ESP32 variants might work if you compile and upload the image yourself, but they have not been tested and probably require some tweaking for what pins to use.

vmarks commented 1 week ago

Hello,

I have get the Xtensa ESP32. I have a problem using the NodeMCU pyflasher. Is there a way to use esptool.py to flash the Atom Lite esp32?

EDIT: here's what I have done so far:

python3 -m esptool -b 115200 --before=default_reset --after=hard_reset write_flash -fs 2MB -fm dio 0x0 ~/Downloads/lgtv-hk.bin

which is a way to saying how slow (115200) the kbps is, when it can write the file, and where for it (0x0). I am checking to see if it does it...

  1. This edit allows me to enter Wi-Fi.
  2. it does not allow Wi-Fi working (that I know of yet)
  3. how do fix this? Screenshot 2024-11-06 at 9 15 04 PM
vmarks commented 1 week ago
  1. Wi-Fi can be connected. Do not use the numeral list for SSID, tell the SSID word for the network. Then, ask the password for Wi-Fi. (SSID name, separate prompt, SSID password)
Screenshot 2024-11-07 at 10 00 57 AM
  1. The device will not use a number first. You have to use S 11122333 (or other code) and it will add code first. It will then work with Apple Home to pair it.
Screenshot 2024-11-07 at 12 57 04 PM

My device appears to be on Wi-Fi and Home code, and now needs RS232 for the TV device.

vmarks commented 1 week ago

To set up the RS232C plug, you need to look at it like this:

1 is up left, 5 up right 6 bottom left, 9 down right

pins for the cable are:

RX is 2 pin TX is 3 pin GND is 5 pin

vmarks commented 1 week ago

OLED65B7P is the LG that uses a 1/8" cord instead of using a DB9 port. For this, the port is a RS232C service port.

The tip is TX or RX the middle bit is RX or TX the rear is GND.

I am working on this problem.