raspbian

Does the Raspberry Pi 2 model B v1.1 have an internal RTC?

血红的双手。 提交于 2019-12-06 00:46:14
I work with Raspberry Pi 2 model B v1.1 and I searched about a RTC to keep time even in the case of a power outage or a loss of internet connection. I found that I must buy a RTC chip with a battery. But recently I heard that my Raspberry Pi already contains a RTC. But is it right? If so, where is its location? I don't see anything called RTC on my chip. I am fairly certain there is not an RTC chip built-in: "One of the complaints Pi users have is that there's no built-in hardware clock on the Pi." (Source: https://www.element14.com/community/community/raspberry-pi/raspberry-pi-accessories

Which library needed to satisfy #include <linux/videodev.h>

坚强是说给别人听的谎言 提交于 2019-12-06 00:06:51
I'm trying to compile uvccapture on the Raspberry Pi running Raspbian Wheezy. What package do I need to install so gcc/make can satisfy this include? #include <linux/videodev.h> sudo apt-get install libv4l-dev maybe you will need also: cd /usr/include/linux sudo ln -s ../libv4l1-videodev.h videodev.h 来源: https://stackoverflow.com/questions/15694753/which-library-needed-to-satisfy-include-linux-videodev-h

How to check if a file is already opened (in the same process)

余生长醉 提交于 2019-12-06 00:04:50
问题 And I'd like to specifically achieve that with the try catch construct. This related question suggests that I can do: try: open(fileName, 'wb+') except: print("File already opened!") raise However, it doesn't work me. I can open the same file multiple times without any problem: fileObj1 = open(fileName, 'wb+') fileObj2 = open(fileName, 'wb+') Is it because I have Python 3.5? Or because I'm using Raspbian? Thanks for the help! 回答1: You open the same file but assign them to different variables.

run python script on startup - debian

六眼飞鱼酱① 提交于 2019-12-05 20:47:48
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!! 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 : [Desktop Entry] Type=Application Exec=python /path/to/your/application.py arguments UPDATE: updated with Don

Prevent usbhid from autoloading when USB HID device is plugged in

我的未来我决定 提交于 2019-12-05 16:01:33
I'm trying to (reversibly) disable USB HID support on a Raspbian Jessie install, kernel version 4.4.16-v7+. We need to have the Raspberry Pi in a semi-public space and display stuff on a TV, and we'd like to make it at least somewhat hard to mess with it. So far I've managed to make the usbhid module removable from the kernel via rmmod. After rmmod'ing the module, tt seems, though, that each time I plug in a USB keyboard or mouse, the device driver gets loaded back into the Kernel. Is there any way to prevent that? udev is the best and easiest way doing that, add a new rule in e.g.: /etc/udev

Sqlite4java on Raspberry Pi

亡梦爱人 提交于 2019-12-05 12:12:35
I want to use my java project on Raspberry Pi. This code depends on sqlite4java which uses native implementations for many platforms including arm processors link . The problem is that java can't load required sqlite wrapper for arm processor. I was doing the follows: Copied all version (tried one by one) of precompiled libraries ( libsqlite4java-linux-armv5te.so , libsqlite4java-linux-armv7a.so , libsqlite4java-linux-arm.so ) which I renamed to libsqlite4java-linux-arm.so . Command java -Djava.library.path=. -jar sqlite4java.jar -d gives output: 140213:092447.509 FINE [sqlite] Internal:

Increase SPI buffer size in Raspbian

给你一囗甜甜゛ 提交于 2019-12-05 11:15:34
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. For some time, the Pi Foundation have compiled the SPI device driver into the kernel. The way to change the buffer size now is to edit the /boot/cmdline.txt file

Segmentation fault with opencv, in python on Raspberry

做~自己de王妃 提交于 2019-12-05 07:03:05
I'm making a really simple program which capture a video from a Raspberry pi camera, using opencv in python. I'm using Raspbian as OS. I've already made a few programs with the version 2.4.5 of opencv and now i've installed opencv 2.4.9. All the programs that i used to run on the previous version of opencv are not working now, and i think i found the point in which the programs gives me errors. Just trying to launch the following code: import cv2 import numpy as np cap = cv2.VideoCapture(0) resAcquisitionWidth = 160 resAcquisitionHeight = 120 cap.set(3, resAcquisitionWidth); cap.set(4,

Raspberry-pi docker error: standard_init_linux.go:178: exec user process caused “exec format error”

☆樱花仙子☆ 提交于 2019-12-04 23:36:51
I've installed docker in rapsbian according to the official instructions (i.e., running curl -sSL https://get.docker.com | sh ) but I'm not able to run the hello-world example (I've also tried other examples without success). This is the error I'm getting: pi@raspberrypi2:~ $ docker run hello-world standard_init_linux.go:178: exec user process caused "exec format error" My environment is Raspberry Pi 2 Model B with Raspbian GNU/Linux 8 (jessie) and Docker version 17.03.0-ce, build 60ccb22. Any hint about the problem or possible directions to solve the problem? Many thanks! Raspberries use ARM

Unable to autolaunch a dbus-daemon without a $DISPLAY for X11. NetBeans. Pi as remote host

≡放荡痞女 提交于 2019-12-04 18:03:16
I am trying to run the following example code using my NetBeans IDE: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <dbus/dbus.h> int main() { DBusConnection *connection = NULL; DBusError error; char buffer[1024]; dbus_error_init(&error); connection = dbus_bus_get(DBUS_BUS_SESSION, &error); if (dbus_error_is_set(&error)) { fprintf(stderr, "%s", error.message); abort(); } puts("This is my unique name"); puts(dbus_bus_get_unique_name(connection)); fgets(buffer, sizeof(buffer), stdin); return 0; } From an excellent tutorial: DBUS TUTORIAL USING THE LOW-LEVEL API I have my