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

Truncated shell $METER_JSON #1271

Open
bkggkt3d opened this issue May 13, 2024 · 1 comment
Open

Truncated shell $METER_JSON #1271

bkggkt3d opened this issue May 13, 2024 · 1 comment
Labels
wmbusmeters General questions about wmbusmeters

Comments

@bkggkt3d
Copy link

Type of request

Bug

OS version

Trixie

wmbusmeters version

master

Your message goes here

The attribute $METER_JSON used within a "shell" command will truncated

Steps to recreate:

  • Create a script /usr/local/bin/mergeJSONintoCommonFile with "echo $1 $2"
  • Connect a meter GossenMetrawatt U1289 to your M-Bus, maybe the problem is also reproduceible with other meters with unknown driver
  • call "wmbusmeters --pollinterval=3s --format=json --shell='/usr/local/bin/mergeJSONintoCommonFile $METER_NAME $METER_JSON' MAIN=/dev/ttyS1:mbus:2400 MBusDevice12 abbb23:MAIN:mbus 04540002 NOKEY
  • choose the driver abbb23, or one of abbb23 em24 gransystems iem3000 nemo
  • The script will show a JSON string which is truncated. the initial "{" is there, but the closing "}" and some data before is missed

Expected behavior:

  • The script shall show the full JSON string including the closing "}", like done when choosing the driver esyswm or omnipower
@bkggkt3d bkggkt3d added the wmbusmeters General questions about wmbusmeters label May 13, 2024
@weetmuts
Copy link
Member

This is probably a shell problem, you have to quote $METER_JSON like this:
--shell='/usr/local/bin/mergeJSONintoCommonFile $METER_NAME "$METER_JSON" '
Otherwise the spaces inside the json will split at the first space in the json.

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

No branches or pull requests

2 participants