-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
[Bug] MI Inverters not working with startFastWrite usage #1434
Comments
Please specify your MI-Inverters. |
I have MI-1200s and possibly a couple of MI-1000s. Im not 100% sure though. Part of my interest in this project was because I don't think the people who installed my system used what they told me they were going to. |
Do the serial numbers start with Nevertheless, issueing a |
All of them start with I was wondering about the MQTT pieces as well. I'm happy to help figure things out any way I can. I'm comfortable with C/C++, just don't know a lot about Ahoy codebase. |
For better understanding and communication with us what's going on, I'd recommend to activate "Serial debug" and "privacy mode" in "Settings/System config". Then you'll get a shortened output on "Webserial". (I assume, with 4ch MI you'll get a lot of buffer overflow messages as well...) As Ahoy is very "asynchronous" in what's happening, here's a rough walkthrough: In case of 2 and 4ch MI, after reception of the first (data) response, the code will follow up with more requests (in case of 4ch: For an example output of a 4ch MI see e.g. https://drive.google.com/drive/folders/1BwN2WV4zxEumq4SlQfkA3gD4yJeOG9V2 and code at the end here. As far as we know, the change to
This was just to leaves the CE PIN high to enhance the chance to get Hope this will help you to get into the code.
|
Addditional remarks: |
@joerocklin - any news on this? The problem itself seems to be the Alarm array to be somehow/somewhen reorganized, so the single values stored there are no longer at the same place as before. (Or there's another mistake I wasn't able to find until now). |
I haven't been able to get back into the code too much yet. I did pull in the changes and tested again though. A quick check just showed that it still doesn't seem to get anything from the inverters with the |
Would you mind adding some serial output from both versions?
|
Additionally: please provide some more info on the nRF module you are using. As you mentionned an external antenna, it's pa+lna version, right? Shielded, unshielded? Sure it's genuine nordic transceiver in it? |
I am using a pa+lna version. It is not shielded. I thought it was an authentic nordic transciever, but it looks like there's a round dot on the IC, so I would call that suspect. Here are some logs, pulled from a direct serial connection and not the webserial output (I missed the boot part of the startFastWrite, but it starts before wifi is connected): |
OK, so a "blob" nRF module is really suspicious... In the good old MySensors days these had often been described as "rubbish", esp. the range is really poor with these afai remember. But: First make sure, Ahoy can reach a NTP server (or set time with your browser). Just yesterday we had a (regular HM) user here with a rather similar log without any reception and no time info in it (see #1440 (comment)). Additionally: Event when it's working with |
@lumapu - any idea why keeping CE high seems to conflict with a non set time in the mcu? Should we actively put it to low after sending is over? |
I have no idea and I see no correlation between both. The time should be synced directly after booting the ESP. |
No, and there's no confirmation from @joerocklin until now on startFastWrite() working as expected as soon as time is synced. Nevertheless this coincidence imo is remarkable, so let's see what @joerocklin reports on that... I had a look in the code wrt. to why there's the tx log entry at all - even as it seemed to be "night time" in the other case. @joerocklin - do you have "no communitation at night" activated as well? Does deactivating this feature make a difference also when using |
@rejoe2 I do have 'Pause communicate at night' activated for all inverters. I tried pushing the power up to 'High', but that didn't show any change. So I tried the 'Max' setting, and I started getting data. But then it stopped communicating with all inverters. I reverted back to the |
Do you have a synced time? Or is the missing timestamps just caused by using USB serial debugging? (You may simply use the Webserial debug. At least here, it takes around 11 seconds to log in there, the output starting from then on is sufficient imo..
Sounds to some extend like a problem with the power consumption of the longer activated pa+lna? (This is the effective difference of the two "write" methods). Could you please try a different power supply (and/or just a different USB cable) for the DTU? |
@joerocklin - any news? |
Work and life got really busy and I haven't had a chance to sit down and investigate. |
OK, thanks for the short update. |
@joerocklin @rejoe2 you may want to read up on our discussion in the upstream nRF24/RF24#877 @2bndy5 could you have a quick look at this and give us a short recap of the right way to use the RF24 lib, please 😊 ? |
We had a brief discussion about the various Some opinionated ranting
Personally, I never liked how manicBug originally wrote the multitude of I personally have written a few different implementations for the nRF24L01. And each implementation only has a blocking
If you are using interrupts, then the code doesn't need to explicitly call
If Warning Lowering the PA level (referred to here as the "power setting") is a software hack that avoids insufficient power supply problems when using PA/LNA modules. We use this tactic in our examples solely for that reason. If you find that lowering the PA level is the solution, then you really need to reassess your module's power supply and make sure it complies with whatever power requirements are stated by the manufacturer (ebyte or others). See also "My PA/LNA module fails to transmit". Looking at the source link in OPI see the code flushes the RX FIFO (👍🏼) and enters TX mode ( |
Sorry for beeing out of all that stuff for quite some time now. Atm. doing some tests would be a little complicated as well..
On the one hand, that sounds quite logic, but on the other side, afair the cause for using startFastWrite() had been startWrite() putting CE to low to soon. Our intention had been to keep CE high for much longer than the hardcoded 10us in startWrite(), as it had turned out to be contraproductive for receiving ACKs from the inverters for those using PA+LNA modules. So where's the point in the code to put CE to low to early? Short look points to stopListening(), but that's called when a (much longer) timeout is reached or we got all fragments expected. Confused. On the other hand, adding a short (10ms) delay after the mMillis = millis(); line should not do any big harm and should make sure, the requirements are met. @lumapu - Your opinion on that? |
To clarify, I said mandatory 10 microseconds, not 10 milliseconds. This is important when interrupts are involved. I'm not familiar with all the code here, but typically you shouldn't |
Sorry, typo, 10us had been meant as delay. This pice of code is outside the ISR, so a short delay here may just lead to other tasks like webfrontend or MQTT transmissions not executed that fast. |
Platform
ESP32
Assembly
I did the assebly by myself
nRF24L01+ Module
nRF24L01+ plus
Antenna
external antenna
Power Stabilization
Elko (~100uF)
Connection picture
Version
0.8.83
Github Hash
5ebfe5a
Build & Flash Method
VSCode - Platform IO (build & flash)
Setup
I have MQTT set up, pin settings for my device (a feather huzzah32), and updates for region/timezone. I don't know what else has been changed.
Debug Serial Log output
No response
Error description
The commit in 0.8.77 (1534952) caused all communication with my MI inverters to cease. I've tracked it down to the change in
hmRadio.h
frommNrf24->startWrite
tomNrf24->startFastWrite
:ahoy/src/hm/hmRadio.h
Line 391 in 5ebfe5a
Changing this back to the following restores communication with the inverters:
ahoy/src/hm/hmRadio.h
Line 418 in 7c532ca
The documentation for the
startFastWrite
call mentions needing to calltxStandBy
, and I don't see that anywhere. I'm not very familiar with the ahoy code, so I'm not sure where it would be appropriate to put that call.The text was updated successfully, but these errors were encountered: