zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
88 stars 46 forks source link

Missing Characters in a message (PDU) when sending over 160 characters #136

Open amnon18 opened 5 months ago

amnon18 commented 5 months ago

Hello Everyone,

I started using this library about 2 weeks ago and it's amazing how it works well, except for the long messages. It seems that for any message over 160 characters long I lose the first character of the next block. If I add a space in my text to send, the space will be removed when sent. Is there a way to find out why and where this is done so we can fix it?

Thank you in advance

Ronen

KillerJulian commented 5 months ago

That sounds like a problem with the dependency node-pdu

amnon18 commented 5 months ago

Hi Julian,

I’ve solved by adding a % sign every 132 characters. I know it’s not the best but it works.

Let me know if you figure this out eventually.

Thank you

Ronen

Get Outlook for iOShttps://aka.ms/o0ukef


From: Julian W. @.> Sent: Thursday, February 1, 2024 8:17:59 AM To: zabsalahid/serialport-gsm @.> Cc: Ronen Tadmor @.>; Author @.> Subject: Re: [zabsalahid/serialport-gsm] Missing Characters in a message (PDU) when sending over 160 characters (Issue #136)

That sounds like a problem with the dependency node-pduhttps://github.com/jackkum/node-pdu/issues/new

— Reply to this email directly, view it on GitHubhttps://github.com/zabsalahid/serialport-gsm/issues/136#issuecomment-1921305705, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIBT24XV4FOJEFSNLKJ5VJDYROIYPAVCNFSM6AAAAABCTSPELGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRRGMYDKNZQGU. You are receiving this because you authored the thread.Message ID: @.***>

KillerJulian commented 5 months ago

Please provide a code to reproduce the issue and I will have a look.

Thank you

justlester commented 1 month ago

Hi Julian, I’ve solved by adding a % sign every 132 characters. I know it’s not the best but it works. Let me know if you figure this out eventually. Thank you Ronen Get Outlook for iOShttps://aka.ms/o0ukef ____ From: Julian W. @.> Sent: Thursday, February 1, 2024 8:17:59 AM To: zabsalahid/serialport-gsm @.> Cc: Ronen Tadmor @.>; Author @.> Subject: Re: [zabsalahid/serialport-gsm] Missing Characters in a message (PDU) when sending over 160 characters (Issue #136) That sounds like a problem with the dependency node-pduhttps://github.com/jackkum/node-pdu/issues/new — Reply to this email directly, view it on GitHub<#136 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIBT24XV4FOJEFSNLKJ5VJDYROIYPAVCNFSM6AAAAABCTSPELGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRRGMYDKNZQGU. You are receiving this because you authored the thread.Message ID: @.***>

How did you implement the %? Can you provide the workaround code?

blackchineykh commented 2 weeks ago

Can you help here as well? I am having the issue of the missing characters. I noticed that the node-pdu dependecy isnt updated on this project to the latest as well

blackchineykh commented 2 weeks ago

Please provide a code to reproduce the issue and I will have a look.

Thank you

const number = "19991234567";
const message = "Hi Friend, we found 73 new results for your Search criteria. View these new matches at https://mywebsiteonlineresults.com/profile/search-results.html?id=12345&passw=rilkb806s1h"

let submit = pdu.Submit()
submit.setAddress(number)
submit.setData(message)

let parts = submit.getParts()

console.log(`Original long message: `, message)

let result = "";
for (let i = 0; i < parts.length; i++) {
console.log(`Encoded message part ${i} is: `, parts[i].toString())

const decodedMessage = pdu.parse(parts[i].toString());
console.log(`Decoded message part ${i} is: `, decodedMessage.getData().getText())
result += decodedMessage.getData().getText();
}

console.log(`Resulting long message: `, result)

Output:

Original long message:  Hi Friend, we found 73 new results for your Search criteria. View these new matches at https://mywebsiteonlineresults.com/profile/search-results.html?id=12345&passw=rilkb806s1h
Encoded message part 0 is:  0041000B919199214365F700008C060804ACC60201C834C8284F97DD6416E85E0699DF753719749B81DCE53B485E9ED7D9F439C8FC9683F2EFBA1C342D87E56334682C4FD3CBF274D805B2A6CB77101D5D9E9741EEF21DD40ED3C7E8F21C14A683D0743A7CAE7BBDDAF97B593C4FD3CB6F373BED2ECBCBF33A9B3E778DDFED175CFE36A7D9E5D7BC1C06
Decoded message part 0 is:  Hi Friend, we found 73 new results for your Search criteria. View these new matches at https://mywebsiteonlineresults.com/profile/se
Encoded message part 1 is:  0041000B919199214365F7000032060804ACC60202F231BA252FCFEB6CFADC85A6B7D9BF34B91793CD6835133C3C9FDF7BF2347B2DC6C16CF3181A
Decoded message part 1 is:  rch-results.html?id=12345&passw=rilkb806s1
Resulting long message:  Hi Friend, we found 73 new results for your Search criteria. View these new matches at https://mywebsiteonlineresults.com/profile/serch-results.html?id=12345&passw=rilkb806s1

I know its the depency of node-pdu that seems to be the issue here but i see that its also outdated in this project.