merbanan / rtl_433

Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
GNU General Public License v2.0
6.04k stars 1.31k forks source link

JSONL is printed in multiple chunks of data. #3011

Closed adminy closed 1 month ago

adminy commented 1 month ago

I have rtl_433 wrapped inside a node process and use node streams from a spawned process to parse the json coming out of rtl_433, however I noticed that in the latest version, jsonl is chunking across multiple stream chunks / lines, which breaks JSONStream package that parses jsonl.

gdt commented 1 month ago

This bug report is really unclear on just about everything. Please ask in discussion or the mailinglist for help, as it sounds more like you need help with your wrapper program. If you can articulate that there is a bug (vs something a little different than you expect), that's fine. But you'll need to give the rtl_433 version, and also post a link to a minimal reproduction example of the node/etc. code.

My guess is that you are assuming that a single read call on a pipe is going to return a logical line. There is no such specification in POSIX.

adminy commented 1 month ago

I wasn't too sure whether I should open this issue or not, just thought maybe the last few git pushes have something, because all I did was update the hash of the source of rtl_433, then everything broke moving from 34c1e67d8c4d34faee704274688058d6a164bdc2 to db2db908f373cf3c48ef663b75ea7d0c71d69740. I don't need help with anything, also I don't know, maybe this is just intended that the stream doesn't conform with jsonl specifications, but wanted to confirm that was the case.

gdt commented 1 month ago

If you are able to really explain what you mean and post a reproducer I suspect someone would look at it. But I can't understand at all what you mean (still), and that sort of discussion doesn't really belong in issues. I'm not really aware of rtl_433 doing jsonl, and you didn't give example output that you can argue is noncompliant. So this is just too vague for anyone to understand, so far.

zuckschwerdt commented 1 month ago

jsonl is chunking across multiple stream chunks / lines

The -F json output is JSONL. Are you hinting that there are newlines embedded inside the JSON lines? How to reproduce?