Post your best Lua script examples here

User avatar
By Quindor
#6151
VasilijHCN wrote:Hi, first thank U for sharing.
I try to move this to esp-03 to control RGB LED strip, code works but wery incorrect - only one pin(LED1)controllable, other pins fail pwm (console show correct debug, but no reaction from other pwm pins)
Now all 3 channels working great, code corrected, using esp-03 pins 0, 14, 12 = pwm(3), pwm(5), pwm(6).
Now searching tcp app for android with slider, to control rgb strip easy.

Hey, good to hear you got it working. If you move it to a different module you need to take into account the different pin mappings, then it should work (as you did I presume).

Also good work in making a third channel, that should work without a problem!

If you wish to integrate it with a Domotica system you can check my blog, but running it from a TCP app on your smartphone also sounds cool, the code and 'protocol' is kind of self written but if you find one, please let us know!
User avatar
By VasilijHCN
#6170 About Android app.
At this moment I use Wifi tcp controller,i found one with rgb sliders available, but arduino controller send data in get http:// format
https://play.google.com/store/apps/deta ... trollerPro
Our corse this prog give incorrect control results.
Also i founs TCP/UDP RGB controller with tree sliders, but... prog send data in rgb format, for using it we need change code.
Image
Attachments
2015-01-03-12-56-39.png
Arduino controller pro
2015-01-03-12-56-56.png
Wifi tcp
User avatar
By thifi
#6337 Hello Quindor,
thank you for your tutorial.
I have a problem with your LED Dimmer on my esp8266.
After programming the init.lua and a restart there is a normal identification of the System:
Code: Select allBooted to QuinLED_ESP8266_V0.4

When I send the command
Code: Select allecho LED1_target=1000 | nc 192.168.11.163 43333

via putty I get the following error:

Code: Select all> Input:echo LED1_target=1000 | nc 192.168.11.163 43333
PANIC: unprotected error in call to Lua API (init.lua:35: attempt to concatenate global 'LED1_target' (a nil value))
PANIC: unprotected error in call to Lua API (attempt to call a string value)
c_ÇÏSöfJSúJSúfî…C…NodeMcu 0.9.4 build 20141230  powered by Lua 5.1.4
Booted to QuinLED_ESP8266_V0.4


and the esp is restarting.
I testet the init.lua file several times, but I could not find any difference to your tutorial.
Can you give me a hint for solving the problem please?

Many greetings from germany and a Happy New Year.
Thifi
User avatar
By thifi
#6378 Sorry for my question, I have found my misstake by myself. I have to send the
echo LED1_target=1000 | nc 192.168.11.163 43333
without the echo.... only LED1_target=1000
Now it works perfect for me.
Thank you so much.


Greetings
Thifi