Digi® XBee® Coding Platform Arduino Compatible Development Kit

Recently I received a Digi® XBee® Coding Platform Arduino Compatible Development Kit from the team at Digi-Key Electronics.

My deepest thanks go to Digi-Key for shipping it to me before the release date to give me the opportunity to give my thoughts and experiences with the kit.

The kit I received contained:
3x XBee S1 modules
1x Arduino Leonardo R3 compatible board by Robotale
1x XBee Shield for Arduino
2x XBee Shield for breadboards
1x Funduino XBee USB Adapter
2x Breadboard power supplies
1x 2 Axis Joystick
6x Push buttons
12x Multicoloured buttons for the push buttons
16x 330Ω resistors
1x 10kΩ variable resistor (potentiometer)
1x 100kΩ variable resistor (potentiometer)
10x Yellow LEDs
4x Green LEDs
4x Red LEDs
2x PP3/LR6 9 volt batteries
2x Battery clips
3x USB Mini cables
1x USB Micro cable
2x 16 Male to Male multicoloured jumper lead bundles
1x multilayer case to hold everything neatly

This differs slightly from the official list at https://docs.digi.com/display/XBeeArduinoCodingPlatform/Kit+contents which shows the 2 variable resistors as both being 10kΩ rather than 1 of 10kΩ and one of 100kΩ. Be sure that you use the correct one in your project.

What is an XBee module?
An XBee module is a transceiver (transmitter and receiver) that uses RF (radio frequency) rather than wires to communicate, in rather the same way as a TV or radio.
An XBee module can be connected to other devices to read from or control them remotely.

Can I use just one XBee module?
Yes, although this would be rather pointless.

Examples:
Morse code transceiver
Requirements:
2 (or 3) XBee modules
2 XBee breadboard adapters
2 LEDs
2 SWitches
2 330 ohm resistors
2 Breadboard power supply units **switched to 3v**
2 PP3/LR6 batteries
12 male to male jumper wires
1 Xbee USB adapter
1 USB mini cable
XCTU software installed on host computer

Connect one of the XBee modules to the XBee USB adapter, connect the USB lead between the adapter and the computer.
I chose to use 3 XBee modules, one to change the settings in the other two. You could use two and change the settings in them both but this may cause issues if you mess with communications settings.

Run XCTU and scan for XBee modules
Click on the Discover button
xctu scan icon
XCTU Discover button

This will bring up a new window
discover radio devicesDiscover radio devices window
Choose the serial (com) port. Mine (linux) is on /dev/ttyUSB1 as my 3D printer is on /dev/ttyUSB0.
This will open the Set port parameters window.
Unless you have changed the speed on your XBees, click on Finish to begin the scan
set port parameters
Set port parameters window

When the search completes you will see another window listing any locally connected XBee modules
search finishedSearch finished window
Click on Add selected devices

This will bring you to the Radio Modules window, populated with the newly discovered XBee module
Radio Modules

We can now use this window to scan for the other XBee modules, but first let’s build and power our Morse code transceivers.

The design is quite straightforward with a lot of identical connections. The only difference is the switch, LED and resistor as they get swapped:
Step 1
Look at the bottom of the 2 XBee modules and make a note of their MAC addresses (it will be 16 characters spread over 2 lines and the first 8 characters will be 0013A200)
For simplicity we will take the last 4 characters of each device and use that as the 16 bit ID later on. If the last 4 characters are the same, use the 4 previous characters which will be different – each XBee module has a unique MAC address not shared with any other XBee module in the world – well until they sell 4 billion of the lovely little devices at least – when that happens I will update this post 😛

Step 2
Mount the breadboard modules into the breadboards.
Ensure the pins are running in the direction of the length of the breadboard and that the 2 rows of pins are on separate sides of the breadboard.

Step 3
* If you only have 2 XBee modules, leave one plugged into the USB for now and put it in the right place when everything else is finished *
Mount the XBee modules into the breadboard modules, ensuring that the pins are aligned correctly and the modules are in the correct holes. Pin 1 is marked on both the Xbee module and the breadboard module.

Step 4
Insert the switches into the breadboards with 2 legs either side of the centre line.

Step 5
Insert the LEDs into the breadboards, this time not across the centre but spanning 2 columns of pins. Put the longest leg furthest away from the XBee module.

Step 6
Insert the resistors into the breadboards
One end of the resistor goes into the column with the short leg of the LED, the other goes across the centre of the breadboard into the same column on the other side.

Step 7
Insert the breadboard power supplies into the breadboard
Look carefully at the breadboard power supplies – they have 4 rows of pins at the bottom. At the top those pins are labelled GND, +5v, GND, VC.
Look at the outer edges of the breadboard – it has a blue line on one side and a red line on the other.

Plug the breadboard power supply in with the end that says GND, +5v on the blue line side and GND, VC on the red side.
** DOUBLE CHECK THIS – YOU CAN AND WILL DESTROY YOUR XBEES by connecting this incorrectly **

There is a small switch in the centre of the breadboard power supply – switch this to +3v
** DOUBLE CHECK THIS – YOU CAN AND WILL DESTROY YOUR XBEES by setting this incorrectly **

** DO NOT CONNECT YOUR BATTERY YET **

Step 8
Wiring
Start with one red wire and one black wire.
Connect the red wire to the +5V row on the breadboard and pin 1 of the XBee breadboard module.
Connect the black wire to the GND row on the breadboard and pin 10 of the XBee breadboard module.

Take another black wire and connect it from one side of the switch to the GND row on the breadboard.
Take another red wire and connect it from the long leg of the LED to the +5V row on the breadboard.

From this point the wiring differs between the boards.

Take a yellow wire and put one end to pin 19 of the XBee breadboard module.
Take a purple wire and put one end to pin 18 of the XBee breadboard module.

On the first board connect the yellow wire to the end of the resistor that is furthest away from the LED.
On the second board connect the yellow wire to the second pin of the switch next to the black wire.

On the first board connect the purple wire to the second pin of the switch next to the black wire.
On the second board connect the purple wire to the end of the resistor that is furthest away from the LED.

You should now have the first board looking like this:
xbee morse code transceiver 1
The first transceiver

The second board should look like this:
xbee morse code transceiver 2
The second transceiver

After checking your work at least 3 times, and then once more for good measure – XBees aren’t cheap – connect the batteries to the breadboard power supplies.

Don’t bother trying to press the buttons yet – it won’t work for another couple of minutes. Yes a couple of minutes – you are almost finished!

Go back to the XCTU window and click on the button under the red (X) scan for remote radiosDiscover radio nodes in the same network

When the scan completes you will see the radios
2 new radios
If you have 3 XBees you will now see 2 new radios listed, otherwise you will see one device.
Click the Add selected devices button and you will be back in the main XCTU window with 2 (or 3) radios showing.
all radios

You should see that the MAC addresses are the same as you found earlier. I hope you kept track of which device is which 😛

We now need to set some of the internal information in 2 of the XBee modules.
If you only have 2 XBee modules, change the remote device first and then the device connected to your computer.
If you have 3 XBee modules, change the second device first and then the third one. Leave the one connected to your computer alone.

Click on the first of the remote modules and it will read all the information about that module.
It may bring up the window below, if so click on the Yes button.
initialize device data

The right hand side of the XCTU window will now be populated with a load of information. Don’t worry about most of it, we only need to change a few items or so.

Look for DL Destination Address Low. We need to set that to the 4 characters we got in step 1 from the other device.
Directly beneath that is MY 16-bit Source Address. We need to set that to the 4 characters we got in step 1 from this device.

Scroll down to I/O Settings and look for D2 DIO2 Configuration.
If this XBee module is the one where the yellow wire goes to the resistor set this to DO High [5] otherwise set it to DI [3]
Directly beneath that is D1 DIO1 Configuration.
If D2 is set to DO High [5], set this to DI [3] otherwise set it to DO High [5].
A quick explanation of what we have done here:
We have set one device to read from pin 19 (D1) and write to pin 18 (D2), while we have done the reverse on the other device.

Scroll down a little to IC DIO change detect.
If the yellow wire goes to the resistor change this to 4, otherwise change this to 2.
A quick explanation of what we have done here:
DIO Change Detect tells the XBee to monitor a pin and if that pin state changes to send a message to the other device. The message will change the state on the remote pin which is why the remote LED is connected to the pin the switch is on and vice versa.
Make sense yet?

Scroll down to IA I/O Input address and type in the 4 character code from the other device.

Click on the Pencil icon at the top of the screen to write the settings to the XBee module.

Now we need to set the other XBee module in much the same fashion but with the information and pins swapped.

Look for DL Destination Address Low. We need to set that to the 4 characters we got in step 1 from the first device.
Directly beneath that is MY 16-bit Source Address. We need to set that to the 4 characters we got in step 1 from this device.

Scroll down to I/O Settings and look for D2 DIO2 Configuration.
If this XBee module is the one where the yellow wire goes to the resistor set this to DO High [5] otherwise set it to DI [3]
Directly beneath that is D1 DIO1 Configuration.
If D2 is set to DO High [5], set this to DI [3] otherwise set it to DO High [5].

Scroll down a little to IC DIO change detect.
If the yellow wire goes to the resistor change this to 4, otherwise change this to 2.

Scroll down to IA I/O Input address and type in the 4 character code from the first device.

Click on the Pencil icon at the top of the screen to write the settings to the XBee module.

If all has been done correctly, press the switch on the first XBee module and the LED attached to the other XBee module should light up.
If you have achieved success this far, tentatively press the other switch and see if the LED on the first XBee module lights up.
Hopefully you now have 2 lights that flash correctly.

If not, carefully check your wiring again and then check the settings.

Consider for a moment what you have just achieved – without a single line of code you have made a “Hello World” where the world can answer you back.

This is an extension of, and a rewrite to https://docs.digi.com/display/XBeeArduinoCodingPlatform/Example%3A+Hello+World which has a couple of features that I disliked or were lacking but from where I got a decent grasp of the fundamentals of the XBee module.

Article written and finished 22:45 Zulu, Thursday 16 July 2015 but not published until 3 August 2015 by request of Dig-Key International who were kind enough to send me a review kit to play with.

Many thanks to all at Digi-Key and thanks to Digi themselves for coming up with the board.

Proxmox no data received

I am running Proxmox on my dedicated server and have come across the following message a few times:

No data received
ERR_EMPTY_RESPONSE

I found the cause in my case – I was connecting by IP address instead of the domain name (in my case the reverse DNS of the IP address)

In short, instead of typing https://93.184.216.34:8006 you would need to type in https://example.com:8006

Cheap DVR teardown and pinout (MVPower, Hi3520D_v1.95p)

I have recently purchased a no-name CCTV kit which was very inexpensive, especially considering the functionality.
DVR Front MVPOWER TM

Mine is branded MVPower CCTV DVR Model TV-7108HE, P/N:UKEX39534 HD CCTV H.264 video equipment.
DVR Bottom MVPOWER CCTV DVR MODEL TV-7108HE INPUT DC 12V System PAL P N UKEX39534
It comes with or without video cameras and with or without a hard drive. I chose the 4 camera, no hard drive option. You may have chosen some other combination.

Working on the back panel first, mine has 8 video in, 1 video out, 1 HD output, 1 audio in, 1 audio out, 1 VGA out, 1 net (ethernet, RJ45), 2 USB ports, 1 RS485 port, 1 DC12v power port, 1 power switch.
DVR Rear Video In DVR Rear VGA DVR Rear Net USB RS485 DC12V DVR Rear Alarm DVR Rear Audio
Continue reading Cheap DVR teardown and pinout (MVPower, Hi3520D_v1.95p)