Jump to content


Photo

How to get SID of the current channel

dvbapi camd.socket pmt.tmp sid C++

  • Please log in to reply
15 replies to this topic

#1 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 17 February 2017 - 12:06

Greetings!

 

I implement some plugin on C++ for OpenPLi. It should gather the statistics watching TV channels (sid, onid, tsid etc) without Python API. The main question: how can I get the SID of the current channel?

 

Should I read /tmp/camd.socket file (just read as a client) or use some dvbapi3?



Re: How to get SID of the current channel #2 littlesat

  • PLi® Core member
  • 57,161 posts

+698
Excellent

Posted 17 February 2017 - 12:51

Look how it is grabbed in PliExtraInfo.py

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: How to get SID of the current channel #3 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+541
Excellent

Posted 17 February 2017 - 13:04

I believe you can get this information from the web interface, using the xml interface.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: How to get SID of the current channel #4 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 17 February 2017 - 13:16

Look how it is grabbed in PliExtraInfo.py

 

Thank you! Unfortunately, I could not find a primary data source...

 

I believe you can get this information from the web interface, using the xml interface.

 

TIA! A good idea! But WI plugin may be turned off. So I have some doubts about this method.

 

What about camd.socket file? Is it only for softcams?



Re: How to get SID of the current channel #5 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+541
Excellent

Posted 17 February 2017 - 17:33

Yes.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: How to get SID of the current channel #6 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 17 February 2017 - 18:57

Ok. Is basic web authentication required for WebIF API from local host? Can WebIF API disabled with web interface?

Re: How to get SID of the current channel #7 WanWizard

  • PLi® Core member
  • 70,497 posts

+1,810
Excellent

Posted 17 February 2017 - 19:48

Localhost does not need authentication unless authentication for streaming is enabled. You can disable the WebIf plugin, which also disables the API.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: How to get SID of the current channel #8 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 17 February 2017 - 20:00

That's bad.  :huh: Are there other ways to get information about the current service?



Re: How to get SID of the current channel #9 WanWizard

  • PLi® Core member
  • 70,497 posts

+1,810
Excellent

Posted 17 February 2017 - 20:09

You want internal information from the box, anything you do will be intrusive, either use something existing, or via your own plugin (which users can disable too).


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: How to get SID of the current channel #10 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 17 February 2017 - 20:31

I agree that user can disable my plugin. However, the user must not disable API. Moreover, it is unclear why the authorization required for the local host.

 

So, Enigma2 has no API for Linux / C ++ developers. You can implement the API through the socket files in XML format like in webIF. Or make *.h and *.a files for C/C++ plugins. Isn't it?


Edited by Stuart, 17 February 2017 - 20:35.


Re: How to get SID of the current channel #11 WanWizard

  • PLi® Core member
  • 70,497 posts

+1,810
Excellent

Posted 17 February 2017 - 20:44

As I said, by default it is disabled: see https://github.com/E...pserver.py#L284. As for the reasoning behind this, you need to ask the OWIF people, it's third pary development, we are not involved. 

 

The C++ core is not written to be interfaced with via a loosly-coupled API. It has an API to Python which provides the I/O layer around the core. Plugins are written in Python.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: How to get SID of the current channel #12 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 17 February 2017 - 22:11

Ok. How can I call OpenPLi plugin component from C++? May be, some works examples...

PyObject* myModuleString = PyString_FromString(("myplugin");
PyObject* myModule = PyImport_Import(myModuleString);

PyObject* myFunction = PyObject_GetAttrString(myModule,"enigma.iServiceInformation.sONID");
PyObject* myResult = PyObject_CallObject(myFunction, NULL);
long result = PyLong_AsLong(myResult);

Is it correct?


Edited by Stuart, 17 February 2017 - 22:13.


Re: How to get SID of the current channel #13 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 18 February 2017 - 22:48

Ok. How can I call Python API from a command line? I could use the Python API in C ++ through the interface, generated by SWIG.

 

root@et7000mini:~# export PYTHONPATH=/usr/lib/enigma2/python
root@et7000mini:~# echo $PYTHONPATH
/usr/lib/enigma2/python
root@et7000mini:~# python
Python 2.7.3 (default, Feb  3 2017, 18:41:32) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append("/usr/lib/enigma2/python")
>>> from enigma import iServiceInformation
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/enigma2/python/enigma.py", line 32, in <module>
  File "/usr/lib/enigma2/python/enigma.py", line 24, in swig_import_helper
ImportError: No module named _enigma

It does not work.



Re: How to get SID of the current channel #14 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 19 February 2017 - 02:33

I think it won't work. You need to run it as a plugin.

Why do you want to use c++? Write a little python plugin which does the job.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: How to get SID of the current channel #15 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 19 February 2017 - 20:15

I have 12 years of experience developing in C / C ++. I nice to know the syntax and many libraries. In C ++ to develop a more convenient for me.
 
Python knows two days... :o  Implemented on Python system plugin, which will give the desired data via a local socket to C application.  :D


Re: How to get SID of the current channel #16 Stuart

  • Member
  • 16 posts

0
Neutral

Posted 19 February 2017 - 20:22

By the way, I get original network id from iServiceInformation. How do to get network Id? Sometimes they are not equals.





Also tagged with one or more of these keywords: dvbapi, camd.socket, pmt.tmp, sid, C++

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users