NR+XBee Conection

Hi, I came across this topic (Node-Red and Xbee S2C), I noticed that they use this (GitHub - angryelectron/xbmq-java: XBee / Mqtt Gateway
GitHub - angryelectron/xbmq-js: NodeJS XBee to MQTT Gateway) and this (XBee · PyPI). So, is this the best ''formula'' for establishing Xbee connection in NR?

It should be obvious to you by now that nobody here has any experience of XBee with node red or they would have helped you already.

This is a really ''sweet'' rejection

That is not a rejection, just pointing out that it appears that nobody here knows.

In this topic there is a comments.

I just want to know the algorithm:

  1. First, I need to install the RPI XBee connection library?
  2. Then install XBee MQTT Gateway project?
  3. Finally, to obtain data in NR through Xbee nodes and / or zigbee2mqtt nodes?

Am I on the right way or not?

Hi @Martin10

I'm sorry that you aren't getting the answer you are looking for here. But Colin makes a reasonable point that if no-one reading this knows the answer, then we can't give you an answer.

I have never used XBee. So I cannot give you a definitive answer. The thread you link to ends with the user says 'dont bother with the MQTT stuff'. That suggests they had success with node-red-contrib-xbee (node) - Node-RED - but I could be reading that wrong.

Have you tried node-red-contrib-xbee (node) - Node-RED?

A very quick google search finds this (quite old) instructable page -

Maybe there's something there you could learn from?

Yes, I read that. Nothing useful in it.
I wrote to Rescue (the author of other xbee topic), but no answer. Did anyone know him?

Nothing? Do you mean it didn't work for you? Or what? Clearly its a set of instructions that do work - its just a matter of apply it to your setup.

It didn't work for me, because there is nothing about xbee configuration.

When I read through it, there was this section all about his configuration:

Have you searched for the sparkfun exploring xbee tutorial he recommends?

There are great tutorials at how to get started with XBee´s like the one in Sparkfun Exploring XBee,

I took some screenshots and commented them here on this step so you can have an overview of my configuration, note the following:

• All your XBee devices have to be the same value for ID : PAN_ID parameter
• I did set encryption on my devices, by enabling parameter EE, and used a private KY:Encription_Key
• I use the same Digital Out pins on my XBee's for simplicity's sake
• I use the same Digital IN pins on my XBee's for simplicity's sake

Very Important, write down the MAC address of your devices (you can retrieve those MAC addresses using XCTU), you will need them to access MQTT topics.

I meant the xbee configuration in NR. That's why i wrote hire, i wish to config. XBee in a way i can use it in NR?

The tutorial explains how to setup XBMQ-Java outside of Node-RED that connects to the Xbee devices and relays their information to an MQTT broker.

Within Node-RED you use the MQTT nodes to connect to the same broker and subscribe to get the data.

That is exactly what you asked how to do.

There is very little information in this tutorial about the configuration of xbee, and more specifically the configuration of the frame. The configuration of the framework is important because it determines what type of information / data we will use. Also, this tutorial uses third-party software that will complicate the process unnecessarily.

I wish to begin with something simple like this, but just can't run it properly..

So you are now back to trying out the node-red-contrib-xbee node?

but just can't run it properly

Did you follow the info on that flow?

Remember to configure your Port number before deploying. This can be found in Windows by going to 'Device Manager' and seeing which ports are connected.

Also, on the readme for node-red-contrib-xbee node it states is uses "xbee-api The xbee-api Node.js module" If you look at the xbee-api page there is a lot of info - perhaps that will help you form the correct payload?

I have to go back to basics.
In general, there is an alternative (ncd-red-wireless (node) - Node-RED) that is easier to use, but can only work with NCD products. I try this examples with my XBee, but I can't run it.

I copy this flow (xBee transmit and recieve (flow) - Node-RED), replacing the frame settings with my Xbee settings, but I still can't run it.
Xbee transmit / recieve example · Issue #8 · ramonmata/node-red-contrib-xbee · GitHub
This flow does not use xbee-api.

I have not see specific xbee-api flow (if you know one, please tell me), i've try to use it (as node) with combination with the above example, but don't get any difference. As far i understand, xbee-api convert msg.payload in to frame, but in the above example there is a function node that, i think do the same work, or not?

Yes it does...

I meant it don't use xbee-api as a node in the flow

I'm lost.

Can you answer this...

Yes, i'm

ok, so 'node-red-contrib-xbee' uses xbee-api under the hood.

That means you could get clues from the xbee-api documentation.

for example, the demo flow you linked to...

... has this code in the function...

var myDataFrame1 = { 
        type: 0x10, 
        id: 0x01, 
        destination64: "0013a200400a0127",
        destination16: "fffe",
        broadcastRadius: 0x00,
        options: 0x00,
        data: flow.get("words")||"hello"

return msg;

... If you look at the docs for xbee-api you will see almost exactly the same example ...

My point was, read the xbee-api documents as it is the code used by the node-red-contrib-xbee node