131 [sw][linux][raspi][ioc] Orange Pi Zero setup
image
apt mirrors
sudo cp -f /etc/apt/sources.list /etc/apt/sources.list.bak
sudo tee /etc/apt/sources.list << 'EOF'
deb https://mirrors.bfsu.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.bfsu.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.bfsu.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://mirrors.bfsu.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.bfsu.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.bfsu.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
EOF
sed -i.bak 's#http://beta.armbian.com#https://mirrors.bfsu.edu.cn/armbian#g' /etc/apt/sources.list.d/armbian.list
#sed -i.bak 's#http://apt.armbian.com#https://mirrors.bfsu.edu.cn/armbian#g' /etc/apt/sources.list.d/armbian.list
sudo apt update && sudo apt upgrade
samba & tftp
[raspi docs samba](https://www.raspberrypi.com/documentation/computers/remote-access.html#samba-smbcifs)
[Test setup (TFTP)](https://www.raspberrypi.com/documentation/computers/remote-access.html#test-setup)
Networking
Install fzf/zellij/zoxide
Download them from windows side
- [fzf](https://github.com/junegunn/fzf/releases)
Or just use samba on windows side.
python
- install pkgs
- add pypi mirrors
- create venvs
- failed to build wheels, then use piwheels
- numpy failed to import, cannot find openblas
# pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple
pip config set global.index-url https://www.piwheels.org/simple
Comments
konosubakonoakua · 2024-12-24T11:54:54Z
epics on orange pi zero
- https://epics.anl.gov/download/base/index.php
> [!IMPORTANT]
> You need to set `PYEPICS_LIBCA` to load the correct `libca.so` on rpi
> Refer to: [pyepics issue 238](https://github.com/pyepics/pyepics/issues/238)
#### pythonsoftioc on raspi
Then try with [this test](https://diamondlightsource.github.io/pythonSoftIOC/master/tutorials/creating-an-ioc.html).
#### pcaspy on raspi
If encountered with: `ImportError: libca.so.4.14.3: cannot open shared object file: No such file or directory`, Check version first:
If epics version not matched with pcas build, then use `ln -s` to make softlinks for shared libs.
mkdir $HOME/EPICS
cd $HOME/EPICS
wget https://epics.anl.gov/download/base/base-7.0.8.1.tar.gz
tar xf base-7.0.8.1.tar.gz && ln -s base-7.0.8.1 epics-base
cd epics-base
make -j2
~/EPICS/bin/linux-arm/softIoc
cat >> ~/.bashrc << 'EOF'
export EPICS_BASE=$HOME/EPICS/epics-base
export EPICS_HOST_ARCH=linu-arm
export PYEPICS_LIBCA=$HOME/EPICS/epics-base/lib/linux-arm/libca.so
EOF
# because it will install 7.0.7.99.0.2 which will not work with latest softioc
uv pip install epicscorelibs==7.0.7.99.1.1
uv pip install softioc
konosubakonoakua · 2024-12-24T14:21:46Z
swapfile
konosubakonoakua · 2024-12-24T15:06:02Z
autostart
rc-local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>IP address is %s\n" "$_IP"
fi
### add your commands here ###
# keep this line
exit 0
systemd
- Example
- Enable & Start
- Logging
- Restart
- Reload
sudo tee /etc/systemd/system/ioc-instr-cs-keithley-6221.service << EOF
[Unit]
Description=softioc for keithley current source 6221
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=5
[Service]
ExecStart=/home/opi/shared/iocs/ioc-instr-cs-keithley-6221/pve/softioc_keithley6221.sh
WorkingDirectory=/home/opi/shared/iocs/ioc-instr-cs-keithley-6221/pve/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=opi
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable ioc-instr-cs-keithley-6221.service
sudo systemctl start ioc-instr-cs-keithley-6221.service