0

I can list the directory using below command. AT+FSLS=\

i found AT+FSCREATE="1.amr",3 command to crate files in directory but the problem is, how to upload the file from my local drive.

Anto sujesh
  • 325
  • 3
  • 14
  • Check AT-command manual of your modem. There is probably separate AT-command for writing to a file. For example: AT+FSWRITE – SKi Oct 03 '18 at 08:16
  • @Ski thx u for your response, yes manual has below command at+fswrite=1.arm,1,512,10. nothing else,how to load from local drive is my main problem – Anto sujesh Oct 03 '18 at 09:51
  • Then you should tell little bit more about your environment. Like programming language. And also possible code-snipped what you have already tried. – SKi Oct 03 '18 at 10:22

1 Answers1

2

I don't have any modem that supports AT+FSWRITE command. But based on SIMcom AT-command manual, AT+FSWRITE= command responds with prompt: >. Manual does not clearly tell how to use the command.

But it might work similar way than AT+CMGS= command:

  1. Send AT+FSWRITE=1.arm,0,512,10 command to modem.
  2. Wait > from the modem.
  3. Write content of the file (512 bytes) to the modem.
  4. Send Ctrl-Z char (0x1A hex) to the modem.
  5. Wait OK/ERROR from the modem.

Step 4. may not be needed, because size of the file is in the command.

SKi
  • 8,007
  • 2
  • 26
  • 57
  • so i need to write audio file in hex format right ? – Anto sujesh Oct 03 '18 at 12:00
  • i can successfully write the file now. but its not playing. i can only hear noise. any idea where i went wrong ? – Anto sujesh Oct 04 '18 at 11:07
  • 1
    @Anto sujesh If you wrote it by using hex format. Did you already tried to use pure binary? – SKi Oct 04 '18 at 12:14
  • what i did is, i opened arm in notepad, copy it and write it on gsm. – Anto sujesh Oct 05 '18 at 06:24
  • how exactly do you do step 3 ? – Xsmael Jul 06 '19 at 12:18
  • @Xsmael : Step 3 depends on your programming language and maybe also OS. And usually there are several ways to do it. For example: with Linux writing to a modem is often done by using [write() function](https://linux.die.net/man/2/write). – SKi Jul 06 '19 at 15:28
  • @SKi Thanks for replying I am using nodeJS with serialport module, but if you can give me a working exemple with any other language I'll me more than glad! coz I have tried many things but to no avail. – Xsmael Jul 07 '19 at 00:15