Issue
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
Solution
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: sendsome_datato 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;\ris 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 founderror 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).
Answered By - Roberto Caboni
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.