raspberry-pi2

Autostart does not work after user reboot

隐身守侯 提交于 2019-12-24 18:09:03
问题 I want to autostart a sh script after reboot. I add below line to /etc/xdg/lxsession/LXDE-pi/autostart . @/home/pi/mog/run.sh Everything works fine if i plug the raspberrypi-2 to power line or switch on it after halt. However when i run shell command sudo shutdown -r now the autostart method does not work after reboot? I want to run a C++ application after reboot and my run.sh script is below. #!/bin/bash sleep 5 /home/pi/mog/mog -platform xcb 回答1: I guess it depends on what type of shell

why does my web api client call not work in Raspberry Pi2 Iot

China☆狼群 提交于 2019-12-24 13:52:38
问题 I have this code: private const string route = "/api/Print"; public bool Update(string header, string tc) { bool success = false; using (var client = new HttpClient()) { client.BaseAddress = new Uri("my uri"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var print = new Print { CompanyRef = new Guid(), Header = header, TC = tc }; var response = client.PutAsJsonAsync(route, print); } success =

Raspberry PI 2 GPIO.setup() exits without any error

我的未来我决定 提交于 2019-12-24 13:02:05
问题 I got a Pi2 and wanted to run the led example. But for some reason, the GPIO.setup(11, GPIO.OUT) always returns without any warnings or errors. I run it in interactive mode with sudo , that's how I figured out it returned at the setup() function. Can anybody help? Thanks in advance. Here is the commands I run. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) ## neither BOARD nor BCM works. GPIO.setup(11, GPIO.OUT) ##<<<< it returns here without error. GPIO.output(11, GPIO.HIGH)

ffmpeg streaming camera command error

时光怂恿深爱的人放手 提交于 2019-12-24 12:23:10
问题 Hi im using this method http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets to stream video from my raspberry Pi cam to my pc using Websocket everything work fine but when I enter this command ffmpeg in my raspberry machine ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -f mpeg1video \ -b 800k -r 30 http://localhost:8082/mypassword/320/240/ Here is the full console output: pi@raspberrypi:~ $ ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -f mpeg1video -b 800k -r 30

Advertising Bluetooth Raspberry Pi Peripheral and iOS Central

吃可爱长大的小学妹 提交于 2019-12-24 07:36:03
问题 I'm trying to connect a Raspberry Pi to an iPhone. I've come a long way but have been hitting the same brick wall for the last couple of days. Perhaps someone here could help me figure out what I'm missing. So far, I have: Created an iOS app that broadcasts as a peripheral Created an iOS app that acts as a Central When testing on an iPhone 5 and iPhone 6, both devices can talk to each other. Created a Java App using the Bluecove library that broadcasts as a peripheral on a Raspberry Pi.

OpenCV Python, reading video from named pipe

限于喜欢 提交于 2019-12-23 10:10:42
问题 I am trying to achieve results as shown on the video (Method 3 using netcat) https://www.youtube.com/watch?v=sYGdge3T30o The point is to stream video from raspberry pi to ubuntu PC and process it using openCV and python. I use command raspivid -vf -n -w 640 -h 480 -o - -t 0 -b 2000000 | nc 192.168.0.20 5777 to stream the video to my PC and then on the PC I created name pipe 'fifo' and redirected the output nc -l -p 5777 -v > fifo then i am trying to read the pipe and display the result in the

Record webcam video with wxpython open-Cv using control buttons?

筅森魡賤 提交于 2019-12-23 05:12:37
问题 I have managed to stream a webcam video inside a Wx-Python window using Open-CV but i want to record that video using control buttons. Let me know how to capture a webcam video while a click a button? import wx import vlc import numpy as np import time import os import user import cv2.cv class MainWindow(wx.Panel): def __init__(self, parent,capture): wx.Panel.__init__(self, parent) mainSizer = wx.BoxSizer(wx.VERTICAL) # video videoWarper = wx.StaticBox(self,size=(640,480)) videoBoxSizer = wx

Getting IOError: [Errno Invalid number of channels] -9998 when using mic with PyAudio on Raspberry Pi

流过昼夜 提交于 2019-12-23 04:28:55
问题 Bad news, everyone! I try to use a microphone on my Raspberry Pi through PyAudio but without success. The microphone is connected to a USB sound card. The microphone works when I go through 'arecord' : pi@raspberrypi ~ $ arecord -D plughw:0,0 -f cd test2.wav Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo However, when I do the test record.py in PyAudio, I got an error. The error is the same for all programs in Python that uses PyAudio : pi@raspberrypi /usr/src

Upgrading skimage version on Raspberry pi

筅森魡賤 提交于 2019-12-22 11:08:34
问题 I've installed python packages using the synaptic package manager on Raspberry Pi-2. However, the skimage module version 0.6 is the latest available version in synaptic. Can someone guide me how to upgrade it to 0.11, as certain functions are missing in the older version. I tried pip install scikit-image , but it gives the output Running setup.py install for scikit image and then gets stuck there. 回答1: I don't think there is anything wrong there. It's just that there is a number of C

Running simple QtWebEngine app on Raspberry Pi 2, page not showing

梦想的初衷 提交于 2019-12-21 22:35:09
问题 I compiled and installed QtWebEngine + QML plugins on Raspberry Pi 2 with Yocto recipes using information in this tutorial using Yocto dizzy branch and run the following script: root@raspberrypi2:~# more chromium.qml import QtQuick 2.1 import QtQuick.Controls 1.1 import QtWebEngine 0.9 ApplicationWindow { width: 1280 height: 720 color: "lightgray" visible: true WebEngineView { id: webview url: "file:///home/root/hello.html" anchors.fill: parent } } Note that the IMPORT VERSION 0.9, not 1.0 I