30 Replies Latest reply on Apr 3, 2017 10:43 AM by pjoly RSS
    pjoly Apprentice

    using Multitech Conduit EdgeMicroserver

    Hello

     

    I have a Multitech Conduit with lorawan card.

     

    I have installed the EMS in it from the maketplace and connected it to Thingworx ...

     

    I can see the gateway associated Thing ("is connected" to true) but the document doesn't describe how to configure/send the data from the multitech to Thingworx (to get the lorawan payload and other information)

     

    Is there something similar available somewhere ?

     

    Regards..

      • Re: using Multitech Conduit EdgeMicroserver
        cgerdes Newbie

        Hi Pascal,

        congratulation for your successful installation!

        Now let's get your task done.

        As far as I can say, your may get the right principles in this tutorial:

        http://developer.thingworx.com/guides/thingworx-java-sdk-tutorial (and look at STEPS>Filetransfer, e.g.)

        (I'm not aware of one better fitting to your special case, someone else?)

        I think, if you got the principles of the Edge MicroServer, your are almost there.

        Or, you may ask a more detailed question, if my answer does not help you here.

         

        Happy thinging...

        CG

          • Re: using Multitech Conduit EdgeMicroserver
            pjoly Apprentice

            Hello

             

            Thanks I'll look at this ...

             

            To be more detailed on this , before Thingworx  I was using MQTT (in multitech  node-red) to get the data from the multitech conduit (as publisher)  into my server where I decoded the payload and stored data into a mysql Database (scripts python) for further analysis and web reports.

            I'm trying to do all these steps directly into Thingworks

             

            I have also other sources of data (other things)  I'm receiving from a cloud server on a websocket (should be the next connector)

             

            Regards

              • Re: using Multitech Conduit EdgeMicroserver
                cgerdes Newbie

                Hi,

                 

                ok, thanks for the details.

                I must say, that I havn't tried THAT myself, so I would like some others to answer here.

                But theoretically speaking this should be no problem, because of the ability to use Java-snippets and scripts.

                And if you have the EMS working so far, you should be able to transfer your payload to Thingworx, where you can extract it and store it in your thing-attributes.

                 

                Happy thinging... ;o)

                CG

                • Re: using Multitech Conduit EdgeMicroserver
                  ryasmin-2 Newbie

                  Hi pjoly,

                   

                  It is a much needed help. I am using multitech conduit which has established a PPP link with a cellular network. i basically want to send packets from the conduit to a thing in the thingworx platform. It appears to be that it is kind of similar what you did so please guide me with this. FYI, i am using MQTT clients to sent some dummy data to a property created in Thingworx already.

                  Waiting anxiously for your answer.

                   

                  Best Regards

                  Yasmin Rumana

                    • Re: using Multitech Conduit EdgeMicroserver
                      pjoly Apprentice

                      Hello Yasmin

                       

                      If you have already your MQTT broker deployed and connected to ThingWorx MQTT extension, this is quite easy for Multitech.

                       

                      I'm using node red and I just used the MQTT connector to publish the data to the broker "uplink"  (I also subscribed to another queue to send data to device "downlink") :

                       

                      2017-03-20 07-50-19.png

                       

                      I used the same topics into MQTT extension in Thingworx and I receive the data on a property with the same name (see extension documentation in the pdf attached to the extension)

                       

                      2017-03-20 07-53-49.png

                       

                      Hope it helps

                       

                      Pascal

                        • Re: using Multitech Conduit EdgeMicroserver
                          ryasmin-2 Newbie

                          Hi Pascal,

                           

                          Thanks alot for the information. We are using our own sensor nodes, whose data i receive at the multitech conduit using mosquitto. Now i have to publish this data (received in the multitech base station from sensor) to Thingworx. The MQTT broker is in place and also the MQTT extension is imported in the Thingworx. Could you please give some steps to follow for such a scenario? Do i have to use red-node in this case as well?

                           

                          FYI, I have never used red-node. Previously i created a property on thingworx i.e Temperature and send a random value from the base station using mosquitto_sub script from the conduit's terminal. Also should the name of 'server name' on ThingWorx while creating a 'Thing' be some specific name or it could be any random name?

                           

                          Thanks in advance.

                          Best Regards

                          Yasmin Rumana

                          • Re: using Multitech Conduit EdgeMicroserver
                            ryasmin-2 Newbie

                            Hi Pascal,

                            Thanks for your information. Now the server is connected and I am able to see the message payload when lora is connecting to debug.

                            Could you help me to write the function on Node red for transfer packet to the Thingworx Using MQTT mosquitto? I did not understand the format of the function.

                             

                            BR

                            Yasmin Rumana

                              • Re: using Multitech Conduit EdgeMicroserver
                                pjoly Apprentice

                                hello

                                 

                                if you just need the message payload you just have to connect "lora" to "MQTT" in node red (and configure this MQTT box with your broker information )

                                You must use the same "topic" to publish in Node-red and to subscribe in Thingworx

                                (you can test with any MQTT client to see what you are receiving to be sure )

                                 

                                I created a function to add information (RSSI, SNR, gateway id, etc ...) to the message payload  itself but it is not necessary

                                 

                                Pascal

                                  • Re: using Multitech Conduit EdgeMicroserver
                                    ryasmin-2 Newbie

                                    Hi pascal,

                                    THanks alot for your help.

                                    I have connected only lora and mqtt according your instructions but I didn't see anything on property setting value. I set the format on json. Do you have any idea to set the property format on thingworx and how could i see the message payload on the thingworx?

                                      • Re: using Multitech Conduit EdgeMicroserver
                                        pjoly Apprentice

                                        1/ shoud should enable the auto mapping

                                         

                                        2/ After You should have the same name in the MQTT thing property and in the subscribtion in Configuration

                                         

                                        Configuration :

                                         

                                        Properties

                                         

                                        after you'll get your message from device in this property (downlink is not working but uplink from device yes)

                                          • Re: using Multitech Conduit EdgeMicroserver
                                            ryasmin-2 Newbie

                                            Hi Pascal,

                                             

                                            thanks alot for your support and guidance. Finally, i managed to observe the payload on thingworx. Yet, when i connect multiple sensor nodes, i cannot differentiate the payload from each one. As far as i understand, i have to configure the gateway( or add some function) on node-red accordingly.

                                            Any thoughts on this one?

                                             

                                            Yasmin Rumana

                                              • Re: using Multitech Conduit EdgeMicroserver
                                                pjoly Apprentice
                                                thanks alot for your support and guidance

                                                you can recommand my answers to encourage myself  

                                                 

                                                to differentiate devices I took inspiration from Sigfox extension documentation :

                                                 

                                                the main principle (you will have to search deeper  in Thingworx documentation to code)

                                                 

                                                1/ create a subscription service to the MQTT thing for exemple "UpdateData()"

                                                this service will be call each time you will publish on MQTT from multitech

                                                 

                                                2/ Create your thing template (for your devices) and add this EUI property

                                                create your things manually from this template and set the right EUI for your device manually

                                                (or more advanced :  create a service for auto provisionning your devices when you will get unknown EUI in the next step 4/ )


                                                3/ in the UpdateData() extract the EUI from the Json received from MQTT


                                                4/ create a service  which will return the thing name associated to an EUI

                                                 

                                                for example :

                                                 

                                                 

                                                var query = {
                                                  "filters": {
                                                    "fieldName": "EUI",
                                                    "type": "EQ",
                                                    "value": EUI
                                                  }
                                                };
                                                
                                                
                                                var params = {
                                                  query: query
                                                };
                                                
                                                
                                                var things = ThingShapes["LorawanShape"].QueryImplementingThingsWithData(params);
                                                if(things.getRowCount() > 0) {
                                                  var result = things.rows[0].name;
                                                } else {
                                                  var result ="";
                                                }
                                                

                                                 

                                                5/  update your thing properties knowing the thing name

                                                  • Re: using Multitech Conduit EdgeMicroserver
                                                    ryasmin-2 Newbie

                                                    Hi Pascal,

                                                    pjoly

                                                    I couldn't quite get what are you refering to? The idea is that, when i connect multiple sensor nodes to the gateway, i can observe data(Payload+EUI etc.) from multiple sensor nodes transmitting simultaneously which i can distinguish by their EUI. Similarly, i want to see the payload on Thingworx including their respective EUI. Currently contrary to what i require, i can see the payload only when multiple sensor nodes are transmitting at a time (i don't know from which sensor node the paylaod is coming from as the payload is similar in all the connected nodes). Moreover i can define only one property on Thingworx.

                                                    Do i have to add a function which could tell the EUI information of the sensor node and payload also?. Or if i have to follow the instructions you sent in the last reply, please elaborate a bit where i should define that 'code'?

                                                     

                                                    P.S. How could i recommend your answers. Please let me know as i don't know how to do it.

                                                     

                                                    Thanks a million!

                                                      • Re: using Multitech Conduit EdgeMicroserver
                                                        pjoly Apprentice

                                                        hello

                                                        to get extra data from the multitech you need to insert a node between 'lora' and "mqtt" (see my screen copy it is "full message into payload"

                                                         

                                                        I inserted EUI, gateway Id, gateway type etc ..; into the payload and tarnsfer it to MQTT

                                                         

                                                         

                                                        for exemple :

                                                        /*
                                                        "msg": {
                                                          "chan": 5,
                                                          "codr": "4/5",
                                                          "datr": "SF7BW125",
                                                          "freq": "903.3",
                                                          "lsnr": "85",
                                                          "modu": "LORA",
                                                          "rfch": 1,
                                                          "rssi": -55,
                                                          "size": 12,
                                                          "timestamp": "2015-04-09 16:22:12",
                                                          "tmst": 67346764,
                                                          "payload": "hi mike",
                                                          "eui": "00:11:22:33:44:55:66:88"
                                                        }
                                                        */
                                                        
                                                        
                                                        
                                                        
                                                        var chaine =
                                                            "{\"EUI\":\""+ msg.eui +
                                                                "\",\"chan\":" + msg.chan +
                                                                ",\"rfch\":" + msg.rfch +
                                                                ",\"port\":" + msg.port +
                                                                ",\"seqn\":" + msg.seqn +
                                                                ",\"rssi\":" + msg.rssi +
                                                                ",\"tmst\":" + msg.tmst +
                                                                ",\"freq\":\"" + msg.freq +
                                                                "\",\"codr\":\"" + msg.codr +
                                                                "\",\"lsnr\":\"" + msg.lsnr +
                                                                "\",\"datr\":\"" + msg.datr +
                                                                "\",\"timestamp\":\"" + msg.timestamp +
                                                                "\",\"gw\":\"00:00:00:00:00:00\"" +
                                                                ",\"source\":\"multitech\"" +
                                                                ",\"payload\":\"" + msg.payload.toString('hex') +
                                                            "\"}";
                                                        
                                                        
                                                        var newMsg = { payload : chaine };
                                                        return newMsg;
                                                        
                                                          • Re: using Multitech Conduit EdgeMicroserver
                                                            ryasmin-2 Newbie

                                                            Hi pascal,

                                                            Thanks alot for your support. By your suggestions i have successfully deployed the whole setup. I owe you a great deal. I can see the data from sensor nodes on the thingworx propertty. Now, when i send data from multiple sensor nodes, it overlaps the data on thingworx everytime. Is there a way to get it separately at the same  on thingworx when send  from both sensir nodes?

                                                             

                                                            yasmin

                                                              • Re: using Multitech Conduit EdgeMicroserver
                                                                pjoly Apprentice

                                                                Hello

                                                                 

                                                                As I explained you ealier you need to create one thing per device (with its right EUI Lorawan) and dispatch the data to the right thing depending of the EUI field when you receive a message from MQTT

                                                                 

                                                                You have only one channel from the gateway to Thingworx so you have to dispatch at reception

                                                                 

                                                                Regards

                                                                  • Re: using Multitech Conduit EdgeMicroserver
                                                                    ryasmin-2 Newbie

                                                                    Hi pascal,

                                                                    Thanks.

                                                                    Actually i am using mosquitto.org as a server to communicate between multiconnect conduit and thingworx. I want to create own server for communication using MQTT. when i use another server IP (any dummy IP) that i defined in the mosquitto.conf file. It is not connected to thingworx. I am confused about the server creation. Do i need to create own server or configure this mosquitto.Conf file in the multitech conduit? Could you please explain the server i defined in thingworx i.e mosquitto.org?

                                                                     

                                                                    Yasmin

                                              • Re: using Multitech Conduit EdgeMicroserver
                                                fbailleux Apprentice

                                                Hello Yasmin,

                                                 

                                                Maybe this two links can help you :

                                                MQTT support in ThingWorx

                                                The second part of this thread (Testing the MQTT extension in Thingworx) is describing the configuration of Mqtt extension and how to exchange property value . It will provide you more details on "server name".

                                                Securing MQTT connection to Thingworx platform

                                                This link could be useful if you want to establish a secured connection between you Multitech conduit and the Thingworx platform

                                                I hope this help you.

                                                 

                                                -Franck

                                          • Re: using Multitech Conduit EdgeMicroserver
                                            ryasmin-3 Newbie

                                            Hi pjoly,

                                            I am using mosquitto.org as a broker to trsnsmit packet from multitech conduit to thingworx. It means, i am using another server i.e. mosquitto.org. so the packet flow like this: multitech conduit->mosquitto.org->Thingworx. Is it right?

                                             

                                            But I want to create my own mosquitto broker. Do you have any idea how i create mosquitto broker to transmit packet from conduit to thingworx? As multitech conduit have already mosquitto.conf file. Should i change this file to create my own server? What is the serverName when i configured 'Thing'?

                                             

                                             

                                            Regards