[GH-ISSUE #49] Error: Bad control character in string literal in JSON at position 67 #171

Closed
opened 2026-03-13 13:31:49 +03:00 by kerem · 1 comment
Owner

Originally created by @jfrogg on GitHub (Sep 13, 2023).
Original GitHub issue: https://github.com/4IceG/luci-app-3ginfo-lite/issues/49

The error was faced with Sierra EM7455 (1199:9071) but the problem may also occur with some other modems.
Here is the relevant part of the script output (before a fix), look at the temperature value:

{
"connt":"-",
"conntx":"-",
"connrx":"-",
"modem":"",
 °C", 25
"firmware":"",
"cport":"/dev/ttyUSB1",

when it should look like this:

{
"connt":"-",
"conntx":"-",
"connrx":"-",
"modem":"",
"mtemp":"25 °C",
"firmware":"",
"cport":"/dev/ttyUSB1",

Here is a fix:

In /usr/share/3ginfo-lite/modem/11999071 (as an example) replace
T=$(echo "$O" | awk -F: '/Temperature:/ {print $3}')
with something like this:
T=$(echo "$O" | awk -F: '/Temperature:/ {print $3}' | grep -oE "\d+\.?\d{0,2}")

Originally created by @jfrogg on GitHub (Sep 13, 2023). Original GitHub issue: https://github.com/4IceG/luci-app-3ginfo-lite/issues/49 The error was faced with Sierra EM7455 (1199:9071) but the problem may also occur with some other modems. Here is the relevant part of the script output (before a fix), look at the temperature value: ``` { "connt":"-", "conntx":"-", "connrx":"-", "modem":"", °C", 25 "firmware":"", "cport":"/dev/ttyUSB1", ``` when it should look like this: ``` { "connt":"-", "conntx":"-", "connrx":"-", "modem":"", "mtemp":"25 °C", "firmware":"", "cport":"/dev/ttyUSB1", ``` **Here is a fix:** In `/usr/share/3ginfo-lite/modem/11999071` (as an example) replace `T=$(echo "$O" | awk -F: '/Temperature:/ {print $3}')` with something like this: `T=$(echo "$O" | awk -F: '/Temperature:/ {print $3}' | grep -oE "\d+\.?\d{0,2}")`
kerem closed this issue 2026-03-13 13:31:54 +03:00
Author
Owner

@4IceG commented on GitHub (Sep 16, 2023):

Hi @jfrogg ,
Thanks, I will add this fix in the next package update.

<!-- gh-comment-id:1722201315 --> @4IceG commented on GitHub (Sep 16, 2023): Hi @jfrogg , Thanks, I will add this fix in the next package update.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/luci-app-3ginfo-lite#171
No description provided.