alexkn / node-red-contrib-valetudo

A Node-RED node to convert Valetudo map_data to a png image wich can be send to a dashboard template node.
Apache License 2.0
14 stars 3 forks source link

incompatible with @rand256/valetudo #2

Closed nicedevil007 closed 5 years ago

nicedevil007 commented 5 years ago

Hey Alexkn :)

maybe something happened to the API in a release of valetudo?

I get those errors with your node and the map is showing a state of some days or maybe weeks ago. The map on the official valetudo site on my robot is showing correctly.

image

alexkn commented 5 years ago

Do you run an self compiled version of valetudo? I still run the Beta 0.4.0 Release and don't have problems.

However, I see that my mqtt node outputs a string as payload, not a buffer like yours. Can you try to change the data type of the output to "a String" in your mqtt node?

nicedevil007 commented 5 years ago

image

with "a String"

I'm using this Valetudo Version => https://github.com/rand256/valetudo Because of more Features and so on.

Can you show me an example of what the input should look like? maybe we can convert my buffer into anything that fits your node?

nicedevil007 commented 5 years ago

Mhh maybe it is because of this?

Valetudo 0.4.0-RE6 preview @rand256 rand256 released this 8 hours ago

Next release for testing RE version, verified on S55 (fw 1898).

The most important change in this release:

Moved map parsing from server-side to clients. This way was greatly reduced CPU usage on the device and somewhat lowered RAM consumption. Also the network bandwidth usage while watching the map was notably reduced as well.

At the same time this change made Valetudo RE incompatible with any third party service that relied on the prepared map data published by the device. Thus the required changes were made for valetudo-mapper companion application: now it can not only create PNG map images but also publish parsed map data in the old compatible JSON format.

As always, I remind everyone the necessity to use valetudo binary with valetudo.conf upstart script from this fork only, as it includes preparations for properly running the service that are missing in the origin script.

alexkn commented 5 years ago

Yes, with this change, the map parsing has to be done inside the node.

nicedevil007 commented 5 years ago

Does that mean you will add this in a future release?

If I understand those changes correct it would likely be added to standard valetudo in the near future? :)

That guy (rand256) coded the ability for No-Go Zones and so on for valetudo and they forked it to the original one after he did this ;)

PS: Grüße nach Bautzen aus Reutlingen ;)

alexkn commented 5 years ago

Yes, I want to add it. But I do not want to break the compatibility with standard valetudo, as long as the changes are not merged. I think the right way would be to create a converter node.

PS: Grüße zurück ;)

rand256 commented 5 years ago

But I do not want to break the compatibility with standard valetudo, as long as the changes are not merged.

You may want to see how it's done in valetudo-mapper without breaking compatibility with older versions. Also, as mentioned in the release post text copied above, it is possible to run valetudo-mapper in just map parser (converter) mode.

nicedevil007 commented 5 years ago

Isn't it possible @ this time to let your node check if the incoming msg is buffer or a string and then let it decide witch modus should be used to draw the map in Node-RED?

Tryed to figure out how to "hotfix" it by myself but I'm to new into this to find a suitable node to change the buffer into string :(

alexkn commented 5 years ago

I have added the valetudo-parse-binmap node. It converts the binary buffer to the old JSON string format. You have to put it between your mqtt and map-png node.

nicedevil007 commented 5 years ago

Worked perfect for me! Problem solved, one of the good developer here <3 :)