I run these commands:
cat /dev/smd7 & echo "AT+CSCS=\"GSM\";\r" > /dev/smd7
cat /dev/smd7 & echo "AT+CMGF=0;\r" > /dev/smd7
cat /dev/smd7 & echo "AT+CMGS=24;\r" > /dev/smd7
Then I enter the PDU message:
07...985C369F01
I get this output:
/system/bin/sh: 07...985C369F01: not found
Let's analyze the two commands you provide to your shell:
cat /dev/smd7 &
echo "some_data" > /dev/smd7
cat /dev/smd7 &
: Listen to device /dev/smd7
: from now on all data coming from that device will be redirected to the stdout (the shell you are writing in). Do it in background (&
) in order to be able to send further commandsecho "some_data" > /dev/smd7
: send some_data
to device /dev/smd7
When you send echo "AT+CMGS=24;\r" > /dev/smd7
AT+CMGS=24;\r
is sent to the device>
prompt character telling you that it is waiting for the PDU message>
prompt is just a print on the shell, so any sent data will be directly sent to the shell!not found
error is shownIn conclusion, in order to send correctly the PDU message to the device, just keep sending it through echo
command:
echo "07...985C369F01" > /dev/smd7
Note: Make sure to terminate the sequence with CTRL+Z character (ASCII 0x1A
).