raspberry-pi2

How to emulate the Raspberry Pi 2 on QEMU?

强颜欢笑 提交于 2019-12-09 04:48:38
问题 Some time ago I emulated the Raspberry Pi following this article, but this approach has several problems: It is very slow. The display solution is limited to 800x600. You cannot emulate more than 256mb ram. Furthermore there is no emulation for the new Broadcom BCM2836 or any other arm7 based cpu in Qemu. However, there are several reasons, why it would be interesting to emulate the Raspberry Pi. So I am interested in any hints that push me in the right direction to get a working Raspberry Pi

Trying to read an ADC with Cython on an RPi 2 b+ via SPI (MCP3304, MCP3204, or MCP3008)?

此生再无相见时 提交于 2019-12-08 11:54:42
问题 I'd like to read differential voltage values from an MCP3304 (5v VDD, 3.3v Vref, main channel = 7, diff channel = 6) connected to an RPi 2 b+ as close as possible to the MCP3304's max sample rate of 100ksps. Preferably, I'd get > 1 sample per 100µs (> 10 ksps). A kind user recently suggested I try porting my code to C for some speed gains. I'm VERY new to C, so thought I'd give Cython a shot, but can't seem to figure out how to tap into the C-based speed gains. My guess is that I need to

Python script too much cpu usage

ⅰ亾dé卋堺 提交于 2019-12-08 11:54:10
问题 I'm not an expert in programming so i googled a lot to get this script to work. It listens on the serial interface ans is searching for 3 values (temperature, humidity and battery level). If it finds one of zhem it saves it to a text file and checks if the value is above or under a certain level. I f this is the case it sends an e-mail to warn. My problem is that it uses constatntly about 99% of cpu power... Can you help me to limit the CPU usage to a minimum. Thanks #!/usr/bin/env python # -

Run Script on Startup with Raspbian Jessi Wheezy and Raspberry Pi2b [closed]

*爱你&永不变心* 提交于 2019-12-08 07:52:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I know there are lots of posts on this topic, but depite working through many many many of them I cant get this working. I have a raspberry pi2b with raspbian jessie wheezy. I want to run this framebuffer command automatically on startup: sudo /usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg I

twython - No module named twython error

梦想与她 提交于 2019-12-08 07:07:27
问题 I installed tywthon on my raspberry pi using the following command: sudo pip install twython There were no errors during the install. When I run my python file it comes up with: ImportError: No module named twython Code is as follows: import sys import datetime from twython import Twython #Twitter keys CONSUMER_KEY="xxx" CONSUMER_SECRET ="xxx" ACCESS_KEY = "xxx" ACCESS_SECRET ="xxx" api = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET) dt=datetime.datetime.now() mon=4-dt.month

Run script with udev after USB plugged in on RPi

为君一笑 提交于 2019-12-08 06:01:45
问题 I am trying to run a script from a udev rule after any USB drive has been plugged in. When I run the script manually, after the USB is mounted normally, it will run fine. The script calls a python program to run and the python program uses a file on the USB drive. No issues there. If I make the script to simply log the date in a file, that works just fine. So I know my UDEV rule and my script work fine, each on their own. The issue seems to come up when udev calls the script, then script

Passing string variable to MySQL, fails as tuple

时光怂恿深爱的人放手 提交于 2019-12-07 15:27:58
问题 Working with a newly purchased RaspberryPi and I am very new to Python/MySQL so please excuse the naive question I am posting. I have looked at many Q&A's about this but I cannot seem to get my head around 'why' this is failing. I get error: "must be string or read-only buffer, not tuple" . My variable appears as a string if I test it with TYPE so now I am lost. import MySQLdb import time db = MySQLdb.connect(host="localhost", user="user",passwd="easypwd", db="imagepi") cursor = db.cursor()

Converting C source to ARM assembly

一个人想着一个人 提交于 2019-12-06 16:28:17
问题 I am trying to convert .c files for ARM (ARMv7l for Raspberry Pi2) but I could not find any online converter or understand how it works. Previously these .c files were executable in Windows platform and thus unable to execute on Pi's arm architecture. Does anybody can assist me in this? 回答1: Any c compiler can generate assembly code from C code, if your objective is specifically to generate assembly code for arm then you'll need a cross compiler such as the GNU arm embedded toolchain. For gcc

Typewriter Effect Pygame

僤鯓⒐⒋嵵緔 提交于 2019-12-06 14:18:12
问题 This question is really difficult to ask, but I know you guys here at Stack Overflow are the brightest minds. I'm totally blinded by why this issue happens (I'm fairly at Python and Pygame, so any suggestions on how to improve the code will be received with the love of improving my skills). What I'm creating: It's really a gimmick project, I have a little 2.5" screen (PiTFT) attached to a Raspberry Pi and the code is creating a typewriter effect with a moving cursor in front of the text as it

Sending and receiving images via a socket

允我心安 提交于 2019-12-06 09:15:37
I have a C# desktop app. It connects to another PC on my network which is a UWP C# app. I am trying to send an image or 2 to my listening socket and to test this I get the listening socket to send me the image back. The trouble is that even though my server recieves all the bytes that were orginally sent the recieved image back to the client is not of the same size. To make this even more weird is sometimes the returned bytes are correct and I get the whole image and when I attempt to send 2 images the 1st one is OK and the 2nd one is not. Then it will/can revert back to no images being sent