Tag: TwinCAT/BSD

  • The first installation of TC/BSD on touch panel Embeded IPC, TcHmi TF2000 and Client

    Hardware info

    CP6706-0001-0050
    Display size/resolution	7" 800 x 480
    Touch screen		single-finger touch screen
    Processor		Intel Atom® E3827, 1.75 GHz, 2 core
    Memory			8GB DDR3L RAm
    Hard disks/flash	40 GB CFast
    Interfaces		4 x USB 2.0, 1 x DVI
    Power supply		24 V DC

    Install X environments

    // Install Xorg
    $ pkg install xorg
    
    // Add a user into video user group
    $ doas pw groupmod video -m Aministrator
    
    // Get VGA info
    $ pciconf -lv|grep -B4 VGA
    // return: "Intel"...
    
    // Get input devices info
    // In X terminal
    $ doas libinput list-devices 
    // return: ELO Touch input device "dev/input/event3"
    
    

    Pass these generated info into config files.

    Install GUI windows

    // Unblock FreeBSD reposity
    $ doas ee /usr/local/etc/pkg/repos/FreeBSD
    $ >> FreeBSD: ( enable: yes )
    
    // Install openbox
    $ doas pkg install openbox
    
    // Install lightdm
    $ doas pkg install lightdm lightdm-gtk-greeter
    
    // Install on-screen keyboard to input password at hello screen
    $ doas pkg install florence
    
    $ doas ee /usr/local/etc/lightdm/lightdm.conf
    $ >> xserver-command=X -nocursor
    
    $ doas ee /usr/local/etc/lightdm/lightdm-gtk-greeter.conf
    $ >> keyboard= florence --focus
    $ >> keyboard-position= "75%,center -0;50%, 25%"
    
    // Follow config file to enable auto start boot into GUI instead of terminal environment
    

    Config files

    /usr_local_etc_X11_xorg.conf.d

    • 10-intel.conf.txt
    Section "Device"
            Identifier      "Card0"
            Driver          "modesetting"
    EndSection
    Section "Monitor"
            Identifier      "HDMI-2"
            VendorName      "ELOTouch"
            ModelName       "Monitor0Model"
            Option          "DPMS" "false"
    EndSection
    Section "Screen"
            Identifier      "Screen0"
            Device          "Card0"
            Monitor         "HDMI-2"
            SubSection      "Display"
            Modes           "800x480"
            EndSubSection
    EndSection
    Section "InputClass"
            Identifier "touchpad"
            MatchIsTouchPad "on"
            Driver  "libinput"
            Option  "Tapping" "on"
            Option  "NaturalScrolling"      "on"
    EndSection
    Section "InputClass"
            Identifier      "touchScreen"
            MatchIsTouchscreen      "on"
            Driver  "libinput"
            Option  "Device" "/dev/input/event3"
    EndSection
    Section "Files"
            FontPath "/usr/local/share/fonts/urwfonts/"
            FontPath "/usr/local/share/fonts/TrueType/"
    EndSection

    /boot/loader.conf.txt

    kern.geom.label.disk_ident.enable="0"
    kern.geom.label.gptid.enable="0"
    cryptodev_load="YES"
    zfs_load="YES"
    hint.attimer.0.clock="0"
    cuse_load="YES"
    hw.psm.synaptics_support=1
    usbhid_load="yes"
    hw.usb.usbhid.enable=1
    kldload i915kms
    hw.vga.textmode=1
    fdescfs_load="yes"

    /etc

    • fstab.txt
    do# Device                Mountpoint      FStype  Options         Dump    Pass#
    /dev/gpt/efiboot0               /boot/efi       msdosfs rw              2       2
    /dev/ada0p2             none    swap    sw              0       0
    proc                    /proc           procfs  rw              0       0
    fdescfs                 /dev/fd         fdescfs rw              0       0
    • rc.conf.txt
    #fonts_setting----------
    allscreens_flags="-f vgarom-thin-8x16"
    #####################
    zfs_enable="YES"
    dumpdev="AUTO"
    CXID_enable="YES"
    MDPService_enable="YES"
    ntpd_enable="YES"
    pf_enable="YES"
    TcSystemService_enable="YES"
    runonce_enable="YES"
    sendmail_enable="NO"
    sendmail_submit_enable="NO"
    sendmail_outbound_enable="NO"
    sendmail_msp_queue_enable="NO"
    dhcpcd_enable="YES"
    #ifconfig_igb0="inet 192.168.137.137 netmask 255.255.255.0"
    #defaultrouter="192.168.137.1"
    #ifconfig_igb1="dhcp"
    #dhcpcd_flags="--waitip --denyinterfaces igb0"
    dhcpcd_flags="--waitip"
    allscreens_kbdflags="-b quiet.off"
    syslogd_flags="-ss"
    devfs_system_ruleset="allow_usb_mount"
    hostname="CP-5B3CCE"
    
    #DAEMONS----------------------------
    zfs_enable="YES"
    #moused_enable="YES"
    webcamd_enable="YES"
    dbus_enable="YES"
    kld_list="i915kms"
    #gdm_enable="YES"
    lightdm_enable="yes"
    
    #RemoteDesktop----------------------
    sshd_enable="yes"
    xrdp_enable="yes"
    xrdp_sessman_enable="yes"
    
    #gateway_enable="true"
    
    #TcHmi------------------------------
    TcHmiSrv_enable="YES"
    • ttys.txt
    # name  getty                           type    status          comments
    #
    console none                            unknown off secure
    #
    ttyv0   "/usr/libexec/getty Pc"         xterm   onifexists secure
    # Virtual terminals
    //....existing ttyv
    ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   onifexists secure

    Enable TF2000

    // Install and enable HMI service
    $ doas pkg install TF2000-HMI-Server
    
    // Unblock firewall
    $ doas service pf stop
    
    $ doas ee /etc/pf.conf
    $ >> pass in quick proto tcp to port 0000 keep state
    $ >> pass in quick proto tcp to port 1010 keep state
    $ >> pass in quick proto tcp to port 1020 keep state
    $ >> pass in quick proto tcp to port 8080 keep state
    
    $ doas service pf start
    
    // Enable HMI service
    $ doas service TcHmiSrv start
    
    /// Remember add this line to rc.conf file above
    /// >> TcSystemService_enable="YES"
    
    /// Remember add this line to fstab.txt file also
    /// >> /dev/gpt/efiboot0               /boot/efi       msdosfs rw              2       2
    /// >> /dev/ada0p2             none    swap    sw              0       0
    
    // Install and config SQLite server
    $ doas pkg install sqlite
    
    // Change directory to
    $ cd /usr/local/etc/TwinCAT/Functions/TF2000-Hmi-Server/service/TcHmiProject
    // Change sqlite database as you like
    $ doas sqlite storage.db
    ...
    

    Install Firefox and enable kiosk mode to boot to HMI

    // Install firefox
    $ doas pkg install firefox
    
    // Edit autostart file
    $ doas ee /home/SystemUser/.config/openbox/autostart.sh
    $ >> 
    $ >> #!/bin/sh
    
    $ >> firefox --kiosk --private-window localhost:1010
    $ >> xset dpms 0 0 0
    $ >> xset s noblank
    $ >> xset s off
    
    // Run
    $ chmod +x /home/SystemUser/.config/openbox/autostart.sh

    Reposity

    See more at: