-
Hello,
I am using the AT module, and the cmd function. I need to provide the AT command which leads to the call of the call back. I mean a signature like this : cb(d, ATcommand) or similar.
I am not expert in JS, but I guess that's a closure. Is it possible to make sure that the call back remembers the AT command which makes it called ?
Thanks a lot
GeekBot -
-
Thank you Dr Azzy, I did your recommendation and found out that it was not a clock problem. Then I focussed on the init procedure of the module and found out that the problem was tricky, due to an involuntary break condition during module power up which puts the module in a locked state. So, I reworked the init procedure carefully to avoid this break condition and now the module works perfect. I also confirm that your breakout is a great device.
GeekBot -
Thank you Gordon,
We are sure that there is ground problem or tx/rx confusion. I work with another person and we double check the wiring. We receive the reset message from the module at power on, so it means that at least basic serial parameters look OK.
The snippet you provide above produces nothing back. It seems that the RN module doesn't catch the \r\n. Looking on the line with the Foca converter tx input, we see the string with CR/LF is emitted by Espruino. So it seems clear that the module doesn't interpret the command. What is strange is that the same command issued by the Foca adpator is executed by the module. So the Foca adaptor and Espruino don't behave exactly the same, and can't manage to undestand where they are different.
One way if to check the electrical signals on the line to see if we are exactly at the good speed or if the Espruino or module clocks and serial speed are shifted. But I need a memory oscilloscope for that, and I don't have yet...
Any idea is welcome, we are totally stuck on this issue.
Best regards
GeekBot -
Hello Gordon,
Thanks for your answer.
My code runs on Pico, not on Linux, (now I understand the comment in the code).
Baud rate, parity and flow are correct.
I am sure that the RN module works, because I tested it using the Foca adaptor and the GtkTerm with the same Serial parameters as those present in the code. It's the same problem on Serial1 and Serial2.My test code runing on Pico is this one:
var SERIAL_OPTIONS = { "rx":B7, "tx": B6, "bytesize": 8, "parity": null, "stopbits": 1, "flow": null }; Serial1.setup(57600, SERIAL_OPTIONS); var at = require("AT").connect(Serial1); at.debug(); at.cmd("sys reset\r\n", 2000, function cb(d) { console.log(d); });
When I run it, I get :
echo(0);
["sys reset\r\n"
=undefined
undefinedI should get the reset return message which gives RN2483 version, date...
The RN module is correctly connected and voltage levels are correct on the PINs. I use a breakboard from Dr Azzy.So my question is: Is the code above correct ? Should it work ?
Thanks a lot.
GeekBotJust to clarify how to send commands from a Linux GtkTerm to the RN2483 (using Foca adpator):
1/ Uncheck the CRLF option in Gtkterm
2/ You need to add CTRL-M CTRL-J manually to the command (to send the CR LF), then the command get executed correctly on the RN2483. -
Hello,
I am working on a project using a Rn2483. I think the AT module very valuable in this context and I tried to use it. But I experienced huge difficulties to make it working with Rn2483. Sending commands with \r\n at the end, such as ‘sys factoryYRESET\r\n’ are not executed by the radio module. I believe that's a cr/lf problem but I don't manage to master it. I looked at the code of the AT module checking that write statement is used instead of print. The code seems ok, so far I understand it....
I wonder if the fact that my host machine is a Linux box may modify the way the code is minified specially the way Cr/lf is managed. This question comes from a remark in the AT module code: ‘’TODO: something odd about Espruino on linux seems to mean that extra '\n' get inserted */’’. This remarks rings the bell’, but I don't know what is hidden behind it.Can you please advice on this issue?
Is there anybody who uses RN2483 + AT module?Thanks a lot.
GeekBotPS:
Epruino Pico is used on this project.
Not tested on Windows yet. -
-
Hello,
I wish to use the Async library, because it would save me a lot of time... I got the last version of the library from http://caolan.github.io/async/index.html . The minified and the non minified files are placed in the modules directory.
The target is Espruino Pico V1.86.
I reset() the target and then import with this code :var async = require("async");
The import fails and returns:
>echo(0); ERROR: Out of Memory! in function called from line 1 col 20814 ...lectSeries=t,a.wrapSync=E;})); ^ =undefined >
The minified file is 20816 bytes (so it should get into memory ?).
It seems that some other Espruino users managed to use Async on Espruino.Any clue and advice is welcome.
GeekBot
-
-
Thank you very much Gordon,
Espruino Wifi : I didn't know, very nice and interesting. I order one to test.Is the "speed" the frequency of the HSE ? I have set a 8 MHz xtal external, I guess the scripts calculate to clock configuration to reach the "speed" . Is that correct ?
Last question, do you design custom cards on request ?
Best regards
GeekBot -
Hello,
I am writing an application on Pico but I use many libraries and I lack room in the Pico flash. Since the STM32F415RG is quite ideal for my application, I try to rebuild Espruino for this micro-controller.
I have managed to recompile and flash the firmware. Of course, it doesn't work ;-)
It seems fairly normal for a first attempt...
Many topics are unclear to me. So I have some questions:- In the Espruino board file I noticed 'bootloader' : 1, on some boards this option is present on some others it isn't. I don't understand what it means exactly. Any clue ?
- What does mean " 'speed' : 84" in the chip section ?
- In the 'saved_code' section, I understand that it defines how the code once temporarily imported toRAM it is then copied to the flash; Is that correct ?
- If above is right, the question is to copy code in pages which in case of STM32F415RG are not uniform (some 16k, 64k, 128 k). Could you advice me on the best way to use the flash pages structure ?
Thanks a lot.
Regards
GeekBot
- In the Espruino board file I noticed 'bootloader' : 1, on some boards this option is present on some others it isn't. I don't understand what it means exactly. Any clue ?
-
-
Hello,
Your question "Are you using WEBIDE to access the PICO?" inpired me to test on another environment.
The problem is linked to Windows or Chrome on Windows.
On a Chromium/Linux machine, all the demo codes work perfect.
I updated the WEBIDE, still the same.
I run Windows 10 Familly edition and my machine is up to date.
Version: 1511, OS version: 10586.545
If you need some more information, just ask.
Best regards
GeekBot -
Thank you ClearMemory041063,
Yes, I use WEBIDE to access the PICO
I did your examples, and I get always the same error, either on Serial1 or on Serial2.
For example, with the file you attached, on Serial2 the error is:Uncaught Error: Function "g" not found!
at line 1 col 23
var Port=Serial2;Port.g(9600,{f:A3,i:A2,a:8,c:"even",h:1});P...^
=undefined
Any clue ?
Thanks a lot
GeekBot -
Hello,
I use Epruino Pico version 1.86.
The source code is made of this unique line of code:
Serial2.setup(9600, { rx: A3, tx : A2 });
Running it leads to this error :
echo(0);
Uncaught Error: Function "b" not found!
at line 1 col 9
Serial2.b(9600,{a:A3,c:A2});^
=undefined
Same story with:
Serial2.setup(9600,{rx:A3, tx:A2,bytesize:8,parity:'even',stopbits:1});I feel to be an idiot, since it seems so trivial to use...
Is this normal ?
Any advice is welcome.Best regards
GeekBot
-
Thank you Gordon
Testing your code, it does what is expected. However, I have difficulties to link my previous code with your explanation. It probably comes from my ignorance of how Espruino works internally. One additional question: what is the effect of the debounce parameter ? In which use cases shall I use it ?
Thanks again for your help.
GB -
Thank you for your questions/answers. I did some tests and measurements so, here are my answers :
- What does your volt meter say when the Button is pressed? : it says 0.00 v. I changed the wire which connects to the pico header. Same effect.
- When pressed - connects pin B10 to GND - correct? Yes, it is wired to the ground. I also checked with the ohmmeter.
- What kind of button do you have? It is a http://www.farnell.com/datasheets/1825221.pdf microswitch. 01L series. I did several objects with these OMRON switches that are quite good and have very low and fast bounce. It is brand new. I will change it and give you the result of the new tests.
- I tested with various debouncing duration, but it has no effect.
I come back to you with test results with another switch.
Best regards
GB
- What does your volt meter say when the Button is pressed? : it says 0.00 v. I changed the wire which connects to the pico header. Same effect.
-
Hello,
I experience a reliability problem as exposed above. The setWatch function sometimes misses the button event (I press once a second). It's not a floating problem, my voltmeter says 3.21 V. Here is the code :var ledjaunestate = false;
pinMode(B10, 'input_pullup');
setWatch(function() {
ledjaunestate = !ledjaunestate;
digitalWrite(B1, ledjaunestate);
}, B10, { repeat: true, debounce : 5, edge: "falling" });It's on Pico with firmware : espruino_1v85.506_pico_1r3_wiznet.bin
Any clue ?Thanks a lot
GB
I think I did a mistake in my code, because now I see the cb function behaving as a closure, so sorry for the noise.
However, I don't understand the code in the function AT.cmd :
if more info is awaited, "return cb". What does exactly this code ? How returning cb function makes the callback retriggered again. Sorry for this neophyte question...
Thanks a lot
GeekBot