Yuping Tseng, CTO of ThroughTek, discusses how to incorporate the AllJoyn framework to the ThroughTek Kalay Platform at the AllSeen Alliance's LinuxCon Japan Mini-Summit in June 2015.
1. 5/26/2015 AllSeen Alliance 1
Designing for
Interoperability:
Yuping Tseng
CTO, ThroughTek Inc.
Incorporating AllJoyn Framework
to the Kalay Platform
2. 5/26/2015 AllSeen Alliance 22
1. Introduction About ThroughTek
2. Use Application:
Surveillance for the Smart Home
3. How Kalay Works with AllJoyn
4. Potential Issues and Difficulties
5. Future Possibilities:
Smart Home and Beyond
Agenda
4. 5/26/2015 AllSeen Alliance 4
About ThroughTek
• Committed to IoT (Internet of Things) & M2M (Machine to Machine)
– Kalay Platform: Kalay Cloud, Kalay Connect, Kalay Application
• Total solution provider for cloud connection platform
• Support streamlined enterprise entry into IoT & M2M markets
• Robust cloud functionality with modular, scalable architecture
5. 26 May 2015 AllSeen Alliance 5
Align Our Values
• Develop strategic services to optimize product experiences
• Work together across company lines and industries
• Create opportunities for the IOT market
• Create products & apps that will be interoperable in the future
6. 5/26/2015 AllSeen Alliance 6
About ThroughTek
• Established in July 2008
• Employees: 150+
• Headquarters: Taipei, Taiwan
• Branches:
– Shenzhen
– Shanghai
– Hong Kong
– Yilan
11. 5/26/2015 AllSeen Alliance 11
High Level Platform Overview
• Kalay modules: A full suite of
intelligence capabilities
• Kalay SDK
• FW Integration
• Generic Applications & Portal
• Customization Service
12. 5/26/2015 AllSeen Alliance 12
Kalay Platform Structure
SDK & RESTful APIs
Consumer
Device Layer
Enterprise
Retail Industry Agriculture Home Storage Wearables
3rd Party
Modules
3rd Party
Modules
Analytics Logic Engine VSaaS Cloud StorageTPNS BillingP2P/RelayUID
Kalay Connect
13. 5/26/2015 AllSeen Alliance 13
Kalay P2P / Relay Server
• P2P delivers real live view, reduced data costs & greater privacy
• P2P and Relay means always connected
UID Verify
Access with
UID & Password
Connection Established
Kalay P2P / Relay Server
Device
Device
Firmware
UID
Kalay API
Modules
Host OS
Client
Browser or
App
Kalay API
Modules
Host OS
15. 5/26/2015 AllSeen Alliance 15
Kalay Logic Engine
Execute tasks on
devices across LAN,
WAN or Internet
Work with 3rd party
applications
Collect rules for
consumer
behaviour analysis
IFTTT Concept for Task Automation
(IF This Then That)
24. 5/26/2015 AllSeen Alliance 24
Discovering Devices, Notifications
and Live Streaming
• Combine AllJoyn notification framework and Kalay Multimedia SDK
• App developed to integrate Kalay and Gateway Controller Framework
• Kalay Cloud Service used for remote access
Kalay
Cloud Service
IP Camera
Notification
Service
Framework
Kalay
Multimedia
SDK
Raspberry Pi
(Gateway Agent)
Gateway
Agent
Framework
Kalay BOX
SDK
LG TV
Notification
Service
Framework
PESI Set Top Box with Storage
Notification
Service
Framework
Kalay
Multimedia
SDK
Mobile Device
Gateway
Controller
Framework
Kalay
Multimedia
SDK
AllJoyn
Kalay
26. 5/26/2015 AllSeen Alliance 26
What Each Framework Offers
Minimal effort for integration
Cloud service and multimedia
module supports:
• Video streaming
• Push notification service
• Connectivity over the internet
Service runs on local network
and enables:
• Discovery
• Advertisement
• Notification
• Gateway Agent
KalayAllJoyn
27. 5/26/2015 AllSeen Alliance 27
Works to be done with AllJoyn
• Build Standard AllJoyn Core
– AllJoyn router to create and join AllJoyn bus
– About Service to advertise the device, IP Cam, TV, or Storage
• Build Notification Service
– Producer for sending specific message, such as motion alert
– Consumer for receiving the alert and taking follow-up actions.
• Build Gateway Connector of Gateway Agent Service
– Connect to Gateway Management Node
– Write a script to send message to TPNS server for push notification
28. 5/26/2015 AllSeen Alliance 28
Producer Sample code
• Take two parameters from command line: UID, message
std::map<qcc::String, qcc::String> customAttributes;
customAttributes[KEY1] = argv[1];
std::vector<NotificationText> vecMessages;
NotificationText textToSend1(LANG1, argv[2]);
vecMessages.push_back(textToSend1);
//Prepare Rich Notification Content
.....
// Send messages
Notification notification(messageType, vecMessages);
notification.setCustomAttributes(customAttributes);
// Set Rich content
....
status = Sender->send(notification, 7200);
29. 5/26/2015 AllSeen Alliance 29
Consumer Sample code
• Check if wanted message and whether to take actions
// If applications list is empty or the name exists in the filter list then print the notification
if ((m_Applications.size() == 0) || (find(m_Applications.begin(), m_Applications.end(), appName)
!= m_Applications.end())) {
// "******************** Begin New Message Received ********************"
std::ofstream outFile;
outFile.open(outFilename.c_str());
std::cout << "Other parameters included:" << std::endl;
std::map<qcc::String, qcc::String> customAttributes = notification.getCustomAttributes();
std:String msg = "Nothing";
for (std::map<qcc::String, qcc::String>::const_iterator customAttributes_it = customAttributes.begin();
customAttributes_it != customAttributes.end(); ++customAt$
outFile << customAttributes_it->second.c_str() << std::endl;
}
// get vector of text messages and iterate through it
std::vector<NotificationText> vecMessages = notification.getText();
for (std::vector<NotificationText>::const_iterator vecMessage_it = vecMessages.begin();
vecMessage_it != vecMessages.end(); ++vecMessage_it) {
outFile << vecMessage_it->getText().c_str() << std::endl;
}
outFile.close();
....
}
30. 5/26/2015 AllSeen Alliance 30
GatewayConnector Sample code
• Receive the message from Notification service and invoke the script
class MyReceiver : public NotificationReceiver {
public:
virtual void Receive(Notification const& notification) {
vector<NotificationText> vecMessages = notification.getText();
for (vector<NotificationText>::const_iterator it = vecMessages.begin();
it != vecMessages.end(); ++it) {
if (tutkScript.size() && it->getLanguage().compare("en") == 0) {
qcc::String cmd = "sh -i " + tutkScript + " "" + notification.getAppName() +
" sent: " + it->getText().c_str() + """;
int result = system(cmd.c_str());
result = WEXITSTATUS(result);
}
}
}
};
31. 5/26/2015 AllSeen Alliance 31
Works to be done on Kalay side
• Build Kalay Modules on device / IP camera
– Embed with UID for identification and P2P service
– Use AV module to send video stream
• Build the client for AV module
– Receive UID from AllJoyn notification and pass to AV client
– Display video stream if the client is a set-top box or smart TV
– Store the video stream as file if the drive is storage or NAS
• Write script to send push notification
– Send message to TPNS server and push to smart phones
– Similar to tweeter script in AllJoyn sample, a RESTful request
UID
Service
Twitter
33. 5/26/2015 AllSeen Alliance 33
What to do with AllSeen / AllJoyn?
• When and how will we find compatible solution with AllSeen?
– No clear idea about AllJoyn framework
– False expectation beyond current limitations
• How to interact with AllJoyn devices?
– Core component, basic services, working groups
– Add some extra control over existing services
• How to interact with other AllJoyn devices made by 3rd-party?
– Do current available components provide necessary capabilities?
– Customized works on top of current services to share between partners
34. 5/26/2015 AllSeen Alliance 34
Technical Challenges
• Fit AllJoyn to Device
– Set up the right environment to build the modules
– Select the necessary modules to limit the overall code size
• Resolve Conflicts Between Two Frameworks
– Potential port conflicts
– Libraries inconsistency
• Testing on Raspberry Pi
– Complete tutorial of building AllJoyn on Raspberry Pi
– Kalay modules ready for Raspberry Pi
39. 5/26/2015 AllSeen Alliance 3939
Visit our website:
• Our latest white paper with Machina Research
“Combining the four pillars of innovation within the
Internet of Things in one platform”
Our open SDK Kalay Kit:
• http://www.throughtek.com
Learn More About ThroughTek