Bringing Star Trek to life: LCARS home automation with Arduino and Raspberry Pihttp://adafru.it/b100872
This LCARS home automation from YouTube user boltszmann138 a trekkies dream come true!
…I came to the conclusion that QT works fine for me. There are two programms running:
First, there is “ha_interface” on the raspberry which on the one hand connects to the arduino via usb and provides a tcp server for clients on the other hand. Clients can request sensor values by sending “request:sensortype:sensorid” over a simple QTcpSocket. If the arduino sends an interrupt (for example: reed contact 1 is now open), ha_interface sends a broadcast message like “broadcast:reed1:opened” to all connected clients. Parsing of these commands can easily be done via the QString::split(“:”) function. The biggest problem was: I dont want the clients to poll for the reed contact state, since they change very seldom. On the other hand, I didnt want to miss that event. So I had to find a way how recognize an interrupt (by emitting a signal) in the serial usb connection. This gave me the answer: http://www.webalice.it/fede.tft/seria
… (part 5) and http://fedetft.wordpress.com/2010/04/
… . Several connected clients can talk to each other via the interface and share for example their local “red alert on” or “system locked” bool variables.Read more