[Solved] SMS Function

6 replies [Last post]
BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010

Hi Guys,

Try to fire up my nokia 7310 with HAH.  I have the cable, the usb serial adapter etc...and although I was haveing trouble getting xap-sms to start, I am now up and running.

Problem is I have no idea where to start.  I have sent a couple of msgs to the phone and was expecting xap-sms to spurt out a xap message which I was then going to use to start a lua script but nothing happens.  When I debug and watch when a msg cmes in I get:

[inf][sms.c:67:processSerialMsg] Serial Rx:
[inf][sms.c:67:processSerialMsg] Serial Rx: 30
[inf][tx.c:19:xapSend] send

So somethings working.

Any pointers?

Cheers

Gary

magill
Offline
Joined: 27 Apr 2012
SMS

Gary

I went through all of this Nokia stuff last year and fought with various flavours of phones and several cables. I gave up.

I now use the email function and have bought credits from a company called "Text Marketer". This converts emails to SMS at about 3p a time which is probably cheaper than topping up a sim card. Also sim credit gets trashed if phone is not used for approx 90 days.

John

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Hi John,Thanks for the info

Hi John,

Thanks for the info and will bear it in mind...I have previously had this all working, so I know I have the correct hardware.

I'm thinking, dare I say it, that there is something amiss with xap-sms as I get heartbeats but nothing when a message arives...

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Still looking into this issue

Still looking into this issue with SMS.  The following log says to me that my HAH is connecting to the phone and establishing a link.

I am then able to send messages from HAH via xAP to my personal phone...works a treat.

The last two lines of this debug shows what happens when an SMS is received.  I don't know what it should be doing but it doesn't seem to interpret the message or create a xAP message...

I just can't get any further than this:

[inf][modem.c:138:setup_serial_port] Using serial device /dev/ttyUSB2
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.hal.SMS
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=sms.message
[inf][filter.c:34:xapAddFilter] section=outbound key=msg value=XAP_FILTER_ANY
[inf][filter.c:34:xapAddFilter] section=outbound key=num value=XAP_FILTER_ANY
[inf][filter.c:195:xapAddFilterAction] section=outbound key=num value=XAP_FILTER_ANY data=0
[inf][modem.c:34:put_command] Serial Tx: AT+CREG?
[inf][modem.c:60:put_command] Reading 1 chars from modem
[inf][modem.c:60:put_command] Reading 19 chars from modem
[inf][modem.c:94:put_command] Serial Rx:
+CREG: 0,1

OK

[inf][modem.c:173:initmodem] Modem is registered to the network
[inf][modem.c:34:put_command] Serial Tx: AT&FE0+CMGF=1;+CNMI=2,1,0,0,0
[inf][modem.c:60:put_command] Reading 6 chars from modem
[inf][modem.c:94:put_command] Serial Rx:
OK

[inf][tx.c:19:xapSend] send
xap-hbeat
{
v=12
hop=1
uid=FF00DD00
class=xap-hbeat.alive
source=dbzoo.hal.SMS
interval=60
port=3643
pid=172.16.10.100:180
}

[inf][sms.c:67:processSerialMsg] Serial Rx:
[inf][sms.c:67:processSerialMsg] Serial Rx: ,6

Any ideas?

brett
Offline
Providence, United States
Joined: 9 Jan 2010
When an SMS message is

When an SMS message is received from your phone this will result in a +CMTI: notification which xap-sms will pick up.
As I don't see any message like that in the above debug then I can only assume the phone has not generated one (yet).

sms.c

        if(strncmp(a_cmd,"+CMTI:",6) == 0) {
                int message_number;
                // Recieved an SMS notification event: +CMTI: "MT",3

This notification event is parsed and it tells us the new SMS message has just arrrived that is stored.
Using the example: +CMTI: "MT",3
We would then read this message "AT+CMGR=3" and generate an xap Frame.

The AT command +CNMI is used to specify how newly arrived SMS messages should be handled. You can tell the GSM/GPRS modem or mobile phone either to forward newly arrived SMS messages directly to the serial port, or to save them in message storage and then notify on the serial port about their locations in message storage.  (We do the later).

AT+CNMI as seen in the modem init sequence.

[inf][modem.c:34:put_command] Serial Tx: AT&FE0+CMGF=1;+CNMI=2,1,0,0,0

If you are sending a sms to your phone the the phone is not telling you a message is waiting, then this should be diagnosed without using the xap-sms program using the command I've indicated above using some serial comms program.

Brett

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Hi Brett,Thanks for the

Hi Brett,

Thanks for the explanation.  I think my issue is similar to what was posted here: http://www.homeautomationhub.com/content/sms-plugboard-v2

Didn't seem to come to a conclusion either. 

I'll try what I can this end...change cables, baud rate etc and see if I can impact anything.  Funny thing is this was working steady as a rock for some time but that was quite a few revisions back.

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
I fixed this issue by

I fixed this issue by swapping out my PL2303 serial to usb adapter for another type, same chipset.

Hardware Info