You are reading a single comment by @stephaneAG and its replies. Click here to read the full conversation.
  • Hi there !

    -> haha, you're welcome, [ happy to contribute .. and can't wait to use it ! ;P ]

    On the SIM800L subject, I got few stuff worked out ..

    First of all, as I luckily had another Pico , I tried with it on Serial1 & B4 for the RST pin of the SIM800L module ..
    .. and it seems to work, after some checks, and ALWAYS after resetting the module after connecting it to the Pico ( in other words, after whenever powering on the Pico ).
    This may make sense / have stuff to do with the auto-bauder set by default on the module ? ( .. )
    Also, the said-tests were done while getting power from a cheap USB<->FTDI adapter ( which was previously used to debug the module using 'screen' )

    Concerning the LED blinking of the module:

    • it shall blink 8 times & then wait & loop when the module is booting/trying to connect
    • it shall blink once every 3 seconds when the module has booted & is connected

    In other words, only 2 blinks when powering it up seems to indicate not enough power [ or another error / faulty sutff .. ]

    I'll try other tests while powering the SIM800L module from the Pico's +5V through a diode & see if it works flawlessly, and then back on the "original" Pico to check that out too ( the only "major" differences being the use of Serial2 instead of Serial1 & the presence of the SD card, but not on the same pins ).

    Now, while I could quickly write a module to wrap useful AT cmds, there's one thing that I'm sure I can do better: parsing response from said-AT cmd:
    For unknown reasons [ spoiler alert: that may be obvious ones .. ], I can't get up to the content of a message retrieved simply using an 'at.cmd()' call like the following(s)

    /* should the following work ? it never gets to the content of a SMS :/ .. */
    at.cmd("AT+CMGR=1\r\n", 1000, function(d) {
     if (d===undefined) ; // we timed out!
     // d is now the result
     console.log('AT+CMGR=1 result: ' + d);
    });
    
    
    /* I tried stg inspired from the following example */
    // example
    at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) {
     if (d===undefined) ; // we timed out!
     // d is now the result
     if ( still_waiting_for_more_infos ) return cb; // can 'still_waiting_for_more_infos' be any of the following ?
     else console.log('AT+CMGR=1 result: ' + d);
    });
    
    // try 1
    at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) {
     if (d===undefined) ; // we timed out!
     // d is now the result
     if ( at.isBusy() ) return cb;
     else console.log('AT+CMGR=1 result: ' + d);
    });
    
    // try 2
    at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) {
     if (d===undefined) ; // we timed out!
     // d is now the result
     if ( Serial1.available() !== 0 ) return cb;
     else console.log('AT+CMGR=1 result: ' + d);
    });
    

    My current "solution", which is pretty hacky & not-clean-at-all ( even more if I can't set back the 'data' listeners that were there in the first place ( .. ) ), is the following one:

    var buff = "";
    Serial1.on('data', function(d) { buff+=d; });
    at.write('AT+CMGR=1\r\n');
    Serial1.removeAllListeners('data');
    // buff seems to contain everything
    

    Any hint on a simpler & cleaner handling of data returned through at.cmd() ?
    -> It's pretty much all I need to complete the following ;)
    SIM800L_moduleTesting.js
    API

    btw: I achieved being thrown at the following ;P

    Uncaught Error: Maximum number of scopes exceeded
    

    UPDATE:
    After trying to get power from the Pico's +5V, now it seems stuck with the red light on & not connecting any more on USB :(
    Also, before the Pico did put on his red led, this is what was received over serial:

    "\x00\x01Áprø¢ÿ\f\x00ø!\x10\x05\x00H\x00­Àøþ\x00\f\x00\b\x00\x00\x00\x00ø\x00ð\x0­0\x00\x00\x00ð\x01\f´\x01à\x00\x00P\x01ð­\x00\x00\x00æ\x1F@\x01ü\x00\x00@\x04F¼\x­10\bÈ\x11\b\x00æxÀ@\x10\x1Eþ\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00BU\x0E\x0B\x00\x00\x00\x00\x00\x­00\x00\x00\x00BU\x0E\x0B\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00­\x00\x00\x00\x00\x00\x00\x00BU\x0E\x0B\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x­00\x00\x00\x00\x00\x00\x00\x00\x00\x00" <--- "\x00"
    

    So ..
    .. any advice on how to get my Pico back from the void :| ?

    Hoping there's no attempts on England ( or any other parts of the world, actually ),
    Your hints are more than welcome

    Thanks +

About

Avatar for stephaneAG @stephaneAG started