raspbian

run python script on startup - debian

て烟熏妆下的殇ゞ 提交于 2019-12-07 12:14:30
问题 I have created an application using webcam. here my application opens a window to display the image. I want to run that application on startup. if i put startup file in rc.local, it runs successfully at startup but not allowing to show window. it shows - gtk warning cannot open display. how to show window? please help me guys!! 回答1: If you're running LXDE (default on raspbian) Add a .desktop file to your ~/.config/autostart directory (create one if not available) with 3 lines saying :

MacOS下给树莓派安装Raspbian系统

萝らか妹 提交于 2019-12-07 07:51:57
下载镜像 前往 树莓派官网 下载镜像。 点击 最新版Raspbian 下载最新版镜像。 下载后请,通过 访达 双击解压,或通过 unzip 命令解压。 检查下载的文件 ls -lh -rw-r--r-- 1 dingdayu staff 4.5G 6 27 02:22 2018-06-27-raspbian-stretch.img -rwxrwxrwx@ 1 dingdayu staff 1.6G 7 18 01:49 2018-06-27-raspbian-stretch.zip 检查SD卡 将内存卡通过读卡器插入电脑。 未完待续 链接 Mac OS X下给树莓派安装Raspbian系统 无显示器启动 来源: oschina 链接: https://my.oschina.net/u/819136/blog/1859124

Increase SPI buffer size in Raspbian

旧巷老猫 提交于 2019-12-07 06:27:01
问题 I need to send 10 k bytes over SPI in single transfer (yes, because Linux is so realtime, if I send these bytes in two transfers, I do not match the timings of IC). But maximum size of message in spi_bcm2708 kernel module is 4096 bytes. How do I modify this value (preferably without recompilation of the module)? If I can do with specifying parameter to the module, what parameter and in what file I need to specify? Thanks in advance. 回答1: For some time, the Pi Foundation have compiled the SPI

Why does my JavaFx application not have a frame when run on my RaspberryPi?

旧时模样 提交于 2019-12-06 07:24:10
问题 I installed JDK 8 on my Raspberry Pi and am trying to run a javaFx sample application. My OS is Raspbian. I am using the "DigitalClock" sample application that comes with Netbeans 8. The application launches and runs on the Pi, but when it does it is almost full screen and has this large black border around the main view. Also, there is no frame on the app. No exit or minimize buttons. Frankly, I don't know how to shutdown the app or just run it in a smaller window. To resume using my Pi, I

Executing a command using JSch

百般思念 提交于 2019-12-06 05:04:05
I'm using JSch to automate remotely launching a python script from a background Java process. Modifying the Shell.java example included in the JSch package, I've successfully installed JSch, connected to my Pi, and even commented out the user/domain/password/host key checking prompt boxes in favor of storing these values directly in my Java code. After my java code logs into the remote Pi, I'd like it to send something like sudo nohup python2 myFoo.py & disown to the terminal. In the Shell.java example I'm modifying, I see lines of code redirecting the input and output streams of the channel

can't find snap7 library - linux

◇◆丶佛笑我妖孽 提交于 2019-12-06 04:52:10
I'm running Rapbian on a Raspberry Pi Revision B. I downloaded the module python-snap7 as instructed on this webpage: Snap7 Installation I tried it twice: One time using pip and another doing it manually. However, I installed it then via setup.py build and then setup.py install . If i try to create a client, I get the following error: Python 2.7.3 (default, Mar 18 2014, 05:13:23) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import snap7 >>> c = snap7.client.Client() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "

How to terminate threads cleanly in C?

戏子无情 提交于 2019-12-06 03:50:32
I am trying to write a multithreaded application in C for the Raspberry Pi in raspbian environment (UNIX system). Apart from the main thread three other threads are created and do the following: the first looks at the output of a PIR sensor and if movement is detected it takes a picture. The thread function is task1() ; the second uses sigwait and alarm() to measure the temperature every given seconds. The thread function is task2() The third thread checks if a new picture is taken and if so it does some other stuff. The synchronization with the first thread is done with a global flag, a mutex

Pillow: libopenjp2.so.7: cannot open shared object file: No such file or directory

半城伤御伤魂 提交于 2019-12-06 03:02:21
问题 I have a fresh, minimal Raspbian Stretch install. I have installed the PIXEL-dekstop by running sudo apt-get install --no-install-recommends xserver-xorg and am now trying to use Pillow in Python. Pillow was installed by running sudo apt-get install pip3 and then sudo pip3 install Pillow . Whenever I try from PIL import Image I get the error ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory . I have attempted to reinstall Pillow under different versions

Configure MySQL for local and remote access

 ̄綄美尐妖づ 提交于 2019-12-06 02:56:47
I'm using MySQL server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0 on a Raspberry Pi. This is my /etc/mysql/my.cnf : # The MariaDB configuration file # # The MariaDB/MySQL tools read configuration files in the following order: # 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults, # 2. "/etc/mysql/conf.d/*.cnf" to set global options. # 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options. # 4. "~/.my.cnf" to set user-specific options. # # If the same option is defined multiple times, the last one will apply. # # One can use all long options that the program supports.

Running Shell Script after boot on Raspberry PI

夙愿已清 提交于 2019-12-06 01:33:03
I'm making a web kiosk display board using a raspberry pi and I want to send some key strokes to the browser window 2 minutes after it's loaded. The script sends the logon details for a webserver. I've got a script that sends the keystrokes which works fine from the telnet console: #!/usr/bash username="username" password="password" echo "Setting Display" export DISPLAY=:0 echo "Sending Username" for char in $(sed -E s/'(.)'/'\1 '/g <<<"$username"); do xdotool key $char done xdotool key Tab echo "Sending Password" for char in $(sed -E s/'(.)'/'\1 '/g <<<"$password"); do xdotool key $char done