Skip to content
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]: Compression does not work at all #2806

Closed
kokroo opened this issue Sep 18, 2023 · 2 comments · Fixed by #2819
Closed

[Bug]: Compression does not work at all #2806

kokroo opened this issue Sep 18, 2023 · 2 comments · Fixed by #2819
Labels
bug Something isn't working

Comments

@kokroo
Copy link
Contributor

kokroo commented Sep 18, 2023

Category

Other

Hardware

T-Beam

Firmware Version

2.1.23.04bbdc6

Description

Compression does not work on Meshtastic as of firmware version 2.1.23.04bbdc6.

I have been using VeryLongSlow to send messages. While doing some experiments I noticed that the logs report an airtime equal to non-compressed messages, even if the message being sent can be compressed.

The message is compressed, but the uncompressed version is transmitted and we have no savings on airtime. I can confirm this is the case because I compiled a custom firmware to manually set the portnum to 7, which transmitted the compressed payload with reduced airtime but unfortunately, it doesn't get decoded on the other end.

When I send this "compressed" message, it takes 27 seconds, even though the compressed size is 21 bytes.

Screenshot_2023-09-18_at_02 59 53

When I send something that is actually around ~21 bytes uncompressed, it only takes 6 seconds.

Screenshot_2023-09-18_at_03 02 39

You may use this test message without quotes :

"Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello"

If someone could fix this by Monday evening, I would be really grateful since I have a 7-day mountain hike coming up on Tuesday :D

Relevant log output

No response

@kokroo kokroo added the bug Something isn't working label Sep 18, 2023
@mc-hamster
Copy link
Member

Please include receive logs

@kokroo
Copy link
Contributor Author

kokroo commented Sep 20, 2023

Please include receive logs

Hello, unfortunately I don't have access to any laptops for this week but if you'd like to replicate this, it's very easy. You can set the mode to VeryLongSlow (just to feel the time difference easily) and send the message above with a lot of "Hello"'s repeated.

When I was trying to debug this, I noticed that the port changes from 7 to 1 before the packet is actually transmitted. When I compiled a custom firmware where the port is forced to be 7 at all times, the airtime dropped to what it should have been for the compressed payload but it couldn't be deciphered by the node receiving it ( because I didn't know how to fix that part).

My most educated guess right now is that it's related to either the port being set incorrectly somewhere, or the uncompressed payload is being used instead of the compressed one.

thebentern added a commit that referenced this issue Sep 24, 2023
* Fix compression: encode to bytes after `decoded` is modified

* Change payload size to decompressed length

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
thebentern added a commit that referenced this issue Sep 26, 2023
thebentern added a commit that referenced this issue Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants