Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send using GSM character set #102

Open
adam-pulley opened this issue Nov 8, 2019 · 5 comments
Open

How to send using GSM character set #102

adam-pulley opened this issue Nov 8, 2019 · 5 comments

Comments

@adam-pulley
Copy link

Is it possible to send using the GSM character set? It doesn't appear to be documented on arduino.cc/en/Reference/MKRGSM and I've tried every possible approach I can think of without success. It appears MKRGSM is converting some characters to the GSM character set, for instance '@' and '$' sends correctly even though they are characters 0x00 and 0x02 in the GSM character set, but I can't find any way to send the british pound (0x01), euro (0xE2 0x82 0xAC) or general supported accented european characters for instance. My suspicion is that the MKRGSM is performing a conversion from standard ASCII for some characters, such as @ and $, but not for others and I can't find any way to tell it to or to accept hex character codes with me doing the conversion for it?

@adam-pulley
Copy link
Author

I've just found that if I send a message with special characters it gets output by MKRGSM to me as a string like this: 00480065006C006C006F0020005B005D007B007D00230025005E002A002B003D005F005C007C007E003C003E20AC002400A52022002E002C003F00210027
So it seems there is handling of hex code based messages, does anyone know if this is documetned anywhere, how to determine when the message is hex based and how to send a hex based message?

@y-fedorov
Copy link

y-fedorov commented Nov 11, 2019

It's SMS PDU Format - https://www.activexperts.com/sms-component/sms/pdu/ it can be decoded with different libraries.

@Rocketct
Copy link
Contributor

Rocketct commented Mar 9, 2020

@adam-pulley you can also check on the at command manual of the sara u201, be careful we not support and not encourage the use of this commands, sorry, say this you can check the section related the AT+CSCS, used to set the character set and also show list of all the format supported by the sara u201, as suggested by @y-fedorov could be a good idea try to search some library that that decode it for you, due to the fact we as arduino not support this last.

@ogellein
Copy link

ogellein commented Dec 8, 2020

I had simular problem with sending Norwegian letters.
With the MKR GSM 1400 I am able to change the modem encoding.
After: gsmAccess.begin(PINNUMBER);
I add encoding: MODEM.send("AT+CSCS=\"8859-1\""); //you can also use GSM

And then the input also must match this encoding, i use this one:
String filterInsertSpecialChar(String str){
for (int i=0; i <= str.length(); i++){
str.replace("æ",String(char(230)));
str.replace("Æ",String(char(198)));
str.replace("ø",String(char(248)));
str.replace("Ø",String(char(216)));
str.replace("å",String(char(229)));
str.replace("Å",String(char(197)));

}
return str;

}
Reference: https://www.u-blox.com/sites/default/files/u-blox-CEL_ATCommands_%28UBX-13002752%29.pdf

@eirikora
Copy link

eirikora commented Jun 8, 2021

Thanks @ogellein, your advice worked for me and I am now able to send Norwegian SMSes with the MKR GSM 1400 after having tried some way too complex alleys earlier.
Have posted an updated code example here that could also be adapted for other European languages: https://forum.arduino.cc/t/how-to-send-sms-with-nordic-characters-on-arduino-mkr-gsm-1400/870836

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants