Giter VIP home page Giter VIP logo

atinout's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

atinout's Issues

Infinite loop

Use case:

AT+CMGF=1
OK
AT+CMGS=+31628870634
> This is the text message.โ†’
+CMGS: 45
OK

Line of code where it gets stuck:

do {
line = fgets(buf, (int)sizeof(buf), modem);
if (line == NULL) {
fprintf(stderr, "EOF from modem\n");
return EXIT_FAILURE;
}
strcpy(buf2, line);
strip_cr(buf2);
res = fputs(buf2, output);
if (res < 0) {
fprintf(stderr, "failed to write '%s' to output file (res = %d)\n", buf2, res);
return EXIT_FAILURE;
}
} while (! is_final_result(line));

DISCLAIMER: I am far from being a sw developer, just wanted to write my linux sms utility using this nice piece of code.

If the device expects to be written again then it will never provide the "end of transmission" hence the fgets keeps listening.

Using a serial terminal emulators you can see that (look at the usecase I have reported) and you (user) keep writing giving the expected terminator at the end (ascii 26 in my case).

Commandline get stuck after execution AT+CMGS

I've written a C file for executing AT commands sequentially as soon as I hit "AT+CMGS=XXXXXXXXX" command the program gets stuck and waits for a user interrupt then when I press Ctrl+C it executes the next command.

strcpy(command, "echo 'AT' | atinout - /dev/ttyUSB0 -");
        system(command);

strcpy(command, "echo 'AT+CMGF=1' | atinout - /dev/ttyUSB0 -");
        system(command);

strcpy(command, "echo -e 'AT+CMGS=\"1234567890\"' | atinout - /dev/ttyUSB0 -");
        system(command);

strcpy(command, "echo -e 'test messaget!!!!\x1A' | atinout - /dev/ttyUSB0 -");
        system(command);

Why does it get stuck?

How can I execute the above commands sequentially without the need of an interrupt?

Is the problem with system command?

Regards.

repeated error

Hi,

i having issues while running spesific command, it is for starting GPS track to my Sierra Modem, here is the output:

root@raspberrypi:/home/pi# echo -e 'AT!GPSTRACK=1,255,50,1000,1'|atinout - /dev/ttyUSB0 -
AT!GPSTRACK=1,255,50,1000,1

Tracking initiated

OK

ATAaated

NO CARRIER

ATAaated

NO CARRIER

AATAaated

NO CARRIER

AAATAaated

NO CARRIER

AAAATAaated

NO CARRIER

AAAAATAaated

NO CARRIER

AAAAAATAaated

NO CARRIER

AAAAAAATAaated

NO CARRIER

AAAAAAAATAaated

NO CARRIER

AAAAAAAAATAaated

NO CARRIER

AAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAAAAAAATAaated

NO CARRIER

AAAAAAAAAAAAAAAAATAaated

NO CARRIER

any help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.