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
  • 9 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
  • 39,946 posts

+413
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 Thanks to Henksat

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

  • PLi® Core member
  • 38,352 posts

+409
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:
- 19.2E/13.0E/4.8E/0.8W/5W single LNB's via uncomitted switch 8->1
- 28.2E/23.5E quattro LNB's via unicable switch
UPC digital cable TV (FTA) on all receivers


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

  • Member
  • 9 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
  • 38,352 posts

+409
Excellent

Posted 17 February 2017 - 17:33

Yes.


* Wavefrontier T90 with:
- 19.2E/13.0E/4.8E/0.8W/5W single LNB's via uncomitted switch 8->1
- 28.2E/23.5E quattro LNB's via unicable switch
UPC digital cable TV (FTA) on all receivers


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

  • Member
  • 9 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

  • Forum Moderator
    PLi® Core member
  • 31,379 posts

+428
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.


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

Currently in use: VU+Duo2 (3xS2), ET10000 (4xS2), HD2400 (4xS2), Formuler F1 (2xS2), Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+ and on the test stack: XP1000Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2).


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

  • Member
  • 9 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

  • Forum Moderator
    PLi® Core member
  • 31,379 posts

+428
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).


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

Currently in use: VU+Duo2 (3xS2), ET10000 (4xS2), HD2400 (4xS2), Formuler F1 (2xS2), Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+ and on the test stack: XP1000Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2).


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

  • Member
  • 9 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

  • Forum Moderator
    PLi® Core member
  • 31,379 posts

+428
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.


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

Currently in use: VU+Duo2 (3xS2), ET10000 (4xS2), HD2400 (4xS2), Formuler F1 (2xS2), Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+ and on the test stack: XP1000Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2).


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

  • Member
  • 9 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
  • 9 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
  • 3,019 posts

+170
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
  • 9 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
  • 9 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.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users