EDIT: Note all of the following actually had no bearing on issue. In end reflashing to the same firmware appears to have sorted it.
@Gordon thanks for coming back on this thread, I'll try and explain what I mean. As I understand it the AT module wraps serial. So I've got two test functions now, one that is sending AT commands directly using Serial2 and another using the AT module.
The first function (Serial2) and some calls with commented returns is/are below.
Note the return on ATE0, but that's another story, though I'm starting to disagree :D
// Serial Tests
var serialTest = function(cmd, timeout) {
var l = "";
Serial2.setup(115200, { rx: A3, tx : A2 });
Serial2.on('data', function(d) {l+=d;});
Serial2.write(cmd + "\r\n");
setTimeout(function() {console.log(l);}, timeout);
};
serialTest("ATE0", 1000);
// ATE0
// no this fun
serialTest("AT+CIPMUX=1", 1000);
// AT+CIPMUX=1
// OK
serialTest("AT+CWMODE=1", 1000);
//AT+CWMODE=1
//no change
serialTest("AT+CWJAP=\"xFxxxS\",\"xxebxxx\"", 1000);
//AT+CWJAP="xxxxxx","xxxxxx"
//OK
serialTest("AT+CIFSR", 1000);
//AT+CIFSR
//192.168.1.16
serialTest("AT+CWLAP", 5000);
//AT+CWLAP
//+CWLAP:(0,"",0)
//+CWLAP:(3,"Orxxxalign",-54)
//+CWLAP:(4,"BIOxxxAMD",-83)
//+CWLAP:(3,"CxxDUK",-52)
//+CWLAP:(0,"CDxxUK-GxxUEST",-52)
//+CWLAP:(4,"waxxdaroxxxWAP1xxx2ice",-64)
//CWLAP:(4,"Laxxxxxp",-67)
//etc
Trying to test the AT module command at.cmd i have the test function below plus the calls and commented returns. Always one line whatever timeout is set. Never anything else.
When I added a few logging statements in the ESP module I downloaded and have locally I could see that in all cases I tested d was being evaluated against something that in the serial function is on the second line, but using AT it actually contained the first/only line (the command) - i.e AT+CIPMUX=1 != OK
I doubt that has clarified things much, and it's fair to say I'm a bit out my depth here, so please tell me if I'm muddying the water ;) but I suppose the question I'm posing is why am I ok using Serial2 but not the AT module which wraps Serial. Is there an issue in there?
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.
EDIT: Note all of the following actually had no bearing on issue. In end reflashing to the same firmware appears to have sorted it.
@Gordon thanks for coming back on this thread, I'll try and explain what I mean. As I understand it the AT module wraps serial. So I've got two test functions now, one that is sending AT commands directly using Serial2 and another using the AT module.
The first function (Serial2) and some calls with commented returns is/are below.
Note the return on ATE0, but that's another story, though I'm starting to disagree :D
Trying to test the AT module command
at.cmd
i have the test function below plus the calls and commented returns. Always one line whatever timeout is set. Never anything else.When I added a few logging statements in the ESP module I downloaded and have locally I could see that in all cases I tested
d
was being evaluated against something that in the serial function is on the second line, but using AT it actually contained the first/only line (the command) - i.e AT+CIPMUX=1 != OKI doubt that has clarified things much, and it's fair to say I'm a bit out my depth here, so please tell me if I'm muddying the water ;) but I suppose the question I'm posing is why am I ok using Serial2 but not the AT module which wraps Serial. Is there an issue in there?