tessel / gprs-sim900

[UNMAINTAINED] JavaScript module for the SIM900 2G driver.
Other
14 stars 7 forks source link

Errors when running script, stopping, and then running script again. #14

Open facultymatt opened 10 years ago

facultymatt commented 10 years ago

I've noticed errors and inconsistent behavior with the module. To recreate on a Mac, do the following:

  1. Create example using the provided example.
  2. Connect Tessel via USB.
  3. Run the script, for example tessel run phone.js.
  4. Allow text message to send successfully.
  5. Terminate script by pressing ctrl+c
  6. Run the script again, tessel run phone.js. You should see an stacktrace like this:
GPRS module connected to Tessel. Searching for network...
Sending Text from a Tessel! to xxxxxxxxxxx ...
{ message: 'Chain broke on AT+CMGS="xxxxxxxxxxx"', type: 'Error', name: 'Error', stack: 'stack traceback:
    /app/node_modules/gprs-sim900/index.js:208: in function 'f'
    /app/node_modules/gprs-sim900/index.js:194: in function 'temp'
    /app/node_modules/gprs-sim900/postmaster.js:152: in function 'reply'
    /app/node_modules/gprs-sim900/postmaster.js:166: in function 'f'
    /app/node_modules/gprs-sim900/postmaster.js:86: in function '?'
    /app/node_modules/gprs-sim900/packetizer.js:152: in function '?'
    builtin/tessel.js:738: in function 'func'
    [T]: src/colony/lua/colony-node.lua:54: in function <[T]: src/colony/lua/colony-node.lua:53>' }

Debug info:

tessel version 
INFO v0.3.5

tessel version --board
INFO Serial #: TM-00-04-f0009a30-00614757-58d045c2
INFO Wifi Version: 0.0
INFO Firmware Version: 93df6d7
INFO Runtime Version: cdb8be3

Related to outstanding issue with this PR: https://github.com/tessel/gprs-sim900/pull/13

facultymatt commented 10 years ago

This might have more to do with running the script before the device has connected network activity. We should create a PR that broadcasts when network is connected, then test this bug again to see if its resolved. I can do this...

jiahuang commented 10 years ago

This might also be due to the SIM900 not cycling properly during a ctrl+C event (or more specifically, resetting itself to a default state when the script is run again). So it would be in the middle of an event transmission and be in a different state than what the message parser expects.

ekolker commented 10 years ago

Can someone ( @jiahuang , @facultymatt , or anyone else on OSX) give this another try with the latest code on master?