This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Joeld98's profile picture

RGB Matrix Controller/Software Distribution

Started by Joeld98, 27 July 2018 - 11:39 PM
Joeld98 #1
Posted 28 July 2018 - 01:39 AM
After a year or so hiatus from Tekkit Legends I got the bug again.

I'm working on a 16X16 RGB Matrix display where there I have a grid of 16X16 advanced computers with an RGB lamp on top and an immibis LAN modem on the bottom. (So I can address each lamp individually using the computer as a controller)

I'm looking for a lazy way to get a small bootp type program on each computer in the grid that will either pull the full client from pastebin or from the server on the same network. It's pretty tedious to click from underneath on the little sliver of computer showing around the modem.

Okay, so the security concern ridden question is: Is there a way to automatically distribute an application to computers that are physically adjacent to one another without using a common disk drive.

Ideally I would like to put the client on a computer in the corner of the grid and essentially mount the neighboring computers then reboot them so that they can do the same before registering with the server that will send the RGB sequences.

Would appreciate any suggestions or clever approaches to software distribution.
Lyqyd #2
Posted 28 July 2018 - 03:14 AM
Is there any reason you can't place a wired modem on the RGB lamps?
Bomb Bloke #3
Posted 28 July 2018 - 04:21 AM
Indeed, directly connecting the lamp peripherals to conventional Wired Modems sounds like the way to go - you can then have a single computer control all of them directly.

I also don't see why you wouldn't want to use a "common disk drive" to pre-program your computers, as that's by far the easiest way. Hook all systems up to wired modems, attach a single disk drive with a startup script rigged to perform your software installation, and then use another computer on the same network to issue a mass "turn on" command to each of the others:

peripheral.find("computer", function(nm, pr) pr.turnOn() end)

If you REALLY want to avoid using a disk drive, the only other way would be to inject the files onto the systems directly through the world save. But again: there's no obvious reason to be using so many computers for this.
Joeld98 #4
Posted 28 July 2018 - 07:07 PM
I'll have to dig into the modem directly on the lamp option. I'm using Bluepower inverted RGB lamps. The modem attaches but does not get a connected light. I need to research how to address them individually and send the RGB values.

I went the one computer per lamp route because the immibis modem notes said "Each modem can send a maximum of 10 messages per second". I took that to mean if each lamp was addressed individually I could only update my grid (256 lamps) once every 25 seconds with a single modem and once every 5 seconds if I put modems on all sides of the controller. Putting a computer on each lamp will allow me to send one message to all nodes at once using a 256 byte message. The RGB controller will parse the message for its position and translate to the lamp resulting in 10 updates per second or more if I load balance across the modems.

Using the ComputerCraft wired modem and network cable will work but it looks like you have to go to each computer and click on the modem to get it to connect before issuing the reboot. I have not figured out a way to automatically deploy modems/network cable like you can with the immibis LAN modem and LAN cable. They automatically connect when placed which lets you deploy a large grid without having to do it by hand.

For the prototype I deployed all the 256 lamps, computers , modems and cables using a buildcraft filler. It all connected and the network registered automatically (blue lights on modems).

I was hoping for a solution to deploy the code that was equally automated (aka Lazy :)/> ).
Bomb Bloke #5
Posted 29 July 2018 - 03:53 AM
I'll have to dig into the modem directly on the lamp option. I'm using Bluepower inverted RGB lamps. The modem attaches but does not get a connected light.

According to the docs for Immibiss Peripherals, LAN Modems can be placed pretty much anywhere, but only actually work with turtles and computers for the purpose of conventional messaging (they don't seem to offer remote peripheral access). I guess if you wanted to make a turtle part of a wired network they might be handy (you wouldn't need to code any wireless security measures), but otherwise I don't get the point to them.

I went the one computer per lamp route because the immibis modem notes said "Each modem can send a maximum of 10 messages per second".

Regular ComputerCraft modems can send as many messages per second as your server can process - hundreds, typically. Each arrives on the next server tick.

Remote peripheral calls through wired modems aren't handled as "messages", but rather work exactly the same as if the peripheral were directly beside the computer making the call. Peripheral functions often yield, and wait for an event from the device before resuming - because of this, having one system call a couple of hundred such functions one after the other may be slow (depending on the speed of the attached devices). They can all be started together through the use of coroutines, though - the parallel API helps with this.

Using the ComputerCraft wired modem and network cable will work but it looks like you have to go to each computer and click on the modem to get it to connect before issuing the reboot. I have not figured out a way to automatically deploy modems/network cable like you can with the immibis LAN modem and LAN cable. They automatically connect when placed which lets you deploy a large grid without having to do it by hand.

Yeah, Wired Modems do have to be "activated" in order to make connected devices available as remote peripherals. While that shouldn't take long to do manually, I suppose you could set up a clicking turtle or something to zig-zag through and do it for you.