Installation tools for APUs and Raspberry Pi boxes

The APU is a Linux box to be used as a control box at LIN sample environment

cfg/ contains the configuration files for all boxes

to_system/ contains the files to be installed in the system

We have also the Raspberry based PLC Iono Pi Max and other Raspberry Pi based boxes.

config files

filename: cfg/(hostname)_(hexdigits).cfg

  • (hostname) the hostname to be given on startup
  • (hexdigits) the last six digits of the ethernet adress of the first interface on the APU (leftmost plug)

content of the config files:

[NETWORK]
eth0=192.168.127.254    # leftmost socket: connect here a moxa with factory settings
eth1=192.168.2.2        # connected device will get this ip via DHCP
eth2=192.168.3.3        #    or must be configured static to this IP
eth3=dhcp               # rightmost socket is the uplink

[ROUTER]
3000=/dev/ttyUSB0       # routing 3000 to the internal serial port /dev/ttyUSB0
5900=192.168.2.33       # routing VNC (local port 5900 to port 5900 on 192.168.2.33
8080=192.168.127.254:80 # routing 8080 to port 80 of 192.168.127.254

[FRAPPY]
cfg=uniax   # the cfg file for the frappy server
port=5000   # the port for the frappy server

[DISPLAY]
startup_text=startup...|HOST|ADDR   # startup text, 3 lines separated with |

network configuration

The example above fits the most cases.

Here a detailed description of possible settings:

fixed IP

eth1=192.168.3.5

Configure the IP address of the connected device to get the specified IP via DHCP or configure the device to with this static IP. The last number must be within 1..254, the APU port itself will get 1 (or 2, if the specified IP is 1).

custom network

eth2=192.168.3.1/24  # our ip address, the static address of the connected device must
                     # be within 1-254 and not match our own

24 means 24 bit = 3 bytes network address. A local network with static addresses. This way, the APU can get an other address than 192.168.x.1 or 192.168.x.2 or the network address size might be defined other than 24. Probably needed rarely.

eth0=wan    # or eth0=dhcp

Uplink configured for DHCP in any network n.x.y.z with n < 192

eth0=wan,192.168.1.0/24

Add more networks to the allowed uplink range. More than one range is allowed, comma separated. Must not overlap networks specified for other ports!

disabled port

eth3=off             # disabled

display

available on control boxes (MLZ type) only. must therefore not be present on bare apu boxes.

Installation of a Fresh Control Box or bare APU

Install image by means of the USB stick BOOT_TINY. The stick has TinyLinux on it and some additional scripts, if you do not have one, you may create it from another box.

a) create a USB stick with TinyLinux (omit if you have the stick already)

log in as root/FrappyLinse to an apu box

apu> cd boxtools
apu> ./makeusb

You are asked to give the device name from a list (typically sdb) before it writes to the stick.

b) boot with TinyLinux from USB stick

Connect a Mac with an USB to serial adapter (and null-modem!).

mac> screen /dev/tty.usbserial-130 115200

Do not yet conenct to LAN, if the box is not yet registered to PacketFence. Plug USB stick and start the box, wait for prompt 'tc@box:' and cd into BOOT_TINY

cd /media/BOOT_TINY

c) Determine address/name for registering in PacketFence

sh reg

enter new hostname (HWaddr will be on the output) register to PacketFence and set role to sinq-samenv connect LAN to rightmost socket on a bare APU or the leftmost socket on a control box

d) Copy Image to APU SSD

sh write_to_ssd

some random art images are shown ...

images from l_samenv@samenv:boxes/apuimages:

2022-11-09.lz4
2024-01-18.lz4

which image?
  • Enter the image you want to write (typically the last one).
  • It will take around 10 mins to write the image.
  • remove the stick, power off/on (or do sudo reboot now)

e) Install Services

login with root/FrappyLinse

> cd boxtools
> git pull
> python3 install.py
...
enter host name:
...

> reboot now

DONE!

f) Cloning an Image from an Existing Box

Use (b) above to boot from the BOOT_TINY USB stick

$ sh clone

You are asked to confirm or change the image name.

Description
forked from aputools when changed to debian
Readme 26 MiB
Languages
Python 77.5%
Shell 22.5%