Replies: 23 comments 54 replies
-
Update:
Line end and the display is good. |
Beta Was this translation helpful? Give feedback.
-
Now, when I change the order of the queried registers like so: current first (r010431050001), voltage last (r010431040001).
The web UI shows:
Well, that's the correct number for the battery voltage. But it is displayed as the current's value. It's supposed to display So there's some serious issue regarding indexing it appears. Unless I'm messing something up which might happen sometimes. Please, could anyone explain to me what is happening and why? |
Beta Was this translation helpful? Give feedback.
-
Using this:
Yields:
That is, everything is zeroed except the battery voltage (which is queried last, gets index 0).
Correct Temperature (and presumably also P and I as it is dark outside). V is zero as there's no data queried. And debugging shows all values are received correctly, just not displayed as it should be.
|
Beta Was this translation helpful? Give feedback.
-
Daily dose of testing: Register addresses according to a document titled "B-Series MODBUS Specification Battery capacity query via r0104311a0001 yields 01 04 02 00 64 b8 db (0064h -> 100). Above document states "Times 100", however it is in fact times "1". Result is "100%". Battery voltage query via r0104331A0001 yields 01 04 02 0a 64 be 7b (0a64h -> 2660). Above document states "Times 100", which is correct and results in "26.60V". However the doc states register address 331Ah is "Battery voltage" but filed under "Statistical Parameters". Section "Examples" states: "Read real-time battery voltage" from "Register Address: 0x3104", this address is not listed in the "Realtime Datum" table, though. Buggers. Battery temperature (external sensor) query via 01 04 31 1b 00 01 4f 31 yields 01 04 02 05 92 3b cd (0592h -> 1426). This correctly results in "14.26°C", which is a fresh late summers night's outside temperature. There's a catch: the order of queries above is only displayed in the corresponding line in the attached image if the indices "ix:" are given as shown below. The indices are all over the place if indices start at 0. They seem fine if indices start at 1. In the latter case the last query, the one for the battery temperature (Tb) is sent last (would be index 3) but needs to be accessed via index 0 (i0:).
Given all this, one might think the decoding algo is defunct. According to the internet no other (EPever Tracer BN?) owner/user experiences the same issue. Or is it that none use EPever Tracer BN series devices and for other SML/modbus decoders this is working out ok? Consequently, I'd rather like to assume there's a fault on my part, wiring or whatever. Ideas anyone? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hm. The source is differing: sha1sums:
Just did a rebase on master: up-to-date. Master had 3 more commits, none regarding SML stuff. Latest git hash for "tasmota_xsns_sensor/xsns_53_sml.ino" is development branch has a file "tasmota_xsns_sensor/xsns_53_sml.ino" with |
Beta Was this translation helpful? Give feedback.
-
this is a debug version that prints out the transmit and receive index with dump data in normal (not dump mode) |
Beta Was this translation helpful? Give feedback.
-
probably yet a hardware issue. what rs485 converter are you using ? |
Beta Was this translation helpful? Give feedback.
-
I changed |
Beta Was this translation helpful? Give feedback.
-
Using
Is it for the swapped RX/TX pins? Then I'd need to get the hot iron out. But why aren't all rx's lost then.. |
Beta Was this translation helpful? Give feedback.
-
This gets more and more interesting. I've got an esp32 with the same firmware settings and script as the esp8266, for easy comparison equally with swapped rx/tx pins. Now, they're correctly crossed over and the script meter description is:
After bootup at the very first moment, Vbstat briefly was correctly displayed as 28.33V. A couple of seconds later, the display shuffled and it ended up displaying the same mixed up mess as usual (as with the esp8266). I managed to grab the log and it shows what was happening:
33 1a (tx index 1) is Vbstat with a value of 0b 11 ( Next time tx index 1 is sent, there's no response but on the subsequent tx index 1 being sent the response is 00 61 ( With the esp32, hw serial should be employed. This I have not yet verified, though. Next up: correctly crossing over rx/tx on the esp8266. |
Beta Was this translation helpful? Give feedback.
-
Tasmota cannot decode 2 bytes responses. Use count 2 in raw at least |
Beta Was this translation helpful? Give feedback.
-
If you have time, compile 12.1.1 stable with this:
(This is what I use in my devices, all its not needed, but is for compare) and paste here My modbus devices are working fine. Above posts you have 00 00 after crc, it's not normal. |
Beta Was this translation helpful? Give feedback.
-
OK, back to square one. Once more. Looks like the RS485 adapter got fried at some point, now it's only Txing, no Rx. After replacement, Rx is functional. That is not to say, the Rx indexing is miraculously fixed. Rx indexing is still off. |
Beta Was this translation helpful? Give feedback.
-
Hi there, Working on this I am. I'm asking for the battery realtime voltage register before asking for battery SOC, yet the value I get back for SOC is actually that of the battery. And Tx for query no. 3 (tx index 2) is never getting any Rx at all. Subsequent Txs get their (or any, as in the bat voltage/SOC confusion) Rx.
Console log:
Bat voltage gets no Rx, hence no voltage display (0.00V). The values that are displayed are sensible and OK. So communication in itself is believed to be good. There's no difference in behaviour wether 3.3V or 5V supplied to the RS485 module. Tested with an esp8266 with 3.3V for the RS485 module and an esp32 with 5V for the RS485 module. Results are identical. Both using hardware serial @115200bps. This setting cannot be changed, AFAIK. I tried but failed and documentation either states, changing baudrate is not possible or should not be done. Either way, it's not going to happen. Cabling is a non-brainer, too. I'm also using this USB dongle with twin screw terminal for A/B input available online. Using this dongle and identical cabling etc., I can successfully start the EPever solar station monitor on windows. This proprietary software is working fine with regards to the values displayed. So up to the physical point of contact where the RS485 adapters access the low level data everything in the setup remains unchanged. The adapter used to fish out the data is of no concern (to me anyways ATM) as there's the correct data Tx/Rx happening. The only variable left over is Tasmota itself, the ESPs (be it esp8266 or esp32) have been swapped and multiple devices have been tested. It's all invariant. The remaining DUT is Tasmota/the RS485/serial code. Communication sniffed per logic-analyser shows nothing unusual or missing. Tx no. 3 in particular gets transmitted fine and has a corresponding Rx. This is corroborating with the fact that the correct bat voltage value is displayed. It just happens to be displayed in the wrong place. All in all, this points to some off-by-one error in Tasmota. So the Rx's get shifted by one and the last one (bat SOC in this case) gets lost. Judging by the scarcity of complaint about this situation to be found online, this is supposedly tightly tied to the EPever Tracer4215BN series, notably the "BN" series, in particular. Happy weekend! |
Beta Was this translation helpful? Give feedback.
-
Addendum: I just had the urge to see where the Rx value for the bat SOC has gone. I added the same bat SOC query again and again:
The console log, lo and behold:
The console output was:
So Rx indices 2, 4 and 6 are missing. Would anyone like to have a guess about what the next Rx index missing would be like? Looks like an index mod 3 condition to me. Nota bene: the 3rd occurrence of SOC is "SOC":64.00. (Yay, it's always been there.) Now, someone show me this isn't the code to blame. Cheers |
Beta Was this translation helpful? Give feedback.
-
Using @radiergimmy's script from #12800 there's no answer every other query. So using the following script it's not a
|
Beta Was this translation helpful? Give feedback.
-
There is a corresponding issue #12205 and discussion #12418 (superseded by this one). |
Beta Was this translation helpful? Give feedback.
-
Gosh, possibly related/possible cause: #17106 |
Beta Was this translation helpful? Give feedback.
-
sml uses its own serial driver and did not have that 115kb overflow.
|
Beta Was this translation helpful? Give feedback.
-
Well, after upgrading to 12.5.0 there is an Rx for every Tx sent. Some code change seems to have fixed this long-lasting issue. |
Beta Was this translation helpful? Give feedback.
-
This looks promising. I still have to look up the correct registers for the Tracer as I am testing with a later model right now as opposed to the production unit manufactured a couple of years ago. Register addresses might differ. This would be kinda strange but not surprising. Anyway, the one(s) who changed the code did good. Kudos. The missing Rx msgs are not happening any more, the I wonder what code change fixed this issue and whether others have been staring at mixed up columns of data for years which I somehow doubt. So what was the reason this issue crept up in this setting here. Between the tests today only lay a couple of hours and the update to Tasmota 12.5 after which everything started working as expected. Will check register addresses soon(er or later) and report back, hopefully being able to close this issue. cheers |
Beta Was this translation helpful? Give feedback.
-
It is clear now that a missing level shifting is not at the origin of this issue. As of Tasmota 12.5 data is queried and displayed correctly with or without level shifter in the loop. |
Beta Was this translation helpful? Give feedback.
-
Why is it that in the SML meter description the meter name must not exceed 7 chars? It's defined as When using I've got two solar controllers I want to monitor. To be able to distinguish them in Grafana and Home Assistant and to know which data is sent by which controller, I'd like to have meaningful names indicating the controller and an indexed suffix like According to the name string definition in Where and why does truncating happen? |
Beta Was this translation helpful? Give feedback.
-
Hey guys,
I'd appreciate your input here: got an esp8266 with Tasmota 12 flashed, built locally with modbus support.
Once the esp is running, querying and displaying battery voltage is working. Adding a query for, say, battery current, the battery voltage is displayed as 0V and current as 0A. Whereas battery voltage beforehand showed like 26.61V. Reverting the query of battery current will however not bring back battery voltage display.
Script:
I inserted comments with the response to the queries, as shown when debugging is enabled via
sensor53 d1
. So the esp <-> Tracer communication via modbus is working correctly. The values are sensible and the right ones as measured by DM.Any ideas why this might happen? This behaviour seems rather non-deterministic to me.
Thanks for your feedback.
Beta Was this translation helpful? Give feedback.
All reactions