Code Monkey home page Code Monkey logo

Comments (7)

kellerza avatar kellerza commented on July 26, 2024

Hi, there is not much I can do with this level of info, but you could try:

  • turn on the watchdog (if the energy meter extension crashes)
  • set the debug flag in config (then the log should print readings)
  • use mqtt explorer to see if something gets pushed to mqtt

from hassio-sma-em.

pabera avatar pabera commented on July 26, 2024

I have turned on Watchdog. I suppose that the extension actually doesn't crash.
As soon as I restart the extension, data gets populated, both for the extension itself and MQTT.. I see the values in both logs properly.

(then the log should print readings)

No errors printed, it just stops populating.

Here are a few lines of the log of MQTT. They won't help much but just wanted to show how it is.

1617791441: Client SMA-EM@6a2c1c7a-sma-em disconnected.
1617791447: New connection from 192.168.1.201 on port 1883.
1617791447: New client connected from 192.168.1.201 as SMA-EM@6a2c1c7a-sma-em (p2, c1, k60, u'mqtt').
1617791447: Client SMA-EM@6a2c1c7a-sma-em disconnected.
1617791452: New connection from 192.168.1.201 on port 1883.
1617791452: New client connected from 192.168.1.201 as SMA-EM@6a2c1c7a-sma-em (p2, c1, k60, u'mqtt').
1617791452: Client SMA-EM@6a2c1c7a-sma-em disconnected.
1617791457: New connection from 192.168.1.201 on port 1883.
1617791457: New client connected from 192.168.1.201 as SMA-EM@6a2c1c7a-sma-em (p2, c1, k60, u'mqtt').
1617791457: Client SMA-EM@6a2c1c7a-sma-em disconnected.
1617792818: Saving in-memory database to /data/mosquitto.db.
--- END OF LOG

And here the last logs of the extension

mqtt: sma-em topic SMA-EM/status/3009876046 data published 10:29:45:{"pconsume": 0.0, "pconsumecounter": 652.2551, "u1": 227.269, "timestamp": 1617791385.2000964}
mqtt: publishing SMA-EM/status/3009876046/pconsume:0.0
mqtt: publishing SMA-EM/status/3009876046/pconsumecounter:652.2551
mqtt: publishing SMA-EM/status/3009876046/u1:227.269
mqtt: publishing SMA-EM/status/3009876046/timestamp:1617791385.2000964
mqtt: ssl disabled
mqtt: sma-em topic SMA-EM/status/3009876046 data published 10:29:50:{"pconsume": 0.0, "pconsumecounter": 652.2551, "u1": 227.371, "timestamp": 1617791390.4012456}
mqtt: publishing SMA-EM/status/3009876046/pconsume:0.0
mqtt: publishing SMA-EM/status/3009876046/pconsumecounter:652.2551
mqtt: publishing SMA-EM/status/3009876046/u1:227.371
mqtt: publishing SMA-EM/status/3009876046/timestamp:1617791390.4012456
mqtt: ssl disabled
--- END OF LOG

You can see that time kinda matches up.. and there is no error telling why it's not populating anymore. Are there other places where I could debug errors?

The expected behaviour of this extension is to run endlessly, polling data constantly, correct?

from hassio-sma-em.

pabera avatar pabera commented on July 26, 2024

I believe I need to get into coding myself. I had a look at your run.py and it actually looks ok. I need to check if the Docker maybe crashes or if there is any issue with the code itself locally.

If you have any insights from your side, still let me know ;-)

from hassio-sma-em.

pabera avatar pabera commented on July 26, 2024

I wrote my own client in Node to listen to the SMA-EM multicast in my local environment and figured out that the connection drops after several minutes (around 3-6) as well, just like I described above. I am unsure whether this is related to my local network or the SMA-EM in general. I am closing this since I am sure this problem is not related to your code.

from hassio-sma-em.

kellerza avatar kellerza commented on July 26, 2024

@pabera you could maybe try the dev version. It is on the same repo

It now uses an asynchronous way to read the data from the socket and it might give better results… it should also allow the addition of a timeout for the read (in which case we can restart the multicast group subscription)

from hassio-sma-em.

pabera avatar pabera commented on July 26, 2024

Thanks for this updated work. I like the fact that you have introduced a threshold.
Unfortunately, my original issue persists. The software reports for 4-5 minutes and then stops. I will check you code and check if I can make PR to have an optional reconnect similar to I have solved the problem in my Node test.

from hassio-sma-em.

kellerza avatar kellerza commented on July 26, 2024

No idea what could cause that.
Works well on my pi4, wired with a static IP, but also worked for longer on my laptop, on wifi, with DHCP.

Even if you simply exit the app when you dont get an update the watchdog should restart and allow it to continue.

from hassio-sma-em.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.