Replies: 10 comments 6 replies
-
I'm glad the software is proving useful. But I have no idea why the Let me know how 2.0.2 works for multi devices. |
Beta Was this translation helpful? Give feedback.
-
I have no idea what the issue is. I put a “print(payload)” right before
the mqtt publish call, and the payload is correct (ie contains all of the
expected data for all of the devices).
But without the sleep, only the first topic is published. If I add the
sleep after the publish, then each expected topic (one per device) is
published.
FWIW, I have inverter, ags, rtr, bmk (two inverters, in parallel). I also
have the network monitor product, but that doesn’t seem to talk on the
network.
***dan
…On Sun, Jan 29, 2023 at 6:40 AM Charles Godwin ***@***.***> wrote:
I'm glad the software is proving useful. But I have no idea why the
sleep(1) is affecting the output. Did you change the packet size? Try
making it bigger number, it may help. --packets 60. The order of the
devices, if they are detected, in the JSON is fixed in this order. *inverter,
remote, bmk, ags, rtr, pt100, acld*
Let me know how 2.0.2 works for multi devices.
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRDMCAYA46DUVNFY4TWYQLWUZ6ONANCNFSM6AAAAAAUJ5BN5Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
How are you testing? Could the interval be too short? Could the subscriber be the problem? Have tried looking at output using mosquitto_sub. |
Beta Was this translation helpful? Give feedback.
-
I am running mosquitto_sub on the machine with my broker, which is not the
same machine as the one running mqttlogger.
When I say that the topics aren’t being sent, what I really mean is that I
am not seeing them using mosquitto_sub on the broker machine.
So I run mqttlogger on 192.168.0.220 (which is a Pi 4) with —broker
192.168.0.221:1883. On 221 (also a Pi 4) I run mosquitto as a broker.
My test is to run mosquitto_sub on 221. Without the sleep I only see the
inverter topic packet, with the sleep I see everything (in the output of
mosquitto_sub).
Does that make sense?
***dan
…On Sun, Jan 29, 2023 at 12:23 PM Charles Godwin ***@***.***> wrote:
How are you testing? Could the interval be too short? Could the subscriber
be the problem?
Have tried looking at output using mosquitto_sub
<https://mosquitto.org/man/mosquitto_sub-1.html>.
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRDMCH7YXEKMHM6OW4SFV3WU3GUFANCNFSM6AAAAAAUJ5BN5Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Your answer makes sense. The results baffle me. Although all my Magnum logging also relies on MQTT I'm not an expert and I've never seen this problem
Alas I'm not near my Magnum system so I can't test until the ice goes out in April. My site is on an island
Charles
**EDIT** Removed redundant text.
|
Beta Was this translation helpful? Give feedback.
-
Excellent. You rock! I will test this afternoon PT.
***dan
…On Mon, Jan 30, 2023 at 9:06 AM Charles Godwin ***@***.***> wrote:
I made a change to the MQTT example. It is in branch MQTT Bug
<https://github.com/CharlesGodwin/pymagnum/tree/MQTT-Bug>. It is
untested. @djlevin <https://github.com/djlevin> If this resolves your
problem, I'll merge it into the main branch.
—
Reply to this email directly, view it on GitHub
<#49 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRDMCHSOONIMAHXRU5IHBDWU7YJBANCNFSM6AAAAAAUJ5BN5Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Did not work :(
No error, but same limit to one topic published.
***dan
…On Mon, Jan 30, 2023 at 9:34 AM Charles Godwin ***@***.***> wrote:
Don't thank me until it works. ;)
—
Reply to this email directly, view it on GitHub
<#49 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRDMCFTX6VP3LXRTTRMKSTWU73TFANCNFSM6AAAAAAUJ5BN5Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The latter.
…On Mon, Jan 30, 2023 at 4:41 PM Charles Godwin ***@***.***> wrote:
Is the JSON truncated or just one device but properly formed. I'll try to
test Tuesday
—
Reply to this email directly, view it on GitHub
<#49 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRDMCEH3AQYL7BXO2H3ZHDWVBNSHANCNFSM6AAAAAAUJ5BN5Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sorry for the brevity earlier, I was in a rush.
Don't know if the following will be useful, but thought that I would at
least try.
With the code like this, ie with a print(payload) immediately before the
publish() but with the sleep() commented out (or with your new code, I get
the same result either way), this is what I see:
[image: image.png]
I see this from the print()
[image: image.png]
Looks to me like the json is fine.
And I see this from mosquitto_sub:
[image: image.png]
When it is working, ie if I uncomment the sleep(), I get these:
[image: image.png]
[image: image.png]
I _think_ that the json is the same in both cases, but the output of the
mosquitto_sub isn't.
Hope that you can see those images. Happy to run any other experiments
that might be useful.
All my best,
***dan
…On Mon, Jan 30, 2023 at 5:10 PM Dan Levin ***@***.***> wrote:
The latter.
On Mon, Jan 30, 2023 at 4:41 PM Charles Godwin ***@***.***>
wrote:
> Is the JSON truncated or just one device but properly formed. I'll try to
> test Tuesday
>
> —
> Reply to this email directly, view it on GitHub
> <#49 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHRDMCEH3AQYL7BXO2H3ZHDWVBNSHANCNFSM6AAAAAAUJ5BN5Q>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
@djlevin I was able to set up a test. Try the version I built today, it is in branch MQTT Bug. |
Beta Was this translation helpful? Give feedback.
-
First, let me say that I am thrilled with this project, and would be delighted to help in any way that I can. I am using mqttlogger to dump data from my Magnum system to Home Assistant, and it is brilliant!
I did discover that mqttlogger.py does not seem to work properly on my Pi 4 as is. For some reason, it only publishes the MQTT message for the first device, which seems to always be the inverter.
When I added a time.sleep(1) immediately after the client.publish(topic, payload=payload), it works fine. No idea why this is, maybe someone with more experience with paho mqtt can tell us.
Also, I need support for two inverters, and so will use and be a test case for your new work in 2.0.2
Thanks again for a fabulous project!
Beta Was this translation helpful? Give feedback.
All reactions