rpi | Golang wrapped version of Gordon 's Arduino-like WiringPi
kandi X-RAY | rpi Summary
kandi X-RAY | rpi Summary
Golang wrapped version of Gordon’s Arduino-like WiringPi for the Raspberry Pi.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rpi
rpi Key Features
rpi Examples and Code Snippets
Community Discussions
Trending Discussions on rpi
QUESTION
I have a bme688 sensor (from Pimoroni) connected to a RPI ZERO. I have the PAHO MQTT library so I can send the data to the broker.
If you see code below, in the very last line, I have a "time.sleep(5)". The code below works perfectly well. It takes the readings and sends them via the MQTT. The problem I have is that if I change the time from 5 seconds to 300 seconds (10 minutes), the MQTT does not seem to send the data. The RPI ZERO has the raspbian desktop installed so I ran it using Thonny to see if I get an error but everything works fine with the 300 second delay... but it does not send the data across to the broker.
Any thoughts?
...ANSWER
Answered 2021-Jun-12 at 22:53You are not starting the client network loop or manually calling it.
https://www.eclipse.org/paho/index.php?page=clients/python/docs/index.php#network-loop
You probably want to add client.loop_start()
after client.connect()
QUESTION
I want to install the JDK 16 on a RPi 3B and I downloaded the Linux ARM 64 Compressed Archive from the Oracle site.
Every time I run the command to check the version of java I get the same error:
bash: ./java: cannot execute binary file: Exec format error
I already tried to untar it again and download the archive from zero, but I get the same error every time. Considering the RPi 3B not able to support the JDK16 for some reason, I downloaded and installed the Kit on a RPi 4 too, but the result is always the same. I used the checksum to make sure the downloaded archive was intact and it was.
Am I downloading the wrong package or have I missed anything important?
...ANSWER
Answered 2021-Jun-10 at 15:45It seems you are running a 32 bit ARM Linux (armv7l), you therefore cannot execute a 64 bit aarch64 JDK. You need to install the 32 bit version, the same way you installed the 64 bit JDK, or to install a 64 bit Linux distribution on your system.
QUESTION
I'm trying to set up my environment to use Yocto's generated SDK to compile my out-of-tree module, but for some reason, I'm getting an error.
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
I'm using Poky distribution and meta-raspberrypi which is needed because I'm using the RPI ZeroW board. Apart from this everything works fine. I'm able to compile the entire image and load it on the board.
Here is the line I've added to local.conf
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"
as I've found in the documentation.
Also below you can find the whole log from the compilation.
...ANSWER
Answered 2021-Jun-07 at 11:16Missing the module.lds file in the latest kernel. Apply the following source code as a patch in the kernel and build the image.
QUESTION
I am running a main python program on a Windows PC that is hooked to equipment that cannot be ran on an Raspberry pi. At a certain point in the main program, I want to call/execute a Rpi program to run. I need the GPIO pins from the Rpi to turn on a relay/s. Is there a way to wirelessly(or serially) open and run the program on the raspberry pi from the main program already running on the Windows PC?
Maybe I am not thinking of something, is there an easier and just as cheap solution to turn on a relay from the Windows PC program?
Any points in the right direction would be greatly appreciated.
...ANSWER
Answered 2021-Jun-06 at 15:30depending on security requirements. Assuming that the Desktop PC and raspberry pi are on the same network, you could create an HTTP REST endpoint on the pi, you could use flask or fastapi for this. then call that from the app running on the desktop. for help with flask see https://flask.palletsprojects.com/en/2.0.x/ if you are familiar with python flask is fairly simple to get started with.
QUESTION
I'm trying to setup a python camera app that streams to a browser and am using bottle. My javascript in the index.html is this:
...ANSWER
Answered 2021-Jun-01 at 23:17Maybe the problem is that you have specified two routes but only one specifies variable name val
and this is an inconsistency. I am no expert in Bottle
, but you might try the following:
QUESTION
I’m doing a home project with a raspi and a rain sensor.
Basically, with cronjobs, i run isitraining.py every 30 min.
If it is raining, i want it to increment a specific variable from another module (rains.water)
If it stops raining, i want it to decrease the same variable.
here are my codes:
rains.py
ANSWER
Answered 2021-Jun-01 at 22:32Every time testscript.py
runs, it's importing isitraining.py
fresh, from scratch, which then imports rains.py
fresh, from scratch. rains.py
and the water
value it holds do not persist across runs.
If you want to save the value, you need to manually write it to disk, then load it later when you want to use it. Something like this:
isitraining.py
:
QUESTION
What I try to do: I want to write a Python program running on an RPI which communicates to a software called QLab4 via OSC. It should display the received workspace data (JSON format) in a table, while the user is able to select a cue from the table and fire it using a key press.
So far I got two scripts (just proof of concept stage), but I struggle to combine them into one program. Any hints to how to do it would be greatly appreciated.
Script 1: Starts OSC client & server and sends and receives OSC to/from QLAB. At the moment it just prints out the JSON (workspace) and the selected cue.
...ANSWER
Answered 2021-May-30 at 06:55The code provided by the OP has various errors such as threads not being executed in a second thread, the code works because threads are not needed.
On the other hand, signals must be used to send the information from the callbacks to the widgets.
QUESTION
I'm working on a project in Python that uses two or more serial ports to manage some devices from my RPi. When ports are open in the same file and I send commands to different instances of serial.Serial object everything works fine. This is an example:
...ANSWER
Answered 2021-May-25 at 16:59You shouldn't be calling serial.Serial(port, timeout)
from your __init__
,
as super().__init__(...)
is already doing this. See these answers. You don't even need an __init__
if you are not going to change what the base class does.
Also, there is a difference in your two versions with respect to the use of positional and keyword arguments. serial.Serial()
's first 2 positional arguments are port, baudrate
, so you need to explicitly use the keyword argument timeout=
:
QUESTION
I am a software engineer working on a microcontroller system for a side project. The microcontroller I am using is the SparkFun ProMicro (based on the RP2040 board). I am trying to flash the board so that I can write data to the onboard flash memory.
All of the tutorials I have found online suggest starting in boot mode, dragging and dropping the UF2 file, and done!
When I do this, the microcontroller ejects from my computer. Is that meant to happen? It just reboots then doesn't reboot in bootloader?
Once I got MicroPython installed I moved on to writing and flashing code to the board.
I am using the Thonny IDE which identified the correct board (albeit the PICO), then saved the following file as main.py (taken from RPI foundation). It prints toggle, and I believe the output shows that it is being printed from the board, but the light on the board isn't blinking. (code and output below)
I considered that the pinout could be different from this board and the PICO, but some research shows they both use Pin 25 for the LED control.
All this leads me to believe I am on the right path, but I think I am missing something that is taken for granted in the tutorials. My end goal is to write arbitrary text data to flash storage, but I understand it can only take about 8000-10,000 writes before it becomes unreliable, so I want to test that I can write working code before I use some of those.
Is there something I am missing, or am I not thinking about this in the right way?
...ANSWER
Answered 2021-May-18 at 03:31When I do this, the microcontroller ejects from my computer. Is that meant to happen? It just reboots then doesn't reboot in bootloader?
Yep.
but the light on the board isn't blinking.
Maybe your LED is busted, cause your code is right.
My end goal is to write arbitrary text data to flash storage
That's a terrible idea, unless you just like burning up boards for no good reason. Get an SD Card reader or concoct one out of a solution like this one, and use this sdcard library that will even mount your card, and add it to the syspath
. Then you can essentially write all the arbitrary text data you like without burning up your RP2040.
QUESTION
I want to delete some files every day at 6am. I was thinking about using crontab to schedule this task with something like
...ANSWER
Answered 2021-May-12 at 17:23The at and cron commands are only launched when the system date corresponds to the date scheduled for execution. There is no catch-up if the machine is turned off at the scheduled execution time.
a solution for you would be to code your own scheduling script and run it at daemon service
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rpi
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page