project website https://oksanagit.github.io/babyIOC
Motivation of babyIOC is to create a portable small form factor control system solution for mobile experimental stations and test systems.
babyIOC is an easy to assemble, plug and play Debian server with deployed NSLS2 EPICS Debian distribution, compiled areaDetector package, and NSLS2 bluesky Data Acquisition Suite. Prosilica sample IOC is deployed at /epics/iocs.
Current Image Download
- Debian Jessie
- NSLS2 EPICS Debian distribution, which is built from epicsdeb repository.
- areaDetector-3-3-1 with
- epics-base R7.0.1.1
- ipac R2.14
- seq R2.2.5
- asyn R4.33
- autosave R5.9
- busy R1.7
- sscan R2.11.1
- calc R3.7
- ioc-stats R3.1.15
- X2Go server
- NSLS2 bluesky software suite
Building an EPICS Control System from scratch could be tedious, time consuming and challenging for beginners. We offer you an out of the box solution. When you buy and assemble this Single Board Computer, you can load our pre-created image onto microSD card, boot the discless babyIOC computer from this microSD card and build your EPICS iocs using prebuild libraries and packages. If the community finds this useful, we can add more modules, sample iocs to ease the learning curve, etc. The image also has NSLS2 bluesky software deployed for those who are intersted to try it out.
We have conducted much research, reviewing many vendors which offer small factor Single Board Computes(SBC) including: Beagleboard, RaspberryPI, BoundaryDevices, Nvidia, Hardkernel, PCengineering, EmbeddedArm, and Udoo.
The selected hardware is UDOO x86 Ultra board, which can be enhanced with different daughter cards. In this project we use an ethernet daughter card, which adds 2 additional interfaces useful in any controls environment. Though the hardware can be purchased from many distributors, we advise buying directly from UDOO. They ship fast.
Parts list:
- UDOO x86 Ultra
- UDOO x86 metal case
- CPU fan for UDOO x86 heatsink
- M.2 dual Ethernet Module Kit
- Power Supply USA
- HDMI to HDMI cable, or other cable to connect the monitor. We used HDMI port.
- microSD memory card 16GB or bigger
root - "babyIOCroot"
iocuser -"$babyioc$"
- babyIOC contribution @ EPICS collaboration meeting 2018 in APS
- EPICS Debian source
- NSLS2 EPICS Debian repository
- areaDetector package
- Oksana Ivashkevych (BNL) vision, driver, babyIOC mother
- Thomas Smith (BNL) sysadmin babyIOC father
- Dennis Poshka (BNL) babyIOC technician
- Leon Flaks (BNL) image conditioning
- Thomas Caswell (BNL) bluesky deployment
- Matt Cowan (BNL) sysadmin help
- Kevin Peterson (ANL) ideas for disc size expansion
- 28ID1, Milinda Abeykoon, Julian Adams (BNL) project support
- Christopher Stelmach (BNL) drawing modification to add a cutoff
Vendor's instructions on how to assemble the hardware can be found here. Vendor's metal case is desiged to hold a board without accesories. In order to use this metal case with Ethernet daughter board, one needs to cut an opening in the back side. The original drawing can be found here. The needed cut out is indicated on UDOO_X86_metal_case_drawing-MODIFIED.pdf.
- plug in microSD card into your linux box. We used microSD-miniSD-USB dungle.
- run cat /proc/partitions to see what the device name is. It usualy comes up as /dev/sdb
oksana@oksana-linux:~$ cat /proc/partitions
major minor #blocks name
8 0 244140625 sda
8 1 234219520 sda1
8 2 1 sda2
8 5 9918464 sda5
8 16 122241024 sdb
8 17 121634816 sdb1
8 18 1 sdb2
8 21 604160 sdb5
Copy image onto microSD card. You should become root.
root@oksana-linux:/home/oksana# date; dd if=udooImage of=/dev/sdb bs=64k; date
Thu Oct 11 15:11:48 EDT 2018
243096+0 records in
243096+0 records out
15931539456 bytes (16 GB) copied, 597.654 s, 26.7 MB/s
Thu Oct 11 15:21:45 EDT 2018
root@oksana-linux:/home/oksana#
Word of warning: dd command will happily overwrite your system's hard drive if you use the wrong /dev/sdX and it won't warn you or anything since you are root. Always double check the dd commands! An easy way to remember the dangers of this command are to think of 'dd' as 'disk destroyer'.
You can plug your microSD card and boot, however if your microSD card size was more then 16GB, you will not be able to use it at this time.
We used this link as a resource. The commands below will output information about all your partitions. We will show outputs only the partition which is being resized.
root@oksana-linux:/home/oksana# fdisk -l
......
Disk /dev/sdb: 116.6 GiB, 125174808576 bytes, 244482048 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
Disklabel type: dos
Disk identifier: 0x9adc4c27
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 29747199 29745152 14.2G 83 Linux
/dev/sdb2 29749246 31115263 1366018 667M 5 Extended
/dev/sdb5 29749248 31115263 1366016 667M 82 Linux swap / Solaris
Since we want to extend Linux partion, which happened to be the boot partition as well, the only way to do this is to delete all partions, and recreate them again.
# fdisk /dev/sdb
- Delete by pressing "d" and accepting the default suggestions. Repeat until all partitions are deleted
- Press "n" to create new partion, 'p' for primary,Last 1, offered default, fist sector offered 2048, since you have to perserve your boot partion beginning, and accept default for your last sector. Your total size will most likely be less then you expected, SD card vendors are a bit creative with the size definition.
- press w to write changes and exit
You do not need to create swap partition because the image file has a swap file configured as a part of the system. The swap file size is a relatively small 1GB to conserve space for a 16GB SD card. You can resize the swap file to your liking if you need more swap space, but it must be done on a running system. Please follow this instructions.
Now you need to resize your file system to use all available space on your SD card. If you run #resize2fs /dev/sdb1, you will be asked to run e2fsck first.
#e2fsck -f /dev/sdb1
press y (for yes) for offers to correct the errors
#resize2fs /dev/sdb1
You are ready to boot now!
Connect a monitor, we used HDMI port, a mouse and keyboard. We used one USB dongle for both peripherals. When you power on the board, you may see the "no botable device" or another similar error. The bootloader needs to be changed.
- Keep pressing Esc button, while power is applied.
- Select Boot Manager. Inside you have to choose legacy boot option. We have seen different screens for this step on identical board units we purchased at different times:
Your boot is set!
babyIOC image has DHCP configured interfaces, you can reconfigure them to your taste in /etc/network/interfaces.
In any case delete content in
/etc/udev/rules.d/70-persistent-net.rules.
This file is being created by operating system and includes mac address of your Ethernet cards. Since you have a new hardware, new interfaces will be created.
-Edit the hostname in these files /etc/hostname /etc/mailname (might not exist) /etc/hosts
Reboot
To resize, first create a new swap file. Substitute with size of the form '#G'. For example, for an 8GB swap file, use 8G. You can put this file anywhere you want, and name it whatever you want, so put it somewhere and name it something that makes sense. In this example, I'll use /mnt/swapfile.swap and a size of 4GB
fallocate -l 4G /mnt/swapfile.swap
Next, format the file for use as swap
mkswap /mnt/swapfile.swap
Now we will get rid of the old swap file and activate the new one
swapoff /mnt/1GB.swap
rm /mnt/1GB.swap
swapon /mnt/swapfile.swap
Make sure to change permissions on your swap file so it is not world-readable!
chmod 600 /mnt/swapfile.swap
Finally, to make these changes persist across reboots, edit the file /etc/fstab with your favorite editor. Replace the old file name with the new one
#swapfile
/mnt/swapfile.swap none swap sw 0 0