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 commands
echo "some_data" > /dev/smd7
: send some_data
to device /dev/smd7
- The connection with the device is open
- The data is sent
- The connection is closed and the control comes back to the shell
When you send echo "AT+CMGS=24;\r" > /dev/smd7
AT+CMGS=24;\r
is sent to the device
- The connection is closed
- ... in the meanwhile the device sends back
>
prompt character telling you that it is waiting for the PDU message
- ... but the shell has the control. The
>
prompt is just a print on the shell, so any sent data will be directly sent to the shell!
- Since the sent data is not a shell command, the
not found
error is shown
In 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
).