Introduction: Arduino Minecraft Server Status + Send Commands
Hi guys!
Today I show you how you can check the server status of your minecraft server. You can also send commands to your Minecraft Server.
I wish you much fun with this project! ;)
When You have questions you can leave a command.
Step 1: What Do You Need?
You need:
- An Arduino (UNO, MEGA) or Intel Galileo
- Ethernet Shield (You don't need one when you have a Intel Galileo)
- Ethernet libraries
- Spigot or Bukkit Server
- Remote Bukkit Plugin
- (An LED) (You have a LED on your Arduino which is already connected to PIN 13)
Step 2: Install Your Spigot Server
Go to this link:
Here you can see how you can install Spigot or Bukkit
If you already installed the Server you can skip this Step
Download:
https://www.spigotmc.org/
Step 3: Install and Config the RemoteBukkit Plugin
1. Go to this link and download the plugin. Link: http://dev.bukkit.org/bukkit-plugins/remotebukkit...
2. Drop the file into the plugins folder and restart your server.
3. Close your server again and open the RemoteBukkit folder in the plugin folder.
4. Open the config.yml file and delete the text inside. Copy this new text into the file:
port: 25564 verbose: true logsize: 500 users: - user: username pass: password
5. If you did that you should save the file and close the server.
Step 4: Upload You Sketch
Now you can upload my code to your arduino and connect it via ethertnet shield to the Internet.
You maybe have to install Ethernet.h and SPI.h. (Download them from github and pack them into the libraries folder)
Here is a little explanation how my sketch works:
1. You connect via RemoteBukkit to your Minecraft Server
2. Arduino trys to connect to your Server. If this isn't successful you can see this on your Serial Monitor: Setup failed!
3. The Arduino connect to your Server every 1 sec. If your server went offline the led will be off.
4. The commands will be send every x seconds.
You have to set the following lines:
1. IPAddress ip(xxx,xxx,x,xx); //Choose the IP of your Ethernet Shield
IPAddress server(xxx,xxx,x,xx); // Your Server IP (If you dont know the ip open cmd and write: ipconfig. You will find your Ip there)
2. server.properties file. Search server-ip=. There you can find your Ip.
3. Now you have to fill in your username and password from the RemoteBukkit plugin. You can change it in
your config.yml file. The standard is:
client.print("username");
client.print("password");
You have to do this again in the void loop.
4. Commands:
I have added two variables:
P: Command will be send every 25 sec
F: Command will be send every 10 sec
PLEASE DON'T USE A SLASH BEFORE YOUR COMMAND!
if (p > 25){
25 is the interval for your first command.
client.println("say 25 sec");
client.println("\r\n");
Serial.println("25 sec");
p = 0;
f = 5; This is very important! You have to set this int. You can calculate that when you take the last number of the p interval. For example when p > 25 (example sketch) You have to write: f = 5;
For example p > 32 (another example) You have to write: f = 2;
} else {
}
This command causes: 25 sec will be write in colours.
if (f > 10) {
10 is the interval for your second command.
client.println("say 10 sec");
client.println("\r\n");
Serial.println("10 sec");
f = 0;
This command causes: 10 sec will be write in colours.
6. Done! You can upload your sketch now and connect your microcontroller to the internet! ;)
Attachments
Step 5: Is It Working?
Now you can test if it works:
1. Start your server (wait until the server has completely loaded)
2. Power your Arduino
3. Wait a few seconds.....
4.1 Now your should see something like this: (Please look at the piture above)
4.2 Check if your commands working. = Join your server and wait until your command has been printed.
5.1 If it works: Congratulation! ;)
5.2 It doesn't work? Don't worry. I have a few suggestions which perhaps help you to fix the problem:
1. Is your board connected to the internet?
2. Can you join your Minecraft Server with your Computer? If not there isn't a problem with the Arduino but with
your server.
3. Maybe your server isn't running?
4. Perhaps you have a plugin which blocks the connection.
5. Maybe you have to forward this port: 25564
6. If all this suggestion don't work you can write a command and I will reply you.