feat: Enhance logging for modem communication in turtle and webbridge; improve command transmission feedback

This commit is contained in:
MayaTheShy
2026-02-20 00:52:35 -05:00
parent 5fb8ddf68e
commit 5b23ab1a14
2 changed files with 44 additions and 3 deletions

View File

@@ -27,6 +27,12 @@ modem.open(CHANNEL_RECEIVE)
modem.open(STATUS_CHANNEL)
modem.open(POCKET_CHANNEL)
print("Webbridge Channel Configuration:")
print(" CHANNEL_RECEIVE: " .. CHANNEL_RECEIVE)
print(" STATUS_CHANNEL: " .. STATUS_CHANNEL)
print(" COMMAND_CHANNEL: " .. COMMAND_CHANNEL .. " (transmit only)")
print(" POCKET_CHANNEL: " .. POCKET_CHANNEL)
-- Track turtles and stats
local turtles = {}
local stats = {
@@ -322,15 +328,22 @@ while true do
target = turtleID
}
print("📡 Transmitting command to Turtle #" .. turtleID)
print(" Channel: " .. COMMAND_CHANNEL)
print(" Command: " .. cmd.command)
print(" Target: " .. turtleID)
print(" Packet: " .. textutils.serialize(commandPacket))
-- Send command multiple times for reliability
for i = 1, 3 do
modem.transmit(COMMAND_CHANNEL, CHANNEL_RECEIVE, commandPacket)
print(" Transmission " .. i .. "/3 sent")
os.sleep(0.05) -- Small delay between retransmissions
end
-- Debug: show what we're sending
if not hasMonitor then
print(" Sent to channel " .. COMMAND_CHANNEL .. ": target=" .. turtleID)
print(" Sent 3 times on channel " .. COMMAND_CHANNEL)
end
end