parent
e106f63e74
commit
bb36543c96
@ -1,11 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=python
|
||||
Comment=My Python Program
|
||||
#Exec=bash -c "sudo python /root/publish/apps/RPi/app.py"
|
||||
Exec=bash -c "sleep 10 && chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=http://127.0.0.1:5000/index.html"
|
||||
Icon=/root/RPi/icon.jpg
|
||||
Terminal=false
|
||||
MultipleArgs=false
|
||||
Type=Application
|
||||
Categories=Application;Development;
|
||||
StartupNotify=true
|
@ -0,0 +1,4 @@
|
||||
while read input
|
||||
do
|
||||
killall omxplayer.bin
|
||||
done < /dev/input/mouse0
|
@ -1,2 +0,0 @@
|
||||
[root]
|
||||
url=http://127.0.0.1:8002/index.html
|
@ -1,109 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** BSD License Usage
|
||||
** Alternatively, you may use this file under the terms of the BSD license
|
||||
** as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||
** contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "browser.h"
|
||||
#include "browserwindow.h"
|
||||
#include "webview.h"
|
||||
#include <QApplication>
|
||||
#include <QWebEngineSettings>
|
||||
#include <QSettings>
|
||||
|
||||
QUrl commandLineUrlArgument()
|
||||
{
|
||||
const QStringList args = QCoreApplication::arguments();
|
||||
for (const QString &arg : args.mid(1)) {
|
||||
if (!arg.startsWith(QLatin1Char('-')))
|
||||
return QUrl::fromUserInput(arg);
|
||||
}
|
||||
return QUrl(QStringLiteral("http://127.0.0.1:8002/index.html"));
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/*
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
app.setWindowIcon(QIcon(QStringLiteral(":AppLogoColor.png")));
|
||||
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::WebGLEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, false);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::ShowScrollBars, false);
|
||||
|
||||
QUrl url = commandLineUrlArgument();
|
||||
|
||||
Browser browser;
|
||||
BrowserWindow *window = browser.createWindow();
|
||||
window->currentTab()->setUrl(url);
|
||||
|
||||
return app.exec();
|
||||
*/
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::WebGLEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, false);
|
||||
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::ShowScrollBars, false);
|
||||
|
||||
QSettings settings("./config.ini", QSettings::IniFormat);
|
||||
settings.setIniCodec("UTF8");
|
||||
QString url = settings.value("/root/url").toString();
|
||||
|
||||
QWebEngineView *view = new QWebEngineView();
|
||||
view->setUrl(QUrl(url));
|
||||
view->show();
|
||||
return app.exec();
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
. /usr/bin/setqt5env-xcb
|
||||
cd /opt/qt5-browser
|
||||
|
||||
GEOMETRY=800x1280
|
||||
HDMISTATUS=`cat /sys/class/drm/card0-HDMI-A-1/status`
|
||||
if [ x$HDMISTATUS = x"disconnected" ]; then
|
||||
GEOMETRY=`cat /sys/class/drm/card0-eDP-1/mode | cut -d'p' -f1`
|
||||
else
|
||||
GEOMETRY=`cat /sys/class/drm/card0-HDMI-A-1/mode | cut -d'p' -f1`
|
||||
fi
|
||||
|
||||
startx ./simplebrowser --no-sandbox -geometry $GEOMETRY
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
9ddd066bb9fc45cfee5b35a1f49c9107f405435b
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,16 +1,49 @@
|
||||
sudo add-apt-repository ppa:openjdk-r/ppa
|
||||
sudo apt-get -y install openjdk-8-jdk
|
||||
sudo apt-get -y install supervisor
|
||||
sudo mkdir -p /home/pi/publish/logs
|
||||
sudo mv /etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf.bk
|
||||
sudo mv /home/pi/publish/supervisord.conf /etc/supervisor/supervisord.conf
|
||||
sudo chmod 777 /home/pi/publish/apps/IoTNode/IoTNode
|
||||
sudo chmod 777 /home/pi/publish/apps/NJWLService/start.sh
|
||||
sudo chmod 777 /home/pi/publish/apps/NJWLService/NJWLService.jar
|
||||
sudo chmod 777 /home/pi/publish/apps/APService/APService
|
||||
sudo chmod 777 /home/pi/publish/apps/ONVIFService/ONVIFService
|
||||
sudo chmod 777 /home/pi/publish/apps/ONVIFService/wwwroot/ffmpeg-linux-arm64
|
||||
sudo chmod 777 /home/pi/publish/apps/SerialPortService/SerialPortService
|
||||
sudo chmod 777 /home/pi/publish/apps/LiChuangService/LiChuangService
|
||||
sudo chmod 777 /home/pi/publish/apps/srs/objs/srs
|
||||
sudo service supervisor restart
|
||||
#!/bin/bash
|
||||
#set root password
|
||||
sudo passwd root<<!
|
||||
pi
|
||||
pi
|
||||
!
|
||||
|
||||
#install packages
|
||||
sudo dpkg -i ~/publish/files/openntpd_6.0p1-2_armhf.deb
|
||||
sudo dpkg -i ~/publish/files/python-meld3_1.0.2-2_all.deb
|
||||
sudo dpkg -i ~/publish/files/supervisor_3.3.5-1_all.deb
|
||||
sudo dpkg -i ~/publish/files/fonts-wqy-zenhei_0.9.45-7_all.deb
|
||||
mkdir -p ~/dotnet
|
||||
tar zxf ~/publish/files/dotnet-sdk-2.2.204-linux-arm.tar.gz -C ~/dotnet
|
||||
if [ `which dotnet` ]; then
|
||||
echo 'dotnet command has in path'
|
||||
else
|
||||
echo 'export PATH=$PATH:/home/pi/dotnet'>>~/.bashrc
|
||||
echo 'export DOTNET_ROOT=/home/pi/dotnet'>>~/.bashrc
|
||||
fi
|
||||
#sudo dpkg --purge oracle-java8-jdk
|
||||
#sudo dpkg -i ~/publish/files/bellsoft-jdk11.0.3-linux-arm32-vfp-hflt.deb
|
||||
|
||||
config system
|
||||
sudo systemctl enable ssh
|
||||
sudo timedatectl set-timezone 'Asia/Shanghai'
|
||||
sudo timedatectl set-ntp true
|
||||
|
||||
#config autostart
|
||||
mkdir -p ~/.config/autostart
|
||||
touch ~/.config/autostart/chromium.desktop
|
||||
echo ''>~/.config/autostart/chromium.desktop
|
||||
echo '[Desktop Entry]'>>~/.config/autostart/chromium.desktop
|
||||
echo 'Exec=bash -c "chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=file:///home/pi/publish/apps/IoTNode/wwwroot/index.html"'>>~/.config/autostart/chromium.desktop
|
||||
|
||||
#config apps
|
||||
sudo cp -f ~/publish/supervisord.conf /etc/supervisor/supervisord.conf
|
||||
sudo chmod 755 ~/publish/apps/IoTNode/IoTNode.dll
|
||||
sudo chmod 755 ~/publish/apps/NJWLService/start.sh
|
||||
sudo chmod 755 ~/publish/apps/NJWLService/NJWLService.jar
|
||||
sudo chmod 755 ~/publish/apps/APService/APService.dll
|
||||
sudo chmod 755 ~/publish/apps/ONVIFService/ONVIFService.dll
|
||||
sudo chmod 755 ~/publish/apps/ONVIFService/wwwroot/ffmpeg-linux-arm64
|
||||
sudo chmod 755 ~/publish/apps/SerialPortService/SerialPortService.dll
|
||||
sudo chmod 755 ~/publish/apps/LiChuangService/LiChuangService.dll
|
||||
sudo chmod 755 ~/publish/apps/srs/objs/srs
|
||||
|
||||
#restart
|
||||
sudo reboot
|
@ -1,8 +1,6 @@
|
||||
[program:apservice]
|
||||
command=/home/pi/publish/apps/APService/APService
|
||||
directory=/home/pi/publish/apps/APService/
|
||||
command=bash -c "~/dotnet/dotnet APService.dll"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=pi
|
||||
stdout_logfile=/home/pi/publish/logs/apservice.log
|
||||
stderr_logfile=/home/pi/publish/logs/apservice.err
|
||||
user=pi
|
@ -1,8 +1,6 @@
|
||||
[program:iotnode]
|
||||
command=/home/pi/publish/apps/IoTNode/IoTNode
|
||||
directory=/home/pi/publish/apps/IoTNode/
|
||||
command=bash -c "~/dotnet/dotnet IoTNode.dll"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=pi
|
||||
stdout_logfile=/home/pi/publish/logs/iotnode.log
|
||||
stderr_logfile=/home/pi/publish/logs/iotnode.err
|
||||
user=pi
|
@ -1,8 +1,6 @@
|
||||
[program:lichangservice]
|
||||
command=/home/pi/publish/apps/LiChuangService/LiChuangService
|
||||
directory=/home/pi/publish/apps/LiChuangService/
|
||||
command=bash -c "~/dotnet/dotnet LiChuangService.dll"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=pi
|
||||
stdout_logfile=/home/pi/publish/logs/lichangservice.log
|
||||
stderr_logfile=/home/pi/publish/logs/lichangservice.err
|
||||
user=pi
|
@ -1,10 +1,8 @@
|
||||
[program:njwlservice]
|
||||
directory=/home/pi/publish/apps/NJWLService/
|
||||
command=bash /home/pi/publish/apps/NJWLService/start.sh
|
||||
command=bash -C "start.sh"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
user=pi
|
||||
stdout_logfile=/home/pi/publish/logs/njwlservice.log
|
||||
stderr_logfile=/home/pi/publish/logs/njwlservice.err
|
||||
user=pi
|
@ -1,10 +1,8 @@
|
||||
[program:onvifservice]
|
||||
command=/home/pi/publish/apps/ONVIFService/ONVIFService
|
||||
directory=/home/pi/publish/apps/ONVIFService/
|
||||
command=bash -c "~/dotnet/dotnet ONVIFService.dll"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
user=pi
|
||||
stdout_logfile=/home/pi/publish/logs/onvifservice.log
|
||||
stderr_logfile=/home/pi/publish/logs/onvifservice.err
|
||||
user=pi
|
@ -1,8 +1,6 @@
|
||||
[program:spservice]
|
||||
command=/home/pi/publish/apps/SerialPortService/SerialPortService
|
||||
directory=/home/pi/publish/apps/SerialPortService/
|
||||
command=bash -c "~/dotnet/dotnet SerialPortService.dll"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=pi
|
||||
stdout_logfile=/home/pi/publish/logs/spservice.log
|
||||
stderr_logfile=/home/pi/publish/logs/spservice.err
|
||||
user=pi
|
@ -0,0 +1 @@
|
||||
36e1c847d50f4a8b392ac6924fd208db056c59f6
|
After Width: | Height: | Size: 50 KiB |
@ -0,0 +1,58 @@
|
||||
# For more options and information see
|
||||
# http://rpf.io/configtxt
|
||||
# Some settings may impact device functionality. See link above for details
|
||||
|
||||
# uncomment if you get no picture on HDMI for a default "safe" mode
|
||||
#hdmi_safe=1
|
||||
|
||||
# uncomment this if your display has a black border of unused pixels visible
|
||||
# and your display can output without overscan
|
||||
#disable_overscan=1
|
||||
|
||||
# uncomment the following to adjust overscan. Use positive numbers if console
|
||||
# goes off screen, and negative if there is too much border
|
||||
#overscan_left=16
|
||||
#overscan_right=16
|
||||
#overscan_top=16
|
||||
#overscan_bottom=16
|
||||
|
||||
# uncomment to force a console size. By default it will be display's size minus
|
||||
# overscan.
|
||||
#framebuffer_width=1280
|
||||
#framebuffer_height=720
|
||||
|
||||
# uncomment if hdmi display is not detected and composite is being output
|
||||
#hdmi_force_hotplug=1
|
||||
|
||||
# uncomment to force a specific HDMI mode (this will force VGA)
|
||||
#hdmi_group=1
|
||||
#hdmi_mode=1
|
||||
|
||||
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
|
||||
# DMT (computer monitor) modes
|
||||
#hdmi_drive=2
|
||||
|
||||
# uncomment to increase signal to HDMI, if you have interference, blanking, or
|
||||
# no display
|
||||
#config_hdmi_boost=4
|
||||
|
||||
# uncomment for composite PAL
|
||||
#sdtv_mode=2
|
||||
|
||||
#uncomment to overclock the arm. 700 MHz is the default.
|
||||
#arm_freq=800
|
||||
|
||||
# Uncomment some or all of these to enable the optional hardware interfaces
|
||||
#dtparam=i2c_arm=on
|
||||
#dtparam=i2s=on
|
||||
#dtparam=spi=on
|
||||
|
||||
# Uncomment this to enable the lirc-rpi module
|
||||
#dtoverlay=lirc-rpi
|
||||
|
||||
# Additional overlays and parameters are documented /boot/overlays/README
|
||||
|
||||
# Enable audio (loads snd_bcm2835)
|
||||
dtparam=audio=on
|
||||
disable_splash=1
|
||||
gpu_mem=512
|
@ -0,0 +1,13 @@
|
||||
Index: jessie-stage2/rootfs/etc/dphys-swapfile
|
||||
===================================================================
|
||||
--- jessie-stage2.orig/rootfs/etc/dphys-swapfile
|
||||
+++ jessie-stage2/rootfs/etc/dphys-swapfile
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
# set size to absolute value, leaving empty (default) then uses computed value
|
||||
# you most likely don't want this, unless you have an special disk situation
|
||||
-#CONF_SWAPSIZE=
|
||||
+CONF_SWAPSIZE=1024
|
||||
|
||||
# set size to computed value, this times RAM size, dynamically adapts,
|
||||
# guarantees that there is enough swap without wasting disk space on excess
|
@ -0,0 +1,5 @@
|
||||
--- a/rootfs/boot/cmdline.txt
|
||||
+++ b/rootfs/boot/cmdline.txt
|
||||
@@ -1 +1 @@
|
||||
-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
|
||||
+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait logo.nologo quiet init=/usr/lib/raspi-config/init_resize.sh
|
@ -0,0 +1,8 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
echo "Asia/Shanghai" > "${ROOTFS_DIR}/etc/timezone"
|
||||
rm "${ROOTFS_DIR}/etc/localtime"
|
||||
|
||||
on_chroot << EOF
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
EOF
|
@ -0,0 +1,17 @@
|
||||
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
|
||||
qpdfview gtk2-engines alsa-utils
|
||||
desktop-base
|
||||
git
|
||||
omxplayer
|
||||
raspberrypi-artwork
|
||||
policykit-1
|
||||
gvfs
|
||||
rfkill
|
||||
chromium-browser rpi-chromium-mods
|
||||
gldriver-test
|
||||
fonts-droid-fallback
|
||||
fonts-liberation2
|
||||
obconf
|
||||
supervisor
|
||||
openntpd
|
||||
ttf-wqy-zenhei
|
@ -0,0 +1,8 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
on_chroot << EOF
|
||||
update-alternatives --install /usr/bin/x-www-browser \
|
||||
x-www-browser /usr/bin/chromium-browser 86
|
||||
update-alternatives --install /usr/bin/gnome-www-browser \
|
||||
gnome-www-browser /usr/bin/chromium-browser 86
|
||||
EOF
|
Loading…
Reference in new issue