PfSense on a Riverbed Steelhead
-
With those smb modules loaded try running:
smbmsg -p
That should return all the available smbus devices available. But it also might hang the bus or even the whole box so be ready to power cycle it. It will probably list some things though. Hopefully including 0x24.
The smbus python tools appear to be more like raw i2c tools. The actual output command in rbmode appears to write to a device at 0x24 with subaddress (or smbus command) 0x55 and whatever the output of that checksum function is. My python sucks!
Steve
You can probably do that easily enough with smbmsg.
-
root@:~ # kldload ichsmb
ichsmb0: <Intel 631xESB/6321ESB (ESB2) SMBus controller> port 0x540-0x55f irq 19 at device 31.3 on pci0
smbus0: <System Management Bus> on ichsmb0
root@:~ # kldload smb
smb0: <SMBus generic I/O> on smbus0
root@:~ # smbmsg -p
Probing for devices on /dev/smb0:
Device @0x10: w
Device @0x48: rw
Device @0x5c: rw
Device @0x60: rw
Device @0x64: rw
Device @0x66: rw
ichsmb0: device timeout, status=0x41
ichsmb0: device timeout, status=0x41
ichsmb0: device timeout, status=0x41
ichsmb0: device timeout, status=0x41 -
That's what I get, and then the "device timeout" messages continue forever. Rerunning smbmsg -p shows nothing but the timeout messages, so pretty much need to reboot after running once. No x24 addresses of course! curses...
-
Hmm. Have you also seen that script work in Linux?
I could imagine the device might come up at a different address in FreeBSD perhaps...
-
@pauloalb Since you got the script to work under Linux...
What were the values for "calcCheckSums" in this bit of the script?
s.write_block_data(0x24, 0x55, calcChecksums(cmd_0)) time.sleep(0.1) s.write_block_data(0x24, 0x55, calcChecksums(cmd_1))
This would give us clues as to what we should give smbmsg to send the same values under BSD. Changing the 0x24 address location per what we see from using "smbmsg -p" .
-
Per some docs...
write_block_data(i2c_addr, register, data, force=None)
Write a block of byte data to a given register.
Parameters
โข i2c_addr (int) โ i2c address
โข register (int) โ Start register
โข data (list) โ List of bytes
โข force (Boolean) โSo I'm thinking the smbmsg equivalent could be something like this per my smbus scan...
smbmsg -s 0x48 -c 0x55 -o 3 0x?? 0x?? 0x??
With the ?? pieces being the values the rbmod script calculates in the above bit of python.
-
With some extra print calls and no actual smbus writes:
steve@steve-MMLP7AP-00 ~/Documents $ sudo ./rbmode.py u [sudo] password for steve: Setting mode to universal [3, None] [3, 1] [3, 252, 1, 254, 102, 153] [3, 0] [3, 252, 0, 255, 102, 153]
So I expect the required smbmsg command to be something like:
smbmsg -s 0x24 -c 0x55 -o 6 0x03 0xfc 0x01 0xfe 0x66 0x99 smbmsg -s 0x24 -c 0x55 -o 6 0x03 0xfc 0x00 0xff 0x66 0x99
BUT I'm unsure how the checksum applies. i2c doesn't have a checksum but the script calculates the checksum from the data because smbus does. So if smbmsg does the checksum for us it might be:
smbmsg -s 0x24 -c 0x55 -o 2 0x03 0x01 smbmsg -s 0x24 -c 0x55 -o 2 0x03 0x00
That all depends on 0x24 being the real device address....
Steve
-
Considering this comment was in the rbmode script all along...
universal
port 0: 06-03-fc-01-fe-66-99 -> 0x03, 0x01
port 1: 06-03-fc-00-ff-66-99 -> 0x03, 0x00
Lines up precisely with your converted output and possible smbmsg commands...
smbmsg -s 0x24 -c 0x55 -o 6 0x03 0xfc 0x01 0xfe 0x66 0x99
smbmsg -s 0x24 -c 0x55 -o 6 0x03 0xfc 0x00 0xff 0x66 0x99I guess the info was staring us in the face this whole time :)
Now will it work? smbmsg syntax is cryptic, but will give it a go.
Thanks!
-
Huge thanks to Steve, his print output of rbmode filled in the final pieces!
First a bit of a caveat: I did this with FreeBSD 12.1. I used a full install of a current FreeBSD version to improve chances of stuff working, have access to extra tools, drivers, etc. that are not in pfSense, let alone and old version of pfSense.
One thing to note BTW is 12.1 installed from a USB key inserted in the front panel directly to an internal SATA without issue. FreeBSD 10.3 and pfSense 2.3.5 based on same were unable to install directly to an internal SATA.
So anyway...
Success! Instant relay click and nic link lights with the first smbmsg command below! LAN0_0 (em0) and WAN0_0 (em1) both working!
Note they nics did require an "ifconfig emX up" before they could be used but that's to be expected.
smbmsg -s 0x48 -c 0x55 -o 6 0x03 0xfc 0x01 0xfe 0x66 0x99
smbmsg -s 0x48 -c 0x55 -o 6 0x03 0xfc 0x00 0xff 0x66 0x99The second command doesn't seem to do anything but does not return an error. I rebooted, which does reset the relays, and tried the second command alone, still doesn't seem to do anything, good or bad.
So next steps would entail getting the following on pfSense, if it's not already there...
-ichsmb.ko
-smb.ko
-smbmsgThen alter boot-up config to load the kernel modules and issue the smbmsg commands automatically.
I won't be doing any of the pfSense bits cause I don't actually want to run a 32bit box. It just always bugged me that half the nics wouldn't work without the original software.
Anybody want to buy one? :)
I think I have 2 250s and 2 550s. The 550s for sure (because that's been my box for all this hackery) have a Xeon Sossaman and 4GB ECC RAM. IIRC the 250s have a Celeron and 2GB ECC RAM. No USB DOMs, no HDDs, no software.
-
The modules are there in pfSense, just not loaded. To run that you would need to add to
/boot/loader.conf.local
:ichsmb_load=yes smb_load=yes
Then run that smbmsg with a shellcmd at boot. Pretty easy.
Of course not if that is 32bit hardware though.I assume the second line is for larger models that have two pairs of ports.
The fact that code was already in the comments there was confusing. The way it's written looked like they got the i2c output from original OS maybe. The extracted the actual commands from it. But then recreate the same string by calculating the checksum... odd.
Steve
-
Special thanks to @stephenw10 and @okijames and everyone that helped.
I am on my lunch break so i couldn't test this much but i call this a SUCCESS! Both nics do light up and show activity.
I am running this on a Rivebed Steelhead 250 with pfSense 2.3.5 running from a flash drive plugged in the front of the device with no hdd and no subonModule internal flash plugged in.
The exact sequence that worked for me, gathering all the bits from previous messages is this:
kldload ichsmb
kldload smb
ifconfig em0 up
ifconfig em1 up
smbmsg -s 0x48 -c 0x55 -o 6 0x03 0xfc 0x01 0xfe 0x66 0x99
smbmsg -s 0x48 -c 0x55 -o 6 0x03 0xfc 0x00 0xff 0x66 0x99Thanks again for the fantastic comunity support and engagement from everyone
pauloalb
-
Nice!
Interesting that it's apparently at a different address in FreeBSD/pfSense.
I wouldn't expect you to have to ifconfig up the interface assuming it is assigned and enabled. Usually in that sort of setup the relays disconnect the physical ports but the OS can always see the NIC chip.
Steve
-
Yeah, different drivers so different reference address I guess.
You're right re "ifconfig up" requirement, under pfSense anyway. Going through the nic assignment process and ticking the "Enabled" box gets them up and running.
-
Ok I wrote a full soup-to-nuts howto on this whole thing but it keeps getting flagged as spam and won't post. Any pointers?
The issue seems to be the text related to shellcmd entries in the pfSense config file. I literally dare not include it here or this post would be blocked. :(
-
Try again. I upvoted your posts so you have the required rep level, 5, that should avoid the filter.
It looks like you wrote this and then deleted it a number of times. I could try to recover those?
Steve
-
@stephenw10 Thanks for the upvote and please delete those other posts. I'll try posting the whole thing right now...
-
@stephenw10 No joy, still getting flagged as spam.
-
Hmm, maybe a combination of the IP you're coming from? Maybe remove any links you have in the post?
-
@stephenw10 There are not links :) . Just this piece seems to be the problem.
<shellcmd>smbmsg -s 0x48 -c 0x55 -o 6 0x03 0xfc 0x01 0xfe 0x66 0x99</shellcmd> </system>
-
Ok that's weird :)