Posted 17 May 2016 - 01:17 PM
Hey guys :)/>
So i'm trying to send data over my RedNet network and then plot the graph on a remote computer. For some reason, this won't work. I'm not getting any errors and i've tried to use multiple print commands to see if the data is getting through (which it definitely is!) but the monitor is still black.
Here is my code for the computer that's sending the information:
And here the code for the receiving side (which is plotting the graph):
as you can see, i've already tried multible troubleshooting steps to see where the problem could be, but it didn't help.
I've also written this small application for further testing of the network
but nothing helped. :(/>
I hope some of the Pros can help me here!
thanks in advance!
So i'm trying to send data over my RedNet network and then plot the graph on a remote computer. For some reason, this won't work. I'm not getting any errors and i've tried to use multiple print commands to see if the data is getting through (which it definitely is!) but the monitor is still black.
Here is my code for the computer that's sending the information:
os.loadAPI("ocs/apis/sensor")
os.loadAPI("ocs/apis/graph")
--get sensor data and serialize
rednet.open("top")
local sensor1="left"
local reactorPos="0,0,1"
local details="getTargetDetails"
while true do
local tab=sensor.call(sensor1, details, reactorPos)
rednet.broadcast(textutils.serialize(tab))
term.clear()
print(tab)
sleep(0.5)
end
And here the code for the receiving side (which is plotting the graph):
os.loadAPI("ocs/apis/graph")
os.loadAPI("ocs/apis/sensor")
rednet.open("back")
while true do
local event, id, text=os.pullEvent()
if event=="rednet_message" then
print(text)
local sensorData=textutils.unserialize(text)
print(sensorData)
print(sensorData.Heat)
end
end
local mon=pheripheral.wrap("top")
function update()
return sensorData.Heat
end
local gr=graph.new(pheripheral.wrap("right"), update, "Heat", 1, 1, 7000)
while true do
gr:draw()
sleep(0.5)
end
as you can see, i've already tried multible troubleshooting steps to see where the problem could be, but it didn't help.
I've also written this small application for further testing of the network
rednet.open("back")
while true do
local event, id, text =os.pullEvent()
if event=="rednet_message" then
local sensordata1 = textutils.unserialize(text)
print(sensordata1)
sleep(0.1)
end
end
but nothing helped. :(/>
I hope some of the Pros can help me here!
thanks in advance!