View Full Version : Siemens c55 sms control help please
camolas
- 28th June 2008, 17:02
Hi,
I cant put this simple sms sender to work in pic(the phone works pdu mode only on hterminal works all call and sms) . In my code you can see 2 parts 1 is the dailing that works fine the other was to be a sms sender but i cant put it to work can you please helpp me on that thans a lot.
By by
@ Device HS_OSC ' High Speed Crystal
define OSC 20
Include "modedefs.bas" ' Include serial modes
' Define LCD registers and bits this time not use it for later apps..
Define LCD_DREG PORTB 'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 2
Define LCD_EREG PORTB
Define LCD_EBIT 3
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)
DEFINE OSC 20 'Define oscilator frequency
DEFINE LCD_LINES 4 'Number lines on LCD
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
TrisC.5=0
TrisC.6=0
TrisC.7=1
B0 var byte
High portC.5 ' Led flashing to see if wardware are ok
Pause 500
Low portC.5
Pause 500
High portC.5
Pause 500
Low portC.5
Pause 500
HSEROUT ["AT", 13]
HSEROUT ["ATD+351xxxx31210;", 13] 'phone dials to number no problem here
pause 5000
' Now were is the problem is when i thange the dialing line command for the sms to send a sms and the phone do nothing.. :(
'HSEROUT ["AT", 13]
'HSEROUT ["AT+CMGS=16", 13]
'HSEROUT ["079153912601000011000C915391663921010000AA02EF35",13]
STOP
end
camolas
- 30th June 2008, 13:39
On my searchs i find more info now i can send the sms from hterminal but not from the pic i read that "Hserout [20]" is the Ctrl+z end command but some thing is still missing for me i belave the problem must be on the sending command..... plz give ne some hellp.Thanks
Hserout ["at", 13]
Hserout ["at+cmgs=16", 13]
Hserout ["079153912601000011000c915391663921010000aa02ef35",13]
Hserout [20]
Norbac
- 30th June 2008, 14:56
Here is a section from my program to send a sms. I'm using a WAVECOM modem, but I think the AT commans are the same for all brands.
sms:
HSerout ["AT",13]
HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
HSerout ["AT+CMGF=1",13] 'Set Text Mode
HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
HSerout ["AT+CMGS=",str tel\14,13] ' dial the phone number
HSERIN 5000 , SMS, [WAIT(">")] 'wait for a response to send the message
HSerout ["Esto es solo una prueba",13] 'write the message
HSerout [26] 'exit message mode
Pause 500
GOTO ESPERA 'exit sms rutine
and it works great!!!!!!!
I hope it can help you
camolas
- 30th June 2008, 18:50
Hi,
thanks for caring, but de siemens c55 do not have text sms only pdu. I think i need in the pdu array some send command... like i have used in hterminal the ctrl+z.
(Mi problema esta en comandar la trama pdu)
Gracias ;)
Thanks,
Ioannis
- 30th June 2008, 19:05
Hi Norbac. Are you sure it is working? After AT+CMGS= there is a need for " character. Maybe your module does not needed.
Here is an older post I gave as an example:
HSerout ["AT+CMGS=",34,your numbers here,34,13]
hserin 2000,noresp,[wait(">")]
HSerout ["your message here",26]
hSerin 5000,noresp,[wait("OK")]
LCDOut com,1,"Sent OK":Pause 1000
GoTo .....
noresp:
LCDOut com,1,"Message not sent...":Pause 1000
GoTo....
34 is " character
26 is Ctrl+Z character
To Camolas: find another mobile with text. PDU is difficult format. Does not worth it. You may find cheap phones and modules to try.
Ioannis
Norbac
- 30th June 2008, 21:36
You are rigth, according with the standard, the CMGS command needs a " for the phone number. But for some reason on my modem does not need it. I will change just to follow the standard.
Thanks for your feedback.
camolas
- 2nd July 2008, 18:11
Hi,
Thanks for caring, i have one nokia 6230 but i have tried for one month to connect it to pc but no sucess then i moved to siemens c55 and made it. Can you please just tell me how i have to do (pbp code, because my pdu array works fine in pc connection) to end my pdu array and send the send command (ctrl+z) ??
Thanks
By by
Hi Norbac. Are you sure it is working? After AT+CMGS= there is a need for " character. Maybe your module does not needed.
Here is an older post I gave as an example:
HSerout ["AT+CMGS=",34,your numbers here,34,13]
hserin 2000,noresp,[wait(">")]
HSerout ["your message here",26]
hSerin 5000,noresp,[wait("OK")]
LCDOut com,1,"Sent OK":Pause 1000
GoTo .....
noresp:
LCDOut com,1,"Message not sent...":Pause 1000
GoTo....
34 is " character
26 is Ctrl+Z character
To Camolas: find another mobile with text. PDU is difficult format. Does not worth it. You may find cheap phones and modules to try.
Ioannis
Ioannis
- 3rd July 2008, 07:19
I gave you the code. You even quoted to the reply. Please read carefully. The ctrl-Z is there. As for the PDU I cannot help you, sorry.
Ioannis
camolas
- 3rd July 2008, 15:32
Hi,
The pdu is fine no problem, are this command lines ok?
Hserout ["at", 13]
Hserout ["at+cmgs=16", 13]
Hserout ["079153912601000011000c915391663921010000aa02ef35",13, 26]
Thanks for caring :)
I gave you the code. You even quoted to the reply. Please read carefully. The ctrl-Z is there. As for the PDU I cannot help you, sorry.
Ioannis
Ioannis
- 4th July 2008, 07:03
If you mean the syntax then yes, I don't see any problem, except the 13 on the last. Just remove it.
Ioannis
GioppY
- 4th July 2008, 08:04
Why not store the messagge in the sim memory card and send with the command "AT+CMSS=n",Cr
Regards
camolas
- 4th July 2008, 12:11
Hi,
@ Ioannis tanks i will try later.
Why not store the messagge in the sim memory card and send with the command "AT+CMSS=n",Cr
Regards
Can you please explain me beter your idea? it will go like this? : Hserout ["AT+CMSS=n", 13]
n- is posicion number in sim storege?
no need off [26] Ctrl+z command?
My code
Hserout ["at", 13]
Hserout ["at+cmgs=16", 13]
Hserout ["079153912601000011000c915391663921010000aa02ef35", 26]
I have connect to hterminal and this is what the pic is sending:
ATAT+CMGS=
16079153912601000011000C915391663921010000AA02EF3
It miss a 5 on the end , and 16 is not on the AT+CMGS=16
Can you hellp me people?
Thanks,
GioppY
- 4th July 2008, 21:20
Here a snip that send a sms from position 1, then wait for ok.
SerOut2 TX,TTMode,["AT+CMSS=1",Cr] ’invia sms presente in posizione 1
gosub Poll_Ok ’sms inviato ?
Search with google "allarme SMS per siemens e pic12f675"
You should found a my program that uses a siemens C35 and send the message stored in pos.1 from sim card. I do not know if it works with C55.
Regards
Gianni
camolas
- 5th July 2008, 15:29
Hi,
Now is working im very happy :))
code line:
HSEROUT ["AT+CMGS=16",13,10]
PAUSE 500
HSEROUT ["079153912601000011000C915391663921010000AA02EF35",26,10]
HSEROUT [13]
A good utility to macke sms pdu-encode-decode
http://twit88.com/home/utility/sms-pdu-encode-decode
Thanks to the ones that hellp me
By by
aratti
- 7th July 2008, 14:18
Hi, when you enter with a voice command then you have to close it with "ATH" otherwise you will never return to data mode.
Regards
camolas
- 7th July 2008, 16:05
Hi,
Please explain what you said.
Now i want to read a sms line code HSEROUT ["AT+CMGR=1",13,10]
but i do not now read it and compare with the IF SMS="pdu array" then .....
Can you please hellp me on that?
Thanks
Ioannis
- 7th July 2008, 16:15
pbp does not have string comparison commands (Hey Darrel, what about a macro for this??)
So you have to compare one character at a time using nested if-then.
Ioannis
camolas
- 7th July 2008, 17:04
Hi,
Sow i can not store the sms full received pdu array as var word and then compar it with IF...THEN... ?
Im very new at all this can you please give me a example sow i can see how to do?
Thanks
Ioannis
- 7th July 2008, 20:42
You ca store in an array of bytes whatever you want, but cannot do this if myarray="1234567890" then do that.
You have to do a nested if-then comparison like that:
if myarray[1]="1" then
if myarray[2]="2" then
if myarray[3]="3" then
....
if myarray[0]="0" then
goto success
endif
....
endif
endif
endif
no_success:
success:
Of course this can be done with a for-next loop more elegant, but for the sake of simplicity I left it like that.
Ioannis
camolas
- 7th July 2008, 21:18
Hi,
Thanks for caring one more time :) sow i need:
...............
myarray var byte
...........
...........
Loop:
HSEROUT ["AT+CMGR=1",13,10]
Pause 1000
Hserin 6000,loop,[STR myarray]
if myarray[1]="1" then
if myarray[2]="2" then
if myarray[3]="3" then
....
if myarray[0]="0" then
goto success
endif
....
endif
endif
endif
no_success:
success:
Is ok the code?
Thanks
Ioannis
- 7th July 2008, 22:05
...............
myarray var byte
No. You need array not byte variable. Read the Manual. I am not going to teach you the abc's of PBP! That is what YOU have to do! Sorry...
HSEROUT ["AT+CMGR=1",13,10]
Pause 1000
Hserin 6000,loop,[STR myarray]
I wrote on a previous post that you have to read back what the module is responding. By waiting 1 sec. I am sure, don't know about you, that you are quaranteed to lose data. Wait for the OK and read immediately.
if myarray[1]="1" then
if myarray[2]="2" then
if myarray[3]="3" then
....
if myarray[0]="0" then
goto success
endif
....
endif
endif
endif
no_success:
success:
The above was an example! You have to complete the puzzle...
Is ok the code?
Thanks
No, I don't think is 100% OK, as I don't know PDU as I stated before and the example I gave has nothing to do with PDU that needs to be decoded first.
Last, you are welcome, but please, read, read, read the PBP manual as to how the compiler is used. Blink a LED and then try this hardcore stuff...
Ioannis
camolas
- 7th July 2008, 22:38
Im lost now :(
camolas
- 8th July 2008, 00:35
Hi,
I think the array is now ok
..........
..........
myarray var byte[48] 'My array is made i think ;)
..........
..........
Loop:
HSEROUT ["AT+CMGR=1",13,10]
HSERIN 5000, Loop,[WAIT("OK")]
if myarray[0]="0" then
if myarray[1]="1" then
..................... ' from 0 to 47
.....................
if myarray[46]="46" then
if myarray[47]="47" then
goto success
endif
endif
................... ' from 0 to 47
...................
endif
endif
no_success:
Goto Loop
success:
High PortD.2
End
Please give me your input thanks.
Ioannis
- 8th July 2008, 07:40
OK. That is an improovment!
I don't like the loop with Hserin. If you have to do other things and the data arrived are not good, it will stuck in the loop. You must have a way out and do some other checks if you need to execute tasks in the mean time.
Ioannis
camolas
- 8th July 2008, 14:51
Hi,
100% right is stuck and keep doing AT+CMGR=1 (see it in hterminal)
Can you please show me how you do it?
thanks for caring.
OK. That is an improovment!
I don't like the loop with Hserin. If you have to do other things and the data arrived are not good, it will stuck in the loop. You must have a way out and do some other checks if you need to execute tasks in the mean time.
Ioannis
camolas
- 8th July 2008, 18:46
Hi,
Its stuck and keep doing LOOP: (see it in hterminal)
at+cpms="SM"
+CPMS: 1,15,1,15,1,15
OK
AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
There is some error on my code. :(
@ Device HS_OSC ' High Speed Crystal
define OSC 20 ' Check the spelling of OSC, must be in capital letter
Include "modedefs.bas" ' Include serial modes
' Define LCD registers and bits
Define LCD_DREG PORTB 'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 2
Define LCD_EREG PORTB
Define LCD_EBIT 3
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)
DEFINE OSC 20 'Define oscilator frequency
DEFINE LCD_LINES 4 'Number lines on LCD
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
myarray var byte[62]
TrisD.2=0
TrisC.6=0
TrisC.7=1
B0 var byte
High portD.2
Pause 500
Low portD.2
Pause 500
High portD.2
Pause 500
Low portD.2
Pause 500
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13]
PAUSE 500
HSEROUT ["AT+CMGR=1",13,10]
PAUSE 500
HSERIN 5000, POR,[WAIT("OK")]
POR:
if myarray[0]="0"then
'0791539126010000240C91539166392101000080707081934 1400453FA1B0E
goto success
endif
goto LOOP
success:
High PortD.2
End
Thanks for caring.
skimask
- 8th July 2008, 21:03
There is some error on my code. :(
No kidding...
Where is myarray getting filled from? And how?
Ioannis
- 8th July 2008, 21:14
After this:
HSERIN 5000, POR,[WAIT("OK")]
and before that:
POR:
if myarray[0]="0"then
you need to fill the array as Skimask stated.
Ioannis
camolas
- 8th July 2008, 22:53
Hi,
It is this ok Masters?
Code:
..........
..........
HSERIN 5000, [WAIT("OK")] ' I tacke off the POR from HSERIN 5000, POR,[WAIT("OK")] i think theres no need, is ok masters?
HSERIN 5000 POR,[STR myarray\62]
POR:
if myarray[0]="0"then
..........
..........
Thanks for caring :)
skimask
- 9th July 2008, 16:06
Hi,
It is this ok Masters?
I don't know....(how can I? I haven't built your hardware, used your firmware, on your chips, with your setup, on your PC)
Does it work or not?
camolas
- 9th July 2008, 16:58
Hi,
Not working :(
I don't know....(how can I? I haven't built your hardware, used your firmware, on your chips, with your setup, on your PC)
Does it work or not?
skimask
- 9th July 2008, 17:05
Hi,
Not working :(
How quickly can and/or does the phone respond after you send the: ["AT+CMGR=1",13,10]
camolas
- 9th July 2008, 17:47
Hi,
After de phone recived the AT+CMGR=1 command he gives very fast (1s at most) the
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
Thanks for still caring :)
How quickly can and/or does the phone respond after you send the: ["AT+CMGR=1",13,10]
skimask
- 9th July 2008, 17:48
Hi,
After de phone recived the AT+CMGR=1 command he gives very fast (1s at most) the
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
Thanks for still caring :)
Ok, so don't you think that by pausing for 1/2 second after sending the command, you might miss the incoming data, or at least maybe the beginning of it, thereby causing you to think you might not have gotten anything at all?
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500
HSEROUT ["AT+CMGR=1",13,10] : PAUSE 500
camolas
- 9th July 2008, 18:45
Hi,
Ive put HSEROUT["at+cpms=",34,"SM",34,13] and HSEROUT ["AT+CMGR=1",13,10] and them it give me error back, sow back to HSEROUT ["AT+CMGR=1",13,10]:PAUSE 500 and
HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500 and then i thang the HSERIN 5000,POR,[WAIT("OK"),STR myarray\62] to HSERIN 500, .............. data came faster but keep looping
then to HSERIN 1000,............. same problem :(
Ok, so don't you think that by pausing for 1/2 second after sending the command, you might miss the incoming data, or at least maybe the beginning of it, thereby causing you to think you might not have gotten anything at all?
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500
HSEROUT ["AT+CMGR=1",13,10] : PAUSE 500
skimask
- 9th July 2008, 20:25
Ive put HSEROUT["at+cpms=",34,"SM",34,13] and HSEROUT ["AT+CMGR=1",13,10] and them it give me error back, sow back to HSEROUT ["AT+CMGR=1",13,10]:PAUSE 500 and HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500 and then i thang the HSERIN 5000,POR,[WAIT("OK"),STR myarray\62] to HSERIN 500, .............. data came faster but keep looping then to HSERIN 1000,............. same problem :(
Just because I'm using l/c letters doesn't mean you have to change yours...
So what does your program look like now...
And again, if your phone responds inside of a second, usually faster, and you add in a pause after sending the command that will get a response, what's going to come first, the pause or the response? And are you going to miss it or not?
Ioannis
- 10th July 2008, 07:30
This is the last time I am going to state this: DON't use pause statements or ignore the responses of the serial devices. When you send a command ALWAYAS check for the response.-
Ioannis
camolas
- 10th July 2008, 13:32
Hi,
Let see if i get it.
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500
HSEROUT ["AT+CMGR=1",13,10] : PAUSE 500
Change to.
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13]
HSERIN 5000, [WAIT("OK")]
HSEROUT ["AT+CMGR=1",13,10]
HSERIN 5000, [WAIT("OK")]
Is this what you ment?
Thanks for caring.
skimask
- 10th July 2008, 13:41
Is this what you ment?
Thanks for caring.
Maybe...again, does it work or not?
Ioannis
- 10th July 2008, 13:41
Skimask got me on the turn!
Pheww! Yes at last... 8-)
Always do this kind of check. It is the only way to communicate. Otherwise you may well be talking but no-one listening!
Ioannis
camolas
- 10th July 2008, 13:59
Hi,
Used this
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13]
HSERIN [WAIT("OK")]
HSEROUT["AT+CMGR=1",13,10]
HSERIN [WAIT("OK")]
HSERIN 5000,POR,[WAIT("OK"),STR myarray\62]
POR:
if myarray[0]="0"then
'0791539126010000240C91539166392101000080707081934 1400453FA1B0E
goto success
endif
goto LOOP
success:
High PortD.2
End
And it stops in the.
at+cpms="SM"
+CPMS: 1,15,1,15,1,15
OK
and dont continue :(
skimask
- 10th July 2008, 14:30
Are you supposed to wait for an OK, then get the actual response, and then another OK?
Or just wait for the response and an OK?
And one more thing...are you sure your phone is even capable of what you want? And if it is, are you absolutely sure that your circuit is communicating properly with said device?
skimask
- 10th July 2008, 14:33
Skimask got me on the turn!
Pheww! Yes at last... 8-)
Always do this kind of check. It is the only way to communicate. Otherwise you may well be talking but no-one listening!
Ioannis
Wouldn't it be a kick to find out that all of this was being done on some sort of 'simulator' or something? :p
camolas
- 10th July 2008, 15:02
Hi,
Its supposed to send:
at+cpms="SM" 'and get:
+CPMS: 1,15,1,15,1,15
OK
then its supposed to send:
AT+CMGR=1 ' and get:
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
By put the code like this
.................................................
LOOP:
HSEROUT["at+cpms=",34,"SM",34,13]
HSERIN 2000,IP,[WAIT("OK")]
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 2000,LI,[WAIT("OK")]
LI:
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
POR:
if myarray[0]="0"then
'pdu sms in the phone 0791539126010000240C915391663921010000807070819341 400453FA1B0E
goto success
endif
goto LOOP
success:
High PortD.2
End
.......................
Its give on hterminal the good info
at+cpms="SM"
+CPMS: 1,15,1,15,1,15
OK
AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
But still cand find the myarray[0]="0" to high the led
skimask
- 10th July 2008, 15:15
So, you send:
at+cpms="SM"
HSEROUT["at+cpms=",34,"SM",34,13]
Then the phone sends:
+CPMS: 1,15,1,15,1,15
OK
HSERIN 2000,IP,[WAIT("OK")]
(But all you're checking for is the OK, not the rest of the items. How do you know the items are actually there?)
Then you send:
AT+CMGR=1
HSEROUT["AT+CMGR=1",13,10]
And the phone sends:
+CMGR: 1,,23
HSERIN 2000,LI,[WAIT("OK")]
(Where's the OK?)
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
(Where's the OK that the line is supposed to start off with? I see it at the end, not at the beginning.)
It looks to me like you need to rethink your code...a bunch. The order in which you are sending and receiving items to and from the phone doesn't match up with the order in which the phone is actually going to receive and send those items, at least not the way you've written your program.
camolas
- 10th July 2008, 15:53
Hi,
The HSEROUT["at+cpms=",34,"SM",34,13] is to change the momory of the cell phone and phone send back comfirmaction on the change +CPMS: 1,15,1,15,1,15
OK
The HSERIN 2000,IP,[WAIT("OK")] is to for the above ok and then goto next step
The IP: HSEROUT["AT+CMGR=1",13,10] is the next step and reads the pdu sms phone send back the comfirmaction AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E (my message)
OK (the ok by the phone)
HSERIN 2000,LI,[WAIT("OK")] whaits for the above ok and goto
LI:
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
here i have some ??? because i dont have a ok input from the cell phone
Then if myrray zero posiction are zero like its in pda array next goto so sucess if not goto lop
POR:
if myarray[0]="0"then
'pdu sms in the phone 0791539126010000240C915391663921010000807070819341 400453FA1B0E
goto success
endif
goto LOOP
success:
High PortD.2
End
skimask
- 10th July 2008, 16:03
And you've just answered your own question and/or fixed your own...if you knew where to look for it...or if you could see the forest through the trees.
Where are you filling myvar and where are you getting the last OK? And when are you going to reorder your code to match what you want?
camolas
- 10th July 2008, 16:14
Hi ,
Big mess please give me some hellp
skimask
- 10th July 2008, 16:32
Hi,
The HSEROUT["at+cpms=",34,"SM",34,13] is to change the momory of the cell phone and phone send back comfirmaction on the change +CPMS: 1,15,1,15,1,15
OK
The HSERIN 2000,IP,[WAIT("OK")] is to for the above ok and then goto next step
The IP: HSEROUT["AT+CMGR=1",13,10] is the next step and reads the pdu sms phone send back the comfirmaction AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E (my message)
OK (the ok by the phone)
HSERIN 2000,LI,[WAIT("OK")] whaits for the above ok and goto
LI:
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
here i have some ??? because i dont have a ok input from the cell phone
Then if myrray zero posiction are zero like its in pda array next goto so sucess if not goto lop
POR:
if myarray[0]="0"then
'pdu sms in the phone 0791539126010000240C915391663921010000807070819341 400453FA1B0E
goto success
endif
goto LOOP
success:
High PortD.2
End
Hi ,
Big mess please give me some hellp
Anything yet? Do you understand the format of the HSERIN command? The time-out, the WAIT, the rest?
camolas
- 10th July 2008, 16:49
Hi,
Nothing me head is exploding.......... :( i put HSERIN [STR myarray\62] and nothing ...........
Thanks for STILL caring
skimask
- 10th July 2008, 17:00
Hi,
Nothing me head is exploding.......... :( i put HSERIN [STR myarray\62] and nothing ...........
Thanks for STILL caring
AND your code is flawed because the timeouts in the HSERIN, I believe, are used incorrectly in this case.
Think about it...
What direction does the code go if you don't receive the OK?
What direction does the code go if you DO receive the OK?
camolas
- 10th July 2008, 17:29
Hi,
In this case the with the HSERIN [STR myarray\62] i send this (only 1 time it stop looping)
at+cpms="SM"
+CPMS: 1,15,1,15,1,15
OK
AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
What time out shell i put? i have tryed 500,1000,2000,5000
on 1st Hserin to IP and the secund to LI
Can you please put me the good command line? please.....
AND your code is flawed because the timeouts in the HSERIN, I believe, are used incorrectly in this case.
Think about it...
What direction does the code go if you don't receive the OK?
What direction does the code go if you DO receive the OK?
Archangel
- 10th July 2008, 17:40
Zero BYTE ARRAY ? Is that right? Seems like an Array of "no" bytes . . . seems to me, a standard byte var is an array of 1, MyVarArray[1] or MyVarArray var BYTE . . . did I miss something here ?
skimask
- 10th July 2008, 17:53
Can you please put me the good command line? please.....
LOOK AT YOUR CODE!!! READ YOUR CODE!!!
Have you looked at your code lately? Have you read it?
Are you just assuming it will work because you wish it to be true?
LOOP:................
HSERIN 2000,IP,[WAIT("OK")]
If this line times out, where does the flow of the code go?
If this line doesn't time out, where does the flow of the code go?
IP:..................
HSERIN 2000,LI,[WAIT("OK")]
If this line times out, where does the flow of the code go?
If this line doesn't time out, where does the flow of the code go?
LI:
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
If this line times out, where does the flow of the code go?
If this line doesn't time out, where does the flow of the code go?
And what is the phone going to send first? The OK or the string you wish to put in the array?
I'm out....
http://en.wikipedia.org/wiki/What_we%27ve_got_here_is_%28a%29_failure_to_commun icate
camolas
- 10th July 2008, 18:02
Hi,
The array is [62] byte the 0 byte in the array is 0 as you can see here "0791539126010000240C915391663921010000807070819341 400453FA1B0E"
by
Zero BYTE ARRAY ? Is that right? Seems like an Array of "no" bytes . . . seems to me, a standard byte var is an array of 1, MyVarArray[1] or MyVarArray var BYTE . . . did I miss something here ?
camolas
- 10th July 2008, 18:04
Ok
Thanks for the hellp skimask i will try and hope that some one give me a litle push to this pbp newbi.
skimask
- 10th July 2008, 18:08
Zero BYTE ARRAY ? Is that right? Seems like an Array of "no" bytes . . . seems to me, a standard byte var is an array of 1, MyVarArray[1] or MyVarArray var BYTE . . . did I miss something here ?
Yep! :D It's just referencing the first byte of the array, not a one byte array (which could just be nothing more than an 8 BIT array :) )
At least THAT part of the program is done correctly.
skimask
- 10th July 2008, 18:09
Thanks for the hellp skimask i will try and hope that some one give me a litle push to this pbp newbi.
I pushed, prodded, pulled, pointed, highlighted, high-fived, colorized, colon-ized, smelt it and dealt it...
All of your answers (assuming your hardware is working correctly), every single one of them, including the fixes, are in the posts above...
camolas
- 10th July 2008, 18:28
Cant get it, but thanks any way (learning Inglish and Pbp at the same is not easy)
skimask
- 10th July 2008, 19:09
Cant get it, but thanks any way (learning Inglish and Pbp at the same is not easy)
Your grasp of English is fine as far as I can tell, not perfect, but much much better than my grasp of any other language besides English, so in that respect, you are light years ahead of me. It's your grasp of the obvious that escapes me...
camolas
- 10th July 2008, 19:50
i try hard to, please tell me how to.....pleazzzzzzzzz
Your grasp of English is fine as far as I can tell, not perfect, but much much better than my grasp of any other language besides English, so in that respect, you are light years ahead of me. It's your grasp of the obvious that escapes me...
skimask
- 10th July 2008, 20:10
i try hard to, please tell me how to.....pleazzzzzzzzz
Re-Read Post #54...
What does this statement mean to you?
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
How is this statement going to act? There are 3 ways this statement can end up...
camolas
- 10th July 2008, 21:03
Hi, that a whait for a ok 2s if dont came goto POR if came then store the "file" to mydata.
AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
Its beter like this i think HSERIN 2000,POR,[WAIT("+CMGR: 1,,23"),STR myarray\62] ??
LOOP:................
HSERIN 2000,LOOP,[WAIT("OK")] Like this?
IP:..................
HSERIN 2000,IP,[WAIT("OK")] Like this ?
I do not at home the pic/gsm...... to test it only tomorow
Thanks for caring :)
skimask
- 10th July 2008, 21:33
I do not at home the pic/gsm...... to test it only tomorow
Thanks for caring :)
You haven't answered any questions yet...only skirted the issue.
What do each of those lines in Post #54 and that last post do? And in what sequence?
That's the issue...
camolas
- 10th July 2008, 21:39
What does this statement mean to you?
Code:
HSERIN 2000,POR,[WAIT("OK"),STR myarray\62]
That mins to me that code whaits for a ok 2s if dont came gos to POR if it came then store the "file" to mydata. (have answered on the before post alredy)
After realise that a change the code like i posted in the before post.
Please give me you feedback on this.
..............................................
LOOP:
HSEROUT["AT+CPMS=",34,"SM",34,13]
HSERIN 2000,LOOP,[WAIT("OK")]
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 2000,IP,[WAIT("OK")]
IT:
HSERIN 2000,IT,[WAIT("+CMGR: 1,,23"),STR myarray\62]
POR:
if myarray[0]="0"then
'0791539126010000240C91539166392101000080707081934 1400453FA1B0E
goto success
endif
goto LOOP
success:
High PortD.2
End
...............
Ioannis
- 10th July 2008, 22:41
Here you have to skip two bytes: HSERIN 2000,IT,[WAIT("+CMGR: 1,,23"),STR myarray\62]
Why? because the string is on the next line as you show. So the phone is sending two more bytes after the 1,,23 and these bytes are.... surprise invisible!! They are 13 and 10. That's why your string appears on the next line. So correct the line as this:
HSERIN 2000,IT,[WAIT("+CMGR: 1,,23"),skip 2, STR myarray\62]
Now you will not lose your first and precious "0" byte!
As for the timeouts, I cannot tell you if 100, 200, 500 or 5000 are enough, as each phone has its own respond times. Some phones have even 15 sec to start responding after reset, or 50sec to erase all messages!
You can test it with timer, but that is another big issue...
Ioannis
camolas
- 10th July 2008, 22:57
Hi,
Thanks a lot men with out the all hellping and caring people and i do not made to this point.
Tomorow i will test it and post it.
Thanks a lot :)
Archangel
- 11th July 2008, 02:33
Hi,
The array is [62] byte the 0 byte in the array is 0 as you can see here "0791539126010000240C915391663921010000807070819341 400453FA1B0E"
by
OK that makes sense, since you only posted snippets, I wasn't sure you had set up a 62 byte array, and if you did post it all, then woops, I missed it.
EDIT: Yep you did, post 26.
camolas
- 11th July 2008, 16:00
Hi,
Code stop working at this last line:
HSERIN 5000,IT,[WAIT(13,10), STR myarray\62] or using this line HSERIN 5000,IT,[WAIT("+CMGR: 1,,23"),skip 2, STR myarray\62]
is the same
If i put the command line success: High PortD.2 (to see where code stops) on the next line
IT:
HSERIN 5000,IT,[WAIT(13,10), STR myarray\62]
success: High PortD.2
Nothing but if a only put
HSERIN 5000,IT,[WAIT(13,10)]
success: High PortD.2
Led lights so the code is good before that line and specialy the " , STR myarray\62]" command , please give me you input on this.
Thanks
skimask
- 11th July 2008, 16:06
Why not try pulling just part of the string first...like the first few characters and make sure you can get those correctly before you try grabbing the whole thing...
And if your 13,10 is actually 13,10, then you're ok...but what if your 13,10 is actually 10,13?
camolas
- 11th July 2008, 18:09
Hi,
If i compriend you i have to try a small array like:
............................
myarray var byte[4]
............................
HSERIN 5000,IT,[WAIT(13,10), STR myarray\4]
The 13,10 situaction as i said i put after that this line command
..............
success:
High PortD.2
..............
and it works sow i bealive that is no problem on that.
skimask
- 11th July 2008, 18:34
If i compriend you i have to try a small array like:
............................
and it works sow i bealive that is no problem on that.
Yes, yes, and, yes, so...
And how much of your 'program' are you leaving out? I get the feeling that you're not showing everything and that something else is screwing up this whole operation.
camolas
- 11th July 2008, 18:52
Tha small array do not work i mod the line from HSERIN 5000,IT,[WAIT(13,10), STR myarray\4] to:
IT:
HSERIN 5000,IT,[WAIT("OK")]
success:
High PortD.2
End
to get the last ok aftar the phone sends the pdu array was i use to see if the others hserout/hserin lines , and try to with the all pda array and with the 1sts 4 bytes and and nothing i have seen the hterminal and the code stops at last OK dont go back to IT: thats strange.....
camolas
- 11th July 2008, 18:56
@ Device HS_OSC ' High Speed Crystal
define OSC 20 ' Check the spelling of OSC, must be in capital letter
Include "modedefs.bas" ' Include serial modes
' Define LCD registers and bits
Define LCD_DREG PORTB 'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 2
Define LCD_EREG PORTB
Define LCD_EBIT 3
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)
DEFINE OSC 20 'Define oscilator frequency
DEFINE LCD_LINES 4 'Number lines on LCD
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
myarray var byte[4]
TrisD.2=0
TrisC.6=0
TrisC.7=1
B0 var byte
High portD.2
Pause 500
Low portD.2
Pause 500
High portD.2
Pause 500
Low portD.2
Pause 500
LOOP:
HSEROUT["AT+CPMS=",34,"SM",34,13]
HSERIN 5000,LOOP,[WAIT("OK")]
' have add success:High PortD.2 and works
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 5000,IP,[WAIT("OK")]
' have add success:High PortD.2 and works
IT:
HSERIN 5000,IT,[WAIT("OK")] ' from here stops and dont go to IT: , have puted HSERIN 5000,IT,[WAIT(13,10), STR myarray\4] tha same resolt and have puted HSERIN 5000,IT,[WAIT(13,10)] works led ligth and final have puted HSERIN 5000,IT,[WAIT("OK")] wait for the last OK afther pdu array and do not work and do not goto IT
success:
High PortD.2
End
Hterminal gives this:
AT+CPMS="SM"
+CPMS: 1,15,1,15,1,15
OK
AT+CMGR=1
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
Yes, yes, and, yes, so...
And how much of your 'program' are you leaving out? I get the feeling that you're not showing everything and that something else is screwing up this whole operation.
skimask
- 11th July 2008, 19:49
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 5000,IP,[WAIT("OK")] ' have add success:High PortD.2 and works
If that's true, then the line failed, because a timeout would've actually gone back to IP: and then, after NOT receiving the 2nd "OK" would've failed.
IT:
HSERIN 5000,IT,[WAIT("OK")] ' from here stops and dont go to IT: ,
The only way it'll go back to IT: is if the line times out. If it gets the "OK" successfully, it won't go to IT:, it'll go to the next line.
See what I'm getting at here? You are contradicting yourself. Either you don't have enough tests in the loops, or you are seeing something that isn't actually happening because it's being covered up by something that is happening, or the other way around. OR...you don't understand how the time outs and labels are supposed to work.
You type:
AT+CPMS="SM"
It responds:
+CPMS: 1,15,1,15,1,15
OK
You type:
AT+CMGR=1
It responds:
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
OK
Correct?
camolas
- 11th July 2008, 20:28
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 5000,IP,[WAIT("OK")] ' have add success:High PortD.2 and works
success:High PortD.2
Let me say ti see if i now woh it works, if the ok dont come in 5s it will go to IP and do it again (wait for ok)??
And as i get i light the led in my experience.
IT:
HSERIN 5000,IT,[WAIT("OK")] ' from here stops and dont go to IT: ,
success:High PortD.2
Yes that is what i think sow why das it dont goto to the next line success:High PortD.2
or go back to IT (the code stops here)
You type:
AT+CPMS="SM"
It responds:
+CPMS: 1,15,1,15,1,15
'one line space down
OK
You type:
AT+CMGR=1
It responds:
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
'one line space down
OK
skimask
- 11th July 2008, 21:04
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 5000,IP,[WAIT("OK")] ' have add success:High PortD.2 and works
success:High PortD.2
Let me say ti see if i now woh it works, if the ok dont come in 5s it will go to IP and do it again (wait for ok)??
And as i get i light the led in my experience.
Ok, fine, so the first part seems to be working...
IT:
HSERIN 5000,IT,[WAIT("OK")] ' from here stops and dont go to IT: ,
success:High PortD.2
Yes that is what i think sow why das it dont goto to the next line success:High PortD.2
or go back to IT (the code stops here)
It probably is STOPPING RIGHT THERE! It's just looping around timing out. BUT...YOU have no way to tell what it's doing, because you have absolutely no 'indicator' there to blip and LED, make a sound or anything.
It responds:
+CPMS: 1,15,1,15,1,15
'one line space down
OK
And one line space down...hmmm...would that be a 13,10 or a 13,10,10?
It responds:
+CMGR: 1,,23
0791539126010000240C915391663921010000807070819341 400453FA1B0E
'one line space down
OK
Same thing...
camolas
- 12th July 2008, 19:26
Hi,
"And one line space down...hmmm...would that be a 13,10 or a 13,10,10?"
I only send the 13,10 but outputs in hterminal as 13,10,10 (10 is line feed)but as i have used the wait on last ok to turn leed on and it did not do the problem as i think is not in there.
Thanks
camolas
- 12th July 2008, 21:12
Code is now full working :) for people that want to do a sms controled......... thanks to all you that haved hellp me and care for starts as me.
Many thanks 2u
@ Device HS_OSC ' High Speed Crystal
define OSC 20 ' Check the spelling of OSC, must be in capital letter
Include "modedefs.bas" ' Include serial modes
' Define LCD registers and bits
Define LCD_DREG PORTB 'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 2
Define LCD_EREG PORTB
Define LCD_EBIT 3
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)
DEFINE OSC 20 'Define oscilator frequency
DEFINE LCD_LINES 4 'Number lines on LCD
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
myarray var byte[62]
TrisD.2=0
TrisC.6=0
TrisC.7=1
High portD.2
Pause 500
Low portD.2
Pause 500
High portD.2
Pause 500
Low portD.2
Pause 500
High portD.2
Pause 500
Low portD.2
Pause 500
LOOP:
HSEROUT["AT+CPMS=",34,"SM",34,13]
HSERIN 5000,LOOP,[WAIT("OK")]
IP:
HSEROUT["AT+CMGR=1",13,10]
HSERIN 5000,IP,[WAIT("+CMGR: 1,,23"),skip 2, STR myarray\62]
'079153 9 126010000240C915391663921010000807070819341400453F A1B0E
IF myarray[6]="9" then
goto success
endif
goto IP:
success:
High PortD.2
End
skimask
- 12th July 2008, 21:28
Code is no full working :)
Are you just typing to fast to care or what's up?
'Code is no full working', while not proper English (and again, your grasp of English is obviously thousands of times better than my grasp of anything but English) means to me that it's NOT working.
'Code is now full working' (again, while it's not proper English) means that it IS working.
Which one is it?
camolas
- 12th July 2008, 22:36
Hi,
I was just typing to fast (it was a big moment for me this code :) ) when you want to learn to speek Portugese just let me now ;)
By by
Are you just typing to fast to care or what's up?
'Code is no full working', while not proper English (and again, your grasp of English is obviously thousands of times better than my grasp of anything but English) means to me that it's NOT working.
'Code is now full working' (again, while it's not proper English) means that it IS working.
Which one is it?
skimask
- 13th July 2008, 00:21
Hi,
I was just typing to fast (it was a big moment for me this code :) ) when you want to learn to speek Portugese just let me now ;)
By by
Didn't answer the question though!
And I have enough trouble with English...much less anything else.
camolas
- 13th July 2008, 01:39
Hi,
The code works 100% if is that what you are ascking and works thanks to you and other caring members.
Inglish - Thank you
Portugese - Obrigado ;)
By by
camolas
- 5th August 2008, 01:21
Hi,
Im traing to decode pdu to text for my sms control i have been "playing" with Alexandros Zachariadis pdupic
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=46&d=1079679786
But no sucess for starting point i just try to macke the pdu to text decode mode, in me sms code i puted the pdu to myarray\62 my last 8 pdu array are the word "Stop" ........53FA1B0E sow i mod. the pdupic code on this line
LOOKup2 X,[232,50,155,253,70,151,217],B0 'pdu data:E8329Bfd4697D9...
to
LOOKup2 X,[myarray[54],myarray[55],myarray[56],myarray[57],myarray[58],myarray[59],myarray[60],myarray[61] ],B0
But the lcd give not the word Stop it gives some thing else.
Please help me thanks a lot
By by
camolas
- 18th August 2008, 22:02
In my searchs i find that the
LOOKup2 X,[232,50,155,253,70,151,217],B0 'pdu data:E8329Bfd4697D9...
line is the pdu array (exadecimal data) in decimal numbers sow 232 is the decimal number of E8.
How can i convert in pbp code the pdu data to decimal and then fill the LOOKup2 X.....
Thanks.
by by
camolas
- 20th August 2008, 01:13
Can please any one hellp me on the encoding of the text gps posicion array to pdu to send a sms with hem?
Thanks.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.