Sonicview Ihub emulator
This Linux app acts like an "iHub" for your SonicView STB
It will allow you to use your SonicView with any available newcamd service
by faking out the iHub device detections and acting like a smarter version
of the iHub device (many bugs of the real hardware are worked around).
Two versions are provided, one for x86_64 and one for i686 - rename the one
you need and toss the other one to avoid confusion.
Do the same with the libuci.so file as that is required for the config file.
./ihubemu <serial device>
If no serial device is given, the default is /dev/ttyS0
You must provide the entire path to the device (include /dev/ always)
You need to use a "null modem" cable between the SonicView and your Linux box.
You may also set the device in the config file (see below for more about that)
Upon launch, it will report the settings it will use, based on defaults or
whatever was provided in the config file, if it exists and is valid.
This has only been tested with the "SV-360 Premier" STB and the only firmware
that will work is the private server version "04.05-P" - if you do not have
that firmware you must load it first before this will work completely. Other
SonicView models should also work as long as they have a "private server" bin.
Note the menus on the SonicView will show normal information as expected, and
any networking changes are accepted but silently ignored, except as noted
in the "Config File" section below. You should be configuring your Linux box
as normal, so it can get to the server when the SonicView asks to connect.
The SonicView "IP Config" menu will always show DHCP mode and the current
network settings as of the time you launched ihubemu, although you can enter
other settings in the config file to "lie" about the details, all of it is
ignored internally anyway.
You will still need to set the "Private Server" option to "Yes" and enter the
login/password/DES key details on the SonicView in the "IP Config" menu.
The firmware has a full newcamd client built in and all ihubemu does is let it
get out to the Internet. Also ihubemu never sees any of this info so it is
secure and safe and is only used for newcamd communications. This also means
this solution only works with newcamd compatible services for now, the option
for private server support is not the more basic SSSP style. Future versions
of ihubemu may break this limitation by emulating the newcamd private server
internally and ripping the important data out of the stream to provide a true
SSSP level connection to other non-newcamd services via handoff to other
software. This also will allow for better mapping of services to multiple
private servers, or multiple providers, which can not be done with the way
SonicView decided to set up the private server option.
There are a few bugs which can not be worked around in the 04.05-P firmware
- It ignores the hostname given by ihubemu, even though it asks for it - so
you do need to set that manually on in the "IP Config" menu if you want to
be able to turn on the "Use DNS" mode and have it work properly.
ihubemu does override the domain name with the configured remote_ip address
if the SonicView asks for something invalid, so it would likely still work
but would have more complaints in the ihubemu status output.
- It sometimes corrupts the DNS Server IP to 255.0.0.0 for no apparent reason
but since that setting doesn't matter anyway it won't break anything.
(set your DNS the normal way on your Linux box, ihubemu uses that always)
- It will try to configure the Server Hostname to a bogus value of "*****"
every time you power up the SonicView. Who knows why it does that, but
ihubemu tells it to screw itself and doesn't nuke your setting in the config
- It also tries to set the remote IP to 0.0.0.0 under some circumstances, and
ihubemu will inform the SonicView that it is insane (again, no damage to
the config file)
- Now and then with "Use DNS" mode turned on, if the ihubemu is shut down and
then later brought up again, the SonicView will be in a weird state and asks
to connect to what seem like totally random IP addresses. This is worked
around by forcing the connection to only the IP or Hostname in the config
file, and nowhere else. So this blocks both the "confusion" problem and any
possibility of it trying to connect elsewhere on purpose.
About the Config File
The config file is read from ./conf/ihubemu and must stay there
Below is an example of what it should look like, in case yours gets screwed:
config 'ihubemu' 'settings'
option 'serial_dev' '/dev/ttyS0'
option 'serial_timeout' '3.0'
option 'handshake_host' 'cardshark.doesntexist.org'
option 'handshake_port' '15309'
option 'remote_host' 'your.newcamd.provider.com'
option 'remote_ip' '22.214.171.124'
option 'remote_port' '54321'
option 'dns_enable' '1'
the full device path for the serial port your SonicView is on
Most of the time we wait forever for the SonicView to tell us what to do.
The serial side of communications will wait at least this long for any
message to complete. This is mainly to bail out of the receive loop in
case a message is somehow incomplete, but the only way that can happen is
if you shut the SonicView off while it is in the middle of sending a
message, or if your serial cable is flaky. Probably fine left at default.
this is an Internet server that simply has a real iHub connected to it,
and this is the current method for getting past the detection handshake.
The only data sent or received is the boot time handshake, and it is only
connected for a few seconds. The operators of the default handshake server
do log the handshakes that go through, but only for improvement of future
versions of ihubemu (building a list of real challenges and their correct
response) so that the list can be embedded in future versions, or to assist
in figuring out the actual calucation involved to avoid any use of an
external handshake server. So by using the default server you are actually
helping to improve this software, which you got for free in case you forgot,
so just leave these at defaults. The handshake data is not personally
identifiable to you or your specific SonicView STB or anything at all.
This is where you put the hostname of your newcamd private server. If it
doesn't have a hostname then just put the IP in both. These are used
internally for some sanity checks (bug workarounds) so they should be set
to something you want the SonicView to be allowed to connect to.
If the SonicView tries to connect to somewhere and the IP it asks for
doesn't match remote_ip or the IP provided by a lookup of remote_host,
ihubemu tells it "yeah sure" but connects to the remote_ip instead. So
this needs to be set as it is used internally as an override.
IF YOU SET "USE DNS" TO "YES" and enter a hostname in the "IP Config" menu
on the SonicView, and that hostname is valid (returns an IP when resolved)
then this config file directive will be overwritten. This is intended as
an ease-of-use feature.
Your newcamd server will have a port # you need to connect to, put it here.
This is directly tied to the "Server Port" setting in the "IP Config" menu.
If you change it on the SonicView it will be saved in the config file.
This is directly tied to the "Use DNS" setting in the "IP Config" menu.
If you change it on the SonicView it will be saved in the config file.
Basically it doesn't do much other than change the way the SonicView does
its connection setup, but ihubemu mostly ignores what the SonicView has to
say about connection setup. If you do enable this, your remote_ip setting
may be overwritten by hostname lookups sent by the SonicView, as that is
the only time it ever really tells ihubemu what hostname it has in its menu
Other times it says its "*****" or some other total crap, and it also asks
ihubemu for the proper setting but then promptly ignores it. Suggested
you just leave this off unless you absolutely need to use a hostname for
your specific private newcamd provider, or you notice one mode works better
for you than the other.
There are a few more you can set, but they are not required as the default
for them is either autodetected at startup (local_ip, local_netmask, etc)
or they are not used other than as canned responses to unimportant queries
from the SonicView. There is a list of configuration settings when you
fire up ihubemu, and they would be named the same thing in the config file.