Post your best Lua script examples here

User avatar
By chaz393
#23889 I am a newbie when it comes to doing web stuff. I have been building electronic projects my whole life but I don't have much experience with web stuff. Basically here's what's going on. I have some network security cameras and I want to build an external PIR based motion sensor. The software I am using to monitor the cameras allows me to send commands to start recording and other functions by HTTP GET (I think I am saying that correctly). So the idea is to connect a PIR sensor to this module and then when it detects motion, call that URL and have it start recording. I have been trying everything I can find on the internet for hours now and I am just so out of my element here that I can't figure it out. Anyone have any advice on how to do this? Thanks!
User avatar
By TerryE
#24144 This is a pretty open Q, so I can't give a specific example, other than do your research. There are various communities out there which could help, but IMO the ESP8266 one is at the hacker extreme, so it might not be a good place to start if you have a big learning curve. IMO, something like the RaspberryPi would be a better place to start, as the community there is a lot larger and they have lots of help for hobbyists new to web technologies, etc. and you won't have to worry about issues like making your application work in 20kB RAM.

The ESP8266 is a good second target if you want to repackage this in a low cost small form factor. The H/W costs will be smaller but the development challenges a lot greater.
User avatar
By chaz393
#24176
TerryE wrote:This is a pretty open Q, so I can't give a specific example, other than do your research. There are various communities out there which could help, but IMO the ESP8266 one is at the hacker extreme, so it might not be a good place to start if you have a big learning curve. IMO, something like the RaspberryPi would be a better place to start, as the community there is a lot larger and they have lots of help for hobbyists new to web technologies, etc. and you won't have to worry about issues like making your application work in 20kB RAM.

The ESP8266 is a good second target if you want to repackage this in a low cost small form factor. The H/W costs will be smaller but the development challenges a lot greater.


I appreciate your response but I actually managed to figure it out. It turns out I was doing it right, but there were some lines in the request that were causing the server to not recognize the command I was sending. I also may have made it sound like I was more of a noob than I actually am. I have done a decent amount of work on websites and understand it pretty well. I was just doubting myself a lot when I couldn't get this to work. Lua is very different than arduino code, but my first programming language that I learned was Visual Basic, which is very similar to Lua. Again, thank you for your response, I might check out the other sites too in the future.