Pico / ESP8266 newbie (idiot?) question ! #4847
Replies: 1 comment
-
Posted at 2015-06-21 by DrAzzy Try instantiating the wifi adapter, w/out trying to connect to anything, and do: wlan.at.cmd("AT+GMR\r\n",1000,console.log); Posted at 2015-06-21 by Pat Thanks ! Tried this .. Serial2.setup(9600, { rx: A3, tx : A2 }); Got
Have I got the right firmware ? Is there a special build to support the 8266 ? Posted at 2015-06-21 by DrAzzy Sorry, wifi.at (or whatever you called it in the initial require call, var wifi=require(...) ) Posted at 2015-06-21 by Pat I'm sorry. Lost. Too newbie, I suspect ! This ? Serial2.setup(9600, { rx: A3, tx : A2 }); Don't understand how (without the connect) I talk down Serial2. Uncaught Error: Field or method "cmd" does not already exist, and can't create it on undefined Posted at 2015-06-21 by DrAzzy You need to do the require().connect(...), not just require, sorry for unclearness. If you don't call connect, there's nothing there - connect is what gives you the wifi object. Also, easier command is wifi.getVersion() You can fire that off from the callback in connect(). I was posting that from the phone while waiting, and didn't do a very good job of giving a helpful post. Posted at 2015-06-22 by @gfwilliams Your wiring sounds good - the red LED and WiFi network seem like a good start! Actually, where did you get your ESP8266 from? They often have different versions of firmware on them, and different versions have different baud rates (the ones I sent with the KickStarter should use 9600 baud). A simple way to check, which you can copy/paste onto the left-hand side of the IDE is:
That should output some text (you should also see the blue light on the ESP8266 flash). For example mine shows:
Sounds like you tried with 115200, but maybe you could also try 57600 as well? If that does work, you may find you still have some problems though. It's not just the baud rates that are different between versions :( However let us know how you get on - it might be there are some simple tweaks that could be made that would make it work. Posted at 2015-06-23 by Cale Hey guys. Was having a similar problem. After I shortened a few wires and moved the 1117 right in close to the Pico would it start returning anything of value. (on a bread board) My mfg says its 9200 but only 115200 would not return gibberish. But my pico only works on every other try... sometime with the need of a reset(). (code run from the right side of the console). The following is where I am getting stuck...... don't know where the sdcard bit is coming from??
Posted at 2015-06-23 by DrAzzy It's not recognizing the AT module (it mentions the SD card because, seeing the unrecognized module, checks if it can load it from an SD card) - Are you typing things into the left-hand side of IDE? Are you not connected to the internet? For using modules, you need to "send to espruino" from the right-hand side - the IDE intercepts it, detects the modules that are needed, fetches them from espruino.com/modules/modulename.min.js, and sends that to the Espruino. Posted at 2015-06-23 by Cale No I am using the right hand side, and on the internet..... Ill try closing the console and reopening it. Attachments: Posted at 2015-06-23 by Cale reset didn't help. Here is what I get on the version:
Posted at 2015-06-23 by @gfwilliams Not sure why it said As @drazzy says it could be something with your internet connection - maybe the Web IDE couldn't load the AT module off the website sometimes? Thanks for trying the version. When you add the strings up you'd yet:
So it's not the version of the ESP8266 firmware that Espruino's driver was designed for - the one it was made for is So I guess you have two options - either you plug the ESP8266 into a USB-TTL converter and then update its firmware to the one Espruino is expecting (just google how to update it), or we can try and figure out what's not working and update the ESP8266 driver to work with it - you might not want to do that though? Posted at 2015-06-24 by Cale Ordered the USB-TTL converter and another (hopefully correct version) of the board. Posted at 2015-06-28 by Cale So I have my new ESP8266 and it is up and running. Couple problems. I'm still having problems with the "AT wasn't found". Happens way too often and I have a great internet connection. The second part is creating an access point. This works:
But this is having issues:
says this:
Posted at 2015-06-30 by @gfwilliams Interesting, thanks - I'll file a bug for it. The issue is that Try:
Posted at 2015-06-30 by Cale I think the reason for the "AT was not found" was due to the load modules from npm being turned on....... and your suggestion works! EDIT: after further testing I am still having the AT module issue. Posted at 2015-07-06 by @gfwilliams Great, glad you're getting somewhere! Not sure about the AT issue - if you download the IDE straight from GitHub then you can access the debug console in Chrome by right-clicking and doing Posted at 2015-07-29 by Cale Just a little FYI. I found that changing the original ESP8266 (ESP8266_AT_V00180902_04.bin) Baud Rate to 115200 made it much more reliable. Serial2.write("AT+CIOBAUD=115200") Posted at 2015-08-03 by @gfwilliams Ahh - very interesting - thanks for letting us know. I guess it might be worth updating the documentation on it? Annoyingly because the module doesn't know what pins TX and RX are, it can't automatically reset the baud rate on Posted at 2015-08-03 by DrAzzy Wait, so if you don't specify the pins when doing serial.setup(), and only specify the baud, it will change the pins? To what??? Posted at 2015-08-03 by @gfwilliams IIRC it changes them to the defaults (lowest numbered/ported pins capable of doing what was required). Now you mention it, I could change that behaviour so if no second argument is supplied it uses the one that was supplied last time (which is saved anyway, so the Serial port can be re-initialised when code is saved). Posted at 2015-08-03 by DrAzzy Yeah - thats what I would have assumed it did - I would have been very surprised if I ran into that behavior. IMO, as long as the serial has already been set up, and setup is called again, only options specified in the second call should be applied. Maybe you'd need serial.setup() (no arguments) to return the serial to it's default state (just like pinMode with no mode) Posted at 2015-08-04 by Cale Any idea as to why the slower baud was cause issues where the higher works fine? Is anyone else able to confirm what I am seeing? Posted at 2015-08-04 by @allObjects With a slower baud rate causing issues, my stab - without knowing any details - to anser that would be: the communication may block and prevent some interrupts or polls from the network side beeing taken care of in a timely manner. I could be totally wrong, because in a completely interrupt driven world this conclusion is very questionable. Posted at 2015-08-04 by DrAzzy I got the impression that the problem with the lower baud was related to the ESP8266 itself...? Posted at 2015-08-05 by @gfwilliams I guess it's possible there's some kind of buffer overflow in the ESP8266 itself? If data comes in over WiFi quicker than it can send it out maybe it loses some of it? Also possibly when sending from Espruino to it, data gets sent in a non-stop stream (because there's just so much it queues up) and that causes problems somehow. I haven't had time to confirm, but I know the ESP8266 with the old firmware is a bit glitchy especially when handling multiple connections. It'd be great if higher baud rates helped (and it's not totally unexpected I guess). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-06-21 by Pat
I'm not getting out of the starting blocks with this.
With this simple code
I get ..
So it looks like I am not even talking to the 8266. Cabling is Ok. I have a 47uF cap across the power lines. Cabling possibly a bit hacky, have the 8266 board attached via header cable to breadboard where the Pico is plugged in. Have checked usual shorts and that all the pins are happy. They are. And that
URXD -> Pico A2
UTXD _> Pico A3
VCC -> +3.3
GND -> GND
CH_RD -> +3.3 (is this right? permanently tied to +3.3?)
My iPhone is actually seeing a WiFi Network called ESP8266 appear when I boot, though. So I guess the module is alive. When it boots, I see a steady red led on the board, and a couple of flashes from the blue led.
Have tried 115,200 as baud rate too. Same problem.
Any ideas please ?
Thanks!
Pat
Beta Was this translation helpful? Give feedback.
All reactions