Jump to content




== WiRe == (Redstone Master Control for your base)

lua wireless utility

117 replies to this topic

#1 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 21 May 2014 - 12:20 AM

WiRe is a server/client system for controlling redstone output. It is focused on controlling doors, hatches, bridges, barriers, etc (e.g. pistons, MFFS mod, Light Bridges and Doors mod) but can control anything that operates on a redstone signal (e.g. redstone lights, machines, etc.). The server is the 'control center', capable of managing up to 20 clients (per server) all from a touchscreen monitor. Each client controls one door/hatch/etc. and reports its status to the server wirelessly or via wired network.

Please note: WiRe is NOT compatible with ComputerCraft 1.74 or ComputerCraftEdu 1.74 or the combined CC/CCEdu 1.74 jar. This includes modpacks that use these versions [e.g. Tekkit Legends]

WiRe Server monitor (control center)
Attached Image: WiRe Server Mon.png

- Each server manages a single 'network' of clients (network group/color is selected during setup). This allows you to have one server control public doors, while another controls private doors, another controls bridges, etc. Due to monitor array size limitations (8 monitors wide), each server should be limited to 20 clients.
- Any client can be opened/closed/activated/deactivated, locked and unlocked from the server.
- Any client that is locked will not operate until it is unlocked at the server (wood/iron doors, although locked, will still open with a redstone signal - there is no way around this).
- The server can also lock or unlock all clients simultaneously with a single touch.
- Clients can support multiple monitors, allowing door/hatch/etc. control from both sides.
- Pressing 'F1' in the client or server terminal screen will display basic help
- Pressing 'q' in the client or server terminal screen will gracefully exit the client or server

This was inspired by a system I made quite awhile ago for a base I had in FTB Ultimate. I was new to Lua then and the system was quite buggy and temperamental...it also was 'mission specific' - trying to use the system in another base wasn't worth the trouble. I've wanted that level of control in my newer bases so I decided to revisit the idea, and WiRe is the result.

WiRe is designed to be relatively flexible - to achieve that, the client asks about 8 questions during setup (the server asks 4). It goes pretty quick after you've been through it once, though.

Take note: as of version 2.0.00 WiRe encrypts all its communications using SquidDev's AES and Alex Kloss' base64.
- For best performance mix computers with even and odd numbered IDs on each network to distribute the load on the server(s) (this makes a difference)

I hope people find this as useful as I have. Go WiRe up your base and let me know what you think!

Screenshots

Requirements

Want to use pocket computers with WiRe?

Downloads

Update History

Similar programs:
WirelessControl by unobtanium

As always, my sincere thanks to everyone who made this possible; with special thanks to the following:
- SquidDev for his AES encryption/decryption function
- Alex Kloss for his base64 encoding/decoding function

Edited by Dog, 26 August 2018 - 08:26 PM.


#2 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 21 May 2014 - 05:05 PM

I get it... WiRe... WiReless... WirelessRedstone...

:D You seem to have put a lot of work into this. Good job!

#3 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 22 May 2014 - 01:40 AM

Thanks, ZudoHackz :) It's been a fun project.

#4 Dry_Taste

  • New Members
  • 2 posts

Posted 22 May 2014 - 05:49 PM

This is awesome! but maybe add a way to connect network monitors to a cliënt? (if that is possible)

#5 Agent Silence

  • Members
  • 319 posts
  • Location[string "FindMe"]:23143: bad argument #1 to 'returnPos' (vector expected, got nil)

Posted 22 May 2014 - 06:23 PM

Well, I was going to make this.
Oh well, you did better on this then I could've ever done. GJ.
PS: Maybe allowing you to control the server through a PDA?

#6 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 22 May 2014 - 09:06 PM

View PostDry_Taste, on 22 May 2014 - 05:49 PM, said:

This is awesome! but maybe add a way to connect network monitors to a cliënt? (if that is possible)
Thanks, Dry_Taste. If you mean connect monitors via modem/network cable - that is already possible :) If that's not what you mean, would you please clarify a bit?

View PostAgent Silence, on 22 May 2014 - 06:23 PM, said:

Well, I was going to make this.
Oh well, you did better on this then I could've ever done. GJ.
PS: Maybe allowing you to control the server through a PDA?
Thank you, Agent Silence. I've been considering adding PDA support. Unfortunately, due to how WiRe works, it won't be easy to add (I wish I had thought about PDA support earlier in the project). That's not to say I won't get around to it; but if I do, it'll probably take awhile to get it where I'm happy with it - no promises, though, as I may not be able to implement it in a way I'm happy with. I don't know if it would interest you, but I also have a program for portable computers called cc10. It allows you to control redstone wirelessly as well, but with a slightly different feature set.

Edited by Dog, 23 May 2014 - 03:02 AM.


#7 Dry_Taste

  • New Members
  • 2 posts

Posted 23 May 2014 - 11:27 AM

View PostDog, on 22 May 2014 - 09:06 PM, said:

View PostDry_Taste, on 22 May 2014 - 05:49 PM, said:

This is awesome! but maybe add a way to connect network monitors to a cliënt? (if that is possible)
Thanks, Dry_Taste. If you mean connect monitors via modem/network cable - that is already possible :) If that's not what you mean, would you please clarify a bit?

Thanks for the reply, i wasn't aware of that (i tried to do that but i obviously did it wrong) how do i do this? I tried to connect a wire-modem to a client but it doesn't show anything on the monitor.

Edit: Nevermind forgot to activate the modems on the terminal and monitor, i'm sorry ^^''

Edited by Dry_Taste, 23 May 2014 - 04:57 PM.


#8 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 23 May 2014 - 09:34 PM

No problem, Dry_Taste. Glad you got it sorted :)

#9 viluon

  • Members
  • 183 posts
  • LocationCzech Republic

Posted 06 June 2014 - 10:03 PM

I was waiting for this :)
Great job, Dog! I'll try ASAP!

#10 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 07 June 2014 - 04:21 AM

Thanks, viluon! Please let me know what you think can be improved or done better :)

Edited by Dog, 07 June 2014 - 04:23 AM.


#11 bbilko

  • New Members
  • 2 posts

Posted 10 June 2014 - 06:27 PM

Hello, loving the idea of this program/system but having a few problems setting it up.

I have an advanced computer, advanced monitor onthe back and a wideless modem on top.

I have downloaded and run the server setup and after the questions I get this error:

Posted Image


Here is a shot with the screen closed

Posted Image

Any ideas??

#12 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 10 June 2014 - 08:44 PM

@bbilko - are you running this with ComputerCraft 1.6 or an earlier version (e.g. 1.58)? Based on the error and the line number it looks like you aren't running ComputerCraft 1.6 which WiRe requires.

Edited by Dog, 10 June 2014 - 09:01 PM.


#13 bbilko

  • New Members
  • 2 posts

Posted 10 June 2014 - 11:21 PM

...That would be it then!

Seems the FTB Monster pack has 1.58.

Damn....

Cheers for your assistance!

#14 Datamats

  • Members
  • 9 posts

Posted 13 June 2014 - 01:43 PM

I was wondering if you could add wired modem support because of security reasons and other stuff? Would be awsome

#15 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 13 June 2014 - 04:54 PM

Hey, Datamats,

Done - wired modem support for communications is added. That's actually something I've been planning on adding for awhile - not sure why I didn't do it sooner. Download 1.0.14 (client and server) to get the updated functionality.

#16 cmckain14

  • Members
  • 22 posts

Posted 14 June 2014 - 04:51 AM

Due to the fact that it was at 1:00 in the morning, I forgot to put a wireless modem on the computer *derp*. Could you consider putting a check for a modem as the first thing (not the last) the program does? Other than that, great program! :) Also, may I ask you how you got the server monitor to print the clients like that with the touch screen?

Edited by cmckain14, 14 June 2014 - 04:57 AM.


#17 micmou

  • Members
  • 54 posts

Posted 14 June 2014 - 05:33 AM

I have a suggestion for you.
Maybe you could integrate Pocket computers :D

#18 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 14 June 2014 - 06:17 AM

@cmckain14 - Thank you :)

I'm guessing you mean the order in which the checks are made during first time setup? If so, that makes a lot of sense - I'll take a look at that and make it right.

As for how I got the names to display, it's not an elegant solution, but here's what I do...
- Each name can be 12 characters
- Each name is 'broken in half' and displayed 6 characters per line (2 lines)
- Just add spaces in the name to space it out so it looks right on the monitor
Like I said, not elegant...but it works - and I haven't yet conquered the coding to have the program do it automatically.

@micmou - you're not the first to suggest it. I've considered it, but it wouldn't be an easy project - WiRe wasn't designed with that in mind. It's still a possibility, but it'll probably happen later rather than sooner. Although the feature set is a bit different, you may want to check out my cc10 program - it allows you to wirelessly control redstone (even analog redstone) outputs with an advanced wireless pocket computer.

Edited by Dog, 14 June 2014 - 06:23 AM.


#19 cmckain14

  • Members
  • 22 posts

Posted 14 June 2014 - 08:11 PM

@Dog I would suggest storing the names in a table and using 'table.sort' and some sort of string manipulation (string.format?) to sort them automatically. Also, how did you have the on/off switches work (respond to touch) when the program doesn't know how many clients there will be? In other words, how does the program auto. set the coords. for each of the buttons?

#20 Dog

  • Members
  • 1,178 posts
  • LocationEarth orbit

Posted 14 June 2014 - 09:52 PM

@cmckain14 - thanks for the suggestions :) The difficulty (for me) is looking at a string with multiple spaces and determining whether to break the string at the first space, second space, etc. The 'work' that needs to be done still eludes my understanding atm. I've only used (and am only familiar with) a few string api calls - guess it's time to sit down and read up a bit. I would definitely like to make the switch labeling 'work better'.

Actually, the server knows how many clients it has at any one time by counting the number of entries in the table of clients (#allClients). In this case, each element on the monitor is a static 6 characters wide, with the first starting at space 2. The formula I used for placement is...

(<number of current client>*8)-6

Although I could have just as easily used a 'for loop' starting at 2 and incrementing by 8 for positioning, inside another loop for incrementing client #.

To match the touch to the client, I compare the x touch coords using a variation of the above formula, in a loop, to find the client number.

for i = 1,#allClients,1 do  --# loop through the client list
  if posX >= (i * 8) - 6 and posX <= (i * 8) then  --# if our touch x position describes the x position of a button
    client = allClients[i].cc --# set 'client' to the computer ID# belonging to table entry 'i' in allClients

Y coords are checked differently since they are static and the same for all buttons.

I hope that explains it. If I misunderstood, or you'd like further clarification, please let me know :)

EDIT: I also released an update to WiRe server and WiRe client - they now look for a modem before starting first-time setup and warn you at the beginning if none is detected. My apologies for missing something so obvious.

EDIT2: Another update for WiRe server - the server now semi-intelligently splits client names on the monitor control display (no more need to 'space out' names). It looks for a single <space> and if it finds one, and both 'halves' of the name are 6 characters or less, it uses the 'split' name, otherwise it just splits the name at the 6 character mark and shows them as 6 characters & 6 characters.

Edited by Dog, 15 June 2014 - 03:46 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users