Yes! I've successfully been able to print four documents without issue on the ImageWriter II via LocalTalk/TashTalk!Ah, okay, we're back to getting checksum errors. Can you putverify_checksums=False
in the parameters to TashTalkPort? i.e. something likeTashTalkPort(serial_port='/dev/ttyAMA0', seed_network=2, seed_zone_name=b'TashTalk Network', verify_checksums=False),
I tried renaming it to "ImageWriterLQ" and scanned again and it read back as "ImageWriterLQ1?" sans space but with extra characters. I've included a log.What happens if you choose a name without a space in it? Something is a bit off there. Oddly I don't see the ESC sequence in the debug being sent to the printer to rename it.
Another data point: I used an AirTalk to connect the LocalTalk network to LToUDP (sans TashHat/TashRouter). I was able to use Namer on Mini VMac to rename the ImageWriter LQ correctly and saw that the name of the ImageWriter II "Itchy & Scratchy" was already named correctly.I have a feeling that the terminating null character is somehow getting eaten, or the length of the string.This looks like a buffer overrun of some sort.
EDIT: Looking at the dumps someone did here on a real LocalTalk network, looks like Namer is working fine and sending the correct packets to your printer. TashRouter appears to be forwarding them correctly as well. I would try the same copy of Namer running on a Mac directly connected to LocalTalk. There is a problem "somewhere", but I can't pinpoint where, because the debug logs show no problems "on the wire".
It could also be that the printer is really being renamed correctly and TashRouter is somehow mangling the NBPReply packet when acting as a "proxy" for the NBP bug workaround.
I'm pretty sure it's the printer doing that (in response to getting its own LkUp-Replies back).Something is incrementing the object field length in the NBP packets. TashRouter starts off sending the right name/length, but subsequent lookup/replies increase the length value by one, adding junk data to the end of the string.
260 # if zone is still *, just broadcast a LkUp on the requesting network and call it done
261 if zone_field == b'*':
262 self._lkup_router.remember_lkup(nbp_id, object_field, type_field, zone_field, network, node, socket)
I'm afraid commenting out line 262 in name_information.py didn't work. I tried changing the name of the ImageWriter LQ from "ImageWriterLQy7" to "ImageWriter LQ" but it ended up named "ImageWriter LQx>" instead. See log attached.The "yielding" debug line happens when a lookup reply is intercepted and re-transmitted. Seems that information sometimes has the printer's net/node/socket in it instead of the requesting machine's information..... from a BroadcastReq that the printer sent. That packet gets sent back to the printer instead of the machine and it appears that the printer is getting confused.
EDIT: try commenting out line 262 in name_information.py. We don't need to "remember" lookup requests if we are just transmitting them back to the same network anyway.
Code:260 # if zone is still *, just broadcast a LkUp on the requesting network and call it done 261 if zone_field == b'*': 262 self._lkup_router.remember_lkup(nbp_id, object_field, type_field, zone_field, network, node, socket)
I'm not quite ready to give up on the LkUp-Reply routing solution, I really think it's the cleanest way to resolve this...OK, a possible solution already was found in this thread. After reading @RolandJuno's numerous logs, this is "what works" per tashrouter-rickards5-debugout.txt.
-Ditch the caching of NBP Lkups. Its not needed and clearly causing issues. Revert to the name_information.py on github.
-Use long form DDP packets for all NBP packets generated by TashRouter, BUT if it is a non-extended/LocalTalk network, you must address broadcasts using the actual network number in the header, not '0' like on extended networks. Ex: a LocalTalk network assigned a number of '10', must have 10.255 as the destination address of broadcasts in long DDP headers.
-Ignore long DDP checksum verification from LocalTalk networks. Either null them out, or pass them along to the destination network, or generate a new valid one.
To summarize, the ImageWriter is indeed generating proper NBPRequestReply packets with the correct destination in the extended DDP header. It only replies if NBPLkups in extended DDP packets are addressed to the current network, not network '0'.
This version seems to work with Namer, allowing both IM II and IM LQ to be renamed properly!I'm not quite ready to give up on the LkUp-Reply routing solution, I really think it's the cleanest way to resolve this...
@RolandJuno can you give this name_information.py a try? As before, just overwrite name_information.py with the one in the zip file, nothing else needs to change (in particular, verify_checksums should still be False on TashTalkPort).
...Whaaaa. This is weird. Mini vMac is looking up the printer by name and for some reason TashRouter is not forwarding the lookup. Was there an exception traceback in the output before the part that you copied? I'm wondering whether some error I made in the NBP service caused it to just completely stop responding...However, now both printers will no longer start printing a job
No exception that I see. I tried it again, starting the router, selecting the ImageWriter II in the Chooser, then attempting to print which eventually leads to the error that it can't be found. Log attached....Whaaaa. This is weird. Mini vMac is looking up the printer by name and for some reason TashRouter is not forwarding the lookup. Was there an exception traceback in the output before the part that you copied? I'm wondering whether some error I made in the NBP service caused it to just completely stop responding...
Ohhh, foo, I see what I did, I created a deadlock condition. This should fix it. Thanks for bearing with me...No exception that I see. I tried it again, starting the router, selecting the ImageWriter II in the Chooser, then attempting to print which eventually leads to the error that it can't be found. Log attached.
Unfortunately, I don't see any change from before. Log attached.Ohhh, foo, I see what I did, I created a deadlock condition. This should fix it. Thanks for bearing with me...