tag:blogger.com,1999:blog-3466508970473354894.post1172615539035541834..comments2024-03-05T23:38:39.420+01:00Comments on AReResearch - Andy Reischle: How to send emails via gmail from an ESP8266 running NodeMCUARehttp://www.blogger.com/profile/13473291183033725832noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-3466508970473354894.post-74605885728618551522019-01-17T14:47:53.997+01:002019-01-17T14:47:53.997+01:00Your code work ? I've always get error after c...Your code work ? I've always get error after credentials<br />Got a response: <br />250 smtp.gmail.com at your service<br /><br />Got a response: AUTH LOGIN<br />334 VXNlcm5hbWU6<br /><br />Got a response: (LOGIN base64 encoded)<br />334 UGFzc3dvcmQ6<br /><br />Got a response: (PASSWORD base64 encoded)<br />535-5.7.8 Username and Password not accepted. Learn more at<br />Anonymoushttps://www.blogger.com/profile/08778329833153063817noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-13674419185615787492017-03-27T10:43:14.399+02:002017-03-27T10:43:14.399+02:00My code is admittedly pretty poorly written. I als...My code is admittedly pretty poorly written. I also had problems with it. I think it takes a complete re-write to get more efficient, ressource-saving code.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-82298430623533041522017-03-20T04:40:38.316+01:002017-03-20T04:40:38.316+01:00I was wondering if anyone has any idea how much he...I was wondering if anyone has any idea how much heap it takes to run this? I was able to take Andreas' code and modify to get to work in my situation. It works (I get the email message) if I estart NodeMCU and run it almost by itself starting with about 42000 heap available. But if I keep updating heap rapidly as this runs heap can get as low as 18000. It makes it hard/impossible to run much else on the module. I'm guessing it has to do with all the data coming at the connection time, but just a guess. Is this what anyone else has seen?Benhttps://www.blogger.com/profile/12143140963531475996noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-18001556760789181622017-02-10T17:50:49.103+01:002017-02-10T17:50:49.103+01:00POP3 would be for receiving mail. Miguel's ori...POP3 would be for receiving mail. Miguel's original script was for sending via generic, unencrypted SMTP servers and can still be found here: https://github.com/AllAboutEE/nodemcu-firmware/blob/dev/lua_examples/email/send_email_smtp.lua<br /><br />Hope that helps.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-18804055093375388562017-02-09T14:11:51.612+01:002017-02-09T14:11:51.612+01:00Hi Andreas, I was wondering if there are any new a...Hi Andreas, I was wondering if there are any new advances in sending emails from POP3 or gamil yet ?Anonymoushttps://www.blogger.com/profile/16687652360699050870noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-74999030983260925282016-12-01T14:12:48.928+01:002016-12-01T14:12:48.928+01:00Hi Andreas,
I'm trying to send Gmails but not...Hi Andreas, <br />I'm trying to send Gmails but nothing happens.<br />This is the error:<br /><br />PANIC: unprotected error in call to Lua API (SendGMAIL.lua:75: attempt to concatenate upvalue '?' (a nil value))<br /><br />And those are the rows:<br /><br />71 local message = string.gsub(<br />72 "From: \"".. MY_EMAIL .."\"<"..MY_EMAIL..">\r\n" ..<br />73 "To: \"".. mail_to .. "\"<".. mail_to..">\r\n"..<br />74 "Subject: ".. email_subject .. "\r\n\r\n" ..<br />75 email_body,"\r\n.\r\n","")<br /><br />My Lua is:<br /><br />NodeMCU custom build by frightanic.com<br /> branch: dev<br /> commit: 016f289f315a6caf01509d83ec31bc9dd900835b<br /> SSL: true<br /> modules: adc,crypto,file,gpio,http,i2c,net,node,tmr,uart,wifi<br /> build built on: 2016-11-30 18:08<br /> powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)<br /><br />So , what's wrong?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/09743119366728933355noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-41704775710884137012016-12-01T12:30:38.175+01:002016-12-01T12:30:38.175+01:00Hi Andreas,
I receive always the same error
PAN...Hi Andreas, <br />I receive always the same error <br /><br />PANIC: unprotected error in call to Lua API (SendGMAIL.lua:75: attempt to concatenate upvalue '?' (a nil value))<br /><br />The lines are:<br /> local message = string.gsub(<br /> "From: \"".. MY_EMAIL .."\"<"..MY_EMAIL..">\r\n" ..<br /> "To: \"".. mail_to .. "\"<".. mail_to..">\r\n"..<br /> "Subject: ".. email_subject .. "\r\n\r\n" ..<br /> email_body,"\r\n.\r\n","")<br /><br />My LUA version is:<br /><br />NodeMCU custom build by frightanic.com<br /> branch: dev<br /> commit: 016f289f315a6caf01509d83ec31bc9dd900835b<br /> SSL: true<br /> modules: adc,crypto,file,gpio,http,i2c,net,node,tmr,uart,wifi<br /> build built on: 2016-11-30 18:08<br /> powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)<br /><br /><br />So what's wrong?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/09743119366728933355noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-73566944967896189022016-11-08T08:37:54.987+01:002016-11-08T08:37:54.987+01:00I'll look over this, thanks alot.I'll look over this, thanks alot.ymhttps://www.blogger.com/profile/10763132344295055054noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-62567466699029413512016-11-08T08:04:40.038+01:002016-11-08T08:04:40.038+01:00The traditional, simple way to obfuscate passwords...The traditional, simple way to obfuscate passwords is to XOR them with a string. There is a NodeMCU / LUA example here:<br />http://stackoverflow.com/questions/34243734/how-to-prevent-wifi-password-from-being-leaked-from-lua-codeARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-66085566654734779612016-11-01T18:01:23.518+01:002016-11-01T18:01:23.518+01:00Hi Andreas,
It definitely works quite well !!!!
...Hi Andreas, <br /><br />It definitely works quite well !!!!<br />The mods you made to have the script usable on Gmail SSL SMTP works 100%.<br /><br />Now, I would like to find a ***simple*** an easy way to hide "somehow" the two following variables :<br /> local EMAIL_PASSWORD = "xxxxxxxx" <br /> local SSID_PASSWORD = "yyyyyyyyyyyyy" <br /><br />I know there is no 100%-safe way to do that in a Lua script (well, that's what I read) but maybe you would have a clue to make it ***a bit*** safer within the script as well as when it runs (big-ear proof) ...<br /><br />Thanks.ymhttps://www.blogger.com/profile/10763132344295055054noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-77202716399300690322016-11-01T09:55:54.959+01:002016-11-01T09:55:54.959+01:00The following python commands ***DO*** work everyt...The following python commands ***DO*** work everytime, at least on ESP12E MCU boards :<br />esptool.py --port erase_flash<br />esptool.py --port write_flash -fm dio -fs 32m 0x00000 .bin 0x3fc000 esp_init_data_default.bin<br />---<br />I spent nights and days before I could understand that I had to flash again the esp_init_data_default.bin along with a custom-built FW !!<br /><br />Espressif changes the init data block (esp_init_data_default.bin) for their devices along the way with the SDK. So things break when a NodeMCU firmware with a certain SDK is flashed to a module which contains init data from a different SDK. <br /><br />ymhttps://www.blogger.com/profile/10763132344295055054noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-17360021584119850602016-11-01T00:25:38.233+01:002016-11-01T00:25:38.233+01:00Very interesting. I was not aware of that and reso...Very interesting. I was not aware of that and resorted to flashing AT-Firmware before re-flashing NodeMCU. But you pointed to a much cleaner solution. Thanks!ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-55432240033433435772016-10-31T18:24:02.970+01:002016-10-31T18:24:02.970+01:00Hi,
Following my previous post, I have finally sol...Hi,<br />Following my previous post, I have finally solved my ESP8266 'custom build' problems (thanks to Marcel Stör here >>> http://stackoverflow.com/questions/38789491 ).<br />Now that I have installed on my ESP12E the proper FW (with the right biolt-in modules), I'll be soon able to test your SMTP Lua script !<br />I'll post follow-ups here ...<br />ymhttps://www.blogger.com/profile/10763132344295055054noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-39115257777080572892016-10-30T17:26:54.857+01:002016-10-30T17:26:54.857+01:00Hello Andreas,
I am facing problems with custom b...Hello Andreas,<br /><br />I am facing problems with custom builds for my ESP12E 4MB WIFI board.<br /><br />Needless to say that it works quite right with older releases like nodemcu_integer_0.9.6-dev_20150704.bin but everytime I need to flash a custom build, it desperately fails ...<br /><br />In some cases, the board is just like dead, wheras in other cases, the blue LED keeps blinking fast and the ESP keeps sending rubbish data to the ESPLORER whatever the selected speed (I tried all speeds from 2400bds up to 115200bds).<br /><br />I am now quite lost with these custom builds but I really need to use them for I want to include modules like adc,crypto,file,gpio,http,i2c,net,node,tmr,u8g,uart,wifi as suggested in this blog !<br /><br />I have carefully read the recommended upgrade notes like erasing my board before flashing (esptool.py --port com2 erase_flash) but I must confess that I did not understand this part :<br />Also verify that you are using an up-to-date NodeMCU release, as some early releases of NodeMCU 1.5.4.1 did not write the SDK init data to a freshly erased chip.<br /><br />What would you suggest me to try ?<br /><br />Thanksymhttps://www.blogger.com/profile/10763132344295055054noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-57213027540098771772016-10-23T23:31:50.245+02:002016-10-23T23:31:50.245+02:00Unless the float version has no SSL-Support built ...Unless the float version has no SSL-Support built in, I don't know. I hardly ever use float in my projects.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-15497076432202162872016-10-23T23:03:19.336+02:002016-10-23T23:03:19.336+02:00Hi,
I've been working with this code for some...Hi,<br /><br />I've been working with this code for some days. Today, out of the blue, the SMTP server didn't accept the authentication anymore. After some try and error I had to figure out that it was the fact that I had installed a float firmware in the meantime. Changing back to the integer firmware, everything was fine again. Any ideas or suggestions?<br /><br />Best regards<br /><br />Heribert Heriberthttps://www.blogger.com/profile/01984389018356515795noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-87134736504376711512016-09-08T11:47:11.072+02:002016-09-08T11:47:11.072+02:00Great to hear it works for you. About including a ...Great to hear it works for you. About including a library module: Have a look at the example here: http://www.electrodragon.com/w/ESP8266_NodeMCU_Lua<br />But I never tried that myself.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-31744034746015814552016-08-28T21:01:59.354+02:002016-08-28T21:01:59.354+02:00Success report ! I was able to use this code to su...Success report ! I was able to use this code to successfully send email from both a esp8266-01 and from a -12e Devkit (in spite of warnings the -01 might not have enough memory) The key for me was adding,in addition to the new build at 0x0000), the esp_init_data_default.bin at 0x3fc000. Initially after a flash I was getting the esp8266 led flashing rapidly outputing error code on 74880 baud via the Lua Loader serial output. Then I did a flash with the new firmware at 0x0000 and esp_init_data_default.bin at 0x3fc000. same result. Then, after another flash with just the esp_init_data_default.bin at 0x3fc000 again, it worked. (For the custom build, I checked the SSL box in below the main selections). BTW, does anyone know how to load a library module that is referenced by "require()" ?<br />CurtToolmanhttps://www.blogger.com/profile/10927945810944680872noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-62629589530646727582016-08-25T19:08:37.249+02:002016-08-25T19:08:37.249+02:00Did you check "Miscellaneous options/ SSL sup...Did you check "Miscellaneous options/ SSL support" when requesting you custom build ? I am getting looping boot info about cksum after flashing.<br />Thanks,<br />CurtToolmanhttps://www.blogger.com/profile/10927945810944680872noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-49801742958854224842016-07-03T22:12:00.286+02:002016-07-03T22:12:00.286+02:00Thanks, that is great info. I'll try if I can ...Thanks, that is great info. I'll try if I can replicate that.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-341734194633609802016-07-03T15:13:35.887+02:002016-07-03T15:13:35.887+02:00Hi,
I used some of your code in one of my project...Hi,<br /><br />I used some of your code in one of my projects. You mention something about socket callbacks in the comments but just say that it didn't work past 3. I tried moving the do_next() to the display function, and it worked perfectly. It now takes 1 second to send my email rather than the 45 seconds or so that it took before. I'm not sure if this is what you tried and it didn't work on earlier firmwares or if you were doing something else. I would be interested to know.Anonymoushttps://www.blogger.com/profile/17222868554581403980noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-88975571054313224302016-06-22T13:03:59.018+02:002016-06-22T13:03:59.018+02:00That sounds like the "function send_email(sub...That sounds like the "function send_email(subject,body)" is started. But it never gets to the point where it starts transmitting anything and "function connected(sck)" is never called. That can only be when the TCP connection to "smtp.gmail.com" on port 465 fails.<br />Try if you can telnet to that port from your PC. Also: replace smtp.gmail.com with the IP 173.194.200.108 to eliminate DNS issues.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-21298409155723007822016-06-22T01:09:31.264+02:002016-06-22T01:09:31.264+02:00Hi,
I tried this and all I get is
Sending start...Hi,<br /><br />I tried this and all I get is <br /><br />Sending started...<br />Open Connection<br /><br />any ideas?<br />Anonymoushttps://www.blogger.com/profile/01040278848832011281noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-67487122477715443722016-06-22T01:08:32.249+02:002016-06-22T01:08:32.249+02:00Hi, I upload this to the NodeMCU and all I get is
...Hi, I upload this to the NodeMCU and all I get is<br /><br />Sending started...<br />Open Connection<br /><br />Does not even appear to start sending...<br /><br />Any ideas?Anonymoushttps://www.blogger.com/profile/01040278848832011281noreply@blogger.comtag:blogger.com,1999:blog-3466508970473354894.post-18210804885384580222016-05-18T09:12:47.727+02:002016-05-18T09:12:47.727+02:00As the message suggests, it might be a DNS issue. ...As the message suggests, it might be a DNS issue. Use "173.194.200.108" in the SMTP_SERVER variable. That should eliminate the need for DNS. I haven't tried that, though.ARehttps://www.blogger.com/profile/13473291183033725832noreply@blogger.com