return codes for luup.inet.wget from arduino

Well… I need help with my arduino project. I was looking to have my arduino with a wifi shield control my LED lights on my aquarium. I can have my lights respond to virtual switch (a server on the arduino) just fine, but wanted the arduino to ask Vera what the lights status should be on startup (a client). There is a bug with the wifi shield that does not allow both a client and server to run. Kind of a bummer.

What I am looking for is a way to respond to a luup.inet.wget for the return of http Status Code (Number), content (String). Is it a HTTP return? What’s the format?

I believe if I can at least respond with this, I can then have Vera run on a schedule (every min) and the response will be the communication back that I need… I think. Any thoughts?

It’s standard HTTP.

200 OK
Content-Type: text/plain
Content-Length: 6

String

200 will be the status code, and the content is “String”.

Assuming (this isn’t clear on reading your post) that the Arduino is the HTTP server and that your LEDs are connected to the Arduino.

Thanks futzle! Your assumptions are correct. I am using the arduino with a WiFi shield to setup the server to control my lighting rig with PWM. More functions will be coming later.

I do now have the response coming back from the arduino and storing them in a virtual switch, but think I need to dive into making a device so I can have better status and more control.

I have been studying one of your posts from a couple of years ago ( it is titled “need help for http post and lua lib”) and you refer to “Create a new device (MiOS developers > Create Device).” I am assuming that this use to be on MiOS’s web? I am trying to find this, with out much luck.

I will continue to follow the walk through that Mi Casa Verde provides, including the Luup Plugins By Hand.

Any pointers, hints, tricks would be greatly appreciated!

On UI5 it’s Apps > Develop Apps > Create Device. Yes, eventually you will have to make a proper plugin for your project.

Ah, yes. I see now, it is for when I actually have my device built. Also, since I am controlling more than one string of LED’s with my device, it looks like I will need my own D_…json file to describe it.

I think I have a bit of a learning curve ahead of me. Nothing like learning a few new languages to keep me out of the wife’s hair. :wink: