-> 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:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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:
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)
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:
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
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:
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 +