-
Notifications
You must be signed in to change notification settings - Fork 17
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
Replacing the main application fails #2
Comments
Well, things are a little bit shaky at the moment. @kuba2k2 does a really great job with LibreTiny, but it's not easy to have stable support for those cloned chips like the EMW3080. The good thing is: it's doable -- I've got a stable WiFi S3 stick running with HA for some weeks. With rtltool3.py I also experienced some errors, I reverted back to using rtltool2.py. Try to flash the app binary alone:
If this works and LibreTiny comes up (watch boot log, e.g. |
Thanks for quick response! Rtltool python2 version worked flawlessly. As you expected, now I'm experiencing exactly the same WiFi issue you have. Any downgrade tips for downgrading to older LibreTiny would be much appreciated :) |
@hn could you post the rtltool2 and rtltool3 versions that you're using? ltchiptool is based on rtltool (an old version that worked on Python 2 I think) which makes it odd that it doesn't work. I could compare the working tool to the current code and maybe fix ltchiptool. |
Install LibreTiny v0.13.0 (may you have to remove the current version before, I dont know):
This will probably install LibreTiny under its old name LibreTuya and you will have to adjust paths and/or names. Please report back so others can benefit from your learnings. Apply this diff to make the UART work:
Compile and upload the binary to the WiFi stick as before. Subsequent updates can be carried out via OTA. If you experience ModBus errors after some hours (e.g. no new values show up in HA), you may have to apply this "makes-no-sense-but-helps" fix as well: libretiny-eu/libretiny#91 (comment) |
I'm running into a lot of compiling errors. So far, I made the changes you suggested and git checked out latest commit from libretiny-esphome before name change (commit SHA 7d37eea0f731a55274659ca08662dd96386e38dd). I also changed libretiny->tuya in solis-inv-esphome.yaml. I'm currently trying to sort out this error:
I'm very new to all of this, but I'll report back as soon as I figure this out. |
You'd have to check out the latest commit before the refactor in esphome. The name change commit was a bit after the refactor commit. |
@spuke113 I used libretiny-esphome from mid-march kuba2k2/libretiny-esphome@d076454 |
It works! At least for now. I don't have UART-USB device connected to the stick at the moment, since it's kinda tricky to access the UART pins while the stick is attached to the inverter (without drilling holes to the case, warranty void bla bla...). Therefore I don't have access to debug logs to monitor status of the modbus, but I suppose the problem shows itself as generic instability in HA as well. Thanks for useful tips! I'll report back in a couple of days. |
@hn we've fixed a malloc() issue just yesterday, which I haven't noticed - it is possible that it was the source of your WiFi problems. Could you check the new version when you get the chance? |
@spuke113 : Congratulations, you are registered user # 2 for wifi-stick-s3-open-source :-) For connecting the UART (without voiding warranty -- a good joke if you re-flashed the firmware some minutes ago), I completely removed the PCB vom the case and just plugged in the (black) cap into the inverter. Then I pushed the PCB into the cap, it it sits there quite firmly, even without the case. Warning: do not confuse the orientation of the PCB! @kuba2k2 : Great, just give me 1-2 days. |
@kuba2k2 : Just a quick test with |
Note to self: don't use linker aliases. Let me know if it's stable in a few days. |
@hn The stick worked fine 3 days in a row. Yesterday updates stopped flowing to HA and sure shit modbus was throwing crc errors. I applied that Serial2.println("foo"); "fix" today morning, but only a couple of hours later crc errors were back again. Booo :( I have a logic analyzer, I'll try to sniff the traffic between the stick and the inverter tomorrow. Deep rabbit hole, here we come! |
@spuke113 I think the ModBus traffic is ok on wire, for some reason it gets de-synced (all the data is there, but incorrectly shifted into the individual telegrams). I've opened a new issue to have one place to track this. |
After finally solving my issues in this ticket #9 I get the following error ============================================ [sassa@fedora libretiny-esphome]$ python3 -m esphome upload solis-esphome-emw3080.yaml --device /dev/ttyUSB0 Obsolete PIO Core v6.1.7 is used (previous was 6.1.9) Processing solis-emw3080 (board: generic-rtl8710bx-4mb-980k; framework: arduino; platform: libretiny) Configuring upload protocol... ============================================ If I try with sudo I get this ============================================ sudo python3 -m esphome upload solis-esphome-emw3080.yaml --device /dev/ttyUSB0 ============================================ I am sure the ttyUSB0 port is the correct one by checking dmesg Whatever I try I get the same results.... I am starting to feel cursed as soon as I touch this project. Any ideas what's going wrong? EDIT I tried this trick (I know it's a dirty one and could be solved with adding my user to the correct group but I was lazy)
That solved my previous error however I got a new one, same as @spuke113 |-- ValueError: Failed to write to 0x800B000 So now I'm sitting here with a bricked stick as well..... This is really getting on my nerves.... time for a break... |
No worries, we'll get it going :) Please try to solely flash the app alone (ota1 and ota2 image) using the Python2 version of rtltool:
|
Not to worried :) Just annoyed that I am not more of a "hacker" 😄 I am sure we will get this sorted sooner or later. I checked that I could still talk to the stick after bricking it, with the I did a quick search regarding the files you mentioned, image_0x00B000.ota1.bin and image_0x100000.ota2.bin but I can't locate them. Thinking the best thing I could do is start over fresh tomorrow with a cup of coffee and a good nights sleep, plan is to install a fresh Linux Mint 21.1 and go from there, this laptop I am using now has been a "battle field" many years for different projects so I have a bad feeling about it. (also a big thank you @hn for helping out all this time, your patience is amazing!) |
If you have an uf2 file (your log |
So, I did not wait for either coffee or a good nights sleep 😃 I did exactly what you told me to in #2 (comment) and what do you know! F*** YES!!!!!!!!!!!!!!! FINALLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
Hello @hn,
I'm trying to flash esphome image to the Solis S3 WiFi Data Logging Stick (3rd gen). I followed your instructions, but the very last step fails with just a generic error:
The stick is in bricked state after flashing fails. I managed to restore the stock firmware by running (MCU is in UART boot mode):
Even though I get this error, the stick seems to work fine with the stock firmware.
Any ideas what I might be doing wrong?
The text was updated successfully, but these errors were encountered: