Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription/Notifications only work when created via Mobius #40

Open
alexe100 opened this issue Nov 7, 2020 · 13 comments
Open

Subscription/Notifications only work when created via Mobius #40

alexe100 opened this issue Nov 7, 2020 · 13 comments

Comments

@alexe100
Copy link

alexe100 commented Nov 7, 2020

Hello,
Scenario:

AE-----Rosemary-----------Mobius---------------Mobile app AE (HTTP Binding)
Assuming an AE and a Container created in rosemary

While trying to evaluate subscription/notification mechanism in Mobius/rosemary I realized that this mechanism only works when subscription is make via Mobius, like this:

Assume that AE creates a subscription in rosemary container. If someone else creates a content instance directly in rosemary container then the AE is notified.
But if someone alse create a content instance in rosemary container via Mobius the AE is not notified.

This is because var subl become empty (sgn.js, exports.check())

Assume now that AE creates a subscription in rosemary container via Mobius. If someone else creates a content instance directly in rosemary container or via Mobius, then the AE is always notified.

Is this a bug or is this the expected behaviour?

Thank you

@hsebs
Copy link

hsebs commented Nov 15, 2020

It is a bug of rosemary.

They do not currently maintain rosemary, so it is recommended to get the necessary part from Mobius to use rosemary. (Rosemary is implemented based on the old version of Mobius)

@alexe100
Copy link
Author

alexe100 commented Nov 16, 2020

Thanks, but does this mean that we should rely only on Mobius (in-cse) and forget rosemary, like this:

TAS+ADN_AE----------------------Mobius(in-cse)------------------------------Mobile_App_AE

By the way, the examples provided by nCube-Thyme (mqtt, ws and coap) all follow the above scenario...

Is mn-cse (local gateway) to be forgotten?

I am confused...

@hsebs
Copy link

hsebs commented Nov 18, 2020

Mobius and Rosemary don't support 5.2.3.4 of TS-0010.
These are designed so that all nodes using mqtt must be on the same network. :-(

@hsebs
Copy link

hsebs commented Nov 18, 2020

http://tech.iotocean.org/board/mobius

This is Mobius QnA site operated by KETI.
They can speak English, so you can just ask questions in English.

If there is no answer, it's not a language problem, it's just that they don't respond.
(They are public officials, so they are lazy to do things outside of work.)

@alexe100
Copy link
Author

Thank you hsebs!
Where did you get the information: "Mobius and Rosemary don't support 5.2.3.4 of TS-0010." ? Is there any webpage that lists Mobius and Rosemary limitations/compliances?

Ok... :-( It seems that we can not have "local regions" (controlled by gateways), right?
We have to always rely on a centralized Mobius server, right? And that server must supporting all data and requests load, right?

Thanks also for the information about the QnA. I am going to ask things in there.

@hsebs
Copy link

hsebs commented Nov 21, 2020

  1. It seems that we can not have "local regions" (controlled by gateways), right?
  • You can have local regions when AEs don't use mqtt.
    See Configuration manual of rosemary repo. You can see that rosemary use only one mqtt broker which connected with mobius.
  1. We have to always rely on a centralized Mobius server, right?
  • If you want to use mqtt, you have to rely on a centralized mqtt broker server, not Mobius server.
  1. And that server must supporting all data and requests load, right?
  • See the answer of 2.

@alexe100
Copy link
Author

alexe100 commented Nov 21, 2020

I dont want to use mqtt at all, if possible.
Please, take this simple architecture I would like to implement:

.Mobius (in public network) ----------------------------Mobile App (connected to Mobius)

. Rosemary1(private net1,with ADN AE and connected to Mobius)
Devices

.Rosemary2(private net2, with ADN AE and connected to Mobius)
Devices

The idea is to support sensing and actuation on Devices from mobile app.

As Mobius/Rosemary do not support long polling (http) I have to use mqtt (public mqtt server) in order to address devices from Mobile app, right?

But then you say that "You can have local regions when AEs don't use mqtt.".
If I need sensing and actuation, what should I use?

Probably a solution could be to put Rosemary instances also in public network and rely on mqtt on local sensors representatives, and rely on http between rosemary and Mobius... But then we can not have local AE (running on the gateways), we have to rely always in mobile app...

Also, when rosemary registers on (public) Mobius via mqtt, rosemary never receives response and then rosemary is always trying to register from 5 to 5 minutes:

csr_custom.on('register_remoteCSE', function() { mn.build_mn('/'+usecsebase, function (rsp) { if(rsp.rsc == '2000') { console.log('[[[[[[[[[[[[[[[[register_remoteCSE]]]]]]]]]]]]]]]] ' + JSON.stringify(rsp)); clearInterval(refreshIntervalId); } else { console.log('register_remoteCSE again'); } }); });
Thanks a lot!

@hsebs
Copy link

hsebs commented Nov 21, 2020

In my case, I modified Rosemary to connect 2 mqtt brokers.

I found a similar question in http://tech.iotocean.org/board/mobius. I hope this helps you.


Q. Do I need a separate setting to register Thyme to Mobius via Rosemary?

A. Rosemary is MN-CSE and acts as a gateway, and if target is not itself, it performs forwarding to IN-CSE. There is no data synchronization function. In other words, I created a resource in rosemary, but the resource is not created in Mobius. This is because rosemary and Mobius are separate CSEs. For synchronization, you need to use a separate AE that sends the same request to Mobius.

@alexe100
Copy link
Author

Hello hsebs,
I understand the architecture and the roles on oneM2M compliant solutions. Probably I did not explain well my problem.

I know that I can have an IN-CSE with public IP and have a ADN-AE connected to IN-CSE and then having also a IN-AE (mobile app) connected to IN-CSE. The prblem is that this architecture is too much centralized (too much load in the in-CSE).

An alternative is to have one or more field domain gateway (MN-CSE) connected to IN-CSE and having ADN-AE connected to gateways. Data remains on Gateways and IN-CSE is used just for discovery, and access data one gateways. The problem is that gateways are situated in pivate networks and IN-CSE can not forward queries to them, even using MQTT.

My question is: using Mobius and Rosemary, is it possible to implement the alternative described above? I have been trying and without success till now.

Thanks a lot!

@hsebs
Copy link

hsebs commented Nov 22, 2020

Maybe you can implement it with Mobius and rosemary. (But I do not recommend it.)

In my case, I used 2 network chips to connect the gateway to the private and public networks. I modified rosemary to use multi mqtt brokers. I placed a mqtt broker on the public network to connect Mobius and Rosemaries, and mqtt brokers on each private network to connect Rosemary to AE. AE created a subscription in rosemary container. Using Postman I was able to create content instances in Rosemary by making a request to Mobius. AE read it and acted.

It is the same as what you are trying to do. Right?


P.S.

  • When using multiple networks, it is the OS area that sends packets to the appropriate network.

  • Do not confuse CSE of Mobius and CSE of Rosemary when you make query.

  • Mobius only supports some of the OneM2M query formats. If Mobius does not work even though it receives a query, it may be a query problem. (I had a problem with this.)

  • Mobius has some problem with mqtt. Read comment in MQTT protocol binding is wrong  #25

  • Rosemary is so old I'm not sure if it's compatible with Mobius.

  • I modified Rosemary to put the mqtt broker on the private network, but I'm not sure if this is what you need.

@alexe100
Copy link
Author

alexe100 commented Nov 22, 2020

Maybe you can implement it with Mobius and rosemary. (But I do not recommend it.)

Is there an alternative I am not aware of? Implement my own OneM2M system?

In my case, I used 2 network chips to connect the gateway to the private and public networks. I modified rosemary to use multi mqtt brokers. I placed a mqtt broker on the public network to connect Mobius and Rosemaries, and mqtt brokers on each private network to connect Rosemary to AE. AE created a subscription in rosemary container. Using Postman I was able to create content instances in Rosemary by making a request to Mobius. AE read it and acted.

Sorry, I dont know the term "network ships"... Do you mean VPN?

It is the same as what you are trying to do. Right?

Yes, it is that scenario I am trying to implement...

P.S.

  • When using multiple networks, it is the OS area that sends packets to the appropriate network.

Ok, But when one part if hidden in a private network, HTTP is not usable, but MQTT could be the solution. The problem is that rosemary MQTT support seems not be very well implemented.

  • Do not confuse CSE of Mobius and CSE of Rosemary when you make query.

Sure. Addressing is different.

  • Mobius only supports some of the OneM2M query formats. If Mobius does not work even though it receives a query, it may be a query problem. (I had a problem with this.)

Right.

But Why was rosemary left behind and only Mobius was updated through the time? Is this a signal that solutions should rely just on Mobius (private or Public) ?

  • I modified Rosemary to put the mqtt broker on the private network, but I'm not sure if this is what you need.

What I need is to keep rosemary in a private network and Mobius in the pubic network and keep communication between each other. Just that... (*)

By the way, if someone asked you (as a SW developer) to implement the scenario (*), what btool would you use to implement it?
(of course following the oneM2M compliance)

Thank you.

@hsebs
Copy link

hsebs commented Nov 22, 2020

Sorry, I dont know the term "network ships"... Do you mean VPN?

Network chips means Network cards, not ships. I used wifi chip for private and LTE chip for public.

What I need is to keep rosemary in a private network and Mobius in the pubic network and keep communication between each other. Just that... (*)

By the way, if someone asked you (as a SW developer) to implement the scenario (*), what btool would you use to implement it?
(of course following the oneM2M compliance)

In my case, the LTE chip does not allow inbound connections. If you want the same effect, use a firewall.


In my memory, Mobius chooses http when multiple connection methods are available. This may be why your Rosemary and Mobius are not communicating. Unfortunately, I can't remember that part very well. Check the Mobius's logs to see how Mobius sent registration requests.

@alexe100
Copy link
Author

alexe100 commented Nov 22, 2020

Registration requests are sent according to the configured cbprotocol in configuration files.
(Probably I am going to implement the oneM2M standard by my own...)
Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants