GSM - AT+STGI=21 how to confirm it using STK AT Command [closed] - gsm

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 months ago.
Improve this question
hi am working on GSM STK to recharge airtel sim.am stuck at last point.how to confirm it using AT Command,
am using below code
AT+STGI=25
+STGI:25,0,0,24,"00410069007200740065006C0020004C0069007600650021",7
+STGI:25,1,22,"00450061007300790020004300680061007200670065"
+STGI:25,2,16,"00450061007300790020005600410053"
+STGI:25,3,26,"0045006100730079002000420069006C006C0020005000610079"
+STGI:25,4,20,"005700680061007400730020006E00650077003F"
+STGI:25,5,32,"004C0061006E0064006C0069006E0065002000420069006C006C007000610079"
+STGI:25,6,20,"00410069007200740065006C0020004400540048"
+STGI:25,7,24,"00410069007200740065006C0020004D006F006E00650079"
OK
at+stgr=25,1
OK
+STIN: 24
AT+STGI=24
+STGI:24,0,0,0,22,"00450061007300790020004300680061007200670065",4
+STGI:24,1,16,"00520065006300680061007200670065"
+STGI:24,2,26,"0047004900460054002000520065006300680061007200670065"
+STGI:24,3,30,"00430075007200720065006E0074002000420061006C0061006E00630065"
+STGI:24,4,22,"004300680061006E006700650020004D00500049004E"
OK
AT+STGR=24,1
OK
+STIN: 23
AT+STGR=23,"9840xxxxxx" // Phone Number
OK
+STIN: 23
AT+STGR=23,"10" //Amount
OK
+STIN: 23
AT+STGR=23,"xxxx" // PIN
OK
+STIN: 21
AT+STGI=21
+STGI:21,1,1,118,"0050 006C 0073 0020 0063 006F 006E 0066 0069 0072 006D 0020 0052 0065 0063 0068 0061 0072 0067 0065 0020 006F 0066 0020 0052 0073 002E 0020 0031 0030 0020 0074 006F 0020 004D 006F 0062 0069 006C 0065 0020 004E 0075 006D 0062 0065 0072 003A 0020 0039 0038 0034 0030 0039 0031 0032 0031 0039 0033 "
OK
its a hex value of
Pls confirm Recharge of Rs. 10 to Mobile Number: 9840xxxxxx
how to confirm it using AT Command.
Modem Model : SIMCOM_SIM5215E
Thanks in advance

Above code was correct. i forgot to attach the antenna with my modem.

Related

How to print a data outside a range using sqldf in R?

I have written a code to map certain positions (in numbers) to a range of positions (range of numbers)
library(sqldf)
library(tcltk)
setwd('G:\\Ann\\op\\')
a <- sqldf("select * from file1test f1 inner join file2 f2 on (f1.POS > f2.Start and f1.POS<= f2.Stop) ")
write.table(a, file = "op",sep="\t")
file1test contains a column position POS consisting of the values
POS
5757
7456
1212
4567
9870
2350
and file2 contains two columns Start and Stop
Start Stop
5751 5758
7440 7460
1201 1224
4560 4569
and the output from the code generated was like
POS Start Stop
5757 5751 5758
1212 1201 1224
4567 4560 4569
7456 7440 7460
but now I need to print the positions which are outside the range as well, like the following
POS Start Stop
5757 5751 5758
7456 7440 7460
1212 1201 1224
4567 4560 4569
9870
2350

File not being sent by browser

I'm baffled by the following web page:
<!DOCTYPE html>
<html>
<head>
<title>workbench: Home</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
<meta charset="UTF-8">
</head>
<body>
<img class="logo" src="/images/cats-muvva.gif" alt="Cats-Muvva Logo" />
<header>
<h1>Router at workbench</h1>
</header>
<menu>
<p>Log Out</p>
</menu>
<section id="body" class="body">
<form method="post" action="restore.html" name="restore" id="restore" enctype="multipart/formdata">
<p>
<label for="filename">File to restore</label>
<input type="file" name="filename" id="filename"/>
</p>
<p>
<button type="submit" id="submit">Submit</button>
</p>
</form>
</section>
</body>
</html>
If I select a file containing text and click the "submit" button, the file is not sent with response.
Here is what the trace looks like:
14:00:54.577664 IP6 localhost.43396 > localhost.8060: Flags [P.], seq 1:614, ack 1, win 342, options [nop,nop,TS val 963497793 ecr 963497793], length 613
0x0000: 0000 0000 0000 0000 0000 0000 86dd 6000 ..............`.
0x0010: 0000 0285 0640 0000 0000 0000 0000 0000 .....#..........
0x0020: 0000 0000 0001 0000 0000 0000 0000 0000 ................
0x0030: 0000 0000 0001 a984 1f7c ee92 c1db b1ac .........|......
0x0040: d6f7 8018 0156 028d 0000 0101 080a 396d .....V........9m
0x0050: cf41 396d cf41 504f 5354 202f 7265 7374 .A9m.APOST./rest
0x0060: 6f72 652e 6874 6d6c 2048 5454 502f 312e ore.html.HTTP/1.
0x0070: 310d 0a48 6f73 743a 206c 6f63 616c 686f 1..Host:.localho
0x0080: 7374 3a38 3036 300d 0a55 7365 722d 4167 st:8060..User-Ag
0x0090: 656e 743a 204d 6f7a 696c 6c61 2f35 2e30 ent:.Mozilla/5.0
0x00a0: 2028 5831 313b 204c 696e 7578 2078 3836 .(X11;.Linux.x86
0x00b0: 5f36 343b 2072 763a 3237 2e30 2920 4765 _64;.rv:27.0).Ge
0x00c0: 636b 6f2f 3230 3130 3031 3031 2046 6972 cko/20100101.Fir
0x00d0: 6566 6f78 2f32 372e 300d 0a41 6363 6570 efox/27.0..Accep
0x00e0: 743a 2074 6578 742f 6874 6d6c 2c61 7070 t:.text/html,app
0x00f0: 6c69 6361 7469 6f6e 2f78 6874 6d6c 2b78 lication/xhtml+x
0x0100: 6d6c 2c61 7070 6c69 6361 7469 6f6e 2f78 ml,application/x
0x0110: 6d6c 3b71 3d30 2e39 2c2a 2f2a 3b71 3d30 ml;q=0.9,*/*;q=0
0x0120: 2e38 0d0a 4163 6365 7074 2d4c 616e 6775 .8..Accept-Langu
0x0130: 6167 653a 2065 6e2d 6762 2c65 6e3b 713d age:.en-gb,en;q=
0x0140: 302e 350d 0a41 6363 6570 742d 456e 636f 0.5..Accept-Enco
0x0150: 6469 6e67 3a20 677a 6970 2c20 6465 666c ding:.gzip,.defl
0x0160: 6174 650d 0a52 6566 6572 6572 3a20 6874 ate..Referer:.ht
0x0170: 7470 3a2f 2f6c 6f63 616c 686f 7374 3a38 tp://localhost:8
0x0180: 3036 302f 7265 7374 6f72 652e 6874 6d6c 060/restore.html
0x0190: 0d0a 436f 6f6b 6965 3a20 5f5f 5345 5353 ..Cookie:.__SESS
0x01a0: 494f 4e5f 5f3d 6662 3631 6236 6566 3065 ION__=fb61b6ef0e
0x01b0: 3837 3939 6561 6239 3233 3530 3131 3166 8799eab92350111f
0x01c0: 6432 6638 3132 3464 3966 3965 6333 6534 d2f8124d9f9ec3e4
0x01d0: 6234 3337 3965 3234 3039 6335 6462 3231 b4379e2409c5db21
0x01e0: 3639 3165 6638 3a61 3133 3866 6138 6632 691ef8:a138fa8f2
0x01f0: 3338 3430 3234 3864 3436 6661 3663 3930 3840248d46fa6c90
0x0200: 3837 3632 6337 3735 6261 3933 3936 3534 8762c775ba939654
0x0210: 6261 6563 6265 6465 6261 6466 3437 3963 baecbedebadf479c
0x0220: 6635 6363 6538 3933 6465 3839 3338 3037 f5cce893de893807
0x0230: 6266 6566 3961 6434 3232 6539 6462 3837 bfef9ad422e9db87
0x0240: 6566 3136 3962 340d 0a43 6f6e 6e65 6374 ef169b4..Connect
0x0250: 696f 6e3a 206b 6565 702d 616c 6976 650d ion:.keep-alive.
0x0260: 0a43 6f6e 7465 6e74 2d54 7970 653a 2061 .Content-Type:.a
0x0270: 7070 6c69 6361 7469 6f6e 2f78 2d77 7777 pplication/x-www
0x0280: 2d66 6f72 6d2d 7572 6c65 6e63 6f64 6564 -form-urlencoded
0x0290: 0d0a 436f 6e74 656e 742d 4c65 6e67 7468 ..Content-Length
0x02a0: 3a20 3139 0d0a 0d0a 6669 6c65 6e61 6d65 :.19....filename
0x02b0: 3d73 7973 7465 6d2e 6366 67 =system.cfg
That's all the response. The next packet is an ACK from the server.
It's obvious that I'm doing something wrong; this works all over the world. Can anyone help?
multipart/form-data
instead of
multipart/formdata

Best way to find the encoding of an old binary file (and to decode it)?

I have been asked by a library to recover some metadata records from some very old (early 1990s) files that can no longer be read by any software and I was wondering if anyone could point me in the right direction for finding out how they are encoded? Here is an arbitrary snippet of one of them:
0014 9c36 0021 7073 2332 0000 0014 9c4d
0022 3478 2332 0000 0014 9c64 0021 7074
2332 0000 0014 9c7b 0022 3479 2332 0000
0014 a3c1 002a edab 2330 0000 0014 a3d8
0022 347a 2332 0000 0014 a3ef 0022 347b
2332 0000 0014 a406 0022 53e9 2332 0000
0014 a41d 0022 347c 2332 0000 0014 a434
0021 87f9 2332 0000 0014 a44b 0020 f046
2332 0000 0014 a462 0027 f928 2332 0000
0014 a479 0020 9e45 2332 0000 0014 a490
0027 68d3 2330 0000 0014 a4a7 0022 44b8
2332 0000 0014 a4be 0027 cf6b 2330 0000
So it is hex of some sort, but I can't seem to decode it to make it make sense. Does anyone have any ideas where I might start? I would preferably like to write a Python script to turn them into some structured metadata format but first I will need to get at something that looks like ASCII perhaps?
Many thanks in advance!
Adam

Mono HttpResponse.TransmitFile sending corrupt data

I'm having some trouble with HttpResponse.TransmitFile under Mono/linux. This code works:
using (var f = System.IO.File.Open(FileName, System.IO.FileMode.Open, FileAccess.Read))
{
f.CopyTo(response.OutputStream);
}
Where as this doesn't: (although it does on Windows)
response.TransmitFile(FileName);
Although in both cases I get back some data, the difference is extreme. Here's the start of the data as it should be:
8950 4e47 0d0a 1a0a 0000 000d 4948 4452
0000 04b0 0000 00a0 0806 0000 001c b895
4700 0000 0473 4249 5408 0808 087c 0864
8800 0000 0970 4859 7300 001b af00 001b
af01 5e1a 911c 0000 0019 7445 5874 536f
6674 7761 7265 0077 7777 2e69 6e6b 7363
6170 652e 6f72 679b ee3c 1a00 0020 0049
4441 5478 9cec bd79 7454 c799 37fc bbbd
492d b5f6 7d97 90d8 1108 3060 b3d8 98dd
3660 6ce2 78c1 d8ce 624f 66be 64f2 bd99
9ce4 cb99 c9c9 36f1 c439 4eec c964 9cc5
9937 f19b 38c9 6499 378e 63c7 3678 5f00
6302 189b cd6c 0281 d086 d46a f5be dcef
0f51 5777 a9ba b76e 770b 845d bf73 38b4
... (109270 bytes total)
but this is what I get:
3161 6164 360d 0a89 504e 470d 0a1a 0a00
0000 0d49 4844 5200 0004 b000 0000 a008
0600 0000 1cb8 9547 0000 0004 7342 4954
0808 0808 7c08 6488 0000 0009 7048 5973
0000 1baf 0000 1baf 015e 1a91 1c00 0000
1974 4558 7453 6f66 7477 6172 6500 7777
772e 696e 6b73 6361 7065 2e6f 7267 9bee
3c1a 0000 2000 4944 4154 789c ecbd 7974
54c7 9937 fcbb bd49 2db5 f67d 9790 d811
0830 60b3 d898 dd36 606c e278 c1d8 ce62
4f66 be64 f2bd 999c e4cb 99c9 c936 f1c4
394e ecc9 649c c599 37f1 9b38 c964 9937
8e63 c736 785f 0063 0218 9bcd 6c02 81d0
86d4 6af5 bedc ef0f 5157 77a9 bab7 6e77
... (109286 bytes total)
It looks like some sort of encoding issue, but I'm stumped as to what it could be or how to fix it.
It starts with 3161 6164 360d 0a, which is a hex number (0x1aad6 or 109270 in decimal, which is the is the size of your file) followed by a CRLF. Looks like chunked encoding to me.
Your HTTP Headers should also contain Transfer-Encoding: chunked.
That's nothing to worry about, the server will get the correct data.

extracting and index of dates and times, with varying opening and closing times for minutely ohlc data in R

I would like to be able to get an index of dates and times that represent the opening and closing times of a financial stock-market index for each day.
However the opening and closing times vary due to changes in the rules from an exchange or due to daylight savings, therefore I would to be able to use this index to accurately get Open to Close returns.
I am currently look at the Hang Seng futures index which also has a lunch-break in the middle so I would like this to noted as well in the index. I.E. I would have two opening to closing returns per day due to this lunch-break gap in the data. The time that the lunch break is not always consistent so using the xts function of xts["THH:MM/THH:MM"], would not work. In subsetting the timeseries to be able to get Open to Close data for a specific day
For example the lunch-break times changed in 2011 in March, so when comparing the 14th Feb 2011 lunch break vs the 14th March 2011 lunch break you have the following data...
> HI.raw.sing['20110214']["T12:25/T14:35"]
HI.Open HI.High HI.Low HI.Close HI.Volume
2011-02-14 12:25:00 23020 23028 23018 23018 180
2011-02-14 12:26:00 23018 23023 23014 23019 108
2011-02-14 12:27:00 23020 23033 23016 23033 142
2011-02-14 12:28:00 23031 23038 23025 23026 173
2011-02-14 12:29:00 23026 23046 23026 23042 264
2011-02-14 12:30:00 23044 23059 23041 23042 314
2011-02-14 14:30:00 23044 23044 23044 23044 311
2011-02-14 14:31:00 23118 23129 23099 23117 781
2011-02-14 14:32:00 23117 23143 23113 23143 554
2011-02-14 14:33:00 23143 23156 23139 23139 762
2011-02-14 14:34:00 23139 23161 23138 23138 644
2011-02-14 14:35:00 23139 23149 23137 23144 326
Warning message:
timezone of object (Asia/Singapore) is different than current timezone ().
> HI.raw.sing['20110314']["T11:55/T13:35"]
HI.Open HI.High HI.Low HI.Close HI.Volume
2011-03-14 11:55:00 23060 23075 23059 23071 195
2011-03-14 11:56:00 23071 23071 23059 23064 187
2011-03-14 11:57:00 23064 23074 23063 23068 96
2011-03-14 11:58:00 23069 23075 23068 23075 116
2011-03-14 11:59:00 23075 23078 23069 23073 120
2011-03-14 12:00:00 23073 23098 23073 23089 231
2011-03-14 13:30:00 23090 23090 23090 23090 103
2011-03-14 13:31:00 23082 23112 23074 23108 326
2011-03-14 13:32:00 23108 23124 23100 23123 179
2011-03-14 13:33:00 23124 23133 23111 23111 326
2011-03-14 13:34:00 23110 23119 23103 23115 148
2011-03-14 13:35:00 23115 23139 23114 23129 284
Warning message:
timezone of object (Asia/Singapore) is different than current timezone ().
Notice how the lunch break started at 12:30 on the 14th Feb 2011 but started at 12:00 on the 14th March.
Basically what I am looking for is an ability to detect these breaks in the timestamps. However using missing consecutive timestamp does not always work as there are sometimes missing minutes where nothing traded during the middle of the trading day, and so it is missed when the data was recorded. What I'm looking for is, gaps in the timeseries xts data greater than 5 minutes, output as a list which can be manipulated or be used as an index, which could help me subset the data easily.
You can use diff(index(x)) to identify holes exceeding 5 minutes.
# Sample data
k <- 100
library(xts)
x <- xts( rnorm(100), sort(Sys.time() + runif(100, 0, 5*3600)) )
# Start of the breaks exceeding 5 minutes
i <- diff(index(x)) > 300
close <- x[c(which(i),length(x))]
open <- x[c(1,which(i)+1)]
break_start <- index(close)
break_end <- index(open)

Resources