mirror of
https://github.com/4IceG/luci-app-3ginfo-lite.git
synced 2026-04-25 11:25:50 +03:00
[GH-ISSUE #30] 3gdetail: JSON.parse: unexpected end of data #22
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/luci-app-3ginfo-lite#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Jalakas on GitHub (Dec 26, 2022).
Original GitHub issue: https://github.com/4IceG/luci-app-3ginfo-lite/issues/30
Page "http://192.168.1.1/cgi-bin/luci/admin/modem/3ginfo-lite/3gdetail"
has error: "SyntaxError
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data"
Git commit:
github.com/4IceG/luci-app-3ginfo-lite@f5a7f57680Modem: Huawei E3272
3ginfo works fine in ncm mode.
@Jalakas commented on GitHub (Dec 26, 2022):
Caused by request:
"/usr/share/3ginfo-lite/3ginfo.sh json"
having error:
caused by modem 3272 having no reply to command:
@4IceG commented on GitHub (Dec 26, 2022):
Hi @Jalakas , Ok thanks for the hint.
I'll try to fix it as soon as I get some free time.
@4IceG commented on GitHub (Jan 6, 2023):
I did an update, it should be better.
@4IceG commented on GitHub (Jan 25, 2023):
It should work ok now (package waiting to be compiled).
@Jalakas commented on GitHub (Feb 4, 2023):
I have now again access to this device and the JSON error is still present, now caused by line https://github.com/4IceG/luci-app-3ginfo-lite/blob/main/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/12d11506#L93:
/usr/share/3ginfo-lite/3ginfo.sh: /usr/share/3ginfo-lite/3ginfo-addon/12d11506: line 93: arithmetic syntax errorTest in line https://github.com/4IceG/luci-app-3ginfo-lite/blob/main/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/12d11506#L86 seems to fail, because variable "$XFR" has non empty value "at^hfreqinfo?".
@Jalakas commented on GitHub (Feb 4, 2023):
This will fix JSON error:
if [ ! -z "$TDL" ]; then
DL=$(($TDL/1000))
fi
TUL=$(echo "$TBX" | cut -d ',' -f9-9 )

if [ ! -z "$TUL" ]; then
UL=$(($TUL/1000))
fi
@4IceG commented on GitHub (Feb 4, 2023):
I tested these changes and had no errors. The command returns different values (not always empty) on different modems.
@Jalakas show the result of this command on your modem
at^hfreqinfo?Like now, it can't be either... why should we show "nothing", it's better to hide it completely.
@Jalakas commented on GitHub (Feb 4, 2023):
Huawei E3272 modem, using sms_tool:
@4IceG commented on GitHub (Feb 4, 2023):
OK thanks. I'll be doing package updates this week, so I'll fix this situation.
@Jalakas commented on GitHub (Feb 25, 2023):
As far I see, the fix has not been released yet?
@4IceG commented on GitHub (Feb 25, 2023):
I haven't tested it with a modem, but I've added some code that checks the output of the command, and it's supposed to work.
@Jalakas commented on GitHub (Feb 25, 2023):
Tested this patch and it works fine:
