Post your best Lua script examples here

User avatar
By dpwhittaker
#9354 I was about to post a "Me too! Please help!" after banging my head against the wall on this bug for a few days... I was getting the same issue with only the first net.socket:send working. It turns out it was fixed in the next firmware after you have (and I had until I figured out how to flash correctly): see viewtopic.php?f=18&t=1160.

Either way, the error ended up being me not understanding how to use nodemcu-flasher. I kept copying files into the same folder with it and renaming them to nodemcu_512k.bin like some sites were suggesting (apparently that is how it used to work), but it just kept reflashing the 20150105 version (with the socket send bug), because that is the version stored internally in the flasher. Instead, you should follow the instructions here: https://github.com/nodemcu/nodemcu-flasher under setting your own firmware. Click the top gear icon and choose the nodemcu_latest.bin you downloaded from here: https://github.com/nodemcu/nodemcu-firm ... n?raw=true and blank out and clear the x on the other entries. Now you are really flashing the latest version.

Maybe everyone else in the world has already figured this out, but if not, maybe it will help someone.
User avatar
By andmpo
#9822 Couldn't get it to work with the latest version of nodemcu (nodemcu_20150212). It restart after executing the file. There is a newer version of the script that is not on github?
User avatar
By dpwhittaker
#9838 20150126 is the latest version I got it working on. I haven't tried the Feb versions.

I saw in some thread that the Feb versions have floating point turned on and that is taking a lot of heap. People were having good success building the source with floating point off.
User avatar
By zioax
#9913 I receive "not enough message" after the boot! I have only those 3 files..why?
EDIT:
I downgrade to 20150126 version and now it work..please update code for new fw version! Thanks :D
P.S. Is possible to passing a value from another script, for example return a constant value from temperature sensor that use another script?