Why doesn't API mode work with two XBee units? - xbee

I have two XBee Pro Series 1 units. Both of them are in AP=2 mode (API mode). I have followed the instructions outlined under the "Series 1" section in XBee Configuration. I try to execute "ZnetSenderExample.java" and I can see it tries to send out a very simple "Xbee" string.
However, I keep getting timeouts on the receiving end saying it never gets any data.
Addtionally, I attempted the Unicast example on this page and found the same behavior. It does not work in X-CTU when in API mode.
I am using firmware 10EC.
How can I fix this problem?

Are the nodes on the same network? When you look at them in X-CTU, do they share the same operating network settings (channel, PAN ID)? Have you installed the API mode firmware, instead of the AT mode (sometimes called transparent serial) firmware?
Have you tried any of the examples on Digi's site, to confirm that the units are configured correctly?

Related

VOLTTRON reading data from multiple BACnet IP to MSTP Routers puts Building Management System down

I have a BACnet network where multiple BACnet IP to MSTP routers are used.
The network configurations are as follows:
Network Configuration sketch
Now I am trying to read data from the network using Volttron. Previously no data was read, so I tried changing use_read_multiple:false in driver configurations. Still to make the request even smaller for the network I changed max_per_request: 1,
Now it is reading data but it shows an error after some time and puts the BMS down. This means we are not able to read or even discover devices on the BMS nor it gives data in VOLTTRON.
It gives an error on the router with most of AHUs, FCUs are attached. I tried testing just that Router (Say its identifier is 4900, now most of the devices like 4900:1, 4900:3, etc.) start giving an error on both BMS and my Laptop.
I have tried grouping too by making groups of 2-5 devices and setting "group_offset_interval" in Platform Driver configurations to some really high value to know whether it is a network congestion issue on the MSTP network. Sometime it starts working but after some time (an hour), it starts giving error on both sides BMS and VOLTTRON too. Although devices are ON.
It gives error on different Routers and sometimes many routers stop working.
How can I solve this issue?
Thanks in anticipation.
Specifications:
Volttron: 7.0
BACpypes: 0.16.7 (as required by Volttron for bacnet)
I could be wrong here (in adding this to the mix) - but as it's relating to MSTP (- BACnet MS/TP), but you might want to also consider if there's a (half-typical) MSTP physical/wiring issue - might not necessarily be the software (or at least not alone).
(You might end up having to consider bifurcating the network / keep 'divide & conquer'ing it into small/2-halves segments to see/locate a wiring issue.)

C UART not working all the time

I'm having an issue connecting a serial device to an embedded device I'm writing code for.
The device I am writing has two serial ports, an incoming from my laptop, and an outgoing to an external device.
When I connect both terminals to my laptop and view the data, I get exactly the data I am expecting.
When I connect my laptop to the external device directly, I am getting exactly what I expect, and a response.
When I connect the laptop and the external device to the embedded device I am working on, the laptop sends data to it, it receives it, it passes it on to the external device. This works as expected.
However, the external device doesn't send back the response.
If I send data to the external device from the embedded device, each new message I send allows it to send the original reply.
I know the first message got through correctly because the external device whirrs to live, and I know when it is sending the response by running and logic analyser on the tx/rx comms and viewing the traffic.
I considered that the embedded device is holding the rx line and preventing its transmission, but I don't see how that possible in the code. Also if that is the case it shouldn't work when I plug both lines into my laptop.
I also considered the DTR was not set high, but checked this and it appears to be set high.
Does anyone know a reason which would prevent a device from responding?
Note: When I say Serial Ports I am referring to the UART when referring to the embedded device. All device use a DB9 connector running RS232.
Edit: Operating System on laptop is Windows 10. Embedded device is a Atmega324p.
Edit 2: Did some more testing. It appears that it sometimes work and sometimes doesn't.
I have added an image which show a almost perfect signal of the response.
The blue section is a gap in the signal that shouldn't be there.
Ended up finding a solution.
The RTS line was held via the embedded device at 1.2v, while the Pc was holding it at 5.2v.
Pulling the RTS line up to 5v fixed the issue.

TRF7970: Mifare Classic authentication

I am doing a project aimed at reading/writing data from Mifare Classic rfid card, by nrf52832(Cortex™-M4F based) together with TRF7970A (Multi-Protocol Fully Integrated 13.56-MHz NFC / RFID Transceiver IC).
The pre-authentication part is done according to ISO14443-3 standart (shown on a picture) and works fine (communication between nrf52832 and TRF7970A is done via SPI)
picture pre-authentication part
But after this part i bumped into problems with a authentication problems.
As far as TRF7970A doesn't support MIFARE cards, there is need to continue communication TRF7970A <-> MIFARE thru Special Direct Mode according to TI PDF "Using Special Direct Mode With the TRF7970A" (cannot link because of Stackoverflow limitations for new users)
Everything is configured according to TI PDF, but still i can't pass 3stage authentication.
To show the problem, 3 picture are attached. The process of authentication is captured by logic analyzer.
Captured signals
upper picture - failed attempt to pass auth1 stage. (TRF send an IRQ before it transmitted response from a card)
middle picture - successful attempt to pass auth1 stage. (Code remains the same, just sometimes it pass 1 stage, sometimes doesn't.)
bottom picture - after after successful passage of auth1, it comes to auth 2, where i never see the answer from trf7970/Mifare Classic card
The crypto part is taken from sdm mifare lib on trf7970AEVM
May bee someone have any ideas whats going wrong, or mb someone can direct me to the similar project.
I suspect the crypto keys used for cryptogram generation on host side and card side are different. That's why you are not seeing any response from the card.
Ensure that keys are the same.

XBee communication in API mode using X-CTU

I am trying to communicate between two XBee S2 modules both in API mode using the XCTU tool.
One device as router and another device as coordinator. I got successful communication of two XBee modules in AT mode and either of them as API or AT mode. But when I configure both of them in API mode they are not communicating.
How do you know they're not communicating? How are you forming your API frames to send into the device?
In API mode, the XBee module requires a checksummed series of bytes in a specific format to send data to another device. During your tests between the module in AT mode and the one in API mode, you were probably able to see a received frame on the API module when typing data into X-CTU on the AT module.
What language are you going to write your program in? I would recommend using a code library to manage encoding and decoding the API frames.
Digi has a webpage listing XBee host libraries in various languages.
After giving a lot of try i found two tricks in configuring X Bee modules
If your X Bee module is not getting read, just write with the suitable firmware
choosing manually
If it is not responding to read or even write also, connect reset pin to
ground using single wire for few second.

Communicating using Dragon12 board with xbee chip

So basically, me and a friend are using the Dragon12-Plus2 board for our class in school, and we are trying to get them to talk via Xbee chips. We have hooked one of them up, and simply need a bit of code to get the Xbee to talk with the board so we can make sure it's in correctly. We are writing in C using Freescale Codewarrior, and as much help as possible is appreciated, especially next steps such as when we hook up the other one, how to get the two to talk and test, etc. They should in theory already be set up as a point-to-point system, but we don't have much experience at this time. Any help would be greatly appreciated
If you configure the XBee modules with "AT mode" firmware, you should be able to use the serial port on the Dragon12-Plus2 board to communicate just as you would with a wired connection.
You'll need to configure both radios with the same PAN ID. Make one a coordinator and the other a router. On the coordinator, configure the DH and DL settings to match the SH and SL settings of the router. You can keep the router's default configuration of using 0 for DH and DL, which tells it to send data to the coordinator.
Do your testing on a PC with a two terminal emulators so you can verify that data sent in on one comes out on the other and vice versa.
Here's an excellent guide from the Digi website on Basic XBee ZB ZigBee (Series 2) Chat which provides more detail and a step-by-step guide for configuring the radios.

Resources