What's new

Naomi 2 - Gateway 33 Error, piforcetools

telmnstr

Beginner
Joined
Oct 20, 2018
Messages
12
Reaction score
12
Location
Virginia, USA
Naomi 2, had a ZeroPIC and tried using piforcetools. In the past I've messed with triforcetools.py on Chihiro and friend's Naomis but this is my first attempt at my own setup.

My Naomi2 was too low on the bios version to be able to setup the DIMM, but I knew the IP address from when I had firmware updated the DIMM (tcpdump, caught it on startup.) Gateway errors.

My Eprom programmer maxes out at 40 pins, can't do 42 pin EPROMs used in the Sega stuff so I ordered a new ZeroPic + Universal BIOS from the canadian dude on eBay. Got the chips, same errors.

Gateway 33 error.

I tried moving to static DHCP addressing of the NetDimm to see if it would pickup an IP gateway from there. Nope. Tried watching all traffic when the error hit, but I don't see any attempt to reach out when the Gateway 33 error pops.

Tired of it, I went a different route and modified the piforcetools.py to do the keep alive.

This is best for someone that understands linux, and editing files and stuff.

I used a drop file in /run/lock called node1. This isn't multi-node friendly, I didn't use the current node variable at all. Quick hack, needs cleanup. YMMV.

In /boot/piforcetools/piforcetools.py there is a drop file cleanup and delay before sending new image. Then at the end drop file is put back to start the keepalive process. Changes marked in >'s



lcd.clear()
lcd.message(selection)
else:
> lcd.clear()
> if os.path.exists('/run/lock/node1'):
> lcd.clear()
> lcd.message("Stop Keepalive")
> os.remove('/run/lock/node1')
> sleep(6)
> lcd.clear()
lcd.message("Connecting....")
try:
triforcetools.connect(ips[curr_ip], 10703)
except:
lcd.clear()
lcd.message("Error:\nConnect Failed")
sleep(1)
lcd.clear()
lcd.message(selection)
continue


lcd.clear()
lcd.message("Sending...")
lcd.setCursor(10, 0)
lcd.ToggleBlink()


triforcetools.HOST_SetMode(0, 1)
triforcetools.SECURITY_SetKeycode("\x00" * 8)
triforcetools.DIMM_UploadFile(rom_dir+games[selection])
triforcetools.HOST_Restart()
triforcetools.TIME_SetLimit(10*60*1000)
#triforcetools.disconnect()
> open('/run/lock/node1', 'a').close()


Then in a separate python script, running all the time, called /boot/piforcetools/keepalive.py and called with scriptname <ip address>:
(Note this is ghetto, it's not multi-host aware -- really needs 4 of them one for each IP and a bit more logic to be clean):

#!/usr/bin/python


# Keep Alive Daemon for Naomi
# Built from Triforce Netfirm Toolbox triforcetools.py keep-alive
# Added to piforcetools


# If file /tmp/node1 exists, this script will start sending keepalive
# to the host
#


# Triforce Netfirm Toolbox, put into the public domain.
# Please attribute properly, but only if you want.
import struct, sys
import socket
import os
import time


triforce_ip = sys.argv[1]
lockfile = '/run/lock/node1'



# connect to the Triforce. Port is tcp/10703.
# note that this port is only open on
# - all Type-3 triforces,
# - pre-type3 triforces jumpered to satellite mode.
# - it *should* work on naomi and chihiro, but due to lack of hardware, i didn't try.



def TIME_SetLimit(data):
s.send(struct.pack("<II", 0x17000004, data))



while 1:
time.sleep(2)
print "Waiting..."


while os.path.isfile(lockfile):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((triforce_ip, 10703))


while os.path.isfile(lockfile):
print "Sending lock"
TIME_SetLimit(10*60*1000)
time.sleep(5)


s.close()


You can trigger the background daemon using /etc/rc.local ... make sure to sudo
If you're trying to modify the filesystem ON the pi, don't forget to do like "sudo mount / -o remount,rw /boot " and such

Tried to attach, invalid ex

Enjoy
 

Attachments

Back
Top