Modify

Opened 5 years ago

Last modified 2 years ago

#12434 new task

openwrt 3G signal strength display

Reported by: hewenhao2008@… Owned by: developers
Priority: high Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: 3G signal 3g dongle Cc:

Description

hello, everybody
who can make a package which can support 3G usb dongle and 3G mini PCI-e module to display 3G signal strength. And better support to display the 3G device model name?
I think it's very important for the 3G router.

Attachments (10)

index.htm (20.9 KB) - added by neryba 5 years ago.
3g status on main page
index.2.htm (21.0 KB) - added by neryba 5 years ago.
new
network.lua (11.7 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/controller/admin/network.lua
iface_overview.htm (9.6 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/view/admin_network/iface_overview.htm
iface_status.htm (3.7 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/view/admin_network/iface_status.htm
index.3.htm (21.3 KB) - added by neryba 5 years ago.
Try new version /usr/lib/lua/l uci/view/admin_status/index.htm
network.2.lua (11.9 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/controller/admin/network.lua
iface_overview.2.htm (9.7 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/view/admin_network/iface_overview.htm
iface_status.2.htm (3.8 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/view/admin_network/iface_status.htm
proto_3g.lua (4.7 KB) - added by neryba 5 years ago.
new /usr/lib/lua/luci/model/cbi/admin_network/proto_3g.lua gives you the opprtunity to select the interface, from whitch to request data (Modem controll device)

Download all attachments as: .zip

Change History (34)

comment:1 Changed 5 years ago by neryba

All this do gcom or comgt
try: comgt -d /dev/ttyUSB2 and comgt -d /dev/ttyUSB2 -s /etc/gcom/getcardinfo.gcom

comment:2 Changed 5 years ago by hewenhao2008@…

I know that I can get signal strength by the comgt command. But some 3G modem model has only one AT port(ttyUSB0),while ttyUSB1 tyyUSB2 can not response AT command. For example, MC5725, when the ttyUSB0 was used to dail-up to the internet, I can not use "comgt -d /dev/ttyUSB2 -s /etc/gcom/getcardinfo.gcom" any more because the ttyUSB0 has been taken by the dail-up script.
So I can only use it before dail-up.
Please any one who can help me? And other question, how show I make the 3G signal strength display on the web GUI, but not only on console.

comment:3 Changed 5 years ago by neryba

I have this index.htm (work fine with OPTION GTM6XX) Just replace /usr/lib/lua/view/admin_status/index.htm

all info come from "gcom" command

LuCI 0.11 Branch (0.11+svn9530)

Changed 5 years ago by neryba

3g status on main page

Changed 5 years ago by neryba

new

Changed 5 years ago by neryba

new /usr/lib/lua/luci/controller/admin/network.lua

Changed 5 years ago by neryba

new /usr/lib/lua/luci/view/admin_network/iface_overview.htm

Changed 5 years ago by neryba

new /usr/lib/lua/luci/view/admin_network/iface_status.htm

comment:4 Changed 5 years ago by ianhessey@…

Cant wait to see working files :D

comment:5 Changed 5 years ago by hewenhao2008@…

it's working when the kernel is 3.3.8 version, but when the kernel version is 3.7.10 it does not work well.

Changed 5 years ago by neryba

Try new version /usr/lib/lua/l uci/view/admin_status/index.htm

Changed 5 years ago by neryba

new /usr/lib/lua/luci/controller/admin/network.lua

Changed 5 years ago by neryba

new /usr/lib/lua/luci/view/admin_network/iface_overview.htm

Changed 5 years ago by neryba

new /usr/lib/lua/luci/view/admin_network/iface_status.htm

Changed 5 years ago by neryba

new /usr/lib/lua/luci/model/cbi/admin_network/proto_3g.lua gives you the opprtunity to select the interface, from whitch to request data (Modem controll device)

comment:6 follow-ups: Changed 5 years ago by neryba

works on OpenWrt Attitude Adjustment 12.09-rc1 / LuCI 0.11.1 Release (0.11.1)

comment:7 in reply to: ↑ 6 ; follow-up: Changed 5 years ago by anonymous

Replying to neryba:

works on OpenWrt Attitude Adjustment 12.09-rc1 / LuCI 0.11.1 Release (0.11.1)

its show errors on this firmware

comment:8 in reply to: ↑ 7 Changed 5 years ago by neryba

Replying to anonymous:

its show errors on this firmware

Please copy error message.
What modem do you have and what interface you selected?

comment:9 in reply to: ↑ 6 Changed 5 years ago by hewenhao2008@…

Replying to neryba:

works on OpenWrt Attitude Adjustment 12.09-rc1 / LuCI 0.11.1 Release (0.11.1)

Thanks very much! Neryba! I am appreciate for your kindness. I will have a try this night and let you know the result. May I know you skype or email? My skype id is: hewenhao2009, email is:hewenhao2008@sina.com.

comment:10 follow-up: Changed 5 years ago by alexey@…

OpenWrt Attitude Adjustment 12.09-rc1 / LuCI 0.11 Branch (0.11+svn9425) Kernel 3.3.8

just replaced index.htm in /usr/lib/lua/view/admin_status/

error is:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute function dispatcher target for entry '/'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute firstchild dispatcher target for entry '/admin'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute function dispatcher target for entry '/admin/status'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute template dispatcher target for entry '/admin/status/overview'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:81: Failed to load template 'admin_status/index'.
Error while parsing template '/usr/lib/lua/luci/view/admin_status/index.htm'.
A syntax error occured near 'write("
\n
\n<script type=\"text/javascript\" src=\"")'.
stack traceback:

[C]: in function 'assert'
/usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

comment:11 in reply to: ↑ 10 ; follow-ups: Changed 5 years ago by neryba

Replying to alexey@…:

OpenWrt Attitude Adjustment 12.09-rc1 / LuCI 0.11 Branch (0.11+svn9425) Kernel 3.3.8

Sorry I don't have same version, but you can try edit you own index.htm, just edit it after string 71 (ctrldev = luci.sys.exec("uci -q get network.%s.ctrldev" %wan:name()) select interface from /etc/config/network, you can replace it with ctrldev = "/dev/ttyUSB2" or some another)

if wan6 then
        rv.wan6 = {
              ip6addr = wan6:ip6addr(),
              gw6addr = wan6:gw6addr(),
              dns     = wan6:dns6addrs(),
              uptime  = wan6:uptime(),
              ifname  = wan6:ifname(),
              link    = wan6:adminlink()
              }
end
	               
if wan and rv.wan.proto == "3g" then
     local data3g, ctrldev
     ctrldev = luci.sys.exec("uci -q get network.%s.ctrldev" %wan:name()) 
     if ctrldev and ctrldev == "auto" then
            data3g = luci.sys.exec("gcom")
     else
            data3g = luci.sys.exec("gcom -d %s" % ctrldev)
     end
	                       
     rv.wan3g = {
            operator = data3g:match("\"[a-zA-Z0-9 ]+\""),
            quality = data3g:match("Signal Quality: [0-9]+"),
            sim = data3g:match("SIM [a-zA-Z0-9 ]+"),
            ctrldev = ctrldev
            }
     end
	 
luci.http.prepare_content("application/json")
luci.http.write_json(rv)

and after string 151

		if (ifc.uptime > 0)
		{
			s += String.format(
				'<strong><%:Connected%>: </strong>%t<br />',
				ifc.uptime
			);
		}

		if (ifc.proto == '3g' && info.wan3g.ctrldev != '')
		{
			qual = info.wan3g.quality ? info.wan3g.quality : "Signal Quality: 0" 
			s = String.format(
				'<strong><%:Operator%>: </strong>%s<br /><strong><%:Signal%>: </strong>%d%%<br /><strong><%:SIM%>: </strong>%s<br />',
			         info.wan3g.operator ? info.wan3g.operator : "reading...", qual.substring(15)*100/31 , info.wan3g.sim ? info.wan3g.sim : "ERROR"
			) + s;	
		}
		ss.innerHTML = String.format('<small>%s</small>', s);
		if (ifc.proto == '3g' && info.wan3g.ctrldev != '')
		{
			var sigqual =  parseInt(qual.substring(15))
			var icon;
			if (sigqual == 99 || !sigqual)
				icon = "/luci-static/resources/icons/signal-none.png";
			else if (sigqual == 0)
				icon = "/luci-static/resources/icons/signal-0.png";
			else if (sigqual < 7)
				icon = "/luci-static/resources/icons/signal-0-25.png";
			else if (sigqual < 15)
				icon = "/luci-static/resources/icons/signal-25-50.png";
			else if (sigqual < 24)
				icon = "/luci-static/resources/icons/signal-50-75.png";
			else
				icon = "/luci-static/resources/icons/signal-75-100.png";
																																																																																	
			si.innerHTML = String.format(
			'<img src="%s" />' +
			'<br /><small><a href="%s">%s</a></small>',
				icon, ifc.link, ifc.ifname
			);
		}
		else
		{
			si.innerHTML = String.format(
			'<img src="<%=resource%>/icons/ethernet.png" />' +
			'<br /><small><a href="%s">%s</a></small>',
			        ifc.link, ifc.ifname
			);
			                                                                                                                                                                        
		}
	}
	else
	{
	si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
	ss.innerHTML = '<em><%:Not connected%></em>';
	}

comment:12 in reply to: ↑ 11 Changed 5 years ago by anonymous

Replying to neryba:

Replying to alexey@…:

OpenWrt Attitude Adjustment 12.09-rc1 / LuCI 0.11 Branch (0.11+svn9425) Kernel 3.3.8

Sorry I don't have same version, but you can try edit you own index.htm, just edit it after string 71 (ctrldev = luci.sys.exec("uci -q get network.%s.ctrldev" %wan:name()) select interface from /etc/config/network, you can replace it with ctrldev = "/dev/ttyUSB2" or some another)

if wan6 then
        rv.wan6 = {
              ip6addr = wan6:ip6addr(),
              gw6addr = wan6:gw6addr(),
              dns     = wan6:dns6addrs(),
              uptime  = wan6:uptime(),
              ifname  = wan6:ifname(),
              link    = wan6:adminlink()
              }
end
	               
if wan and rv.wan.proto == "3g" then
     local data3g, ctrldev
     ctrldev = luci.sys.exec("uci -q get network.%s.ctrldev" %wan:name()) 
     if ctrldev and ctrldev == "auto" then
            data3g = luci.sys.exec("gcom")
     else
            data3g = luci.sys.exec("gcom -d %s" % ctrldev)
     end
	                       
     rv.wan3g = {
            operator = data3g:match("\"[a-zA-Z0-9 ]+\""),
            quality = data3g:match("Signal Quality: [0-9]+"),
            sim = data3g:match("SIM [a-zA-Z0-9 ]+"),
            ctrldev = ctrldev
            }
     end
	 
luci.http.prepare_content("application/json")
luci.http.write_json(rv)

and after string 151

		if (ifc.uptime > 0)
		{
			s += String.format(
				'<strong><%:Connected%>: </strong>%t<br />',
				ifc.uptime
			);
		}

		if (ifc.proto == '3g' && info.wan3g.ctrldev != '')
		{
			qual = info.wan3g.quality ? info.wan3g.quality : "Signal Quality: 0" 
			s = String.format(
				'<strong><%:Operator%>: </strong>%s<br /><strong><%:Signal%>: </strong>%d%%<br /><strong><%:SIM%>: </strong>%s<br />',
			         info.wan3g.operator ? info.wan3g.operator : "reading...", qual.substring(15)*100/31 , info.wan3g.sim ? info.wan3g.sim : "ERROR"
			) + s;	
		}
		ss.innerHTML = String.format('<small>%s</small>', s);
		if (ifc.proto == '3g' && info.wan3g.ctrldev != '')
		{
			var sigqual =  parseInt(qual.substring(15))
			var icon;
			if (sigqual == 99 || !sigqual)
				icon = "/luci-static/resources/icons/signal-none.png";
			else if (sigqual == 0)
				icon = "/luci-static/resources/icons/signal-0.png";
			else if (sigqual < 7)
				icon = "/luci-static/resources/icons/signal-0-25.png";
			else if (sigqual < 15)
				icon = "/luci-static/resources/icons/signal-25-50.png";
			else if (sigqual < 24)
				icon = "/luci-static/resources/icons/signal-50-75.png";
			else
				icon = "/luci-static/resources/icons/signal-75-100.png";
																																																																																	
			si.innerHTML = String.format(
			'<img src="%s" />' +
			'<br /><small><a href="%s">%s</a></small>',
				icon, ifc.link, ifc.ifname
			);
		}
		else
		{
			si.innerHTML = String.format(
			'<img src="<%=resource%>/icons/ethernet.png" />' +
			'<br /><small><a href="%s">%s</a></small>',
			        ifc.link, ifc.ifname
			);
			                                                                                                                                                                        
		}
	}
	else
	{
	si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
	ss.innerHTML = '<em><%:Not connected%></em>';
	}

Thank you very much man
I've made it little simpler for me

if wan and rv.wan.proto == "3g" then
rv.wan3g = {
	 quality = luci.sys.exec("gcom -d /dev/ttyUSB2 -s /etc/gcom/getstrength.gcom"):match("\+CSQ: ([0-9,]+)")
	}
end
if (ifc.proto == '3g' && info.wan3g.quality != '')
{
	s += String.format(
	'<strong><%:Signal%>: </strong>%s<br />',
	info.wan3g.quality
	);
}

comment:13 in reply to: ↑ 11 Changed 5 years ago by hewenhao2008@…

Replying to neryba:

Still not work on
Firmware Version: LuCI Trunk (trunk+svn9625)
Kernel Version 3.7.3

I and use MC5725 3g module. There are ttyUSB0 ttyUSB1 ttyUSB2. I choose ttyUSB0 as modem device and modem control device but it not works. Message as below:

3g-3g Operator: reading...
Signal: 0%
SIM: SIM ERROR
RX: 0.00 B (0 Pkts.)
TX: 0.00 B (0 Pkts.)

comment:14 follow-up: Changed 5 years ago by choogenboom

Not working for me using

Powered by LuCI 0.11 Branch (0.11+svn9668) OpenWrt Attitude Adjustment 12.09-rc1

getting multiple errors:

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute arcombine dispatcher target for entry '/admin/network/network'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:104: Failed to execute template 'cbi/map'.
A runtime error occured: /usr/lib/lua/luci/template.lua:81: Failed to load template 'admin_network/iface_overview'.
Error while parsing template '/usr/lib/lua/luci/view/admin_network/iface_overview.htm':
Syntax error in /usr/lib/lua/luci/view/admin_network/iface_overview.htm:40: unfinished string near '"/cbi.js">'
stack traceback:
	[C]: in function 'assert'
	/usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:195: in function 
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute template dispatcher target for entry '/admin/status/overview'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:81: Failed to load template 'admin_status/index'.
Error while parsing template '/usr/lib/lua/luci/view/admin_status/index.htm':
Syntax error in /usr/lib/lua/luci/view/admin_status/index.htm:106: unfinished string near '"'
stack traceback:
	[C]: in function 'assert'
	/usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

Sounds like its working for others, what am I doing wrong? Looked at source around offending lines and I see no obvious errors.

comment:15 in reply to: ↑ 14 Changed 5 years ago by anonymous

Replying to choogenboom:

Not working for me using

Powered by LuCI 0.11 Branch (0.11+svn9668) OpenWrt Attitude Adjustment 12.09-rc1

getting multiple errors:

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute arcombine dispatcher target for entry '/admin/network/network'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:104: Failed to execute template 'cbi/map'.
A runtime error occured: /usr/lib/lua/luci/template.lua:81: Failed to load template 'admin_network/iface_overview'.
Error while parsing template '/usr/lib/lua/luci/view/admin_network/iface_overview.htm':
Syntax error in /usr/lib/lua/luci/view/admin_network/iface_overview.htm:40: unfinished string near '"/cbi.js">'
stack traceback:
	[C]: in function 'assert'
	/usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:195: in function 
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute template dispatcher target for entry '/admin/status/overview'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:81: Failed to load template 'admin_status/index'.
Error while parsing template '/usr/lib/lua/luci/view/admin_status/index.htm':
Syntax error in /usr/lib/lua/luci/view/admin_status/index.htm:106: unfinished string near '"'
stack traceback:
	[C]: in function 'assert'
	/usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

Sounds like its working for others, what am I doing wrong? Looked at source around offending lines and I see no obvious errors.

Don't know how or why but all my .htm files I downloaded from here were "DOSified" with CR/LF. got rid of the CR's and now working great, its a thing of beauty to see signal strength!

comment:16 follow-up: Changed 5 years ago by syamsul

how to get port automatically without having to change it manually?
modem I worked on / dev/ttyUSB0 but to check the signal, I have to use USB2, how I'll be check every port imaginable so no need to change the port manually?

please change the script to dBm

comment:17 in reply to: ↑ 16 ; follow-up: Changed 5 years ago by neryba@…

Replying to syamsul:

how to get port automatically without having to change it manually?
modem I worked on / dev/ttyUSB0 but to check the signal, I have to use USB2, how I'll be check every port imaginable so no need to change the port manually?

please change the script to dBm

You need to select signal interface manually, if it is not detected automatically. It cannot be same as modem.

for display in dBm you can edit index.htm after line 177

s = String.format(
                                                '<strong><%:Operator%>: </strong>%s<br /><strong><%:Signal%>: </strong>%d dBm<br /><strong><%:SIM%>: </strong>%s<br />',
	                                                 info.wan3g.operator ? info.wan3g.operator : "reading...", qual.substring(15)*2-113 , info.wan3g.sim ? info.wan3g.sim : "ERROR"
	                                        ) + s; 

and line 48 in iface_status.htm

html += String.format('<strong><%:Operator%>:</strong> %s<br /><strong><%:Signal%>:</strong> %d dBm<br /><strong><%:SIM%>:</strong> %s<br />', ifc.wan3g.operator ? ifc.wan3g.operator : "reading...", qual.substring(15)*2-113, ifc.wan3g.sim ?  ifc.wan3g.sim : "ERROR")

comment:18 in reply to: ↑ 17 ; follow-up: Changed 5 years ago by Syamsul

Replying to neryba@…:

You need to select signal interface manually, if it is not detected automatically. It cannot be same as modem.

for display in dBm you can edit index.htm after line 177

s = String.format(
                                                '<strong><%:Operator%>: </strong>%s<br /><strong><%:Signal%>: </strong>%d dBm<br /><strong><%:SIM%>: </strong>%s<br />',
	                                                 info.wan3g.operator ? info.wan3g.operator : "reading...", qual.substring(15)*2-113 , info.wan3g.sim ? info.wan3g.sim : "ERROR"
	                                        ) + s; 

and line 48 in iface_status.htm

html += String.format('<strong><%:Operator%>:</strong> %s<br /><strong><%:Signal%>:</strong> %d dBm<br /><strong><%:SIM%>:</strong> %s<br />', ifc.wan3g.operator ? ifc.wan3g.operator : "reading...", qual.substring(15)*2-113, ifc.wan3g.sim ?  ifc.wan3g.sim : "ERROR")

Thanks for your help, its work.
how to see the qos of modems, each modem is to be / just for huawei alone?
how to see the qos of modem? script please ..
if the data entered in operator.dat operator, how to retrieve and display the operator in use?

comment:19 in reply to: ↑ 18 Changed 5 years ago by anonymous

Replying to Syamsul:

how to see the qos of modems, each modem is to be / just for huawei alone?
how to see the qos of modem? script please ..
if the data entered in operator.dat operator, how to retrieve and display the operator in use?

For qos, you need to create own gcom file based on default

"opengt\n\
    set com 115200n81\n\
    set senddelay 0.05\n\
    send \"AT+CFUN=1^m\"\n\
    waitquiet 1 0.2\n\
  :start\n\
    flash 0.1\n\
    send \"AT+CPIN?^m\"\n\
    waitfor 30 \"SIM PUK\",\"SIM PIN\",\"READY\",\"ERROR\",\"ERR\"\n\
    if % = -1 goto error\n\
    if % = 0 goto ready\n\
    if % = 1 goto getpin\n\
    if % = 2 goto ready\n\
    if % = 3 goto error\n\
    if % = 4 goto error\n\
  :error\n\
    print $s,\" ***SIM ERROR***\n\"\n\
    print \"Check device port configuration.\nCheck SIM is inserted\nTest SIM in a mobile phone?\n\"\n\
    exit 1\n\
  :getpin\n\
    #handle case where original Vodafone 3G generates wrong response\n\
    waitfor 1 \"2\"\n\
    if % = 0 goto ready\n\
    print \"\nEnter PIN number: \"\n\
    input $x\n\
    let a=len($x)\n\
    if a<>5 goto getpin\n\
    let c=0\n\
  :test\n\
    let $c=$mid($x,c,1)\n\
    if $c<\"0\" goto getpin\n\
    if $c>\"9\" goto getpin\n\
    inc c\n\
    if c<4 goto test\n\
    let a=val($x)\n\
    if a<0 goto getpin\n\
    if a>9999 goto getpin\n\
    let $c=$left($x,4)\n\
  :enterpin\n\
    send \"AT+CPIN=\\\"\"\n\
    send $c\n\
    send \"\\\"^m\"\n\
    waitfor 20 \"OK\",\"ERR\"\n\
    if % = -1 goto timeerror\n\
    if % = 0 goto cont\n\
    if % = 1 goto pinerror\n\
  :pinerror\n\
  :timeerror\n\
    print \"ERROR entering PIN code\n\"\n\
    print \"Caution! - entering the wrong PIN code three times will lock the SIM\n\"\n\
    exit 1\n\
  :ready\n\
    print \"SIM ready\n\"\n\
  :cont\n\
    print \"Waiting for Registration..(120 sec max)\"\n\
    let c = 0\n\
  :waitreg\n\
    send \"AT+CREG?^m\"\n\
    waitfor 2 \"+CREG: 0,1\",\"+CREG: 0,5\"\n\
    if % = -1 goto regagain\n\
    if % = 0 goto homereg\n\
    if % = 1 goto roamreg\n\
  :regagain\n\
    if c > 120 goto regtimeout\n\
    let c=c+2\n\
    print \".\"\n\
    goto waitreg\n\
  :regtimeout\n\
    print \"\nFailed to register\n\"\n\
    exit 1\n\
  :homereg\n\
    print \"\nRegistered on Home network: \"\n\
    goto registered\n\
  :roamreg\n\
    print \"\nRegistered on Roaming network: \"\n\
    goto registered\n\
  :registered\n\
    waitquiet 1 0.1\n\
    send \"AT+COPS?^m\"\n\
    get 2 \"^m\" $s\n\
    get 2 \"^m\" $s\n\
    let a=len($s)\n\
    let b=a-12\n\
    if b < 1 goto regtimeout\n\
    let $c=$right($s,b)\n\
    print $c,\"\n\"\n\
    let c=0\n\
  :signal\n\
    waitquiet 1 0.1\n\
    send \"AT+CSQ^m\"\n\
    get 2 \"^m\" $s\n\
    get 2 \"^m\" $s\n\
    let a=len($s)\n\
    let a=a-6\n\
    let $s=$right($s,a)\n\
    if $s <> \"0,0\" goto sigcont\n\
    if c > 3 goto sigexit\n\
    let c=c+1\n\
    pause 1\n\
    goto signal\n\
  :sigexit\n\
    print \"Signal strength measure 0,0 too low!\"\n\
    exit 1\n\
  :sigcont\n\
    print \"Signal Quality:\",$s,\"\\n\"\n\
    waitquiet 1 0.1\n"

about operator.dat, all depends file structure, may be AT+COPN may help you

comment:20 Changed 4 years ago by anonymous

hi,

a few month later and i would like to know how to do this, i'd like to know how to replace the attached files in the router (i know how to get in, with SSH but i don't know the exact commands)

I use OpenWrt Barrier Breaker r35310 / LuCI Trunk (trunk+svn9640) with Edimax 6200n

Thanks.

comment:21 follow-up: Changed 4 years ago by anonymous

How to display 3g modem info:

Modem Name
Modem Type
Manufacturer
IMEI Number

Thanks,
Jesk

comment:22 in reply to: ↑ 21 Changed 4 years ago by neryba

Replying to anonymous:

How to display 3g modem info:

Modem Name
Modem Type
Manufacturer
IMEI Number

Thanks,
Jesk

Create topic on openWRT forum. no more comments here

comment:23 Changed 4 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

comment:24 Changed 2 years ago by reinhard.handler@…

any news on this?

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.