Community discussions

 
User avatar
mramos
Member Candidate
Member Candidate
Topic Author
Posts: 230
Joined: Sun Nov 23, 2008 1:05 am
Location: S. B do Campo - SP - Brazil

3G Modem info scripting

Sat Jan 02, 2010 12:23 pm

Hi:

3G connection status is avialable via interface pane on winbox (info ...) or via terminal/telnet (/interface ppp-client info ppp).

Several parameters such as status, pin-status, gprs-mode, cops & etc are recovered. And the signal-strengh in dBm.

I'm trying to write some simple script that reads the signal-strengh value and as soon as this value is less than a minimum (lets say -100dBm) some info is logged, but no success on that 'till now.

The way 3G modem info is displayed in the same way as gps-monitor is? I mean, on a gps/ntp routine I run, I use something like this (forget unclosed brackets, I cut the codes):
{/system gps monitor once do={
:if ($"valid" = no) do={
:log info "GPS down, enabling NTP-client";
etc etc ...
Converting this to ppp-client info should be more or less this way:
{/interface ppp-client info PPP once do={
:if ($"signal-strengh" < -100) do={
:log info "3G RSL Low";
etc etc ...

But it's not working. I'm not able to read the signal-strengh value.

Anyway, I want to build a script that send 3G RSL to a Dude syslog, may be after that generating some alert.

Any help?

Regards (and a nice 2010 4 all)
Marcus Ramos
Electronics Technician
(Microwave HW, RF, antennas, propagation)
S.Paulo - Brazil
 
andreacoppini
Trainer
Trainer
Posts: 486
Joined: Wed Apr 13, 2005 11:51 pm
Location: Malta, Europe

Re: 3G Modem info scripting

Sat Jan 02, 2010 7:19 pm

Hi Marcus,

have you tried doing a :put $signal-strength using the Terminal to see what kind of values are normally returned?
- No strings attached -

<< Please give good Karma if this post helped you. Press the + button above the Location entry
 
User avatar
mramos
Member Candidate
Member Candidate
Topic Author
Posts: 230
Joined: Sun Nov 23, 2008 1:05 am
Location: S. B do Campo - SP - Brazil

Re: 3G Modem info scripting

Sun Jan 03, 2010 12:05 pm

Hi Andrea
have you tried doing a :put $signal-strength using the Terminal to see what kind of values are normally returned?
Tried now, using a terminal inside winbox:
[mramos@WISP-3G-PTP] > int ppp-client info PPP
            status: "call in progress"
        pin-status: "READY"
     functionality: "minimum"
         gprs-mode: "B - EDGE"
      manufacturer: "huawei"
             model: "E156"
          revision: "11.604.09.01.149"
     serial-number: "22368040395709"
  current-operator: "ABCD"
    signal-strengh: -85

[mramos@WISP-3G-PTP] > :put $signal-strengh
syntax error (line 1 column 7)
I think that the way monitor values is returned from interfaces, some services & etc are not the same way used by info command for 3G usb modems because at the gps script (and may be another one to check interface status, etc) the sequence is ...

For a sample gps ...
\sys gps mon
if ($"valid"= no) do{ (or as you sugested :put $"valid")

For a sample interface ...
\int mon WLAN
:put $"tx-bits-per-second"
24.6kbps <= (updated every second)

Cosmetics: note that at the info for 3G modem the signal label is "signal-strengh" (a missing "t"), at least when using terminal. On winbox pop-up info window is labeled ok (strength).

May be we can recover any value/status from a monitoring routine but not from a status routine ...

Thanks for the sugestion.

Regards
Marcus Ramos
Electronics Technician
(Microwave HW, RF, antennas, propagation)
S.Paulo - Brazil
 
andreacoppini
Trainer
Trainer
Posts: 486
Joined: Wed Apr 13, 2005 11:51 pm
Location: Malta, Europe

Re: 3G Modem info scripting

Sun Jan 03, 2010 12:30 pm

The $xxxxx syntax is for variables.

You need to do something like:
/interface ppp-client
:put [get ppp-out1 [TAB]

this will show you the list of available values.

I tried this on my routers, but I don't have any 3G connections running so I don't see signal-strength. You could try it on your router and see if this value is available. If it's not there, then it means MT forgot to make that field available as a value. In that case send an e-mail to support and they might put it in.

I'm running v4.4.
- No strings attached -

<< Please give good Karma if this post helped you. Press the + button above the Location entry
 
User avatar
mramos
Member Candidate
Member Candidate
Topic Author
Posts: 230
Joined: Sun Nov 23, 2008 1:05 am
Location: S. B do Campo - SP - Brazil

Re: 3G Modem info scripting

Sun Jan 03, 2010 1:26 pm

Well, I'm on 4.4 too.

I tried that and got the avialable values, almost the same I got when using 'print' except the 'comment' field.
[mramos@WISP-3G-PTP] /interface ppp-client> :put [get PPP]     
.id=*8;name=PPP;max-mtu=1500;max-mru=1500;mrru=0;port=usb2;data-cha
nnel=0;info-channel=1;user=;password=;profile=default;phone=*99#;di
al-command=ATDT;modem-init=ATZ;null-modem=false;dial-on-demand=fals
e;add-default-route=true;use-peer-dns=false;allow=;comment=
May be MT makes signal strength avialable in some way in the future. But I guess most 3G users does not have RSL problems like I do.

Those modems works at 'full speed' up to -90dBm than drop do 512K between -90 ... -100 ... 256K from -101 ... -107 and that's it.

I'm far away from the radio base station, I use a modified 2.2m dish to connect to it (the modem is at the dish focus and a home made patch feeder). Signal is at 2.1GHz and despite heavy rain this signal keeps stable, but the PTP link from the cell tower to their backbone drops (may be something on 15, 18 or 23GHz, IP on NxE1) and the cell tower seems to 'stand by', dropping both 3G & GSM voice.

So I want to create a personal watchdog based on some 3G modem health parameter, at least to call cell companhy custommer service (yes, NMS seems not to be efficient there).

Regards;
Marcus Ramos
Electronics Technician
(Microwave HW, RF, antennas, propagation)
S.Paulo - Brazil
 
andreacoppini
Trainer
Trainer
Posts: 486
Joined: Wed Apr 13, 2005 11:51 pm
Location: Malta, Europe

Re: 3G Modem info scripting

Sun Jan 03, 2010 6:21 pm

I see your point, but it looks like the variable is not available. Try sending MT an e-mail about it. If they got it to work in the info screen already it means the value is already there, it should be easy for them to make it available in a variable.
- No strings attached -

<< Please give good Karma if this post helped you. Press the + button above the Location entry
 
ibeeby
newbie
Posts: 45
Joined: Tue Dec 12, 2006 8:49 am
Location: Matlock, England
Contact:

Re: 3G Modem info scripting

Tue Jun 01, 2010 1:05 pm

Anyone still working on this?

My contribution is (so far):

i/ The 3G cards have different USB sub-channels on which they communicate - for instance, my Huawei E220 card has only 2 USB sub-channels whereas the Sierra Wireless 8775 PCI-e card has three sub-channels;

ii/ It is possible to open a serial channel to a sub-channel on the 8775 - using channel 2 - and then to send AT commands - there is an ETSI communications protocol of which the 8775 uses a (published) sub-set and from which the card can return some information AND it is also possible to set card parameters, such as leaving data in the card memory, while the device is connected to the 3G network;

iii/ What I don't know (yet) is HOW to script such interaction with the card. For mobile use I should like to get signal strength and quality measurements at timed intervals for logging purposes.

Any further input gratefully received...

Ian
 
m2mconnectivity
newbie
Posts: 25
Joined: Mon Sep 20, 2010 2:52 am

Re: 3G Modem info scripting

Mon Oct 11, 2010 4:12 am

Hi ibeeby,
how did you go with this goal. any luck??
I'm trying to pick signal strength and firmware of the 3G modem. i'm trying to export the info data to a file but in file i'm not getting these parameters.
when i issue command interface ppp-client info ppp-out1, it takes some time (about 5s)to get the values and so, it doesn't send any data to the file.
any suggestion??
 
andreacoppini
Trainer
Trainer
Posts: 486
Joined: Wed Apr 13, 2005 11:51 pm
Location: Malta, Europe

Re: 3G Modem info scripting

Mon Oct 11, 2010 9:54 am

you could copy the values to variables first, make the script wait for 10s, then write the data from the variables to the file.

I haven't tried it myself, so no guarantees.
- No strings attached -

<< Please give good Karma if this post helped you. Press the + button above the Location entry
 
hanma
just joined
Posts: 2
Joined: Tue Oct 19, 2010 11:02 am

Re: 3G Modem info scripting

Tue Oct 19, 2010 11:06 am

about 3g usb modem, here i found a professional online shop share for all reference :http://www.modem3g.com/ ,hope it helps.
 
mystdragon
just joined
Posts: 1
Joined: Sat May 21, 2011 1:03 pm

Re: 3G Modem info scripting

Thu Aug 04, 2011 12:55 pm

you could copy the values to variables first, make the script wait for 10s, then write the data from the variables to the file.

I haven't tried it myself, so no guarantees.

Hi all,

I've been trying to get the info thing right for a while now and making a script that waits doesn't do the trick...

here's what I've tried

:do {/int ppp-client info ppp-out2 file=ppp_signal.txt} while=([delay delay-time=5]);

Anyone has success on this topic??
 
odge
Member Candidate
Member Candidate
Posts: 102
Joined: Mon Nov 29, 2010 2:53 pm

Re: 3G Modem info scripting

Thu Apr 04, 2013 12:07 pm

Did you ever come right with this?

How can someon programatically from a script extract signal strength, and if the value is less than a certain value, log it locally or remotely.
Is there no known way yet?

Regards
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5942
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 3G Modem info scripting

Thu Apr 04, 2013 12:27 pm

To get signal strength from info

ros code

/interface ppp-client info <name> do={
  :put $"signal-strength"
}
 
odge
Member Candidate
Member Candidate
Posts: 102
Joined: Mon Nov 29, 2010 2:53 pm

Re: 3G Modem info scripting

Thu Apr 04, 2013 12:52 pm

for me this fails with

7 name="script1" owner="admin"
policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api
last-started=apr/04/2013 11:48:08 run-count=35
source=
/interface ppp-client info ppp-3gsignal do={
:put $signal-strengh
}

[admin@Wired4Signs] > system script run script1 ;
syntax error (line 2 column 9)
[admin@Wired4Signs] >
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5942
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 3G Modem info scripting

Thu Apr 04, 2013 1:03 pm

Put signal-strength in qoutes
 
odge
Member Candidate
Member Candidate
Posts: 102
Joined: Mon Nov 29, 2010 2:53 pm

Re: 3G Modem info scripting

Thu Apr 04, 2013 1:05 pm

thanks indeed requires:

/interface ppp-client info ppp-3gsignal do={
:log info message=$"signal-strengh"
}
 
odge
Member Candidate
Member Candidate
Posts: 102
Joined: Mon Nov 29, 2010 2:53 pm

Re: 3G Modem info scripting

Thu Apr 04, 2013 3:43 pm

Sometimes you will get failure: Unable to acquire port!

How would I programmatically pick that up?


(Basically since that creates a loop, i have my script rerun every 60 seconds, but first killing off its previous job of itself.
 
bitaites
just joined
Posts: 1
Joined: Sat Sep 28, 2013 12:42 pm
Location: Portugal

Re: 3G Modem info scripting

Sat Sep 28, 2013 12:55 pm

Hi Marcus,

I´m new here is this forum and, i have the same problem you have.
I trying to do the same thing, and can´t get the signal-strengh to do something like that
If (3G signal strengh < -80 dBm) then pass the router to access tecnology GPRS.

Do you Know to do it with scripting?

Thank you


quote="mramos"]Hi:

3G connection status is avialable via interface pane on winbox (info ...) or via terminal/telnet (/interface ppp-client info ppp).

Several parameters such as status, pin-status, gprs-mode, cops & etc are recovered. And the signal-strengh in dBm.

I'm trying to write some simple script that reads the signal-strengh value and as soon as this value is less than a minimum (lets say -100dBm) some info is logged, but no success on that 'till now.

The way 3G modem info is displayed in the same way as gps-monitor is? I mean, on a gps/ntp routine I run, I use something like this (forget unclosed brackets, I cut the codes):
{/system gps monitor once do={
:if ($"valid" = no) do={
:log info "GPS down, enabling NTP-client";
etc etc ...
Converting this to ppp-client info should be more or less this way:
{/interface ppp-client info PPP once do={
:if ($"signal-strengh" < -100) do={
:log info "3G RSL Low";
etc etc ...

But it's not working. I'm not able to read the signal-strengh value.

Anyway, I want to build a script that send 3G RSL to a Dude syslog, may be after that generating some alert.

Any help?

Regards (and a nice 2010 4 all)[/quote]

Who is online

Users browsing this forum: No registered users and 10 guests