Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beginner's guide - Appreciate some help #48

Open
geedsen opened this issue Sep 19, 2024 · 23 comments
Open

Beginner's guide - Appreciate some help #48

geedsen opened this issue Sep 19, 2024 · 23 comments

Comments

@geedsen
Copy link

geedsen commented Sep 19, 2024

I have 2 x Solis 10.0 kW Dual MPPT (3F) . Their dataloggers (LAN) dont work. Now I am planning to buy two S3-WIFI-ST dataloggers.
And hopefully they will let me integrate the inverters into HA. So I am going through the installations of the ESPHome and Solis Add-ons. Probably for lots of HA people easy to do, but I got lost in the amount of documentation in specially for ESPHome. So I hope someone is willing to help me out here.
I installed ESPHome and started it.
I added the two yaml files to the ESPHome directory (1 in subdir 'common')
Then I need to modify the configuration:

image

The api encryption key, I can just paste any Encryption key there?
The wifi ssid and pwd, I assume is off the wifi near the inverters.
and the ap wifi ssid and pwd, where to they come from, do they come with the wifi dataloggers?
And is it straight in like 'key': 'value' ?

and I see this:
image

Do I need to add these to the secrets.yaml as well? any ota_password will do?

And in the ESPHome documentation, I see this:
image

but it does not mention what configuration file, is that the secrets.yaml?

Probably more questions later. Any help appreciated.

@geedsen
Copy link
Author

geedsen commented Sep 19, 2024

Found some information now how !secret refers a variable to the secrets file. That helps.

@geedsen
Copy link
Author

geedsen commented Sep 19, 2024

I added the api encryption key to the secrets, restarted ESPHome, but when I ask for the key I get this:
image
Is it because it is 'a secret'?

@geedsen
Copy link
Author

geedsen commented Sep 22, 2024

Sorry for posting my comment under "Set the MCU to UART boot mode (pull TX pin low during boot)", I thought it would make sense to keep my expererience with the same issues at the same topic.

So I am in the next phase of flashing the datalogger. Now I need to buy a usb to serial adapter.

  1. Will any one do, there are so many on amazon.nl?
  2. Is this one probably a good (fast) one? DSD TECH SH-U09C5 USB naar TTL UART-converterkabel met FTDI-chipondersteuning 5V 3.3V 2.5V 1.8V TTL
  3. Can I do this from Windows?
  4. In the installation documentation it says this: Click the three-dots button, then "Install" and "Manual Download".
    Wait for the compilation process to finish and download the "UF2 package"., does that mean the UF2 package is different for every installation and is generated specially for my configuration?

Thanks.

@hn
Copy link
Owner

hn commented Sep 22, 2024

1./2. The serial adapter you pasted looks good. One never can say for sure if it will work. Some serial adapters do not supply enough power for the MCU -- but you can not "see" that in advance. Also put some male-female Dupont wires in your shopping cart.
3. I never did this but it should work.
4. Use two config/uf2 files with different name and friendly_name, otherwise ESPHome/HomeAssistant gets confused with two adapters.

If you document everything you do here with pictures, links, screenshots so others can learn from it, I'll help you if there are problems.

@hn hn changed the title Appreciate some help Beginner's guide - Appreciate some help Sep 22, 2024
@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

So I connected the adapter to the stick and started the ltchiptool. But some things are still unclear.
image
But we also have this:
image
So should I set the jumper on the adapter to 3.3V or 5V?
My guess would be 5.0V
image
And then getting it in boot mode, when and how exactly do you do this?
image
If I understand it correctly, I connect VCC and GND to the serial adapter, and place a jumper wire between TXD and RXD. Then I plug the adapter in the USB port , remove the jumper wire (do I need to wait for the boot to finish?) and then connect the RXD and TXD to the corresponding pins on the serial while the power is still on the UART?

I already connected and tried the flash read, without setting boot mode and VCC set to 5V.
image

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

I also tried jumping GND - TXD while inserting the adapter, keo that connection for around 20 seconds. No luck :(
image
I keep the two metal spots on the connectors connected with each other while plugging in the adapter.

And one question about the secrets.yaml. The install guide tells me to also add the AP ssid and pwd, I see this in the terminal:
image
So is the ssid of the AP solis001? And pwd is 'admin', which I believe is the standard password? But validation shows me this:
image

@hn
Copy link
Owner

hn commented Sep 24, 2024

Set your USB serial adapter to 3.3V (not 5V).

  1. Connect GND of adapter to GND of stick
  2. Connect TX of adapter to RX of stick
  3. Connect RX of adapter to TX of stick
  4. Do not connect VCC yet
  5. Connect TX of stick to GND ("pull TX low"). TX pin of stick is already occupied by the wire which you connected in step 3. I found it convinient to connect an additional wire to the Dupont pin on the other side of the TX hole.
  6. Now connect VCC of adapter to VCC of stick, stick powers up ("pull TX low during boot")
  7. After 2 seconds remove (only!) the TX-GND wire you connected in step 5 (stick is now in flash mode). Be careful not to wiggle the other cables, otherwise the stick will restart without entering flash mode.
  8. Backup whole flash via ltchiptool
  9. Flash UF2 image via ltchiptool

secrets.yaml:
wifi_ssid, wifi_password = WiFi credentials for your home network which you want the stick to connect to.
wifi_ap_ssid, wifi_ap_password, = WiFi credentials for a 'rescue access point' to access the stick is not able to conect to your home network. https://esphome.io/components/wifi.html#access-point-mode
api_encryption_key = 32-byte base64 encoded string, copy a random one from https://esphome.io/components/api.html
ota_password = a random password for later updates. You never need to enter it manually, so choose a strong password.

All the above values are hardcoded into the UF2 file. Do not give the UF2 files to untrusted persons as they contain you WiFi password.

The screenshot you pasted ("LDO Mode BD_Info") is the boot log of the original vendor firmware.

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

THe only thing I get is "Connecting to chip", Hardware reset, Software reset and this looping. How can I tell the 'pull' worked? I also found that using the Dupont pin on the other side of the stick might be too short to connect a female to it. It really is very lose. So if that does not connect the pull will fail as well.
I do get garbage in the terminal window. And only the red light is flashing (slow) on the stick.

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

Yep, that was the problem. I just kept two males against txd/gnd and pulled those. That worked.

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

So I just made a copy of the yaml file and gave it a new name and friendly name.
image

That's all, generate a new uf2 with these settings etc....?

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

Hmm Flashing resulted in this:
image
image
Is that OK?

@hn
Copy link
Owner

hn commented Sep 24, 2024

Yes, just use two different yaml files. People tend to give them descriptive names like solis-esphome-emw3080-garage.yaml. For dutch people solis-esphome-emw3080-campervan.yaml might be an option.

Just check if flashing suceeded by powering the stick without TX pulled low. If everything went ok, you should see the ESPHome boot log in terminal. If not, try to flash again.

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

Hmm, maybe it did work:
image
But the terminal is not really helpful
image

@hn
Copy link
Owner

hn commented Sep 24, 2024

Looks good. Now you never should need to connect the serial adapter again. You can update via ESPHome OTA. Press the LOGS button to see the device logs.

Your terminal uses the wrong baud rate (should be 115200).

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

The logs look good. Should I already see any values for the entities? It is still just connected to the adapter.
What I am really interested in is the entity that allows output limiting (like 80%) Should I see that entity in the logs?

@geedsen
Copy link
Author

geedsen commented Sep 24, 2024

Thanks for all your help BTW!

@hn
Copy link
Owner

hn commented Sep 24, 2024

You'll not see any values unless the stick receives values via ModBus from a powered-on inverter (usually they power down at night). Go to HomeAssistant->Settings->Integrations->ESPHome to see the details then.

Consider to star this project if you like it.

@geedsen
Copy link
Author

geedsen commented Sep 25, 2024

The only part I am not seeing is this part:
image
I cannot find any of the entities in HA....

@hn
Copy link
Owner

hn commented Sep 25, 2024

You need to add the device on the HomeAssistant->Integrations page, see my last post.

@hn hn pinned this issue Sep 26, 2024
@JGeeforce
Copy link

JGeeforce commented Oct 6, 2024

@geedsen Would it be possible to create a step by step manual? I really would like to use my stick with ESPhome too.

So your USB serial from Amazon worked, did you by this one: USB

@geedsen
Copy link
Author

geedsen commented Oct 6, 2024

@JGeeforce Yes, that is the USB stick I used.
THe step by step guide @hn made is pretty accurate. So please follow that and anything unclear just ask.

@JGeeforce
Copy link

So I just made a copy of the yaml file and gave it a new name and friendly name. image

That's all, generate a new uf2 with these settings etc....?

Not sure about the different yaml files. Why is this and what should I do?

@JGeeforce
Copy link

Baud rate tip!

As I had issues with backing up the original firmware I had to set the baud rate in the Windows version to auto! I had it set to 112500, but then I only got read time out. With auto it took 6 minutes and with success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants