PDA

View Full Version : Running multiple oscams on OpenViX



Szelest
12-11-23, 21:41
I would like to run at least 2 oscam instances on my stb, but the first problem is, i have no idea how to change config files location for each instance, i thought it is just a matter of adding the bins, then adding in init.d file called softcam.oscam-whatever, changing the location of config files in there, and then enabling oscam with my remote and it would just run, but its not, could anyone tell me what else to do, and what i am doing wrong?

johnhoe
13-11-23, 09:44
Simply create your other set of oscam configs (ie minimum oscam.server and oscam.conf) in a sub-directory "extra" off var/etc/tuxbox/config ie var/etc/tuxbox/config/extra.
Then create an alternative softcam.oscam2 script based upon softcam.oscam-latest or softcam.oscam
This should have references to the extra subdirectory when running your oscam in the new script like this:-

/usr/bin/oscam --wait 60 --config-dir /etc/tuxbox/config/extra --daemon --pidfile /tmp/oscam.pid --restart 2 --utf8

save it into var/etc/init.d . Give this file attribute 755.
You should then see after reboot the new script in softcam setup in menu.

Szelest
13-11-23, 13:09
Simply create your other set of oscam configs (ie minimum oscam.server and oscam.conf) in a sub-directory "extra" off var/etc/tuxbox/config ie var/etc/tuxbox/config/extra.
Then create an alternative softcam.oscam2 script based upon softcam.oscam-latest or softcam.oscam
This should have references to the extra subdirectory when running your oscam in the new script like this:-

/usr/bin/oscam --wait 60 --config-dir /etc/tuxbox/config/extra --daemon --pidfile /tmp/oscam.pid --restart 2 --utf8

save it into var/etc/init.d . Give this file attribute 755.
You should then see after reboot the new script in softcam setup in menu.

https://github.com/s3n0/e2scripts/blob/master/softcam i used this, cause i wasnt sure how to add the lines u said to the file softcam.oscam* and actually make it work, it has a different directory for oscam, and it worked when i used original oscam-latest bin + my new oscam bin, but then when i replaced (kept the same name) oscam-latest, to a different bin, the oscam-latest no longer works, or should i say, it seems like its working in gui, but seems like it switched its config directory to the other oscam im running, so both bins for some reason, are using the config directory from the github script?

twol
13-11-23, 14:20
https://github.com/s3n0/e2scripts/blob/master/softcam i used this, cause i wasnt sure how to add the lines u said to the file softcam.oscam* and actually make it work, it has a different directory for oscam, and it worked when i used original oscam-latest bin + my new oscam bin, but then when i replaced (kept the same name) oscam-latest, to a different bin, the oscam-latest no longer works, or should i say, it seems like its working in gui, but seems like it switched its config directory to the other oscam im running, so both bins for some reason, are using the config directory from the github script?

OpenViX oscam softcams will when installed create the basic files using the oscam suffix such as oscam-latest, so for example in the case you have a script installed in /etc/init.d ---> softcam.oscam-stable , a config file /etc/tuxbox/config/oscam-stable and a binary fiile in usr/softcam NOT /usr/bin.

So if you go to Menu/setup there are 2 methods --- I would suggest you use Softcam Script not SoftcamManager.
So to add a new Oscam ... copy the bin file to /usr/softcam as e.g. oscam-fred and set file permissions to 755. Copy an installed script to your PC, rename it to whatever the Oscam is called e.g. oscam-fred and copy back to /etc/init.d set the file permissions to 755, create a config in /etc/tuxbox/config/oscam-fred

Go to menu/setup/softcam script and select the script file oscam-fred ... and everything should start

As above OpenViX softcams go in /usr/softcams....and the scripts expect the bin file to be there

Szelest
13-11-23, 15:45
it is exactly same as above, the oscam-latest is using the others oscam config directory, instead of the default one, and again, it works perfectly on the original oscam-latest, but when i replace the bin (again without changing the name) this problem occurs

Szelest
13-11-23, 15:58
Let me just sum it up so theres no misunderstanding, if i install fresh oscam-latest from the feed, it uses /etc/tuxbox/config directory, for the config,
then im adding oscam-whatever and using the linked script (ofc edited the directory of the bin and name etc), and start it, both oscams work from thier own default config directories, for latest its above, and for whatever its /etc/tuxbox/config/oscam
but as soon as i replace oscam-latest bin file, with the one bin i need and rename it to oscam-latest, set permission, restart the box, suddenly oscam-latest now is using oscam-whatever config files from /etc/tuxbox/config/oscam instead of its own default config directory

i dont know how to make my own starting script, and when i tried to edit the oscam-latest script, to change the config directory (or based on this, create another one for the other oscam bin, with different directories), it just doesnt do anything


/etc/tuxbox/config/oscam-stable

so i actually installed oscam-latest, and oscam-stable few hours ago, on fresh system, and both bins use /etc/tuxbox/config as the default directory for config, not the folder named as the bin, theres a config in /etc/tuxbox/config/oscam-latest, but the bin doesnt use it at all i always thought its just an example for ppl who dont know how to set up thier oscams, so they can copy these files to /etc/tuxbox/config and start oscam and keep working from there.


Unix starttime: 1699888921
Starttime: 13.11.2023 15:22:01
Version: oscam-1.20_svn-r11725
Compiler: arm-oe-linux-gnueabi
Box type: H9Twin (generic)
PID: 2385
TempDir: /tmp/.oscam
GBox tmp_dir: not defined using: /tmp/.oscam
ConfigDir: /etc/tuxbox/config/
WebifPort: 83
theres fresh installation of oscam-latest not using /etc/tuxbox/config/oscam-latest for config directory

twol
13-11-23, 16:46
Let me just sum it up so theres no misunderstanding, if i install fresh oscam-latest from the feed, it uses /etc/tuxbox/config directory, for the config,
then im adding oscam-whatever and using the linked script (ofc edited the directory of the bin and name etc), and start it, both oscams work from thier own default config directories, for latest its above, and for whatever its /etc/tuxbox/config/oscam
but as soon as i replace oscam-latest bin file, with the one bin i need and rename it to oscam-latest, set permission, restart the box, suddenly oscam-latest now is using oscam-whatever config files from /etc/tuxbox/config/oscam instead of its own default config directory

i dont know how to make my own starting script, and when i tried to edit the oscam-latest script, to change the config directory (or based on this, create another one for the other oscam bin, with different directories), it just doesnt do anything



so i actually installed oscam-latest, and oscam-stable few hours ago, on fresh system, and both bins use /etc/tuxbox/config as the default directory for config, not the folder named as the bin, theres a config in /etc/tuxbox/config/oscam-latest, but the bin doesnt use it at all i always thought its just an example for ppl who dont know how to set up thier oscams, so they can copy these files to /etc/tuxbox/config and start oscam and keep working from there.


Unix starttime: 1699888921
Starttime: 13.11.2023 15:22:01
Version: oscam-1.20_svn-r11725
Compiler: arm-oe-linux-gnueabi
Box type: H9Twin (generic)
PID: 2385
TempDir: /tmp/.oscam
GBox tmp_dir: not defined using: /tmp/.oscam
ConfigDir: /etc/tuxbox/config/
WebifPort: 83
theres fresh installation of oscam-latest not using /etc/tuxbox/config/oscam-latest for config directory
how are you starting the softcams??

Szelest
13-11-23, 16:51
that fresh oscam-latest without anything else, from the remote from softcam menu or w/e its called, i tried both script and menu and both give the exactly the same results
its just, the oscams dont use the config locations from softcam.oscam-latest, -stable or whatever, it seems to me like the bins ignore that script configuration, and using the default config directory, that was selected during compilation.

twol
13-11-23, 17:03
that fresh oscam-latest without anything else, from the remote from softcam menu or w/e its called, i tried both script and menu and both give the exactly the same results
its just, the oscams dont use the config locations from softcam.oscam-latest, -stable or whatever, it seems to me like the bins ignore that script configuration, and using the default config directory, that was selected during compilation.

softcammanager starts from config, softcam script uses whatever is in the script name, so that from softcam.oscam-stable it will start oscam-stable
this from the standard default installed script......where $CAM in this example would be oscam-stable
So check whats in the script sounds like you are using the one you installed from above link

PIDFILE=/var/tmp/${CAM}.pid
DESC="Softcam service $CAM"
DAEMON=/usr/softcams/$CAM

case "$1" in
start)
if [ -e $PIDFILE ]; then
PIDDIR=/proc/$(cat $PIDFILE)
if [ -d ${PIDDIR} ] && [[ $(readlink -f ${PIDDIR}/exe) == $DAEMON ]]; then
echo "$DESC already started; not starting."
exit 1
else
rm -f $PIDFILE
fi
fi
echo -n "Starting $DESC: "
ulimit -s 1024
$DAEMON --config-dir /etc/tuxbox/config/$CAM --daemon --pidfile $PIDFILE --restart 2 --utf8 2| grep -v "UTF-8 mode"

Szelest
13-11-23, 17:06
softcammanager starts from config, softcam script uses whatever is in the script name, so that from softcam.oscam-stable it will start oscam-stable
this from the standard default installed script......where $CAM in this example would be oscam-stable
So check whats in the script sounds like you are using the one you installed from above link

PIDFILE=/var/tmp/${CAM}.pid
DESC="Softcam service $CAM"
DAEMON=/usr/softcams/$CAM

case "$1" in
start)
if [ -e $PIDFILE ]; then
PIDDIR=/proc/$(cat $PIDFILE)
if [ -d ${PIDDIR} ] && [[ $(readlink -f ${PIDDIR}/exe) == $DAEMON ]]; then
echo "$DESC already started; not starting."
exit 1
else
rm -f $PIDFILE
fi
fi
echo -n "Starting $DESC: "
ulimit -s 1024
$DAEMON --config-dir /etc/tuxbox/config/$CAM --daemon --pidfile $PIDFILE --restart 2 --utf8 2| grep -v "UTF-8 mode"

its exactly that, i put it on fresh system to just prove my point, literally installed fresh, updated feeds, installed oscam and thats the result
so you are saying, i have to run all the oscam instances from the script for it to work properly? i thought softcam manager is for that to work properly, at least for the default bin from feed, this is confusing :confused:

twol
13-11-23, 19:39
its exactly that, i put it on fresh system to just prove my point, literally installed fresh, updated feeds, installed oscam and thats the result
so you are saying, i have to run all the oscam instances from the script for it to work properly? i thought softcam manager is for that to work properly, at least for the default bin from feed, this is confusing :confused:
Softcammanager doesn,t use scripts and uses a config if defined from /etc/tuxbox/config, but you can select an oscam binary installed in /usr/softcam
Because so many images now use scripts and users can have more than one oscam installed, support for scripts was added to openvix via softcam script.….for testing purposes I have currently 4 scriots installed to test various things.
To run different versions, its easier to use the scripts from softcam script, rather than some manual method

Szelest
13-11-23, 20:21
nvm i found the command, thanks!

Szelest
13-11-23, 21:03
Ok cant edit the message, so i found a command to run both oscams, but after restart, it doesnt autostart, so how do i exactly make it autostart after boot, restart if crashed, and run both at the same time?

johnhoe
13-11-23, 22:23
You can't run "both oscams". Only one oscam at a time...
"I would like to run at least 2 oscam instances"
Do you mean two servers?

BrianG61UK
13-11-23, 22:50
I switched from using oscam-latest to using oscam-stable some time ago after finding oscam-latest had problems at one point.

At least for my usage case*, oscam-stable has worked perfectly for many months. I think it is since OpenVIX 6.1, maybe 6.0, but I could be wrong.

* using an expired white Sky UK card to allow watching the one remaining FTV channel on Sky UK.

BrianG61UK
13-11-23, 22:51
I would like to run at least 2 oscam instances on my stb
I may be misunderstanding something, but I thought there was never any reason to do that.

Szelest
15-11-23, 12:49
You can't run "both oscams". Only one oscam at a time...
"I would like to run at least 2 oscam instances"
Do you mean two servers?

i can, i found the commands


cd etc/init.d
update-rc.d softcam.oscam* defaults
and this is to autostart, i already had the commands to run both of them, but after restart they didnt start up automatically


I may be misunderstanding something, but I thought there was never any reason to do that.

theres plenty of reasons, these days, if u want particular card to work u need certain oscam, but if u have another card, that needs other stuff, thats only available from different oscam, u need to run both, cause either one doesnt have the other card needs.