0

Creating Alljoyn ecosystem of devices and apps - Best Practices

asked 2015-02-09 08:42:19 -0800

AllJoyner gravatar image

Hi everyone,

Last year I have successfully created AJTCL app which was running on Arduino Due with the Ethernet shield and an AJSCL app running on the Android smartphone. In this project I had Alljoyn router bundled with the Android app and I was using only Alljoyn Core to implement private services and interfaces.

The project that I am working on now is supposed to involve multiple devices, where each device would expose its services and be able to interoperate with other Alljoyn devices and apps. Before starting on this project I wanted to know what are the best practices to create a large Alljoyn ecosystem, so I have a few questions regarding both software and hardware and would like to get a confirmation on some things as well:

ARCHITECTURE

  • What would be the best way to setup everything? I am assuming I should have one Alljoyn router that all devices connect to so that they are always available...the question is on what kind of device shall this be running, is it okay to have an app on my laptop running in the background and could this also be used as a rule engine or is there a better way to do it?

SOFTWARE

  • For each device to expose its services and to interoperate with other devices which Alljoyn service frameworks would I use? In my previous project I used the Alljoyn Core only so I don't have experience with any Alljoyn Service Frameworks. However, I have read that we are encouraged to use them to make things standard.
    • Secondly, since my project is based on IoT, should I be using DDAPI or stick with the Alljoyn Core, what are the benefits of each one?

HARDWARE

  • Is Arduino Yun a good choice to implement an AJTCL app on and will it be able to communicate over WiFi? I know that for Arduino Due there was an issue with the existing WiFi shields so we had to use the Ethernet shield.

I think that's all, I know I am asking so many questions but I really wanna follow the best convention when building this, so if I have missed something I would really appreciate your suggestions and recommendations. Also, if you could point me to the sample programs for the things I need, that would be great!

Thanks in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-02-13 09:54:45 -0800

jprestwo gravatar image

ARCHITECTURE: Having multiple AllJoyn routers is ok but for what your doing I would recommend just one. I recommend using an Arduino Yun because it can also act as an access point. Essentially you get your access point and AllJoyn router in one package.

SOFTWARE: Not knowing the exact problem your trying to solve its hard to say what services you should use. All the services solve very different problems. Whatever services you do decided to use I would highly recommend using AllJoyn.js. It will make your life much easier when writing all the software for this project, especially if your using a Yun. Getting set up to compile programs for the Yun is not easy but there are already pre-built binaries for AllJoyn.js. Then all you need to do is write JavaScript. All the services are already bundled into AllJoyn.js so there would be no need to learn how to implement each of them in C/C++. For example you can send a notification with one line of code "AJ.notification(0, "A notification").send(1000);". The control panel is also very simple to use with AllJoyn.js which would allow you to have a handset that can either control your system, give you feedback, or both.

HARDWARE: As I have already said the Arduino Yun is a good choice for both AJTCL and AJSCL clients and services. They are easy to use since they run Linux and AllJoyn/AllJoyn.js is already supported on them. AllJoyn.js will also allow you to easily control their IO pins (PWM, ADC, I2C etc.) letting you do anything from blink LED's to controlling motors.

Hope this answers your questions. Good luck with your project.

edit flag offensive delete publish link more

Comments

I wanted to come back to this question now that I am using Arduino Yun and Alljoyn.js as you have suggested. Regarding architecture, when I run js app on yun, does it connect to alljoyn-daemon that is running on Arduino Yun as well? Doesnt this mean I am gonna have multiple alljoyn routers now?

AllJoyner ( 2015-03-16 12:52:43 -0800 )edit

And i say multiple because i wanna use multiple arduino yun's in my ecosystem for different services. My idea was to have one application, android or windows with the router acting as a rule engine, and all apps running on arduino's would connect to that particular app, such as ControlPanelBrowser

AllJoyner ( 2015-03-16 12:58:08 -0800 )edit

But I am not sure how to set it up because in alljoyn.js I dont see anywhere deamon/service name, port number etc. being setup, and I was used to doing that with ajtcl core, when I wanted to connect it to android/windows application.

AllJoyner ( 2015-03-16 13:04:38 -0800 )edit

Yes, if AllJoyn core is installed on the Yun it will have a router already on it but that is ok. AllJoyn routers on the same network will all connect to each other and route traffic to the correct leaf node. In AllJoyn.js you don't need a daemon's bus name because it will find it automatically. Have a look at clientlite.js and svclite.js which mirror clientlite.c and svclite.c. This will show you how to set up your own interfaces/methods/signals etc.

jprestwo ( 2015-03-16 13:36:16 -0800 )edit

What If I didn't have a router running on arduino already, how would it know which one to connect to, since we don't explicitly set it anywhere? Also, what about the service name and port number, is that needed as well or sharing the same interfaces is sufficient for two apps to communicate? Thanks.

AllJoyner ( 2015-03-16 14:20:38 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-02-09 08:42:19 -0800

Seen: 238 times

Last updated: Feb 13 '15