[PR #120] [MERGED] workaround for malformed cops reply #130

Closed
opened 2026-03-04 11:58:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/4IceG/luci-app-3ginfo-lite/pull/120
Author: @kazigk
Created: 5/6/2025
Status: Merged
Merged: 5/6/2025
Merged by: @4IceG

Base: mainHead: main


📝 Commits (1)

  • e7009e2 workaround for malformed cops reply

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh (+1 -1)

📄 Description

Some operator names contain carriage return and/or newline characters:

root@WazonWrt:~# sms_tool -d /dev/ttyUSB2 at "AT+COPS=3,0;+COPS?" | sed 's/\r/\\r/g'
AT+COPS=3,0;+COPS?\r\r
+COPS: 0,0,"Mobile Vikings\r\r
",7\r
\r

Since commit 51d8df1 added primitive sanitization, this no longer crashes the app.

However, this will still cause issues with mode recognition:
github.com/4IceG/luci-app-3ginfo-lite@51d8df1aa1/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh (L407)

And consequently, modem scripts won't be able to get cell id and signal data.

Sanitizing the output can be tricky. Previously, I added a line to remove \r\r\n sequences, but this approach is not universally applicable and could potentially break compatibility with other devices.

To resolve this, we can bypass the issue entirely by using the response from the other COPS command we've already sent.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/4IceG/luci-app-3ginfo-lite/pull/120 **Author:** [@kazigk](https://github.com/kazigk) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/6/2025 **Merged by:** [@4IceG](https://github.com/4IceG) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`e7009e2`](https://github.com/4IceG/luci-app-3ginfo-lite/commit/e7009e2d77d8d7bae6984e55edba217f60623870) workaround for malformed cops reply ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh` (+1 -1) </details> ### 📄 Description Some operator names contain carriage return and/or newline characters: ``` root@WazonWrt:~# sms_tool -d /dev/ttyUSB2 at "AT+COPS=3,0;+COPS?" | sed 's/\r/\\r/g' AT+COPS=3,0;+COPS?\r\r +COPS: 0,0,"Mobile Vikings\r\r ",7\r \r ``` Since commit 51d8df1 added primitive sanitization, this no longer crashes the app. However, this will still cause issues with mode recognition: https://github.com/4IceG/luci-app-3ginfo-lite/blob/51d8df1aa1f3ab3fb1e711503619a77848a8233c/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh#L407 And consequently, modem scripts won't be able to get cell id and signal data. Sanitizing the output can be tricky. Previously, I added a line to remove `\r\r\n` sequences, but this approach is not universally applicable and could potentially break compatibility with other devices. To resolve this, we can bypass the issue entirely by using the response from the other COPS command we've already sent. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 11:58:51 +03:00
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#130
No description provided.