Project

General

Profile

CMS Burn-in box

Quickstart instructions:

This code is an extension of the OTS-DAQ project and requires it to function. To setup OTS-DAQ use the instructions listed here for users (here for developers only) for installing the core OTS-DAQ packages. This must be done first! Once the OTSDAQ core dependencies are set up, the CMS Burnin Box interface code can be included.

If you are one of the project managers and plan on making modifications to the code, you can checkout the repository doing the following assuming you have valid kerberos credentials,

cd $MRB_SOURCE # this is the 'srcs' directory that will be set in the course of setting up OTS-DAQ
mrb gitCheckout -d otsdaq_cmsburninbox ssh://p-cmsburninbox@cdcvs.fnal.gov/cvs/projects/cmsburninbox

Otherwise, you can just clone the directory using the http sever,

cd $MRB_SOURCE # this is the srcs directory that will be set in the course of setting up OTS-DAQ
mrb gitCheckout -d otsdaq_cmsburninbox http://cdcvs.fnal.gov/projects/cmsburninbox

Alternatively, if you do not have mrb set up, you can check out the code using git directly,

git clone http://cdcvs.fnal.gov/projects/cmsburninbox otsdaq_cmsburninbox 

Useful links

Wiki syntax Here

Instructions for setting up main version of OTSDAQ using MRB: Off-the-Shelf DAQ

Setting up new BeagleBone

All documentation can be found at the beaglebone black website.

Note: As of July 2018, the versions of Debian that came installed on the BeagleBone were not compatible
with setting up the digital sensors DS18B20. Reverting to Debian 3.8 (8.7 on the flash image) fixes the problem for now.

BeagleBone Pin Layout

Flashing an image

How to flash an image

Debian images for BBB

DEBIAN 3.8

For the impatient

1) Connect BeagleBone with a USB cable to your pc
2) If you type /sbin/ifconfig you'll probably see a network with

192.168.7.1     USB     Windows     
192.168.6.1     USB     Mac OS X, Linux

3) Next ssh to the Beaglebone with

ssh root@192.168.7.2 #(or 192.168.6.2) #Note the last digit is 2 while 1 is the interface on your PC

Reverting back to Debian 3.8

4) If you need to revert back to Debian 3.8 proceed with the following

  1. After a successful ssh via USB, disconnect the BeagleBone from the USB and insert the SD card that you just flashed.
  2. From there reconnect the BeagleBone with the USB cable to your pc, and ssh to the BeagleBone
  3. Edit the file /boot/uEnv.txt
  4. Navigate to the line at the bottom of the txt file.
    #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
  5. Delete the "#" at the beginning of the line.
  6. Save the file and Reboot the BeagleBone
  7. The SD card should automatically flash the BeagleBone which will be indicated by the LED's following pattern that goes back and forward. Once done the LED's will all flash and then turn off.
  8. Disconnect the USB, remove the SD card, then reconnect the USB.
    The default user:password are [machinekit:machinekit].

Allowing root access without password

  1. Edit the file located at: /etc/ssh/sshd_config accessing as superuser (prefix "sudo")
  2. Navigate to the line "PermitRootLogin" and make sure it is changed to yes
     PermitRootLogin yes 
  3. Then find UsePam and set it to no
    UsePAM no
  4. You will then be able to ssh using root

5a) Edit the file /etc/network/interfaces by un-commenting the lines for eth0 and adding the IP, net mask and gateway address

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.133.241 #Choose your favourite IP address
netmask 255.255.255.0
gateway 192.168.133.100 #Choose your gateway (host PC)

5b) Then plug the ethernet cable to the Beaglebone, then identify your interface and set the static ip
First list the contents of the /var/lib/connman directory.

 ls -la /var/lib/connman 

It will be shown something like this:

drwxr-xr-x 3 root root 4096 Jan 27 18:42 .
drwxr-xr-x 33 root root 4096 Nov 6 15:28 ..
drwx------ 2 root root 4096 Jan 27 18:42 ethernet_9059af4beffc_cable
-rw------- 1 root root 284 Jan 27 18:42 settings

In my case the ethernet card eth0 is identified by the directory "ethernet_9059af4beffc_cable"

5c) Knowing this directory, run a "connman" command to make the static IP:

connmanctl config ethernet_9059af4beffc_cable --ipv4 manual 192.168.133.241 255.255.255.0 192.168.133.100

6) Remove the usb and reboot!

7) Now you can ssh using the network, after you entered rulinux03:

ssh root@192.168.133.241

then

service sshd restart 

root login

Setting up Sensors and Relays

Digital sensors DS18B20

1) Ssh to Beaglebone using the Ethernet cable

2) You have to enable 1-wire connection on Beaglebone. First, create a file called "w1.dts" with the following content:

/dts-v1/;
/plugin/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part-number = "DS1820";
    version = "00A0";

    exclusive-use = "P9.22";

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
             ds1820_pins: pinmux_ds1820_pins {
                 pinctrl-single,pins =  <0x150 0x37>;
             };
        };
    };

    fragment@1 {
        target = <&ocp>;
        __overlay__ {
            onewire@0 {
                status          = "okay";
                compatible      = "w1-gpio";
                pinctrl-names   = "default";
                pinctrl-0       = <&ds1820_pins>;
                gpios           = <&gpio1 2 0>;
            };
        };
    };
};

3) Make sure that:

a) exclusive-use = "P9.22"
b) pinctrl-single,pins = <0x150 0x37>
c) gpios = <&gpio1 2 0>

4) Now build the file using dtc

dtc -O dtb -o w1-00A0.dtbo -b 0 -@ w1.dts

If yout came across a "Missing -@ flag error", you probably have a dated version of dtc. You can download a newer version that is compatible at:

wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh

5) Now copy the file to /lib/firmware

cp w1-00A0.dtbo /lib/firmware

6) Now set up the device tree path by typing

echo w1 > /sys/devices/bone_capemgr.9/slots

To see if everything has been setup correctly, run the following and check for the "Override Board Name" connection

cat /sys/devices/bone_capemgr.9/slots

0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
7: ff:P-O-L Override Board Name,00A0,Override Manuf,w1

7) NOTE: You will need to run "echo w1 > /sys/devices/bone_capemgr.9/slots" every time you turn on the Beaglebone. In order to automatically do it, insert the command in "/etc/rc.local" file somewhere after the comments section.

8) Having connected the DS18B20 sensor to the right-configured pin, it is available at "/sys/devices/w1_bus_master1/", with the format "28-xxxxxxxxxxxx" representing the serial number.

9)To make a temperature reading, type the following command (where 28-03146d0c5bff must be replaced with your sensor serial number)

cat /sys/devices/w1_bus_master1/28-03146d0c5bff/w1_slave

If everything has been set up correctly, the output should be
93 01 55 00 7f ff 0c 10 cb : crc=cb YES
93 01 55 00 7f ff 0c 10 cb t=25187

The value t=25187 is the current temperature in Celsius degrees: 25.187 C.

Analog Temperature Sensors PT100RTD

1) The RTDs are connected to Beaglebone using analog inputs. They use AIN0, AIN2, AIN4, AIN6.

2) To set up the analog inputs tree path, you need to type

echo BB-ADC > /sys/devices/bone_capemgr.9/slots

NOTE: you have to do this once every time you turn on BB, and ALL analog inputs will be set up. In order to have it automatically set up, read point 7 of DS18B20 setup.

3) The ADC has a 12-bit resolution, meaning that it gives back values from 0 to 4095. To read the value associated to an analog input, type

cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw

Where the "*" in "in_voltage*_raw" correspond to the AIN* you want to read (so, in order to read AIN0 it will be "in_voltage0_raw").

4) Some GPIO pins are configured to be used with HDMI. To disable the HDMI Cape, un-comment the lines in /boot/uEnv.txt:

cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

Dew point DMT143

1) They don't need to be set up. To read the value with ADC use the same procedure of RTDs (point 3).

DEBIAN 4.4

For the impatient

1) Connect BeagleBone with a USB cable to your pc
2) If you type /sbin/ifconfig you'll probably see a network with

192.168.7.1     USB     Windows     
192.168.6.1     USB     Mac OS X, Linux

3) Next ssh to the Beaglebone with

ssh root@192.168.7.2 #(or 192.168.6.2) #Note the last digit is 2 while 1 is the interface on your PC

4a) Edit the file /etc/network/interfaces by un-commenting the lines for eth0 and adding the IP, net mask and gateway address

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.133.241 #Choose your favourite IP address
netmask 255.255.255.0
gateway 192.168.133.100 #Choose your gateway (host PC)

...of course this was too simple so with the new beaglebones you need to follow these instructions. :

Very very good news !!! Problem totally solved ...

Debian, Jessie 8.6 distribution, has a connection manager called "connman". This manager has its own ways of operating with both static IP and dynamic IP. By default, the IP configuration is set dynamically. But in some cases, as in my case, it is necessary to make the IP static, but "connman" does not allow IP to be fixed in the ways known to most people, and it overrides the information when the Linux device is rebooted . In my case the device is a BeagleBone Black (BBB). To prevent this and make the IP static, the steps are:

1) Identify the eth0 name that "connman" manages. In my case there is a directory in "/var/lib/connman" that identifies eth0:
A) ls -la /var/lib/connman
It will be shown something like this:
drwxr-xr-x 3 root root 4096 Jan 27 18:42 .
drwxr-xr-x 33 root root 4096 Nov 6 15:28 ..
drwx------ 2 root root 4096 Jan 27 18:42 ethernet_9059af4beffc_cable
-rw------- 1 root root 284 Jan 27 18:42 settings

In my case the ethernet card eth0 is identified by the directory "ethernet_9059af4beffc_cable" 

2) Knowing this directory, run a "connman" command to make the static IP:

connmanctl config ethernet_9059af4beffc_cable --ipv4 manual 192.168.137.2 255.255.255.0 192.168.137.1

Explaining the parts:
ethernet_9059af4beffc_cable => identification of my eth0 card
--ipv4 => identification of what will be configured, in this case the ipv4 protocol
192.168.137.2 => IP that I chose to configure the static IP of Linux
255.255.255.0 => subnetmask
192.168.137.1 => Gateway IP, which in my case is a Windows notebook

3) Configure the DNS servers:

connmanctl config ethernet_9059af4beffc_cable --nameservers 192.168.1.1 8.8.8.8

Explaining the parts:
--nameservers => identification of what will be configured, in this case the DNS servers
192.168.1.1 => IP of my router
8.8.8.8 => IP DNS Google

4) Edit the file "/ etc / network / interfaces" 

NOTE: That was the first thing I did, before those others above. I did not get to test without doing this, but I believe that only items 1, 2 and 3 above are sufficient to solve the problem (fixed / static IP definitely). If it is not, then just edit the file "/ etc / network / interfaces", including at the end of the file the information below, adapting the numbers to your network:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.137.2 (IP that I chose)
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.137.1 (Ethernet IP of my Windows notebook)
dns-server 192.168.1.1 (my router)

5) Reboot.

Thank you all for your help. Well, that was a lot of work!

5) remove the usb and reboot!

6) Now you can ssh using the network:

ssh root@192.168.133.241

Flashing an image

How to flash an image

Debian images for BBB

The default user:password are [debian:temppwd].
If you want to let root access without password you need to change in

/etc/ssh/sshd_config
the line
PermitRootLogin yes
and set Pam to no
UsePAM no

then
service sshd restart

root login

Setting up Sensors and Relays

Digital sensors DS18B20

1) Ssh to Beaglebone using the Ethernet cable

2) You have to enable 1-wire connection on Beaglebone. First, create a file called "w1.dts" with the following content:

/dts-v1/;
/plugin/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part-number = "DS1820";
    version = "00A0";

    exclusive-use = "P9.22";

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
             ds1820_pins: pinmux_ds1820_pins {
                 pinctrl-single,pins =  <0x150 0x37>;
             };
        };
    };

    fragment@1 {
        target = <&ocp>;
        __overlay__ {
            onewire@0 {
                status          = "okay";
                compatible      = "w1-gpio";
                pinctrl-names   = "default";
                pinctrl-0       = <&ds1820_pins>;
                gpios           = <&gpio1 2 0>;
            };
        };
    };
};

3) Make sure that:

a) exclusive-use = "P9.22"
b) pinctrl-single,pins = <0x150 0x37>
c) gpios = <&gpio1 2 0>

4) Now build the file using dtc

dtc -O dtb -o w1-00A0.dtbo -b 0 -@ w1.dts

If yout came across a "Missing -@ flag error", you probably have a dated version of dtc. You can download a newer version that is compatible at:

wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh

5) Now copy the file to /lib/firmware

cp w1-00A0.dtbo /lib/firmware

6) Now set up the device tree path by typing

echo w1 > /sys/devices/platform/bone_capemgr/slots

To see if everything has been setup correctly, run the following and check for the "Override Board Name" connection

cat /sys/devices/platform/bone_capemgr/slots

0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
7: ff:P-O-L Override Board Name,00A0,Override Manuf,w1

7) If the previous list is empty it means that you need to modify the file /boot/uEnv.txt to add the enabling of the pins in capemgr

#uncomment the line and add the connector and pin that need to be enabled
cape_disable=bone_capemgr.disable_partno=cape-universaln
cape_enable=bone_capemgr.enable_partno=BB-W1-P9.22

8) NOTE: You will need to run "echo w1 > /sys/devices/platform/bone_capemgr/slots" every time you turn on the Beaglebone. In order to automatically do it, insert the command in "/etc/rc.local" file somewhere after the comments section.

9) Having connected the DS18B20 sensor to the right-configured pin, it is available at "/sys/devices/w1_bus_master1/", with the format "28-xxxxxxxxxxxx" representing the serial number.

10)To make a temperature reading, type the following command (where 28-03146d0c5bff must be replaced with your sensor serial number)

cat /sys/devices/w1_bus_master1/28-03146d0c5bff/w1_slave

If everything has been set up correctly, the output should be
93 01 55 00 7f ff 0c 10 cb : crc=cb YES
93 01 55 00 7f ff 0c 10 cb t=25187

The value t=25187 is the current temperature in Celsius degrees: 25.187 C.

Analog Temperature Sensors PT100RTD

1) The RTDs are connected to Beaglebone using analog inputs. They use AIN0, AIN2, AIN4, AIN6.

2) To set up the analog inputs tree path, you need to type

echo BB-ADC > /sys/devices/platform/bone_capemgr/slots

NOTE: you have to do this once every time you turn on BB, and ALL analog inputs will be set up. In order to have it automatically set up, read point 7 of DS18B20 setup.

3) The ADC has a 12-bit resolution, meaning that it gives back values from 0 to 4095. To read the value associated to an analog input, type

cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw

Where the "*" in "in_voltage*_raw" correspond to the AIN* you want to read (so, in order to read AIN0 it will be "in_voltage0_raw").