Can Xbee run code without being connected to another device? - xbee

I don't know if this is the right place to ask this. Sorry if I'm wrong.
I'd like to know if you can run code in an Xbee module without being connected to the computer or another device like arduino.
For example, I want to have 2-3 Xbee modules that communicate with each other sending information and then take decisions by code dynamically without using the X-CTU software. And I don't want those Xbee modules to be connected to the PC or other devices, they have to run by themselves with a coin cell battery and run some code previously written into their memory. Is this possible? If so, can you provide me some info/documentation to take a look? which language do you have to use to program the code? Which Xbee model do I need?
Thank you!

The XBEE modules can not do such tasks without a host. You can not run your own code on the module.
If you want to run you own code on the same device as the ZigBee stack then you should choose a solution from a silicon/stack provider.
You could achieve your goal using the Texas Instruments ZigBee Home automation SDK from www.ti.com/tool/z-stack which runs the ZigBee stack and your application on one of the TI ZigBee SoC's. But there are likely other similar providers as well.
Regards, TC.

XBees can be configured to initialize themselves with network data, i.e. the PAN ID, so they're aware of how to communicate on start up without requiring external configuration. However, they cannot run headlessly; they must to have some idea of the data that needs to be sent. They're fundamentally designed to act as a transparent serial bridge between computers to aid communications on personal networks. They cannot however be configured to do something bespoke.
It sounds like you're worried about power, so you could try looking for a low-power microcontroller that possesses a USART; this is all you'll need in order to communicate with an XBee via Serial.

It isn't possible to put your own code on a standard XBee module, but Digi does offer a Programmable XBee that includes a Freescale HCS08 co-processor that you can write code for. They offer a development kit with sample programs to get your started.
For a small-scale project where you don't need to be ZigBee certified, that might be easier than getting up to speed with a ZigBee development kit from TI, Freescale or Silicon Labs.

Related

SGMII without phy - external loopback on Xlinix Zynq UltraScale+ RFSoC board

I have a costume board with Xilinx Zynq UltraScale+ RFSoC.
I'm using 3 PS_GTR transceivers as sgmii.
2 of them are connected to external Marvell phy and the third connects directly (fixed link - without phy).
In the manufacturing stage i would like to make sure that the direct sgmii interface is assembled correctly - so I made an external loopback between tx and rx sgmii signals.
Now, Is it possible to transmit something through this external loopback and compare with the received data?
Is it possible to ping with yourself? (simple ping command not working: "ping -I eth2 ")
perhaps there is a 'patch' under the 'macb' kernel driver that someone can guide me through?
Thank you all,
Tzipi Kluska
Yes it is possible to ping yourself. Note that linux does or at least used to bypass the hardware when talking to itself and would do the loopback in the IP stack. I recently saw someone within a terminal (window, command line) isolate one network interface, then another another network interface and then it was trivial to use stock tools like ping and iperf to test the link.
Before doing that though, the serdes on your part should have PRBS capabilities (for a reason), some may have internal scope like features that allow you to extract an eye or at least numbers that indicate the quality of the eye. The marvell phy should also have this capability and you can both use a loopback to talk to yourself use various prbs lengths to check the quality of the link (less than one error in so many 10 to the 14th bits or whatever your desired quality is), and then when connected to the marvell repeat that.
Before doing all of this the software is often the hard part and you need to insure you have it working first, so you may wish to do loopbacks inside the fpga that do not have analog issues and get the software worked out, then in the serdes on the edge of the fpga they may have loopbacks in both directions, the marvell as well may have loopbacks in both directions so you can for example go direct fpga to marvell one is the tx and one the rx and vice versa, or you might enable a lan side shallow loopback on the marvell and talk to yourself.
Also depending on these speeds, hand made loopbacks might be noisy so sometimes a pcb based loopback (which also has to be designed) may wish to be deployed.
Can you ping yourself, absolutely. You can use other low level network interfaces like sockets, to make raw packets and talk to yourself through these interfaces as well. Ping, doing a ping flood, iperf, netperf, etc are all fine ways to exercise or get a warm fuzzy about the interface during both development and manufacture test.
Being an fpga you can of course have a test design that you load into the fpga that pushes the external interfaces and reports the bit error rate.

Architecture for communication with sensor network

I have several raspberry pis, each one connected to a sensor module. I have written a C program which runs on each raspberry pi to communicate with the sensor module and to configure it properly (the driver for the sensor module is written in C).
The next step is to make the configuration of the sensor modules more flexible and to enable other applications to communicate with the sensor modules over the network.
To make the configuration more flexible I thought about creating a web application which is able to connect to the raspberry pis (all of them are in the same wifi) and configure the sensor modules remotely.
My idea is to create a REST Api which runs on each raspberry pi and enables the communication with the sensor module. But as my application is written in C, I was wondering if there is any better solution to my problem? I know that creating a REST Api in C is possible, but, as far as I know, it is not very common.
Would you think that creating a REST Api in C for this use case is a good idea and if so, is there any good framework available?
Also, if someone has a better idea for a different architecture, I would really appreciate it.
Thanks in advance!

Autoconfiguration on programmable Xbee modules

Non-programmable Xbee modules should be configured through a PC (with XCTU) or other devices like Arduino... but can the programmable xbee modules (like xbee-pro zb s2b) autoconfigure themselves, without being connected to another device like a PC or Arduino, by running code stored in their memory?
I mean, can they run orders like the ones you run through XCTU but programming them in the internal memory code? Like scan energy of every channel, select a channel, set a PAN ID, configure the different parameters of the device...
Thank you
Yes, the development kit includes an API for sending AT commands from the co-processor to the radio on those boards.
There's also a passthrough mode that relays the host computer serial port through to the radio processor, which can help with initial setup/configuration of the modules like you might do during manufacturing.
To answer your question:
I mean, can they run orders like the ones you run through XCTU but programming them in the internal memory code?
No. You can not program a sequence of orders/commands into the internal memory of the device. To do anything meaningful the device needs to be "driven" from a host PC or MCU that can send the AT Commands.
If you want 1 device solution that does not require a Host MCU then you will need to use a ZigBee SoC (System on Chip), such as the CC2538 - http://www.ti.com/product/cc2538 running a ZgBee SDK (Software Development Kit) - http://www.ti.com/tool/z-stack (ZStack-Home). However this will require you to develop the ZigBee application SW.
Regards,
TC.

Communicating to USB Device

I bought a usb otoscope from the internet and I want to create an application that uses it. When I plug it into the computer, it reads the device as a USB Camera, and I can use the very barebones software supplied to communicate with it. I'm very new to the idea of communicating with usb all together. I've tried to look at some sites like this: http://www.jespersaur.com/drupal/book/export/html/21, that tell me how to reverse engineer a device. I don't know if I'm going down the right path with this...
I've downloaded USB Snoopy and I can't seem to get it to sniff the packets correctly. I also have Crunchbang linux installed on a different computer but I don't know how to sniff it on that either (especially because the drivers are native to windows). All I want is some sort of API/Interfacing functions for me to call and use. How do I go about doing such a thing? I'm able to locate the device on the device manager in windows, and it tells me hardware ID's and such. I can supply any information if necessary. Thank you.
EDIT - Small description I found of the otoscope: http://microscopesimgv.blogspot.com/2012/08/oasis-ehev2-usbplus-20mp-handheld-usb.html
would this tool help you any?libusbx is a cross-platform user mode library that provides generic access to USB devices
CHEERS!

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