Thanks for the responses.
If you send "AT" to a phone, for instance, it expect that the whole command will arrive with some time period. If the T arrives late, the A won't be recognized as a valid command.
I understand this, but on the other hand if I send “AT+CMGS=” using a single Serial.print command, and then use a 2nd Serial.print() command to send a second array containing the phone number, then the SMS module is quite happy to accept this as all being part of the same command, despite what is presumably a delay (albeit only fractions of a second) between the two statements.
I have no idea what is being generated by your PduEncoder class, but, surely there is meaning to less than 300 characters at a time
The PduEndcoder class takes a plain text SMS message (160 Characters max) and converts it to PDU format for processing by the SMS module, the PDU encoding translates 1 plain-text character into two pdu-encoded characters.
I started with the PduEncoder library on the arduino home, it works ok, but it uses String types which take up lots of memory and seem to cause fragmentation issues. I re-wrote the library to process the plain-text message one character at a time and provide the pdu-encoded message one character at a time. At the time I thought I’d done a great job, the data memory used by the library went down to less than 75 bytes, however, it now seems my work was pointless because although the new library can generate the pdu-encoded text one character at a time, the SMS module won’t except it one character at a time and only works if it gets the whole pdu-encoded text in one big block. Bu993r!
The SMS module I’m using (SM5100B-D from sparkfun) allows the transmission of plain text messages up to 140 characters long, but if you want to transmit 160 characters messages (which I do
) then they need to be PDU formatted. My project sends a lot of data via SMS so if I switch to 140 characters then I’ll have to send more SMSs (and get bigger bills)
Perhaps the answer is to fix the lack of memory?
Yeah – I know and I’ve been making dramatic improvements (you should have seen how much memory the first versions used!) My project involves sending a lot of data via SMS, but more importantly, it saves the data if it can’t transmit when there’s no phone signal. If I have to add a new 300+ byte buffer then that’s at least two 160 character messages that I can no longer back up!
Thanks for your help, I’ll carry on experimenting. I wonder what happens if I try sending normal AT commands 1 byte at a time? Or maybe I can get away with passing my PDU string in ten 30 byte arrays instead one big 300 byte one.