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

how can i interface a wireless to a wired network

Started by Dandelion, 15 February 2015 - 04:11 PM
Dandelion #1
Posted 15 February 2015 - 05:11 PM
Hi all, I like to think of myself as a skilled basic coder, that is i can code doors and other standalone programs with ease and understand most of what things do,

that being said i feel like i'm biting off more than i can chew with networking,

Basically what i want is for a remote wireless terminal to access a "Mainframe" hardwired drive/printer network, in a separate section of my home, due to the constraints of CC 1.64 ive decided what i need (other than an update to 1.65) is essentially a router, which I feel should be a terminal connected to the wired network with a wireless modem to relay wireless access to wired,

unfortunately for me while i can setup the hardware i haven't got a clue as to where to start with the coding.

following a quick google and a trawl of the CCwiki i found perhaps the modem api thing could help, however i burnt that code when i couldn't make it work :(/>

so i've come here, to the land of the gurus in hopes that i may learn the truths of what need to be done,

please help me
Lignum #2
Posted 15 February 2015 - 09:06 PM
So basically you want to remotely access your peripherals which are connected to a computer using networking cables?
This should be what you want:

rednet.open("left") --# Assuming your wireless modem is on the left.

while true do
   local id, tbl = rednet.receive() --# Receives a table containing some instructions.
   local p = peripheral.wrap(tbl.device)
   local ret = { p[tbl.func](unpack(tbl.args)) } --# Calls the function and stores the return values...
   rednet.send(id, ret) --# And sends them back to the requesting client...
end

And to interact with it…

--# This code will print "Hello World!" on a remote monitor.

--# Change these depending on your setup.
local monitorName = "monitor_1"
local serverID = 15

rednet.open("right") --# Assuming the modem is on the right.
rednet.send(serverID, {
   device = monitorName,
   func = "write",
   args = {
	  "Hello World!"
   }
})
Dandelion #3
Posted 15 February 2015 - 09:14 PM
thank you so much, i'll give these a whirl and see what i can't destroy
Dandelion #4
Posted 15 February 2015 - 10:38 PM
just trying to tie this into what i have standing, how would i get the remote terminal to display (on demand) the dir for all "Networked" disk drives,

just for some background incase its getting confusing, i have a remote computer with wireless modem(wLAN) that i want to connect to a group of disk drives which are network cabled(LAN) to another computer with both a wired modem (back) and a wireless modem(left) which i aim to act as a sort of router which will receive the wLAN requests and access the LAN Drives for programs and other files

as i understand it the above codes are for sending a message from the wLAN terminal to display on a LAN Monitor