I can not send program to ESP8266 module - lua

Yesterday I got ESP8266, NodeMCU v2.0. I have a problem with module. I Use Esplorer IDE. I have simple code in LUA language.
gpio.mode(4,gpio.OUTPUT)
gpio.write(4,gpio.LOW)
wifi.setmode(wifi.STATION)
wifi.sta.config("Livebox-C408","7255E6262488CC90482CE6F264")
print(wifi.sta.getip())
When I send program to ESP8266, Esplorer shows below error.
stdin:2: '=' expected near 'a'
stdin:2: ')' expected (to close '(' at line 1) near 'TATION'
Sometimes(~10%) I can send above program to ESP8266 without problem. In my opinion, ESP8266 is damaged. What do you think about my problem?
Anticipating your questions, login and password to my home wi-fi are correct.

A few things:
There's no such thing as NodeMCU v2.0. What you probably mean is v2 or 1.0. v1 was revision 0.9. See my comparison for details.
Your code is doomed to "fail" because it doesn't consider the fact that wifi.sta.config() is asynchronous i.e. it won't block until an IP address was assigned. print(wifi.sta.getip()) will eventually print nil. We have an example for a better boot sequence in the docs.
Your device most likely is not damaged.
In the ESPlorer settings tinker with the turbo and dumb modes. I have "Turbo Mode" on and "Dumb Mode" off. Futhermore, set your baud rate to 115'200.
In case you haven't done so already I strongly suggest to upgrade your firmware to a recent version. See here how to build it.

Related

ESP8266 AT+CWLAP gives generic ERROR message with no details

I have been having trouble all day learning how to enable "AT" commands for the ESP8266 module. I'm using my Arduino Uno as a bridge to my ESP8266. So my pin connections are:
ESP8266 | Arduino
-----------------------
TX | TX
RX | RX
CH_PD | 3.3V (separate battery that has common ground with arduino)
VCC | 3.3V (separate battery that has common ground with arduino)
GND | GND
GPIO0 | GND
I initially had some success with an ESP8266 Flasher that someone shared here and he provides instructions here. Essentially I use an esp8266_flasher.exe to load a ESP8266_BIN0.92.bin into my ESP module. This worked so far as in when I load up my Arduino IDE Serial Monitor, I can type the command AT and get OK response, and I can type AT+GMR and get the firmware version number. But typing AT+CWLAP after any of AT+CWMODE=1,2,3,etc.. gave a generic ERROR response, with no other details.
Has anyone else had this issue and know how to resolve it?
EDIT
I also tried a second way to resolve my AT command issues as described here: ESP8266 No response in serial monitor from official AT firmware
I know this thread ist super old but I dealt with the same question.
That AT+CWLAP returns an error without any prior connection is desired behaviour. The doc states that AT+CWLAP "[c]onnect[s] an ESP station to a targeted AP with [the] last Wi-Fi configuration." Since there is no last Wi-Fi configuration an error is returned.
Moreover if you have characters like ,, " or \ in your SSID and/or password you do have to escape them (see here). The documentation has an example.
AT+CWMODE=1 is the correct mode if you want your esp to be a client only.

Unable to burn program into NodeMCU when it's soldered to a board

I seem to have come across a strange issue. When my NodeMCU is connected onto a PCB circuit, I am unable to burn the program into it (even though the board is not powered up!). It says:
espcomm_open failed
espcomm_upload_mem failed
But the very same NodeMCU, when I pull it out of the circuit and try to upload the code works fine. Why is this?
P.S. Well, I can pull out the NodeMCU, burn the program and re-insert it, but I am trying to understand what's happening behind it.
I think your comm port is getting closed or used when you plug it into the pcb circuit. So the Arduino IDE cannot comunicate with the nodeMCU com port.
I had simmilar problems and after xxx attempts i uploaded it when the Nodemcu was unpluged from the PCB and worked perfectly.
I lately found out that the pcb used com port pin.

Status of NodeMCU for ESP32

I was looking at the docs for the dev-esp32 branch, no docs for net? But I see in the sources there's a code file that defines it? How likely is it my 8266 code will run on the latest ESP32 firmware?
Do interrupt pins configured with gpio.wake, wake it up from a dsleep? Can multiple wake-up pins be set?
I guess the question is, is this firmware still a million miles away from being substantially useful, or is it worth ordering a chip and kicking its tires now? (That no esp32 tag yet exists on SO seems like a bad sign.)
At least wifi module has been refactored in dev-esp32 branch, so it's definitely not 100% portable. Also, ticket #1612 mentions both addition of gpio.wakeup() for configuring wake-from-sleep-on-GPIO-level functionality, and that they're not attempting to be "NodeMCU for ESP8266" API compatible. Note that this is accurate at the time of writing, and everything is subject to change in the future.

starting with nodemcu/esp8266 dev board

I have a esp dev board that I've been trying to get to work, but have faild miserably. after spending a few days trying I was able to 'flash' a firmware and up load code(to connect to my wifi) via arduino IDE. the problems are when I open the serial monitor the serial monitor window is nowhere to be seen(it refuses to show up on my desktop, but if I place my mouse over arduino IDE on the task bar I can see a tiny version of the window with what seems like the esp is supposed to tell me). I verified the wifi program was working with advanced ip scanner. The other problem is that when I try to use esplorer I am told the following:
Communication with MCU..Got answer! Communication with MCU established.
AutoDetect firmware...
Can't autodetect firmware, because proper answer not received (may be unknown firmware).
Please, reset module or continue.
à‚3þÿÖ
ü
I've tried reseting via hardware and software and also saving a init.lua to the esp ( which I am told: Waiting answer from ESP - Timeout reached. Command aborted.)
Is there an easy step by step tutorial or something where I can get this thing to work in such a way that it is possible to develop with it? I dont care what language I have to use as long as I dont have to spend more time on trying to get the hardware to work. For something that is Arduino-like hardware it is significantly harder to do the simplest thing, a pic mcu is easier.es
If you are doing serious IoT thing then, I guess its better to go by Espressif IDE. There's a Freetos version also available which makes programming experience better.
To get started step by step you can check lot of videos on youtube, that's my preferred way of getting started. I found these three helpful to get started : here

HPLIP 3.13-11, A LaserJet 4/4M with a JetDirect: no workie

I'm trying to get a very old, but working great C2001A/J4100A (HP LaserJet 4) to work with the HP Linux Imaging and Printing library, but I'm having an awful time of it.
1) There's no entry in /usr/share/hplip/data/models/models.dat for [hp_laserjet_4]. This is the first problem so far when I used Bonjour discovery through an avahi.service file I put on my OpenWRT router. I don't currently have an iPhone I want it to discover with AirPrint, but this is how I started off and helps CUPS finds printers anyways.
2) SLP discovery is a complete bomb. I've traced it down to the UDP packet the JetDirect sends off in response to the broadcast discovery request. The part that is 'x-hp-p1=0' should be something like 'x-hp-p1=MFG:HP;MDL:LaserJet4;etc..' and it causes hp-probe to fail to see what printer the JetDirect is plugged into.
I can't seem to force HPLIP to bypass the bad discovery methods and it's too smart and wants to verify.
I've posted to the HPLIP help area, but they seem to run a week slow.
Instead of doing JetDirect, try LPR directly to the IP address. And any of the older PCL drivers should work against that printer.

Resources