Problems getting started (flashing) w NodeMCU /ESP8266

If doesn't fit into any other category ....
Eloclegin
Posts: 33
Joined: Fri Dec 09, 2022 5:04 pm
Has thanked: 17 times
Been thanked: 7 times

Problems getting started (flashing) w NodeMCU /ESP8266

Post by Eloclegin »

Can any of you young geniuses help out a retired old timer?!

Background
Having seen the "Annex Wifi RDS" google site pages showing BASIC running on an ESP8266 I am very motivated to implement this module. My objective, to pull data from another project via its I2c interface and then to send this data via email over wifi. The ESP8266 modules look ideal for doing this task.

The problem…
I purchased some Amica NodeMCU modules (2 photos attached) but I cannot communicate with them!

What I have tried
Initially i tried via browser by connecting to their default transmitted Wifi (FaryLink-XXX) and then I am browsing 192.168.4.1. I have even scanned IP and looked for all ports. However I am unable to get any response. Browser just says Server not responding. Tried different PCs and different browsers.

So next I try to connect via various Flash programmers with USB connection onto module. I have tried both the Annex-WIFI Toolkit flasher and the NodeMCU flasher from NodeMCU Dev Kit (also tried Arduino IDE 2_0_3 although I dont see how to add the correct board on the latter so not fully explored that option). In all these cases there seems no serial comms when I connect cable from the module to the PC USB port. PC does not do anything when I plug in the Amica NodeMCU module. PC does not assign any COM port. Flasher progs just sit there "waiting for MAC". I have tried various sequences of the modules RESET and FLASH buttons but nothing seems to enable comms to the PC. I believe these flashers should automatically pull GPIO0 pin LOW as required, but I am not even achieving any basic serial connection w PC.

I downloaded and installed the driver CP2102 onto my PC. But has not made any difference.

So I am stuck.
I seek help in either (A) finding a way to talk to (read, and flash) these Amica NodeMCU modules or else (B) maybe someone can point me to an alternative ESP8266 module that will be easier to communicate with and flash. Bear in mind my objective was to load ESP8266 BASIC.

Thank you in advance to anyone who can get an old timer on their way!
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 852
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 273 times
Been thanked: 321 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by Electroguard »

Hello Eloclegin, welcome to Annex.
Thank you for the very informative info about what you have tried, that helps a lot.
In the first instance, the esp device has to be 'flashed' via its serial ports, which may also be accessible via a USB port if it has one.
If it does not have a USB port, or the computer being used does not have the correct drivers installed to allow it to 'see' the USB port, then it must be flashed manually by using a serial UART cross-connected to the esp devices serial pins after booting the esp device into 'flashing mode' by shorting the esp's gpio0 to ground while switching on.

If you are using windows, and it has correct device drivers installed that recognises the esp device, it should automatically assign it a com port number.
If not, then you must flash it using a serial UART.
In either case, the computer must have drivers for the appropriate serial interface (UART) used by the device being plugged in to the USB port, the most widely recognised being CH340.

So I would suggest you get a CH340 UART which 'in a pinch' would allow you to manually flash any esp8266 devices if needed, including your existing ones. Here is an example ch340 UART:
https://www.aliexpress.com/item/3280930 ... zmihTFRt4


But seeing as you will have to wait for it to arrive, you might want to order yourself a couple of Wemos D1 Mini esp8266 while you are at it.
These use ch340...
https://www.aliexpress.com/item/1005004 ... 789825_6

And perhaps a wemos d1 mini tripler board.
https://www.aliexpress.com/item/3291002 ... s9HXJvVlY
Depending on what you plan on doing with the project, you might also want to consider a wemos d1 mini plugin relay module, a dc power module, button module, and any other of the many wemos d1 mini foorprint plugins which might take your fancy.
https://www.aliexpress.com/item/3264808 ... 782%21rec
If you do a search on Aliexpress for "wemos d1 mini sheild" you could be browsing for ages.

I specifically mentioned the tripler base because it would allow you to plug in the 2 esp8266's side by side for communicating with each other, cutting any tracks you don't want connected in common (such as cross-linked tx and rx). It would also allow plugging in a dc power module allowing the project to be run from any mains adapter or other DC source from 6v to 24v. The button module could plug in to either esp8266 to offer user control if needed, and likewise the relay module.
User avatar
PeterN
Posts: 384
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 177 times
Been thanked: 214 times
Contact:

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by PeterN »

Hello Eloclegin
Just to mention one of the last possible causes for your problem:
Did you test with another USB cable, because there are also "USB" cables that are only for power supply?
I see on your micro USB connector a suspicious "lightning" sign , but not the USB signet.

Good luck
Peter
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by Fernando Perez »

Almost certainly your problem is, as PeterN says, that the USB cable is only for charging batteries, not for data transfer.
Make sure of this by connecting your module to the computer: in the "Device Manager" it should appear as a COM port.
(Help at https://www.myrapidq.it/magazine/drive.html)
I have recently received a couple of ESP32 modules from the same brand and I have noticed that in order for communication to start, either with cicciocb's flasher or with the Arduino IDE, you need to PRESS AND HOLD the little "FLASH" button. module until communication is established. When the communication starts, you can release it.
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 124 times
Been thanked: 132 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by AndyGadget »

As others have said, you need to be able to see the NodeMCU board a a COM port first, but once you have achieved that, this looks like one of the older style boards where you have to manually hold the flash button (which grounds GPIO0) whilst programming takes place. Here are the instructions I posted in an Amazon review for that type of board some time ago.

TO FLASH THE MODULE :-
Connect to USB serial port.
Press and hold FLASH.
Press and release RST.
Start the flash download
Release FLASH.
Wait for download completion.
Power-cycle the module.
Eloclegin
Posts: 33
Joined: Fri Dec 09, 2022 5:04 pm
Has thanked: 17 times
Been thanked: 7 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by Eloclegin »

Thank you so much for all your replies. How simple and embarrassing! It was indeed the micro-usb cable. I had already thought of that and I had already tried 3 different cables but obviously all were power only type!! Only with the 5th cable does it finally connect.

I can now READ the module, I can FLASH FIRMWARE (green button) only. I can Flash FIRMWARE and DATA (yellow) with success. (But i did not understand what was in the DATA, I just selected the Yellow button)

After completing Yellow button Flash…
I then reboot module and see the module connects onto my home wifi network at my chosen IP. 192.168.1.100 (per all the Router Info that I enter at start of Yellow flash)

I browse there with my browser and I see the Editor.
I load an example .BAS and it runs ok. Great
So I think I am all ready to roll… BUT….

DATA AREA
I dont really understand what is in the DATA area. Nor how one defines what is used there.
I don't understand SPIFFS

FOLDERS
I also dont yet understand the local folder structure. Presumably the BUILD folder is the location that holds the firmware to be flashed? It is just placed there at this default location, rather than being a selected filename and loaded into prog before flashing?
And the DATA folder is presumably where various .BAS progs will sit, including the examples and my own code?

Would anyone be able to give me a few words of background here, walking around all this stuff, so I understand better the ecosystem I am working within.

A big thank you for your kind assistance getting me started. This is a very patient, helpful and friendly forum.
Eloclegin
Posts: 33
Joined: Fri Dec 09, 2022 5:04 pm
Has thanked: 17 times
Been thanked: 7 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by Eloclegin »

Forget my request.. I have just found there are a lot of background description pages in the practical tutorials in the Annex Wifi pages. This is very helpful to newbies like me. So i can get my backgrounding and better understanding of the ecosystem from there

However if anyone can point to a code example for SENDING GMAIL that would be useful. I am nervous that it is not going to be simple smtp commands but that I am going to get tied up due to SSL certificates and authentication.

Thanks again. All best
bugs
Posts: 142
Joined: Mon Feb 08, 2021 10:10 pm
Location: Scotland
Has thanked: 47 times
Been thanked: 50 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by bugs »

Hi,
You seem to be progressing speedily...
Google mail has become a bit more difficult recently with their "untrusted" device paranoia.
The Annex part is fairly easy - this should work if you have got the right info from google.
xxxxx in line 1 is first part of your gmail address.
jleoiwgdlgptdify in line 1 is the sort of string you have to obtain from your google account page google
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
[Local Link Removed for Guests]

Code: [Local Link Removed for Guests]

email.setup"smtp.gmail.com", 465,"xxxxx","jleoiwgdlgptdify",1

msg$="Test999"

 r = 0
 subject$ = "ESP8266 message " + Date$
 r = EMAIL("fredbloggs@somewhere.com", "someone@gmail.com", subject$, msg$)
  If r = 1 Then  'it worked
    Print
    Print "Email sent on "; Date$; " at "; Time$
  Else
    Print
    Print "Email failed r="; r; " on "; Date$; " at "; Time$
  End If

User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by Fernando Perez »

Like Gmail, Yahoo allows you to send emails but using a password generated in "Yahoo Mail, Account Security option, application password section."
But I have realized that there is a problem: The mail is sent and received correctly, but with the text of the message blank.
I have taken into account the matter of the colon and of not including conflicting characters in the body of the message, but without results.
I know that this is not the appropriate section to raise this issue, but can you check it? If it's resolved, I'll take care of opening an entry in "Troubleshooting".

Another thing: Bugs, the link you put leads to a message "The requested page could not be found."
bugs
Posts: 142
Joined: Mon Feb 08, 2021 10:10 pm
Location: Scotland
Has thanked: 47 times
Been thanked: 50 times

Re: Problems getting started (flashing) w NodeMCU /ESP8266

Post by bugs »

Another thing: Bugs, the link you put leads to a message "The requested page could not be found."
Very strange - you are right - seems to be something peculiar to this forum since right clicking the link and opening new browser tab goes to the correct url.
Trying again without using the forum link:-myaccount.google.com/lesssecureapps
Post Reply