SmartEVSE / ESP32-PLC

a ESP32-S3 talks to a QCA7005 to read the SOC of a car
13 stars 10 forks source link

How to connect ESP32-S3 and QCA7005? #1

Open EgnionInnovation opened 1 month ago

EgnionInnovation commented 1 month ago

Hello, thanks for sharing your code here. I'm want to do the exact same thing, i.e. reading the car SoC using an ESP32-S3 using the QCA7005. However, I was wondering how you connected the QCA with the ESP? Also, were you using the bare chip for QCA or some carrier board like YELLOW Beet or RED Beet?

I would be really greatful if you could guide me. Looking forward to your reply. Thanks in advance.

mstegen commented 1 month ago

I was using the yellow beet. There are only 5 connections. basically connect the SPI port of the Yellow beet to the ESP32-S3

define PIN_QCA700X_INT 9 // SPI connections to QCA7000X

define PIN_QCA700X_CS 34

define SPI_MOSI 35

define SPI_MISO 37

define SPI_SCK 36

I don't have a detailed schematic at the moment, but i hope this helps.

taliesin commented 1 month ago

Not really exactly the same topic, but a bit in the same direction:

I'm about to buy a SmartEVSE V3, is there a chance to be able to patch this kind of extension onto it? The SPI connection would be the 5 wires, 2 for power and one to connect to the CP pin, which probably needs a filter ...

The space inside the housing might be quite tight then? I know it's too early :-)

EgnionInnovation commented 5 days ago

Hi @mstegen, thanks for your reply. I understand the connections.

However, instead of using a yellow beet or a red beet, if I choose to use the QCA7000 chip, along with all required components, on my own PCB. Would that QCA7000 chip need a firmware of it's own? Or would it work out of the box with an ESP32-S3 having your firmware on it?

I'm using this schematic as reference for integrating the QCA7000 with my EVSE. https://github.com/uhi22/foccci/blob/main/schematic_2024-07-09_v5.1.pdf

uhi22 commented 5 days ago

When using the Foccci approach, the qca has an SPI flash connected, which contains the firmware and the settings ("PIB") for the qca. Alternatively the QCA could boot from the master SPI, if the ESP would provide the firmware and settings. As far as I know nobody used this approch so far.

EgnionInnovation commented 5 days ago

The firmware and settings in the SPI flash connected with the qca, is that available open source?

I have an EVSE developed on an ESP32-S3, and for now I just want to read the SoC from the EV. For which, I understand that your code in this repository would do the trick. But it's not possible for me to use a red beet or a yellow beet for my solution, but to use a qca chip on my EVSE PCB. So what I can I do, or use, to do this?

Any help is greatly appreciated. Thanks in advance!

uhi22 commented 5 days ago

The method how to bring the firmware and configuration into the spi flash is described here: https://github.com/uhi22/foccci?tab=readme-ov-file#programming-the-spi-flash There is also the link to the necessary flash file.

EgnionInnovation commented 4 days ago

Thanks alot @uhi22. One last question.

If i setup the flash as described in foccci, and if I program the ESP32-S3 with the firmware in this repository, would that work for me to achieve my goal of getting the SoC?

uhi22 commented 4 days ago

Oh wait. The focccis flash data is parametrized as PEV, but you need the EVSE side. This can be changed by connecting the qca to a Raspberry and using the qualcom plc tool to change the parameters. Or maybe someone can provide a flash dump of a working EVSE setup. Afterwards, according to the desciption of this repository, reading the SOC should work.

uhi22 commented 4 days ago

Oh, wait again. This project covers only the high level communication. You need to have a circuit to create the 12V 1kHz 5% PWM in addition.

EgnionInnovation commented 4 days ago

I already have the PWM circuit in my EVSE for generating a 12V 1kHz PWM signal, and I can vary it's duty cycle from 0-100%. Now the question comes to getting my hands on a flash dump of a working EVSE setup. Any leads for that?