Interface minetest to a real world device

Gorilla
Member
 
Posts: 10
Joined: Wed Oct 16, 2013 01:39

Interface minetest to a real world device

by Gorilla » Tue Oct 22, 2013 08:32

I have been thinking about physical computing, namely do something in the virtual world and a real world device changes state and similar for the other way around. See http://en.wikipedia.org/wiki/Physical_computing for more explanation.

As an example, I'd like to use an Arduino to illuminate a LED (light) when a player punches a particular door at which point the Minetest server sends a signal via a serial port to the external advice, eg Arduino. The Arduino then toggles a light. In the real world, User may then toggle a switch which sends a signal back to the minetest server which could unlock/open the door.

Reading online, Lua can support access to peripherals such as serial ports but not sure how to "hook" into Minetest. I'd like to avoid having to recompile minetest-server if possible.

Typical Architecture could be as follows

Minetest Server -> Custom Lua Mod code -> Serial Port data -> Arduino

Server: Debian Linux "Jessie" (Currently in testing) running in a virtual machine on Windows8. I can't change this atm.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Tue Oct 22, 2013 11:41

Gorilla wrote:I have been thinking about physical computing, namely do something in the virtual world and a real world device changes state and similar for the other way around. See http://en.wikipedia.org/wiki/Physical_computing for more explanation.

As an example, I'd like to use an Arduino to illuminate a LED (light) when a player punches a particular door at which point the Minetest server sends a signal via a serial port to the external advice, eg Arduino. The Arduino then toggles a light. In the real world, User may then toggle a switch which sends a signal back to the minetest server which could unlock/open the door.

Reading online, Lua can support access to peripherals such as serial ports but not sure how to "hook" into Minetest. I'd like to avoid having to recompile minetest-server if possible.

Typical Architecture could be as follows

Minetest Server -> Custom Lua Mod code -> Serial Port data -> Arduino

Server: Debian Linux "Jessie" (Currently in testing) running in a virtual machine on Windows8. I can't change this atm.
Actually, Jeija himself made a light turn on and off (In real life) via a lever in minetest.
Last edited by Evergreen on Tue Oct 22, 2013 11:41, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Oct 22, 2013 21:45

Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Tue Oct 22, 2013 23:43

I had my arduino blink lights corresponding to actions in Minetest by just using Lua's normal file access functions to write data to the serial interface. Interfaces can be written to and read from like any other file.
An innocent kitten dies every time you top-post.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 


Return to Minetest Features

Who is online

Users browsing this forum: Bing [Bot] and 12 guests

cron