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

mqtt.pm gets insufficient data #528

Open
linuxha opened this issue Jul 29, 2015 · 2 comments
Open

mqtt.pm gets insufficient data #528

linuxha opened this issue Jul 29, 2015 · 2 comments

Comments

@linuxha
Copy link
Contributor

linuxha commented Jul 29, 2015

My code may have a bit of addition debugging since I am the author of the module and I found the issue.

Here is a sample of the error message from misterhouse

07/27/15 01:06:48 PM *** mqtt read_mqtt_msg: decode_string: insufficient data at /usr/local/share/perl/5.20.2/Net/MQTT/Message/Publish.pm line 36. ( sub _parse_remaining() )
 at /home/njc/dev/HA/git/misterhouse.add_mqtt_support/bin/mh line 31.
        main::__ANON__("decode_string: insufficient data at /usr/local/share/perl/5.2"...) called at /usr/share/perl/5.20/Carp.pm line 166
        Carp::croak("decode_string: insufficient data") called at /usr/local/share/perl/5.20.2/Net/MQTT/Constants.pm line 121
        Net::MQTT::Constants::decode_string(":01 GMT -->\x{a}\x{d}\x{a}<myId>http://alerts.weather.gov/cap/nj.atom", SCALAR(0x4551ef8)) called at /usr/local/share/perl/5.20.2/Net/MQTT/Message/Publish.pm line 36

The issue is that the sysread of the MQTT socket returns more than 1 MQTT message. The check for data will need to be rewritten to properly handle this (and probably also other problems such as handle the asyncronous nature of MQTT's other messages).

@tbclark3
Copy link
Contributor

tbclark3 commented Jan 4, 2023

I am running into this same error and curious about whether you have an unpublished fix or workaround. Thanks!

@linuxha
Copy link
Contributor Author

linuxha commented Jan 5, 2023

I don't recall, I haven't used that code since it was last updated. I've switched to Node-Red and MQTT (and various gateway software for things like ZigBee and ZWave).
Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants