emilsedgh / modem

Send and receive messages and make ussd queries using your GSM modems
161 stars 68 forks source link

Cutting off last characters sending SMS #4

Closed leoncc closed 9 years ago

leoncc commented 10 years ago

When using the modem.sms function I am experiencing that the last few characters are cut of when viewing the sms message on the receiving phone.

function sendSMS() { console.log('Attempting to send SMS'); modem.sms({ receiver: '0761234567', text: 'Test text from app.js on Mac.', encoding: '7bit' }, function (err, sent_ids) { console.log('>>', arguments); if (err) console.log('Error sending sms:', err); else console.log('Message sent successfully, here are reference ids:', sent_ids.join(',')); }); }

For instance: Test text from app.js on Mac. gets cut off toTest text from app.js on M

Have you experienced this?

Thanks Leon

emilsedgh commented 10 years ago

https://github.com/emilsedgh/pdu/issues/1

I will fix it in a couple of weeks.

Thank you for the bug report.

leoncc commented 10 years ago

Hi,

Attached pdu.js for the pdu package on npm.

I fixed decode7Bit to ignore \u0000 char (line 186 - 191). I fixed cutting off of last few characters (line 294).

Regards Leon

On 27 Jul 2014, at 11:27 AM, Emil Sedgh notifications@github.com wrote:

emilsedgh/pdu#1

I will fix it in a couple of weeks.

Thank you for the bug report.

— Reply to this email directly or view it on GitHub.

emilsedgh commented 10 years ago

Hi. I cannot see any attachment.

engkan2kit commented 9 years ago

I am experiencing this too.

leoncc commented 9 years ago

Hi,

In the scenario I wanted to use SMSs I discovered I needed a bit more. I want to be able to send SMSs in a queued manner (if things get busy), process delivery reports, receive SMS etc. I downloaded the Gammu SMSD deamon from wammu.eu. Unfortunately you need to compile it with cmake, but I found that relatively easy. It works for me, but maybe your scenario is different.

Regards Leon

engkan2kit commented 9 years ago

My scenario is this: I have multiple GSM modems. I have a main nodejs app that stores the sms message and destination in mongodb. Each GSM modem has node.js app(same script but different device addresses) that is connected to the main app and fetches queued messages in the mongoDB. Also, whenever the main app stores the mongodb, it notifies all gsm node that there is a new data to be fetch( to avoid polling the database). Right now I am using only one GSM modem. I have experience this problem(cutting of lasst few characters as well as corrupted multiple messages when more that 160 characters are sent.). I suspect the problem is with the PDU so I am thinking of not using the PDU and directly use the Text mode of GSM modems since mine supports it.

It's like a load balancing application for GSM. Any ready GSM can send a message.

leoncc commented 9 years ago

Most important I think is that only one application should communicate with one modem as while you are busy sending other messages might come in, for instance delivery reports if you request them. I have one deamon running per modem, which handles the sending and receiving. In my case I also need to process incoming SMSs.