Friday, April 4, 2014

Raspberry pi i2c and spi bus notes



I ran across some notes about using i2c with the pi.  For my version, debian_version 7.0, Wheezy this page describes how to enable the access to the controller and install a simple program to access the ic chip

BC2708 it would appear.

http://www.cooking-hacks.com/forum/viewtopic.php?f=37&t=3512

This example is for a board which adapts arduino shields to the Pi, so you will get nowhere if not using a board with the chip attached.


1. Install i2c-tools on your Pi:
Code:
sudo apt-get install python-smbus
sudo apt-get install i2c-tools


2. If you have Raspbian, check /etc/modprobe.d/raspi-blacklist.conf and comment "blacklist i2c-bcm2708" by running sudo nano /etc/modprobe.d/raspi-blacklist.conf and adding a # (if its not there).
If you're running Wheezy you will need to
add the following lines to /etc/modules file
i2c-dev
i2c-bcm2708

3. Run i2cdetect (You need to specify the i2c bus where the ADC is attached, there are different for Rev1 and Rev2). THE BRIDGE MUST BE ATTACHED TO YOUR RASPBERRY PI.
Code:
# For Raspberry Pi rev2
sudo i2cdetect -y 1

#For Raspberry Pi rev1
sudo i2cdetect -y 2


Monday, March 24, 2014

xbee notes

Nice page with list of things you can do wrong

http://www.faludi.com/projects/common-xbee-mistakes/

High power xbee

http://www.soselectronic.com/?str=1128 

Xbee Pro 868

With XBee-PRO 868 you have 40 km within reach

If you´re searching for an RF communication module with a long range, you´re on the right address. More precisely said – 40 km at line-of-sight outdoor, or 550m indoor.
XBee technology enables to transfer data from various sources, mainly in industry – for example data from various sensors, controlling of technology and similar. XBee-PRO 868 from DIGI International (Maxstream) uses SRD G3 868 MHz band (869,525 MHz) and has a software selectable output power in the 1 - 315mW range.

Advantages / Features:

  1. powerful XBee module
  2. simple to use topology
  3. line-of sight range up to 40 km (outdoor) / 550m indoor and in urban conditions
  4. 1 to 315 mW (0 až +25 dBm) output RF power
  5. receiver sensitivity: -112 dBm
  6. 24kbps RF data rate
  7. AES 128 bit data encryption
  8. 16 bit network ID
  9. low power consumption 3,3V/65-500 mA
  10. footprint common with other XBee modules types
Relatively high maximum output power provides to the module a very long range. This enables to use it in applications with long distances between particular points. XBee_PRO can be connected to your application via a standard 3.3V CMOS UART with 1.2 to 230.4 Kbps data rate. Various XBee modules from Digi International feature common footprint, that´s why they´re mutually exchangeable this adaptable to your application requirements. XBee-PRO 868 features 128 bit AES encryption and a 64 bitovou adress (network ID). They are usable for Point-to-Multipoint/Star or also Peer-to-peer topologies. An advantage is also an easy use - no further configuration is necessary. Available are multiple versions, type XBP08-DPSIT-024 has an RPSMA connector. Thanks to it, the module can be connected to various antennas.

Detailed information will provide you the XBP08-DPSIT-024 datasheet, overview of XBee-PRO 868 modules, as well as XBee/RF family comparison from company Digi International. In case of interest, please contact us at info@soselectronic.com

Xbee to wireshark article

http://www.freaklabs.org/index.php/Tutorials/Software/Feeding-the-Shark-Turning-the-Freakduino-into-a-Realtime-Wireless-Protocol-Analyzer-with-Wireshark.html


Sunday, March 23, 2014

Simple method of mounting SD card image partitions for testing

Frequently you will have an SD card with linux or other partitions and you will require a method to access them.

In the case of the shell script here, I had to dd images of sd cards and I wanted to start out with just diffing everything on the two cards at a file level

First you need to fdisk the image and get the offset of the partitions you need to get to.

then perform a mount -loop,option with an offset to the start of the partition.

If you are lucky, you won't need to specify an FS type as the mount software will figure that out.


root@jws2:/home/jws/work/pitbull2# cat mount.sh
#!/bin/bash

#root@jws2:/home/jws/work/pitbull2# fdisk ipfire-72-pitbull.img
#
#Command (m for help): p
#
#Disk ipfire-72-pitbull.img: 15.7 GB, 15719727104 bytes
#64 heads, 32 sectors/track, 14991 cylinders, total 30702592 sectors
#Units = sectors of 1 * 512 = 512 bytes
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
#Disk identifier: 0x00000000
#
#                Device Boot      Start         End      Blocks   Id  System
#ipfire-72-pitbull.img1   *          32      131071       65520    c  W95 FAT32 (LBA)
#ipfire-72-pitbull.img3          131072    30701567    15285248   83  Linux



mount -o loop,offset=$((131072 * 512)) ipfire-72-pitbull.img /mnt/reference/
mount -o loop,offset=$((131072 * 512)) mmcblk0.backup.compress /mnt/test/

diff -u -r /mnt/reference /mnt/test > diffout.txt



This illustrates not only the mount method but also the diff method.

The two images are both 16gb SD card image files.  You would also have to create the files in /mnt, or some other location upon which to mount the images.

Reference on loop mounting:

http://madduck.net/blog/2006.10.20:loop-mounting-partitions-from-a-disk-image/


Friday, February 28, 2014

memory part numbers for dell 2950 servers

Memories for Dell 2950 server (4gb)  4gb 2rx4 pc2-5300f-555-11

http://www.ebay.com/itm/151237440250

Sunday, February 23, 2014

Cisco 2612 token ring setup

from:   http://vintagebigblue.org/VintageHardware/cisco2612.php



Setting up the Cisco 2612 as a Token Ring Bridge

Note: This is a basic quick start for Token Ring to Ethernet bridge using the Cisco 2612. In my setup 192.168.73.0 is my home network and 192.168.123.0 is the tokenring network. More complete information can be obtained at
Cisco 2612 Quick Start Guide.
1. Connect the Cisco 2612 as follows:
     The RJ45 connector of the serail cable from the PC goes to "Console" on 2612.
     A CAT-5 cable goes from the "TokenRing0/0" port of the 2612 to the concentrator.
     A Cat-5 cable goes from the "Ethernet0/0" port of the 2612 to your home network router.
2. We will set the configuration using a terminal program on our PC. On Windows try HyperTerm, newer versions of Windows do not have this program but XP and earlier do. On newer Windows obtain Putty to talk to the serial port. On linux the most popular is minicom. After intalling it ("sudo apt-get install minicom" on Unbuntu) run it with "minicom -s -o" the first time. The -s will take you into setup in which you typically want port set to "/dev/ttyS0" and port settings to 9600 baud, 8 data bits, 1 stop bit, no parity. After the initial setup run you can start it with "minicom -o", the -o says do not issue modem initialization strings.
3. We are going to start by reseting the router to factory specs. When you start the comm program if you do not get a "SomeName>" prompt from the router hit enter. Now at the "SomeName>" prompt enter "show version". The last line displayed should have: Configuration register is 0x2102. Type "enable" to get command ability. If there is some other value type "config-register 0x2102". Type "write erase" to clear memory. Reload the router with "reload". If you get a message asking wether or not to save the configuration, reply "no".
4. The router will reload. You will get a message saying "Press RETURN to ge started", press enter. It is probable that it will try to load a configuration from the network (displays tftp messages indicating failed load attempts from the network gateway and/or 255.255.255.255), ignore these messages and type "enable", followed by "configure". It asks from where, and the default is terminal.
5. Let's get rid of the tftp attempts first. Key "no service config" followed by Cntrl-Z. This will activate the previous command. Now we key "configure" again to continue.
6. Now the ethernet. Type "interface Ethernet0/0". Then "ip address 192.168.73.200 255.255.255.0". Followed by "exit".
7. Now the tokenring. Type "interface TokenRing0/0". After the new prompt appears "Router(config-if)#", type for example "ip address 192.168.123.1 255.255.255.0" to set the ip address/subnet mask for the tokenring interface. Then we need to set the ring speed with "ring-speed 4". Then "no shutdown" followed by "exit".
8. It is time to save what we have done with "copy running-config startup-config". It will ask for a destination filename which is startup-config, the default if you just hit enter.
9. You will have to add a permanet route somewhere. If your home network router has the ability to add routes I would suggest that method as it will then work with any computer you have. Otherwise on the Windows machine you intend to use for Herucles, at a command prompt type "route -p add 192.168.123.000 mask 255.255.255.0 192.168.73.200". On Ubuntu open a terminal and type "route add -net 192.168.123.0 netmask 255.255.255.0 gw 192.168.73.200 dev eth0".
10. At this stage you should be able from your pc to ping the tokenring adapter in the 2612 with "ping 192.168.123.1 and the 3174 with it's tokenring ip address if you have it setup. If not something has gone wrong. You can check your settings with various incantations of the show command. Try "show config" to get a summary. If you have followed the tutuorial correctly please email me with the symptoms and I will try to help or find the bug in my tutuorial.

Monday, January 27, 2014

Fun with Arduino Mega ADK board

First blush experience with the Arduino supplied IDE is pretty nice.  The Sketch was installed and worked with my laptop w/o any guessing.

The only thing to configure is the serial port, and on my Windows XP laptop which I use for such experiments has only the Arduino on it for this test, and it worked.

On the Mac Mavericks I have on loan, it took a bit of guesswork since there were 8 ports enumerated from the /dev directory.  As it turned out it wasn't hard to find, and a youtube video below shows a modifed demo, blink running.

First mission will be to get the PDP11 running and see how it works, and if it works.

http://youtu.be/679aVAg75tQ

A youtube upload / posting will have some of the details here.  More setup updates here for Sketch.

The intent is to use cross platform gcc directly next, which will be a different note.

http://arduino.cc/en/Main/ArduinoBoardADK

Win:
http://arduino.googlecode.com/files/arduino-1.0.5-r2-windows.exe

Mac:
http://arduino.googlecode.com/files/arduino-1.0.5-macosx.zip

Linux:
http://arduino.googlecode.com/files/arduino-1.0.5-linux32.tgz

Source:
http://arduino.googlecode.com/files/arduino-1.0.5-src.tar.gz