Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

JSON.parse: bad control character in string literal at line 18 column 17 of the JSON data #102

Open
matrock47 opened this issue Oct 30, 2024 · 2 comments

Comments

@matrock47
Copy link

matrock47 commented Oct 30, 2024

I Try compile openwrt 23.05.5 unfortunately there is an error when clicking information 4g/5g with following error. How to fix this?

DEVICE ZBT Z8102AX M2
MODULE FIBOCOM L850-GL

JSON.parse: bad control character in string literal at line 18 column 17 of the JSON data

i didnt face this error on wg1608-16, the issue only occured when compile z8102ax m2 - t.

@matrock47
Copy link
Author

photo_2024-10-30_07-42-48

@Ulfila80
Copy link

HI! Have the same problem.

Analysis of the file output /usr/shared/3ginfo-lite/3ginfo.sh showed that variables EARFCN, SINR may contain a carriage return character (\r). On some routers this corrupts the json output. I added (tr -d '\r') command to the script to remove the \r character and everything works fine.

cat <<EOF
{
"conn_time":"$CONN_TIME",
"conn_time_sec":"$CT",
"conn_time_since":"$CONN_TIME_SINCE",
"rx":"$RX",
"tx":"$TX",
"modem":"$MODEL",
"mtemp":"$TEMP",
"firmware":"$FW",
"cport":"$DEVICE",
"protocol":"$PROTO",
"csq":"$CSQ",
"signal":"$CSQ_PER",
"operator_name":"$COPS",
"operator_mcc":"$COPS_MCC",
"operator_mnc":"$COPS_MNC",
"location":"$LOC",
"mode":"$MODE",
"registration":"$REG",
"simslot":"$SSIM",
"imei":"$NR_IMEI",
"imsi":"$NR_IMSI",
"iccid":"$NR_ICCID",
"lac_dec":"$LAC_DEC",
"lac_hex":"$LAC_HEX",
"tac_dec":"$TAC_DEC",
"tac_hex":"$TAC_HEX",
"tac_h":"$T_HEX",
"tac_d":"$T_DEC",
"cid_dec":"$CID_DEC",
"cid_hex":"$CID_HEX",
"pci":"$PCI",
"earfcn":"$(echo $EARFCN | tr -d '\r')",
"pband":"$PBAND",
"s1band":"$S1BAND",
"s1pci":"$S1PCI",
"s1earfcn":"$(echo $S1EARFCN | tr -d '\r')",
"s2band":"$S2BAND",
"s2pci":"$S2PCI",
"s2earfcn":"$(echo $S2EARFCN | tr -d '\r')",
"s3band":"$S3BAND",
"s3pci":"$S3PCI",
"s3earfcn":"$(echo $S3EARFCN | tr -d '\r')",
"s4band":"$S4BAND",
"s4pci":"$S4PCI",
"s4earfcn":"$(echo $S4EARFCN | tr -d '\r')",
"rsrp":"$RSRP",
"rsrq":"$RSRQ",
"rssi":"$RSSI",
"sinr":"$(echo $SINR | tr -d '\r')"
}
EOF

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

No branches or pull requests

2 participants