RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Repo Name | URL | Comment |
---|---|---|
WPEFramework | https://github.com/WebPlatformForEmbedded/WPEFramework | Main repo for Thunder/WPEFramework |
WPEFrameworkPlugins | https://github.com/WebPlatformForEmbedded/WPEFrameworkPlugins | Various WPEFramework plugins |
Lightning SDK | https://github.com/WebPlatformForEmbedded/Lightning | WPE UI Framework (JS & WebGL library for developing web apps) |
WPEReferenceUX | https://github.com/WebPlatformForEmbedded/WPEReferenceUX | Sample UI/Demo app which demonstrates WPEFramework and Lightning use |
WPEPluginLauncher | https://github.com/WebPlatformForEmbedded/WPEPluginLauncher | Plugin to "Launch" linux applications and scripts |
WPEFramework provides a unified web-based interface with a consistent navigation model. In this model, plugins (custom or generic) are controlled and queried, through the WPEFramework application.
The main responsibilities of WPEFramework application are:
Each instance of a plugin in the WPE id identified by a name. This name is referred to as Callsign of the plugin. The callsign must be unique in the context of all configured plugins.
All request and response bodies should use the JSON format for data.
Method | Function |
---|---|
GET | Retrieve information from WPEFramework or a plugin |
POST | Update new information or new objects at WPEFramework or a plugin |
PUT | Update new information or new objects at WPEFramework or a plugin |
DELETE | Delete information at WPEFramework or a plugin |
All WPEFramework commands start with the “Service” prefix followed by the Plugin name:
(GET|POST|PUT|DELETE) /Service/<PluginName>[/OptionalPaths] HTTP/1.1
Retrieve the list of all active plugins:
curl -X GET http://192.168.1.122:9998/Service/Controller
Deactivate OCDM plugin:
curl -X PUT http://192.168.1.122:9998/Service/Controller/Deactivate/OCDM
Send a Scan command to the WIFI controller plugin:
curl -X PUT http://192.168.1.122:9998/Service/WifiControl/Scan
Update the WebktiBrowser config:
curl -X POST http://192.168.1.122:9998/Service/WebKitBrowser/Config --data "config.json"
The architecture of the WPEFramework offers event based feedback to clients. This functionality is realized using web socket connections to a plugin. Over these web socket connections, the plugin will notify the client on the other side of the web socket of events specific to the plugin.
The syntax for opening a web socket to the plugin is equal to the syntax of the RESTfull API:
Request: ws://<IP Address and port of WPEFramework>/Service/<Callsign>
protocol: notification
In Javascript, the socket would be opened like:
socket = new WebSocket("ws://192.168.1.122:9998/Service/Controller", "notification");
using wscat tool: (shows notification for OCDM plugin being deacticated)
09:23 $ wscat -c ws://192.168.1.122:9998/Service/Controller -s notification --no-color
connected (press CTRL+C to quit)
< {"callsign":"OCDM","state":"deactivated","reason":"Requested"}
< {"subsystems":{"Decryption":false}}
>
Using the Controller callsign, one can listen to all the notifications. If a specific plugin callsign is used when opening the websocket connection, only events from that plugin will be received.
Config files are stored under /etc/WPEFramework:
root@pacexi5:/etc/WPEFramework# find .
.
./config.json
./plugins
./plugins/OCDM.json
./plugins/DeviceInfo.json
./plugins/Tracing.json
./plugins/Monitor.json
config.json is the main configuration file for the WPEframework and port number and network interface for the main HTTP API are set here:
"version":"1.0.0000000",
"port":9998,
"binding":"0.0.0.0",
"ipv6":false,
"idletime":180,
"persistentpath":"/opt",
"datapath":"/usr/share/WPEFramework",
"systempath":"/usr/lib/wpeframework/plugins",
"proxystubpath":"/usr/lib/wpeframework/proxystubs",
"redirect":"/Service/Controller/UI",
Each plugin has a json config file under /etc/WPEFramework/plugins. For example, OCDM plugin config file OCDM.json:
root@pacexi5:/etc/WPEFramework# cat plugins/OCDM.json
{
"locator":"libWPEFrameworkOCDM.so",
"classname":"OCDM",
"precondition":[
"Provisioning"
],
"autostart":true,
"configuration":{
"outofprocess":true,
"mapping":[
{
"key":"com.youtube.playready",
"system":"PlayReady"
},
{
"key":"com.microsoft.playready",
"system":"PlayReady"
},
{
"key":"com.widevine.alpha",
"system":"WideVine"
}
]
Generic plugin properties like preconditions, autostart and outofprocess are set here as well as plugin specific ones. In this case, supported KeySystems (DRMs) are listed in the config file.
Two executables are installed in /usr/bin:
/usr/bin/WPEFramework-1.0.0000000
/usr/bin/WPEProcess -> WPEProcess-1.0.0000000 (each out-of-process plugin will run in a seperate WPEProcess)
/usr/bin/WPEProcess-1.0.0000000
/usr/bin/WPEFramework -> WPEFramework-1.0.0000000 (main WPEFramework process, started with systemd, Controller and in-process plugins run in this process)
wpeframework core libraries are in /usr/lib:
root@pacexi5:/usr/lib# ls -l libWPEFramework*
libWPEFrameworkCore.so -> libWPEFrameworkCore.so.1
libWPEFrameworkCore.so.1 -> libWPEFrameworkCore.so.1.0.0000000
libWPEFrameworkCore.so.1.0.0000000
libWPEFrameworkCryptalgo.so -> libWPEFrameworkCryptalgo.so.1
libWPEFrameworkCryptalgo.so.1 -> libWPEFrameworkCryptalgo.so.1.0.0000000
libWPEFrameworkCryptalgo.so.1.0.0000000
libWPEFrameworkPlugins.so -> libWPEFrameworkPlugins.so.1
libWPEFrameworkPlugins.so.1 -> libWPEFrameworkPlugins.so.1.0.0000000
libWPEFrameworkPlugins.so.1.0.0000000
libWPEFrameworkProtocols.so -> libWPEFrameworkProtocols.so.1
libWPEFrameworkProtocols.so.1 -> libWPEFrameworkProtocols.so.1.0.0000000
libWPEFrameworkProtocols.so.1.0.0000000
libWPEFrameworkTracing.so -> libWPEFrameworkTracing.so.1
libWPEFrameworkTracing.so.1 -> libWPEFrameworkTracing.so.1.0.0000000
libWPEFrameworkTracing.so.1.0.0000000
OCDM library is also part of WPEFramework:
root@pacexi5:/usr/lib# ls -l libocdm.so*
libocdm.so -> libocdm.so.1
libocdm.so.1 -> libocdm.so.1.0.0000000
libocdm.so.1.0.0000000
Plugin shared libs are located in /usr/lib/wpeframework:
root@pacexi5:/usr/lib/wpeframework# find .
./plugins/libWPEFrameworkMonitor.so
./plugins/libWPEFrameworkOCDM.so
./plugins/libWPEFrameworkWebKitBrowser.so
./plugins/libWPEFrameworkTraceControl.so
./plugins/libWPEFrameworkDeviceInfo.so
./proxystubs
./proxystubs/libWPEFrameworkInterfaces.so.1.0.0000000
./proxystubs/libWPEFrameworkInterfaces.so
./proxystubs/libWPEFrameworkProxyStubs.so.1
./proxystubs/libWPEFrameworkProxyStubs.so.1.0.0000000
./proxystubs/libWPEFrameworkInterfaces.so.1
./proxystubs/libWPEFrameworkProxyStubs.so
WPEFramework runs as a systemd service. The main process is named WPEFramework and runs the main controller plugin as well as the other in-process plugins (such as monitor, tracing etc).
The out-of-process plugins such as OCDM plugin run in seperate "WPEProcess" processes. For example, in a configuration with Trace, Monitor and DeviceInfo in-process plugins and OCDM out-of-process plugin, the following processes are present:
root@pacexi5:/etc/WPEFramework# ps ax | grep -i wpe
11317 ? Ssl 0:00 /usr/bin/WPEFramework -b
11340 ? Sl 0:00 WPEProcess -a /usr/bin/ -c OCDMImplementation -d /usr/share/WPEFramework/OCDM/ -i 85 -l libWPEFrameworkOCDM.so -m /usr/lib/wpeframework/proxystubs/ -p /opt/OCDM/ -r /tmp/communicator -s /usr/lib/wpeframework/plugins/
Top command output:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25712 root 20 0 105156 3040 2432 S 0.3 0.5 0:00.08 WPEFramework
25737 root 20 0 322284 6120 5064 S 0.0 1.1 0:00.19 WPEProcess
The main WPEFramework process "WPEFramework" uses ~3MB RES memory with monitor, trace and deviceinfo plugins enabled. WPEProcess (OCDM) plugin is using 6MB (in idle state, it uses more when there are active DRM sessions).
Plugins: (Monitor, OCDM,TraceControl,DeviceInfo, WebkitBrowser) use about 409KB of file space:
root@pacexi5:/usr/lib/wpeframework# du -ah
75.0K ./plugins/libWPEFrameworkMonitor.so
103.0K ./plugins/libWPEFrameworkOCDM.so
104.0K ./plugins/libWPEFrameworkWebKitBrowser.so
67.0K ./plugins/libWPEFrameworkTraceControl.so
59.0K ./plugins/libWPEFrameworkDeviceInfo.so
409.0K ./plugins
Core shared libraries use about 600KB of file space:
root@pacexi5:/usr/lib# du -ah libWPEFramework*.so.1.0.0000000
146.0K libWPEFrameworkCore.so.1.0.0000000
34.0K libWPEFrameworkCryptalgo.so.1.0.0000000
152.0K libWPEFrameworkPlugins.so.1.0.0000000
162.0K libWPEFrameworkProtocols.so.1.0.0000000
39.0K libWPEFrameworkTracing.so.1.0.0000000
67.0K libocdm.so.1.0.0000000
ProxyStubs use an additional of 207KB:
root@pacexi5:/usr/lib/wpeframework/proxystubs# du -ah
143.0K ./libWPEFrameworkInterfaces.so.1.0.0000000
63.0K ./libWPEFrameworkProxyStubs.so.1.0.0000000
Executables use 367KB:
root@pacexi5:/usr/bin# du -ah WPE*
276.0K WPEFramework-1.0.0000000
91.0K WPEProcess-1.0.0000000
WebKitBrowserPlugin allows WPEFramework clients to launch WPE instances, set the URL, suspend&resume browser processes. It works similar to rdkbrowser2 but instead of the rtRemote interface, HTTP API is used.
23 Comments
Unknown User (hteece)
There now appears to be two WPE plugin repositories offering mostly different services, but some that overlap.
https://github.com/rdkcentral/rdkservices
And
https://github.com/rdkcentral/ThunderNanoServices
While most of the services don't overlap, some do.
For example, SecurityAgent, OpenCDMi, TraceControl
Worse, it would seem that these components differ depending on the repo.
Can you tell us which repo to use, and why this has come about?
Thanks,
Howard
Deepthi Suseelan
Discussions are in progress on thunder plugins alignment between these 2 repos.
Currently, the official version is https://github.com/rdkcentral/rdkservices
This is what we are building for the Accelerator migration to rdk-next.
Raghavendra Narayana
Hi,
We are trying to implement a diagnostic test application and we wanted to subscribe for the notification from Nano Service. we are getting following error when we send curl command
can you please help us to understand the issue?
Also can you please share one example which we can refer to for notification from JS APP to Nano service?
Deepthi Suseelan
Unknown User (raghavendra.narayana)
You can refer to this sample testapp to understand event notification from Thunder plugins:
https://github.com/rdkcentral/rdkservices/blob/main/WifiManager/test/thunder-wifimanager-test.js
Raghavendra Narayana
Thank you Unknown User (dsuseelan)
will check it
Raghavendra Narayana
Thank you Unknown User (dsuseelan)
will check it
Raghavendra Narayana
Hi Team,
We are looking for an example of sending and receiving of structure in WPEFramework-Plugin using JSON. Could you point me to one such example?
Deepthi Suseelan
Unknown User (raghavendra.narayana)
Can you please provide more details on what structure you meant.? There are lot of get/set properties there, but all these will be predefined structures
Some example in jsonrpcplugin :
https://github.com/rdkcentral/ThunderNanoServices/blob/master/examples/JSONRPCPlugin/JSONRPCPlugin.cpp#L76-L78
Raghavendra Narayana
thank you this example was use full.
Unknown User (keerthi.venkatanaga)
Unknown User (dsuseelan) with the yocto framework, dunfell build would the port to which i make the thunder connection in the lightning app change from 80 to anything diff ? I get a connection refused when try this
const thunderJS = ThunderJS({ host: '127.0.0.1' });
Deepthi Suseelan
Unknown User (keerthi.venkatanaga)
With rdkservices, Thunder framework is now running on port 9998. You can specify the port as well.
Unknown User (keerthi.venkatanaga)
I realized that the plugin I am looking to use isnt present within the plugins folders in the image , how to do I add the plugins during the build process for yocto 3.1(dunfell). Any instructions or documentation for the same would be great.
I have looked into how to make a Thunder Nano service but I wasn't able to add it to the build.
Thank you
Deepthi Suseelan
RDKServices Plugin Template#ToaddPluginintherecipefile - This might be useful for you. The document is a work-in-progress and under review.
Unknown User (keerthi.venkatanaga)
Hi Unknown User (dsuseelan) I tried what is given in that doc but I am still having troubles. Would there be a point of contact for the RemoteControl plugin specifically. This is to include it in the build. This has been a blocker for a while now, would really appreciate any leads.
Deepthi Suseelan
Unknown User (keerthi.venkatanaga)
Please create a ticket in https://jira.rdkcentral.com/ with exact details and issue faced.
Unknown User (rahulku3)
Hi,
We are trying to implement the event call backs based on registration from platform via ThunderJS, but we are not getting to receive the callbacks once the event is invoked.
Is there any documentation for registered event callbacks for thunder js or any sample implementation where we can look.
Deepthi Suseelan
This is a good example to understand event notification from Thunder plugins:
https://github.com/rdkcentral/rdkservices/blob/main/WifiManager/test/thunder-wifimanager-test.js
If you are looking specifically for ThunderJS, Lightning UI code will be a good reference. (RDK UI Options)
Unknown User (keerthi.venkatanaga)
Hi Unknown User (dsuseelan) I have opened a ticket for the issue I have faced and haven't had any inputs. I know that the official repo for the plugins is rdkservices but the RemoteControl plugin is in the ThundernanoServices repo and I have added it but isnt working the way it is supposed to. I have opened a ticket here REFPLTV-865 - Getting issue details... STATUS . Just updated it to reflect the issue.
Deepthi Suseelan
Unknown User (keerthi.venkatanaga)
Can you provide details on what is the issue and till what level it is working? Have you used any utilities like evtest to monitor if key presses are getting detected from kernel level.
Unknown User (srinivass)
Hi Unknown User (dsuseelan) ,
Is there any HTTP API Or Websocket event that provides browser consuming memory, CPU and GPU info ?
Mohd Saliem
Hi Unknown User (dsuseelan) ,
Is there a way to find the number of active plugins?
Prabhat
Hi Unknown User (dsuseelan) Do you have a Thunder deb package created that I could use?
Z-Mahalaxmi Chittawadagi
Hi Unknown User (dsuseelan)
For RDK-Broadband, trying to bring up TDK framework on Raspberrypi(3b) board.
Raspberrypi board is built and loaded with tdk enabled image, configured the test manager(x86) referring the steps in RDK central. Currently we are seeing communication issue between Raspberrypi(DUT) and test manager.
At tdk test manager we observed that device is not showing in green instead showing in grey.
Displaying below message:
Rasberrypi : Device is not free to execute scripts.
1) For Test Manager to communicate with device, WPE framework (Thunder) is mandatory ?
If yes, please point the link to follow instructions
2) Without WPE framework, is it possible to establish communication with Device
Please help on this regard
Thanks & Regards,
Mahalaxmi.