Git Product home page Git Product logo

mcserver-raspberrygpio's Introduction

MCserver-RaspberryGPIO

Plugin for the MCserver to control Raspberry Pi's GPIO from Minecraft. If you want to add some code or make it better in any way, I would be most grateful! You can see it working at http://www.youtube.com/watch?v=Y1ErAeNBC_0.

Installation: 1) Install MCserver (http://mc-server.org) on your Raspberry Pi. I had to build it manually, otherwise it gave me a SegFault after start - it takes about an hour to build (or you can use distributed build like distcc). Note: This problem went away with newer MCserver releases.

a) The Lua version. Download the GPIO.so module from the "Lua only" subfolder and put it into /usr/local/lib/lua/5.1/ (if you have other version of Lua, change the path accordingly). -if this doesn't work for some reason, try building it yourself (takes about five minutes): http://www.andre-simon.de/doku/rpi_gpio_lua/en/rpi_gpio_lua.php just watch out, as in the Makefile for it there is an old version of the Python lib linked, so you need to change that for it to work

b) The Lua and C-module version. --Note: This is probably outdated with the new versions of MCserver and will not be maintained. I rewrote some of slower functions into C to make it a bit faster, but I think it is even slower (probably because of the C to Lua interface dragging it down). To use it, download the MCmodule.so from the "Lua with static C module" subfolder and put it into the folder described above. To build it, download the main.c from "/Lua with static C module/C module source/" subfolder and build it with the instructions included. You also need the WiringPi library installed (http://wiringpi.com/download-and-install/)!

Edit the settings.ini in your MCserver directory. Add "Plugin=RasPiGPIO" line somewhere in the "[Plugins]" section to load the lua file.

Copy the files from the desired "Plugins" folder into your MCserver Plugins folder. The path should be like this: MCserver/Plugins/RasPiGPIO/*.lua where * is main, arbitrary, blockHandler (only required if you use the Lua only) and CoreMessaging (not sure if required).

Launch with "sudo ./MCServer" and enjoy!


In-game usage: The script remembers last placed block (only for certain types) or you can "mark" any block by using a golden showel on the block. Than write "/assignlast [IN]", where IN is optional flag for inputs. Now only works with: -lever -stone/wooden button -redstone torch -redstone lamp (as both input and output). But new blocks can be easily added by some basic editing of the Lua scripts or the C source. Note: levers as inputs are bugged for some reason - after being in the ON state, the redstone near the lever stays activated no matter what.

For the infosigns place a sign and write "/TEMP", "/CPU", or "/RAM" on the first line and see what happens! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.