Development Help for Door Sensing to Laptop?


#1

hey guys, a friend turned me onto Bluz. I’ve got a unique need for an art project and perhaps someone here can help develop it. Simple run down:

I have a triptych of wood panels on the wall. The left and right side panels fold over onto themselves. There is video projection onto each of the three panels of the triptych, but the video playback for the left and right panels only plays when those panels are unfolded. So I want to use a door contact to sense when the panels are open (simple closed contact) and then send that via BlueTooth to a Macbook that is running our video playback software (QLab). It would be amazing if that could work. I need the solution to be both wireless and battery powered because the wall the Triptych is mounted on has no power or ability to get wiring to it.

Can Bluz be set up this way for local Bluetooth transmission of the status of the sensors or does it have to hit the internet first?

Sorry for dumb questions - I know only enough to know this might be a cool solution.

Thanks,
Andrew


#2

Welcome!

It would certainly be possible to get that working locally, though it would also be easier to have it route through the Internet.

If you wanted to go the local approach, I would suggest looking at the open source gateway that one of our community members wrote. It hasn’t been explicitly tested on Mac, but it is node and the underlying library works on Mac I am pretty sure, so it should work. You can see it here: https://github.com/mumblepins/bluz-gateway

That could be modified pretty easily to handle our local communication protocol and then you would have a local server on the Mac that bluz would talk to which could trigger your software. Not sure if you are comfortable with node/JS, but that would be the way to do it.

If you wanted to go through the Internet, that would involve less programming, but would require an Internet connection and a gateway.

Either would work and the choice is certainly up to you.


#3

Eric, might there be someone in the community who could develop that for me?


#4

You could certainly ping the original author, or put out an offer for help. People here are usually pretty helpful. If you have some of the programming background you could try it yourself as well, it should be pretty easy to add the extra pieces you need.

It looks like the code you would need to add would just go right here: https://github.com/mumblepins/bluz-gateway/blob/master/bluz-dk-module.js#L312

So you need an extra else if to check if the last service was 4, which is for custom data. If it is, you could trigger your software.

Then on the DK side, you could just send a packet with BLE.sendData() and that would trigger the gateway: http://docs.bluz.io/reference/ble/#senddata