#help-with-linux-sbcs
1 messages ยท Page 15 of 1
im used to that name
This is the first I've ever heard it, lol
you learned something new then
but yeah, @finite bay is right
but it seems the prefered is #!/usr/bin/env bash
this guarantees you use bash, for a consistent shell on different systems
but the usual #!/bin/sh works as well
yeah I think the reason its not working for me has to do with something else but I curbed it for now
it would be nice tho, I am thinking about using cron for it though
next I need to figure out how to re launch services if the internet goes out and they crash
unsure if pi is stuck here or not, but I connected to another terminal session on the same pi and that is working just fine.... but no progress on this and its been.... a while
never installed opencv before unsure if this is normal or not
cancled it out and just re ran as pip install --upgrade pip pip install opencv-python and that worked X/
Hello, I am trying to stream the feed from my raspberrypi camera using ffmpeg. I am currently using: raspivid -o - -t 0 -w 1920 -h 1080 -b 8000000 -g 30 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i pipe:0 -c:v copy -c:a aac -ab 128k -g 30 -strict experimental -f flv -flvflags no_duration_filesize -r 30 "udp://0.0.0.0:1234" And to view the stream, I am trying to use both ffplay udp://127.0.0.1:1234 (on the same machine, hence localhost), and mplayer udp://127.0.0.1:1234
I am leaving in the bit of a hack to pad in /dev/zeros for the audio since I do not believe that is hurting anything. The main focus point is the video.
Attempting to read the data manually over udp via netcat also doesn't appear to send any data (nc -u 127.0.0.1 1234). So perhaps my ffmpeg binding to "udp://0.0.0.0:1234:" is not doing what I am thinking it should be doing?
Well, maybe not? Using nc -ul 127.0.0.1 1234 (binding to the port as a server instead of a connecting as a client) I get data... How? udp://0.0.0.0:1234 should be binding to all network interfaces as a server and waiting for a client to connect. How on earth?
Hi! Anybody here worked with this module before? https://www.adafruit.com/product/3006
I'm wondering if it's possible to play different frequencies like you would with a Piezo buzzer. Would I just connect this to the PWM pin?
Also, if I'm interfacing a number of peripherals (including the camera), how would I find out the exact current draw of my project?
For example: I have a motor, a camera, LED strips, and a speaker. Is there a way I can find out exactly how much amps it will need? I'm trying to find a suitable battery ๐
That amp needs I2S input; PWM wouldn't work. Easiest way to measure current if you have all the parts is to put them together and measure the current draw from a power supply with a multimeter or USB gadget. Otherwise, you can look at the data sheets for all those parts and look for a typical current draw number, but that probably won't be as easy for the motor.
Thank you! Will try it out with my multimeter
Having trouble finding resources on how to generate different frequency tones with this module + speaker. Should it just be done with a Piezo?
If you set up the module properly it should be as simple as playing the sound on the Pi, and there are a lot of ways to do that, but it looks like setting it up is a bit involved. If you really just want PWM and a tone, maybe it's not the right module. I don't think it's particularly well suited for driving a piezo. You could probably drive a piezo directly from the GPIO, if the result is loud enough.
The way I have it right now is it can only play sound files like mp3 with a 4-ohm 3W speaker. The Piezo works fine with just the PWM pin btw thank you. I just wish I could do it easily with the speaker ๐
stupid question but any winXP uses here?
Are there serial/uart drivers for winXP? for pico specifically. Looks like even win7 is unsupported :/
I seem to recall the Pico is the usual CDC/ACM interface.
If you can do a CDC/ACM from say a SAMD21 target I'd bet the Pico would also work. @gilded stump
In Linux it's /dev/ttyACM0
Hey thanks, I'll try it ๐
Just following up. No problems powering a QT Py 2040 off a Pi Zero's 3v output. Only problem is JP's clever rotary-encoder-stuck-on-a-QT trick (retroflective greenscreen project) doesn't work with PIO's consecutive pin requirement. I thought about using two state machines, but got bored and just soldered on some crossed wires.
I have a few questions regarding the Pi 400. Are there board files or schematics available? Is the keyboard connected as a USB device (shows up in lsusb)? I was thinking about picking on up and designing a case that could hold the Pi 400 pcb and a 60% mechanical keyboard PCB.
It doesn't look like it.
https://www.raspberrypi.org/documentation/hardware/raspberrypi/mechanical/README.md
This section contains documentation with technical information about the Raspberry Pi hardware, including official add-ons and the Pi itself.
This section contains documentation with technical information about the Raspberry Pi hardware, including official add-ons and the Pi itself.
If you want to see what's in it:
Raspberry Pi 400 Teardown - What exactly is the Raspberry Pi 400, who is it for, and, most importantly, whatโs inside?
In this video, we have a close look at the Raspberry Pi 400 and take it apart to see what is inside. Inspecting the circuit board shows some interesting changes compared to the Raspberry Pi 4 on which it is based.
More informa...
I think the guts are just a RPI4
with a few extra gizmos
the kb does show up when doing lsusb
Well that's bodes well for me. I might just pick one up and have a go.
it uses the other usb 2 hub leaving the other one for the mouse
Bus 001 Device 005: ID 04d9:0007 Holtek Semiconductor, Inc. Raspberry Pi Internal Keyboard
all the crap connected to my pi400: https://paste.debian.net/1200233/
Nice info here regarding the keyboard controller and how it interfaces with the USB hub.
powered usb hub
This is neat,but kind of the opposite of what I was thinking. Custom PCB to match the Pi 400 case and keyboard matrix: https://www.40percent.club/2020/12/orthopi.html
It's a shame this isn't actually a product, pretty cool design.
yeah, the pi 400 keyboard being a permanent usb attachment is pretty much why the 400 only has 3 USB-A ports, compared to the pi 4's 4.
hello all, I have a https://www.adafruit.com/product/4407 and a RPi4-8gb, I cannot get i2cdetect to find the mlx90640
this is a freshly installed and upgraded RPiOS
the sensor works fine on my clue btw
Yeah they used to call that one Raspbian, but now they call it RPiOS. ;)
not the question
๐
been soldering cpus since 1980
I remember when there was only 3 distros
Quick idea - are you using sudo with your I2C detect?
yes, i2cdetect -l lists the bus
What command did you exactly use?
i2cdetect -y 1
How's the wiring?
2,3,5,6
Could you post a pic?
ok
Are you also powering the thermal camera correctly? I'm not familiar with it or the Clue but maybe the Clue is a 5v device and the thermal camera isn't compatible with 3v3? product page explicitly states works with both voltages nvm ๐
ada says device works on either
Have you tried using their example code? (And posting the exception if any?)
https://learn.adafruit.com/adafruit-mlx90640-ir-thermal-camera/python-circuitpython
I gtg, hopefully you get it to work!
getting pic
oh well
anyone else able to tell me why it doesnt show up?
I have tried reversing sda and scl
even tried altering speed
@worn oak most likely a connection issue. are those alligator clips the only STEMMA cable you have?
Losing my darn mind... setting up a new instance of octoprint on a rpi and every step of the way it's fighting me.... Finally got it on the wireless network, ssh is enabled.... when I try to ssh connect it doesn't like my pi username/password but when I walk over to it and use that combo to log in on the local unit it lets me into the system as the pi user
the ssh is as pi user
not sure why it doesn't like me
auth.log says I'm failing the password
I am most definitely entering the same password on the local machine and the remote ssh. Not a capslock issue, for sure I'm typing the same password
For sure I'm entering the same user as well
Any symbols in your password?
Pound sign ๐
oof
Was gonna ask if you'd adjusted locale yet
โค๏ธ
every step setting up a new sd card has been like this today lol
first issue was quotes in my psk ๐
So, is anyone familiar with creating img's from pi's? I can use win32 disk imager to make a full backup, but it's 14gigs and I would like to get rid of the empty space and have the pi inflate on the first boot....
Look up pishrink
hmm, I just stumbled on that and am about to try it out
any idea on auto-inflating on first run?
How hard would it be to get a Raspberry Pi Zero W to use a USB C port soldered to it's GPIO as an Ethernet out, which it uses to share it's wireless connection?
The USB C port would be misused but convenient, so it's just a proper wiring job to get the electrical part right.
However, Ethernet doesn't work the same as GPIO.
Pretty sure there are what amounts to transformers used.
You're not going to graft that much onto a target board and magically come up with an Ethernet interface.
I'm not going to use the USB C solely for Ethernet
And ah
Might save myself a lot of time and headache to simply use a similar SBC that already comes with USB C
Yeah if you want multiple things happening an SBC will get you there far faster.
We see an endless parade of people here who think they're going to be the next one person band going down the street playing the cymbals with their knees and the tuba and some drums.
Hahaha
Well, I need a small form factor if this is going to go anywhere, but a standard Pi would be easiest for prototyping probably
Can it's Ethernet go both ways?
What does both ways mean to you? Not sure I understand.
With a regular desktop PC, you use two Ethernet cards to bridge in some situations. If you only have the one card, you cannot do some things.
So for example that machine cannot behave as a firewall.
Need two Ethernet ports to do that.
Adafruit sold one stand-alone Ethernet dongle thing.
Probably WICED but I don't remember.
I meant Ethernet bi-directional, right?
I'm still not sure why you think it would ever be other than bi-directional.
Where did you get the idea that it could only serve in a single direction from.
maybe I need to drink some water. ;)
Physically, Ethernet rides on four twisted pairs, iirc.
Well of course it can be bi directional because upload/download but I mean directional as in router to devices, but given the other contexts of Ethernet cables not sure why I imagined that would be a limitation
I had an Ethernet cross-over cable that allowed me to avoid a router. It was connected between two laptops.
It's just a physical wiring change so that it forms a shape like the letter X
Yeah, okay
I was under the impression that each twisted pair was a transformer winding.
I'm sure there's a Wikipedia article explaining what Ethernet is.
Haha
(totally shutting out coaxial cable variant)
That one was dead simple: RF cable.
In those days it was 10 Base-T vs 10 Base-2.
iirc.
I remember back when modems were a thing people actually had and routers looked like rugged military equipment
For whatever reason
;)
The Ethernet cards I had were 10BASE2 cards.
They ran on pip cables (BNC terminated RF coaxial cable).
Thanks for your help```
Ah yes let me screw in my Ethernet real quick
The public library ran 10BASE2 for a while. ;)
Ouch
There's a development kit that is to be paired with that display to get anywhere at all with it, is my first guess.
It's not a beginner's project.
no, it's not, I am not beginner in programming, but I am beginner in electronics, and I don't necessary want to get much better, I don't need to much.
I've found that development kit, but it's very bulky, I know that this display has nice documentation
Don't worry - if my summary is off-base someone will step in to point that out. ;)
well, that's a lof of reading.... I think I kinda like that display, my question is, if it can be driven as dircetly as possible with raspberry pi zero, in as zero as to little space as possible (basically smaller == better)
I want it to be similarly thick as M5Paper
I don't think you understood.
well, probably not, maybe you can explain ?
That display is of no use at all without other parts.
I would first find out what the minimum bill of materials was to get any use out of it at all.
I would suggest one of their development boards would be the place to begin.
I'm not going to comment further, as it is beyond my personal experience what steps are required for certain.
So you are saying, that I should get their development kit ?
Yes indeed. ;) that's the usual path towards getting stuff like this working at all.
but that's too expensive
They are not in the hobbyist market.
If you now any way around, I would be happy to hear it, I need about 6" eink with touch
but I've already got an option of getting an E-ink and adding touch layer
but I was unable to find a good pair of display + touch layer
Amazon broke the rules and made the Kindle. It was a very unusual event for personal electronics.
I don't understand, what are you trying to tell me
I'm saying making a portable eInk display based project is not trivial.
yeah, I understand
I think mobile read forums has a few experimenters who've repurposed Kindle.
but I am also not able to find any other type of display, that would have similarly low power consumption
yeah repurposing Kindle is a option, but not for me....
I don't have kindle, and it's to expensive...
What you mean, why do I think I can do it ?
I started this project very recently... so maybe I can't
I've entirely forgotten what our electronics instructor used to say about this.
but I started watching great scott on youtube, and I guess, as there is a datasheet, there is a way
?
For him, sure. Or Ben Eater.
He talked about stick-to-it-tivity.
My electronics instructor said if you quit it definitely will never happen.
I'm just telling you the forecast for getting it done in the time frame I'm supposing you had in mind.
so, I was thinking, what with help of internet guys, like you, I will be able to get it somehow to work....
time frame ?
I'm saying the shortcut is to spend the money and buy the dev kit.
And be prepared for significant setbacks.
yeah... but I have as much time as I can (I don't have time limit or so.... and I have some time)
That's a good start, in my view. Leave the time thing to itself.
If you wake up every day thinking about what you're going to do to further this project, you may be onto something.
My electronics instructor made his own TV sets. Had a factory.
Now I guess we are getting into Philosopy xD
Pretty much.
I am gonna explain here my entire project here
;)
and maybe you will be able to help me than
It's a slow hour on this discord. There's tons of people who show up here and offer different perspectives.
Just not at the moment.
what I want is, to make VERY powerful calculator, that can do graphs etc. (I can program it)
So there's a practial tip: once you ask a question, stick around and wait for someone who has something to say about it.
You know they now have a decent calculator already.
For getting best battery life I was thinking of using E-Ink, but now when I see, that E-Ink is a lot of work, I may change my mind....
nah... not powerful enough xD
It's programmable. They sold the last one but the kit itself is probably still on the market.
I would get one of these and see how it is:
https://www.adafruit.com/product/3790
This calculator is designed to be moddable (for when you don't want to use it just for exams), with 3D models, firmware operating system source code, schematics and board layout details available to the public under a Creative Commons License. It is even possible to build your own 3D-printed collaborative calculator!
Electronics costs real money.
you see these buttons ? uddfjkg they are awful ๐ I don't want buttons... and I gues it's now much more powerfull ( if even ) than calculator like HP prime G2
my problem is getting some E-ink setup....
everything else is sort of straight forward then, and I have friend that can help me with it
but not with e-ink
Yeah eInk displays are a thing.
I don't really know what they do - mobile read forums is the only place I've seen where people get that specific about it.
Adafruit has the smaller ones.
Obviously the larger ones are what people want.
yeah, people want them, but manufacturers don't want to provide them to normal people
Building an E-Ink Laptop
someone dropped that link on me the other day but I haven't found the time for it.
they exsist, like waveshare 7.5" but they are not touch
If you were able to root a kindle touch you'd have a linux box with e-ink display, and a touch interface.
They sell them below market value because they expect you to use them to buy ebooks with them.
That's why they cost less than 'expected'.
Subsidized by book sales.
but they are not as powerful as rpi zero W, aren't they ?
that's my biggest problem, I really want that power
They're roughly in the same performance range, I'd suspect. I don't know.
We're pretty well off-topic for Raspberry Pi.
May want to take it to #general-chat (where this would be very much on topic. ;)
hey everyone, i've got an issue with SPI-related stuff for my raspberry pi zero
basically, i'm trying to make a robot remote control that takes input from a small resistive pitft touchscreen, a 2 axis joystick, and a button. the issue here seems similar to this person's issue here:
https://www.raspberrypi.org/forums/viewtopic.php?p=1416536
from this thread, it seems like the display is taking up the SPI resources (idk the proper term for it, i'm still a big noob at this point), and that it's preventing spidev0.0 from existing
the main issue here is that i'm trying to connect a MCP3008 to convert the analog input from the joystick to digital, but the MCP3008 requires SPI to connect. i know that at some point you could use i2c to connect the MCP3008 before circuitpython came around, but i couldn't find any examples of this using circuitpython.
is there any way to fix the pitft taking up all the SPI resources or is there any way to connect the MCP3008 to my pi zero using i2c? thanks in advance
From memory the Pi permits two SPI devices, so the question would be how to differentiate the two in hardware and software. On the Pimoroni Breakout Garden there are two SPI sockets, at SPI address 0 and 1 (or is it 1 and 2, can't remember).
the thing is i'm not sure if the pitft takes up 2 spi devices because it's both a display and a touchscreen
also because i'm really new to the pi and hardware in general
If it's the Adafruit SPI display it just uses one.
Though I'm not sure I don't think the touchscreen is SPI. Anyone here know?
Hey, any idea why this C program yields the following errors
#include <stdio.h>
#include <pigpio.h>
int main(){
printf("Started!\n");
gpioPWM(17, 255);
time_sleep(2);
gpioPWM(17, 0);
printf("Ended!\n");
return 0;
}
> gcc main.c -o main
/usr/bin/ld: /tmp/ccAOGx1a.o: in function `main':
main.c:(.text+0x18): undefined reference to `gpioPWM'
/usr/bin/ld: main.c:(.text+0x20): undefined reference to `time_sleep'
/usr/bin/ld: main.c:(.text+0x2c): undefined reference to `gpioPWM'
collect2: error: ld returned 1 exit status
i do have libpigpio installed via apt-get install libpigpio
> ls /usr/lib/libpigpio*
/usr/lib/libpigpiod_if2.so /usr/lib/libpigpiod_if2.so.1 /usr/lib/libpigpiod_if.so /usr/lib/libpigpiod_if.so.1 /usr/lib/libpigpio.so /usr/lib/libpigpio.so.1
somehow those functions aren't being included
'sudo apt-get install libgpiod-dev' that's something else, I think.
(just a guess)
I don't see gpioPWM in the function list for what I found, not explaining how time_sleep() fails on you
thanks for the help, unfortunately it didn't solve the issue ๐ฆ
i'll try to re-flash OS on this empty SD card and see if that'll make it work.. its an empty drive after all.
I'm not sure it is that large scale of a problem
somehow pigpio.h simple isn't providing
i haven't updated the OS in about a year if that's relevant. i did run apt-get update + apt-get upgrade however.
btw, i had another issue where having multiple i2c devices plugged in didn't make one of them work.
atm, i have the following plugged in:
- DC stepper + motor hat (https://www.adafruit.com/product/2348)
- VL53L0X TOF sensor (https://www.adafruit.com/product/3317)
- BH1750 light sensor (https://www.adafruit.com/product/4681)
DC stepper + motor hat and VL53L0X work together just fine. however BH1750 doesn't want to work unless I plug out the other two I2C devices. Trying to run the example script (https://learn.adafruit.com/adafruit-bh1750-ambient-light-sensor/python-circuitpython) would output:
Traceback (most recent call last):
File "test.py", line 9, in <module>
sensor = adafruit_bh1750.BH1750(i2c)
File "/usr/local/lib/python3.7/dist-packages/adafruit_bh1750.py", line 187, in __init__
self.i2c_device = i2c_device.I2CDevice(i2c_bus, address)
File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 76, in __init__
raise ValueError("No I2C device at address: %x" % device_address)
ValueError: No I2C device at address: 23
However, If I plug out DC stepper + motor hat and VL53L0x sensor, BH1750 sensor works fine!
when all three i2c devices are plugged in, the script says no i2c device found at address 23 but sudo i2cdetect -y 1 says otherwise:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- 23 -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
Are you getting I2C bus address conflicts, or do you think the software library is looking for a device at the wrong address? I.e., if you list the addresses of each of those devices, are they matching what you see from i2cdetect?
Yeah I don't think they're conflicting because when plug out all the three devices, and plug back DC stepper+motor hat and VL53L0X, i get this:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
And, when I plug the BH1750 device, the output says 23 is occupied.
So I suppose that implies there isn't an address conflict happening between the three devices.
If you investigate the test scripts, are any of them altering the default i2c address in a constructor, e.g., "i2c_addr=0x29"?
This is the test script:
import time
import board
import adafruit_bh1750
i2c = board.I2C()
sensor = adafruit_bh1750.BH1750(i2c)
while True:
print("%.2f Lux" % sensor.lux)
time.sleep(1)
adafruit_bh1750 library probably has the 0x29 somewhere in there, but i am not overriding the default addresses yet
The device begins working soon as I plug out other plugged-in i2c devices however, I suppose there's a limit on how many i2c devices can handled?
I've used the VL53L1x and BH1750 sensors together with no issues but never the stepper driver so I'm not seeing an answer myself, sorry. That looks pretty normal. Maybe tail -f /var/log/messages as you plug and unplug devices and run the test script, maybe you'll get a clue from the logs.
Hmm interesting
But off to bed for me, 'nite.
Good night! ๐๏ธ
good luck
Oh yeah, you're right. VL53L0X and BH1750 work together just fine. So the stepper+motor hat creates the issue
Wow okay, this is interesting. So the hat requires supplying a separate power source than the power source being used for raspberry pi for obvious reasons.
I didn't turn on the hat's power source but had it connected to the raspberry pi. It shows up as an i2c device even when it is turned off however.
When I turn on the hat's power supply (the green LED on it lights up), the BH1750 sensor along with the other i2c devices begin working.
If you've got a powered-down device connected to the I2C bus it shouldn't show up at all, so if it is that sounds like the control portion is active, at least enough to react to the slave request. But it seems that whenever high-powered devices (motors, heaters, fans, relays) that have inductive or RF loads switch on or off, this can mess up the control circuitry.
Yeah, I may have messed up my last raspberry pi by directly plugging motors in ๐
Has anyone tried the LSM6SOX 6 DOF sensor's gyro? It seems to be giving inaccurate results for me. This is the script I'm using:
https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS/blob/main/examples/lsm6ds_lsm6dsox_simpletest.py
However, I occasionally get an error of ยฑ0.20 radians when it lays flat on ground.
I'm thinking of making use of it by attaching it to a toy RC car so I can rotate it (near) exactly 90ยฐ by comparing it's initial orientation / yaw against the differences.
Hello. Would my idea be possible to do between two Raspberry Pi wirelessly?
โข Have one Pi have an LCD with a menu and some push buttons. Have another Pi with an LED and a buzzer.
โข If I selected the option "turn on LED and buzzer" on the first Pi with the LCD menu after triggering a push button, this will send the signal to the second Pi and its LED and buzzer will be activated.
What protocol should I use for this?
Why can't you combine them? Seems simple enough to one Pi do them both. But if I need local network communication I use network zero (If you are using Python obviously):
https://pypi.org/project/networkzero/
I was hoping to do a master-slave connection if there was no wifi available
You could use UART to communicate between the two with or without WiFi since there is UART over WiFi and UART connected directly, you can either use a hardware flow control or software flow control
Bluetooth maybe? I don't have much experience but maybe that could work? You could also get some wireless hardware transmitter and receivers, although I think doing it on one Pi is the best route based on what you said...
Thanks! I'll give that a try ๐
I was planning on mounting the device somewhere high up and it would be convenient to have a way of being able to still control it if there was no wi-fi
Best of luck on that
I'm currently working on a RP2040 board with 60 GPIO pins and I needed it to talk to a RPi for something to do with a aim system fed to FPV goggles, I quickly realised I can either use USB or UART to talk between the two, I chose UART in the end because USB would take more programming and it's a headache to write up stuff for it
UART can be very flexible even if it is a old serial standard but most devices have it nowadays
just be careful as you can't have multiple devices on one UART bus, if you wanted to do that use a MCU with multiple UARTs and have it act as a communication center to forward messages and etc
Thatโs not really how electricity works. The pins may be damaged, yes, but in this case it may simply be they werenโt able to drive the motor. You can check by testing IO function on them now
I can't do IO operations, nothing but the indicator LED works on it. I think this is safe to assume the hardware itself is damaged.
Take a look at GPIO Zero - it allows you to do remote control of another Pi's GPIO over WiFi.
I had my raspberry pi set up in a way that it created a WiFi hotspot on startup, which it no longer does with that raspberry pi since the incident. I had also read of RPi4s having overheating issues soon as they were announced, so I wouldn't be surprised tbh.
I do understand how electricity works. The motors take up most of the current leaving little to no current for the system itself to operate. At most that would corrupt the software due to an immediate shutdown, but that's the last event that occurred before permanent shutdown.
Funny that you mention that. I was actually just trying it out ๐
Thank you
You're welcome. It's an intriguing piece of functionality that is not often used! ๐
Can confirm it works. I thought I'd need a transceiver module but this is so convenient
๐
Well, I'd then thank the Pi for its service and get yourself a new one. ๐ญ ๐
rip ๐ ๐
Yeah, my partner is Japanese and she's taught me to always thank the things that have helped me, even if they are inanimate, because there were many, many people involved in designing, manufacturing, selling and even shipping the thing to me. And the object itself did its duty, so it deserves thanks.
She even thanks the things that hurt her because they are part of her life and part of her education. It's an interesting viewpoint, and I think healthy.
...and I kinda like my little Pi computers. They're cool and have helped me learn many things, and they do their duty without complaint.
Awesome perspective. I dislike it a lot when people say the Pi is just a toy
Yeah, a teddy bear is a toy. I guess to some people a Raspberry Pi might be considered cute, but even the Raspberry Pi Zero is a fully-functioning Debian-style Linux computer. Not every application needs an Intel i9-10900XE 18 core processor to the job. And at least $900 just for the CPU, it's a bit pricey.
At $10 the Pi Zero W provides a 1 1GHz processor, onboard Bluetooth and WiFi, HD video and stereo audio on a board measuring 30mm by 65mm, and enough compute power to power a robot or create a live-video streaming server, which is what I'm using mine for right now. It's actually a remarkably powerful computer for its size, price and power comsumption.
any pi people on?
On what?
That is an interesting way to look at things 
I just set up wireless on a Raspberry Pi Zero W and when I run apt-get update it runs into a Kernel Panic about an incorrect ARM program counter value?
force_turbo=1 and over_voltage=2 seemed to fix it
;) I'd have scratched my head about that one. And not come up with your solution.
apt-get update refreshes a database.
iirc
$ ls /var/lib/apt/lists
that should show what got updated.
It was frequency scaling that caused it
What's a good way to implement a menu with an LCD? I want to scroll through a list of options with an LCD (maybe using a potentiometer or buttons)
For example: Option 1 is "Turn LED on". If the LCD is on that option and I press a button, it should turn on an LED.
Should I just make a list of strings for it?
@faint sparrow That makes sense. I wonder if RPi4B is any different than predecessor boards in that regard.
@meager bay Here's an idea for a simple dispatcher I saw recently:
This is the program dispatcher:
https://github.com/wa1tnr/rp2040-arduino-basics-a/blob/main/monitor.d/monitor-aa/n_monitor-aa_SKETCH.cpp#L123
(Arduino based, not Raspberry Pi at all.)
Each case in the 'program' is handled in the dispatcher, so in this instance, it's a linear sequence of pseudo-instructions (in the so-called 'program') but the technique could be adapted to a menu, I think.
const int memory [] { 6, 1, 2, 3, 4, 5, 6, 7, 1 };
That's the entire 'program' for this virtual machine!
It would normally begin with 1, 2, 3, .. but I wanted initialization.
Choice of language (python, C, perl &c.) would deeply affect the approaches possible.
Interesting. Thanks for the idea! How do you trigger the cases?
Also @faint sparrow please correct me if I am wrong, but do you iterate through the memory array with your cases? This array keeps track of where you are right?
@meager bay I'm not really sure exactly what happens - just the effects.
It's an array of ints for the memory/program.
Apparently the case/switch stuff can interact with it.
You could use the C Preprocessor to create symbol names that represent those ints in the memory array, to make it more legible.
case op_lit: // literal
_lit:
push(memory[I]);
I++;
goto next;
op_lit, 4000, op_dly,
/* blink */
op_lit, led, op_pon, op_lit, 1100, op_dly,
op_lit, led, op_pof, op_lit, n1_sec, op_dly,
Now that means that I have not just instruction opcodes but also data in that array. ;)
In this case, the literal 4000 which is the number of milliseconds I want the delay to last.
That's a wallful of text from me; will termbin it and truncate at least some of it, now. ;) EDIT: done!
Thank you for this! Very helpful ๐
I've decided to implement my menu by using state machines and writing my own classes for it in Python. Thank you for the help!
Now I just can't decide whether or not I should use either a potentiometer or some push buttons to cycle through the menu ๐
Using a potentiometer would require an ADC right?
hey hope everyone is doing great, so im doing a project with raspberry pi 3 and arduino , i need to make user interface but im kinda stuck i dunno where to start any documents or examples on user inputs ?
What sort of user interface? Buttons & LEDs? Touchscreen?
yeah like basically user data and then start and stop buttons
and also heart rate and humidity display
Small OLED and a bunch of buttons then.
In that case, I'd say use a web interface and display it on a touchscreen with a fullscreen browser window started on bootup/after the webserver launched.
aka Kiosk setup
https://desertbot.io/blog/raspberry-pi-touchscreen-kiosk-setup
thank you so much !!! i really had no idea where to start
Always happy to help. ๐
@meager bay cool!
@meager bay Yeah I made a 'fretless keyboard' that was resistive.
You just read a voltage with an ADC peripheral (most MCU chips have them as on-chip peripherals).
Potentiometers are either Linear or Tapered/Logarithmic I think.
There are stepped pots for audiophiles but they cost a bundle.
(basically a union of a rotary switch and a resistive network, I'd guess)
I would go for widest arc separating 'stations' on this 'radio dial'.
Work out each one experimentally.
If one type of pot is too touchy, try the other type and see if it makes it even worse, or offers improvement.
I've been meaning to setup several pots in an R2/R net to find optimal values experimentally for several pushbuttons.
(cheap resistor DAC)
Raspberry Pi now has a VGA resistor DAC thing going for cheap video from the Pico.
Should probably copy the design and see how it fares.
relay
@faint sparrow Thank you again ๐
Glad to help!
Hi guys, I need some help for accessing my raspberry pi in headless mode
Basically after I have done a first time setup on my raspberry pi, I enabled SSH and also VNC before rebooting
Now when I try to SSH into my rasp, it says connection time out
@jade thunder what did you try so far.
If I try VNC, it says "Time out response from the computer"
I've been looking all around, but I couldn't find any clue what's causing this
In the old days we'd check to see if the node could be ping'd first.
$ sudo ping 192.168.1.1
Do i enter that into my cmd?
(sudo may not be required; I don't remember)
Always use the shell when you see typed commands. Pretty much.
Ok, let me try now
The IP address I gave was an example; use the one for the node you want to connect to.
Hmm, this doesnt make sense
Here's the response from shell
Pinging 192.168.1.112 with 32 bytes of data:
Reply from 192.168.1.108: Destination host unreachable.
Reply from 192.168.1.108: Destination host unreachable.
Reply from 192.168.1.108: Destination host unreachable.
Reply from 192.168.1.108: Destination host unreachable.
Ping statistics for 192.168.1.112:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
$ sudo netstat -rn
If there's more than say ten lines those don't matter at the bottom)
generally two entries are required.
Gateway is the router on a regular setup.
The Iface column names your ethernet NIC device name.
By Iface, do you mean Interface List ?
What operating system are you typing this in?
My assumptions are Linux (it's all I run)
Windows 10, sorry my bad for not mentioning this earlier
;)
Yeah it could be somewhat different or a lot different.
Basically the host PC you are on gets a DHCP Lease from your router.
So does the Raspberry Pi.
They're on the same subnet.
The router ordinarily lets you talk to each other behind the firewall.
The ssh port has to be open and the sshd daemon has to be listening for inbound connections.
A firewall resident on the Raspberry Pi (if it has a firewall running) can block inbound ssh connections.
If there's no firewall on the RPi and it has sshd running, it'll usually allow inbound connections.
If everything succeeds you gain a shell on the machine running sshd.
The routing table on the machine you are trying to connect from usually has a Destination for just your LAN, iirc.
It'd be something like 192.168.1.0 to indicate all of that subnet, with a mask of I think255.255.255.0.
It is of course much easier if you can already connect to any other machine on your LAN - that proves (generally) that routing has been setup to do that.
Okay, so I should be seeing my raspberry pi IP address in the route table? Since i enabled SSH on it?
Not usually, no. Do you have a regular router that 'everything' connects through?
Oh yes, of course.
So it probably assigns each node on your LAN an IP address via the DHCP protocol.
Ordinarily they can all talk to one another.
I actually login into my wireless router to check out my rasp IP address
Can any of your nodes talk to any other?
Erm... I'm not quite sure what do you mean by that
I mean I can see my computer's IP address, my phone's, my brother's phone, those devices Ip address over there
You're trying to get two nodes talking to eachother. I was wondering if any nodes you have can talk to any others, already.
I think no? But I've tried doing the usual routine of accessing my raspi using vnc before
I mean it was working, all i need is just enter my rasp IP address in the VNC on my computer and then I'm in
Oh so it was working before - that should rule out router stuff unless all other things have been tried.
(the router ought to allow the ssh connection to succeed)
I see
So that sounds a bit like a routing issue for the Windows machine.
Maybe it only has a routing table entry for the Internet (for addresses not on your LAN).
Hmm, I tried using the VNC app to try login into rasp, no result too
So I think a destination of 192.168.1.0 with a mask of 255.255.255.0 needs to be added to the routing table.
OTOH why did it work before. ;)
(the same destination would have to be in the routing table for it to have allowed that connection that did work)
That's what puzzled me too๐ซ
That the ping was received is a puzzle.
If you unplug the Raspberry Pi and ping, what happens? Does the ping look different?
Well, technically there wasnt any ping received when I tried pinging my rasp IP address
See here's the response
Some NIC's blink the LED with each ping.
Unless I misunderstood the console message?
I just want to see the output of ping, with and without the cable connected to the RPi for contrast.
They should be different.
Ok, so do I plug in my rasp into my router and try pinging again?
Do it both ways and post both, in separate messages here. ;)
(long messages just jam up the Discord client)
sure, gimme a sec
This is the result of raspi with LAN cable plugged into my router:
Pinging 192.168.1.112 with 32 bytes of data:
Reply from 192.168.1.112: bytes=32 time=400ms TTL=64
Reply from 192.168.1.112: bytes=32 time=370ms TTL=64
Reply from 192.168.1.112: bytes=32 time=172ms TTL=64
Reply from 192.168.1.112: bytes=32 time=112ms TTL=64
Ping statistics for 192.168.1.112:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 112ms, Maximum = 400ms, Average = 263ms
This is the result with the LAN cable unplugged:
Pinging 192.168.1.112 with 32 bytes of data:
Reply from 192.168.1.108: Destination host unreachable.
Reply from 192.168.1.108: Destination host unreachable.
Reply from 192.168.1.108: Destination host unreachable.
Request timed out.
Ping statistics for 192.168.1.112:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
What?....
but why? This is so weird
You're probably pretty close to the correct settings on both your router and in Windows.
route print | more should show you what netstat -rn does in Linux.
I'm guessing you're already routing though.
Well, good news is I can access my rasp through VNC already, only with the LAN cable plugged in
And that your issue is to be resolved at the Linux shell prompt on the Raspberry Pi.
Yeah if you have a VNC session on the target a lot of things are already correctly setup.
Starting to sound like sshd on the Pi isn't .. functional.
But I don't understand why cant I start VNC session on my raspi wirelessly
I mean my raspi is connected to my network already, isnt it? That's how it can have its own IP address
Oh as far as I know wireless connections are a different matter.
I think people generally resort to a wired LAN connection to get 'into' the RPi until they've gained some experience with that method, before trying wireless.
Let's see ifconfig from the RPi - is it possible to do it easily?
$ sudo ifconfig
On the RPi
If you are using VNC to get a shell on the RPi you may be able to copy and paste from the shell window.
Ok, hold on
Here's the result:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.109 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2001:d08:d3:c6dc:4c3b:ab26:cddc:a46e prefixlen 64 scopeid 0x0<global>
inet6 fe80::50ca:271b:7f98:5242 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:a4:d8:61 txqueuelen 1000 (Ethernet)
RX packets 544 bytes 51729 (50.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 510 bytes 167797 (163.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 5 bytes 284 (284.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5 bytes 284 (284.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.112 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::18fb:5f6a:f5e8:684c prefixlen 64 scopeid 0x20<link>
inet6 2001:d08:d3:c6dc:1b86:b2e5:62ce:2552 prefixlen 64 scopeid 0x0<global>
ether dc:a6:32:a4:d8:63 txqueuelen 1000 (Ethernet)
RX packets 72 bytes 7029 (6.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 88 bytes 11847 (11.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
okay so .109 is eth0 (the wired NIC).
yup
ssh to .109 not to .112
(I'm assuming sshd isn't listening on both wlan0 and on eth0 but just eth0).
Don't do anything you believe will change the relationship to VNC as that's your way in at the moment.
also wlan0 has super low traffic counts which sounds like it's being ignored by active network connections.
wlan0 is my raspi wifi, right?
So that pretty much leaves open ports or blocked ports, and an active sshd listening for inbound.
Yes wlan0 is teh raspi wifi yup
eth0 is the wired ethernet to the raspi
$ ps auxwwww | egrep ssh on the raspi
pi 637 0.0 0.0 4520 288 ? Ss 01:06 0:00 /usr/bin/ssh-agent x-session-manager
pi 677 0.0 0.0 4520 288 ? Ss 01:06 0:00 /usr/bin/ssh-agent -s
pi 2823 0.0 0.0 7348 564 pts/0 S+ 01:18 0:00 grep -E --color=auto ssh
what does this means?
pi is the logged in user.
Looks like root is running sshd so I'd expect a connection to be possible.
try:
pi $ ssh localhost
from the Raspberry Pi shell (vnc is fine)
The ssh-agent I think is background and doesn't count here.
ok, looks like I logged into my own raspi on my raspi?
yup.
Try the process table thing with that ssh session going.
$ ps auxwwww | egrep ssh
(there should be a new process ID above 2823 for the session .. maybe two or three of them)
pi 637 0.0 0.0 4520 288 ? Ss 01:06 0:00 /usr/bin/ssh-agent x-session-manager
pi 677 0.0 0.0 4520 288 ? Ss 01:06 0:00 /usr/bin/ssh-agent -s
pi 3358 0.0 0.1 12120 4956 pts/0 S+ 01:21 0:00 ssh localhost
root 3359 0.1 0.1 12240 6308 ? Ss 01:21 0:00 sshd: pi [priv]
pi 3478 0.0 0.0 12240 3476 ? S 01:21 0:00 sshd: pi@pts/1
pi 3704 0.0 0.0 7348 552 pts/1 S+ 01:23 0:00 grep -E --color=auto ssh
Yeah, so:
pi 3358 0.0 0.1 12120 4956 pts/0 S+ 01:21 0:00 ssh localhost
root 3359 0.1 0.1 12240 6308 ? Ss 01:21 0:00 sshd: pi [priv]
pi 3478 0.0 0.0 12240 3476 ? S 01:21 0:00 sshd: pi@pts/1
it will look very similar when you login from Windows.
The ssh localhost is you trying to ssh to the same machine .. that part won't be showing when you use the Windows PC to ssh into this raspi.
okay
So you can see that there's one process owned by root and one by pi once you've successfully gained a shell.
We've proven that sshd is running on the raspi.
I see
That would ordinarily indicate the raspi is blocking connections inbound from the LAN but not from localhost.
(if indeed it is blocking - may not be)
Let's look at the routing table on the raspi.
$ sudo netstat -rn
also:
$ sudo netstat -n
One of those is super long; only the top part matters.
Do I need to quit from my current ssh session on my raspi to do this?
Nope. Better to leave it going!
ok
Yeah don't post netstat -n that's too much information to put out in public.
haha ok
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
So what does this mean?
Looks to me like you can ssh out from the raspi on either interface.
Which would confuse things!
Either interface? means?
You may very well be in a situation where both interfaces are active on the same subnet.
(that to me seems counter-intuitive)
When you want to ssh out from raspi, how can it choose a destination when there are two paths out? ;)
I would try - but don't try it yet:
sudo ifconfig eth0 down
That would disable the NIC (wired ethernet)
Hopefully that disabled state would not propagate across cold boots.
Sorry what interface are you referring to here? Is it my eth0 and wlan0?
When you cycle power it should just behave as if you'd never brought the interface down.
I think both eth0 and wlan0 are on the same subnet.
I never do that so I don't know what happens if you do.
I bring one interface down before bringing the other one up - or at least before trying to use it.
Well could it because of I have my raspi connected with wifi and also the LAN cable at the same time?
Well just supposing sshd has a policy that forbids wifi and only allows ethernet.
I don't know what the default setup is.
Since you're using wlan0 as a VNC session I don't want that interface taken down.
Oh, okay. So you're saying its abnormal for my raspi to be able to SSH into it using wifi and LAN at the same time?
That leaves disabling eth0 to see if the ssh from Windows will then succeed.
You can't ordinarly use both at the same time for the same conversation.
There's a name for that but I don't remember the name. 'load balancing' for network traffic or something.
I see, ok
So erm, I can just unplug my LAN cable to "simulate" this situation?
No because it may still try to route to eth0.
Ahh ok
Hopefully you refer to Discord this conversation if you run into trouble later on.
$ sudo ifconfig eth0 up reverses it ordinarily.
Sometimes, routing has to be setup again &c.
But I would expect a cold boot to just restore it to the way you had it three hours ago.
what's a cold boot?
Using ifconfig on the command line is usually or always temporary.
cold boot means you at some point removed all power (5VDC on a raspberry pi).
Ahh okok
cycle power is an equivalent term.
Generally you sudo poweroff and wait 'forever' for it to properly shut down.
They give you a button at the login window to automate this.
i see
My Raspi 3B takes like 90 seconds to power off. ;)
(never clocked it but it's quite a while)
That's.... really taking forever
It's 90 seconds I'll never see again!
So if I do sudo ifconfig eth0 down, will that allow me to ssh/vnc my raspi wirelessly again?
as far as I know it won't affect wireless at all.
It'll just shut down the ethernet so that there's only one possible destination in the routing table.
(locally)
but it will help my network routing on my raspi, correct?
I'm thinking it'll simplify netstat -rn by exactly one entry. Maybe more.
I see, ok
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
That's before and after, I'd expect.
I see, ok
Again afaik it's temporary.
I do it all the time when I switch over from/to wireless or wired ethernet.
I rarely have both up at the same time.
I have no real clue what happens when you try to keep both interfaces up (especially on the same subnet).
Alright, got it
I'll give it a try tomorrow, gotta sleep now so i can wake up tomorrow morning for work
Yeah, really thanks a lot @faint sparrow !
Okay good luck!
truly appreciate your help!
Glad to be of some help.
I have a very odd setup i need help with. Can I use the pi4 internal wifi to connect to a network. Then using a wifi dongle, host an ap JUST so I can ssh/VNC in from a device connected to the dongle wifi?
(internet) ---- [wlan0]/ [wlan01] ----- ssh/vnc
also can I get a lead on an arduino or raspberry pi baseball cap? or beanie? Arduino.cc is out of stock ๐ฆ
@solar meteor Might take some work but I don't know of any reason why not.
Raspbian is Debian and as far as I know you can have at least two interfaces; probably three, four or five.
(maybe unlimited except by other constraints related to hardware bus issues).
I believe there is a limitation somewhere in the kernel where interface names canโt go past a certain length, giving a limit but it is high enough that it will never be a concern. Older versions of the kernel had a much lower limit, a couple of hundred I think but due to changing the interface implementation to linked lists that has been resolved. You will run into hardware limitations well before that though, pcie enumeration will have issues with physical devices but virtual devices should be able to go up very high.
@hybrid vortex The last kernel upgrade (or a recent one anyway - recent for 'stable' Debian, iirc) added new names for ethernet.
So I get something like enp0s22 or like that.
I think it is independent from the naming scheme itself, instead a limitations of no more than 16 bytes for any interface name according to some mailing lists.
I know I saw five USB interfaces in 9front.org running on RPi 3B so it's not limited to four of them.
And that was with only two USB slots populated, physically.
(I don't remember why it was five - the USB keyboard+mouse dongle likely counted as more than a singleton)
CP2104 was the fifth. Easily enumerated.
You take the manufacturer's code (or whatever that first tuple is) and concatenate the 'serial number' (unique to that instance, established in CP2104 firmware, one supposes) to identify that particular CP2104 from any others you own.
(the five-character serial numbers are not even a little similar)
Thank you to David for submitting news about his company Caribou Labs new product called 'CaribouLite' which will be a software defined radio HAT for the Raspberry Pi 4. The product is currently in the pre-launch stage over on Crowd Funding platform CrowdSupply and you can sign up for future updates on the release. David writes: I'd like to info...
Software defined radio
Can you execute functions that use the GPIO simultaneously in Python? Letโs say someone wanted to activate a buzzer and an LED at the same time
If you use two different GPIO pins, one connected to the buzzer, one connected to the LED, certainly.
What library do you suggest for this
You don't need a specialised library for the Pi. The RPI.GPIO library is installed by default on the official Raspberry Pi OS (formerly called "Raspbian"). You just import the "rpi.gpio" library and use its API (methods), which is documented on PyPi:
https://pypi.org/project/RPi.GPIO/
https://www.ics.com/blog/control-raspberry-pi-gpio-pins-python
Basically, you declare a specific pin as either input or output, then get or set the value as either True (1) or False (0).
My functions seem to be running sequentially though
How would you run them in parallel ๐ค
Do they need to be actually at the very same moment (or very close) in time?
If you set the buzzer and then set the LED the amount of time between should be extremely small.
Yes. I think I will try this ๐ https://docs.python.org/3/library/multiprocessing.html
Thanks!
In Python you have Threads, Multiprocessing, and asyncio that allow for multiple processes running at the same time, but any of them are significantly more complicated than what I'd think would be necessary to just turn on a buzzer and an LED.
If you instrument your code with print statements (so you can see when things actually run), is there a long lag when turning on the buzzer or LED? That seems strange if it is.
Oops sorry I just gave a very simple example. I actually have a couple devices I want to try and run at the same time
Ah, understood. You might want to investigate the differences between threading and multiprocessing in Python as they're different beasts with different characteristics.
Have fun!
You're right thank you! Hopefully it goes well ๐
Hi Guys I've got a Raspberry pi4 and a Adafruit speaker Bonnet Stereo. I would like to get some sound from it but when i follow this tutorial https://learn.adafruit.com/adafruit-speaker-bonnet-for-raspberry-pi/raspberry-pi-usage I get nothing at the end (no sound from the speakers) do you guys have any idea of where the problem could come from ?
Are there any guides on using the raspberry pi with the bluefruit connect app?
I'm testing my raspberry pi zero w and I'm only seeing 4.5 v on pins 2 and 4 but pin one is a solid 3.3 v
it also gets really hot, like too hot to grab when idle...
is my pi borked?
it boots and seems to run just fine, but my standard pi zero gives a solid 5v on the mentioned pins and stays cool running the same sd card on the same power supply.
Hi everyone, I have a pi pico and the 16x2 LCD+Keypad Kit for Raspberry Pi
I don't really know anything about circuits but it's my understanding that I only need to connect two wires to start programming the LCD? I don't know which ones to connect to on the LCD plate though
and I suppose the naive approach would be to compare a GPIO pinout from a pi 3/4 to my pico and then connect it the same way?
I actually bought the kit for the pi 1/2, maybe it would be best to desolder the LCD from the kit and use it as a normal LCD
@charred sonnet send me a link to the kit, i'll see if I can help you
@primal turtle https://www.adafruit.com/product/1110
@charred sonnet it is using i2c so if you use probably any of adafruit's i2c lcd libraries connected to the i2c pinson the kit you'll be able to control it. Also its using a gpio expander that is also i2c so those 2 pins should be able to do it all. With any mcu or sbc
So is it just pick any pins and then make sure the code it going to the same pins?
and thank you for looking
It would help to do a bit of reading about the I2C bus. It's two pins, SDA and SCL (plus power and ground for a total of four) that as a bus allow you to connect dozens of I2C devices, each with a unique address. Each device just needs those two pins, SDA and SCL, to communicate.
@hardy plaza thanks, looking through some info about it now
my brother went to school for EE stuff and he said he'd take a look too, probably shoulda started there ๐
Is there any files for a good 3D printable laptop?
There are a large number of raspi laptop stls on thingiverse, but the vast majority of them are for 7" screens. If you are using a recycled laptop screen, I would recommend designing your own to fit your screen and driver board.
I already started. Thanks!
I recommend getting hinges from old laptop screens [or a screen with hinges] -- makes your life easier insofar that you don't need to design a hinge or anything like that
gday all,
recently purchased the raspberry pi stepper bonnet, ive got it running on the test code provided and undertsand the forward and back steps provided, i cant seem to find documentation on other code like moving angles or positions? does this exist
Hello! I'm trying to run a python script on startup of my Raspberry Pi Zero W. I updated crontab to run the script on @reboot. When I ssh into it after a reboot and run ps aux | grep main.py I get this line: pi 530 0.0 0.4 7332 1812 pts/0 S+ 14:14 0:00 grep --color=auto main.py
main.py is colored red. Does this mean it can't find a process that is named main.py? The script is a bot that runs infinitely.
Here's what I added to the crontab - @reboot python3 /home/pi/main.py &
Running that exact command when I ssh into the pi works.
Being colored red is just grep being helpful and highlighting the string you are looking for
it is showing up in that line because the grep command is just searching for the string main.py anywhere in the line and is finding itself
ah darn. So my script isn't running
I am seeing a few ways to run scripts on startup. Is there a particular one that works best?
So far I've tried rc.local and now crontab with no luck.
I'd probably use the "systemd" method: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/#systemd
Although you should add a User=pi and Group=pi to the [Service] section
Wasn't able to get systemd to work either. Doesn't even spit out a log file for me. Here's my service file
Description=Bot Runner Service
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/bin/python3 /home/pi/main.py > /home/pi/logs/bot.service.log 2>&1
User=pi
Group=pi
[Install]
WantedBy=multi-user.target```
did you enable it?
yep
Using this command sudo systemctl enable my-bot.service
my-bot.service is what I named the service
Ah I see. The service failed
It didn't even spit out the log file for me to understand why it failed though
The only reason I know it failed is because I listed all enabled services
check /var/log/messages?
Just checked. Nothing there either.
Ayyyy! I got it to work. The systemd was the right way to go since my script actually needs the network to run. I had to add Wants = network-online.target After = network.target network-online.target
Thanks for your help! I learned a ton.
Just kidding, i didn't get it to work yet. But I think I made a good step forward.
Check out the comments in:
https://github.com/ifurusato/letterbox-robot/blob/main/lbrd.service
which controls this script via systemd:
https://github.com/ifurusato/letterbox-robot/blob/main/lbrd.py
I just got some stepper motors working with my rpi, i then wanted to use the LSM303DLH compass + accel sensor at the same time which needed circuitpython. Having installed circuit python, the stepper motors no longer work correctly; instead of spinning, they seem to change direction very quickly as well as gain and loose power. I feel like installing circuitpython has somehow messed up the gpio outputs in the program to control the stepper motors, or it has started running something in the background which is writing random values to the gpio pins, does anyone have any idea whats going on here? Is it possible to disable circuit python to see if that gets the steppers working again?
Steppers are known to be quite finicky with timing, which is usually why their control is left to microcontrollers and/or stepper drivers. The more things you have running on RPi, the more likely it'll cause issues with speed and direction control.
If you are driving these steppers directly with Raspi, you'll probably see these issues with any additional multitasking, regardless of circuit python.
some things aren't multithreaded, the pi has 4 cores
Fair, then next problem with circuit python is its interpreted, and Idk what adverse effects that can have on timing.
Hey, I think the connector on my official Pi 4 fan is too long, and the case wonโt close. (from https://www.adafruit.com/product/4794 ) Any recommendations? Maybe an upgrade pick for a Pi 4 fan?
Are you looking to upgrade the fan, the case, or both?
None sound like bad options! Say a $20 budget. Probably can get away with just a new fan though.
Well, at 25 you'll get one of these: https://www.adafruit.com/product/4340 heh
Looking for a wayย to keep yourย Raspberry Pi 4ย running cool and also look cool? We've got a two-birds-one-stone solution for you. This enclosure kit is absolutely perfect, ...
I'm assuming you don't touch the GPIO pins much if you current case is kinda in the way of your fan pins, so maybe this guy might fit in your case? https://www.adafruit.com/product/4316
And if none of these appeal to you, maybe you can take a file and wear down the problem edges of the DuPont connector on your own. The fan will still work, I promise.
Oh, and the case pictured in the fan shim page is https://www.adafruit.com/product/4318 if you happen to like the look.
I'm obliged to try this first. Then I'd have an excuse to shop more. ...but that aluminum case, wow! Thank you Hem ๐ ๐
No problem. Adafruit has a whole subcategory dedicated to Pi4 cases, so took no time at all!
The weird bit is that it worked fine before installing circuit python, afterwards the steppers are now doing random stuff and nothing I do seems to prevent it. As far as i'm aware i'm not even using circuit python in my code yet installing it was what caused the issue. Does it automatically run something in the background that I don't know about which could cause this? Failing all else I can just put a clean install on the sd and avoid installing circuit python but this seem a little extreme
Are they directly connected to your Pi? If you pins can't be held high, it could be current draw on the steppers, but if they can't be held low and free-spinning, something might be wrong with your pins. If you can revert to your last known working state and make sure it works properly, you can cross off hardware issues...
Though in my experience, you should not be running steppers directly off of any GPIO pin because their current draw is not something GPIO pins are typically rated for...
They aren't directly connected. I'm using a Stepper Motor HAT with a 12v power supply (with plenty of current) which uses a pair of DRV8825 to drive the motors. I'm very confident that it is not a hardware issue; the motors worked flawlessly before installing circuit python, the only different before and after breaking is that i typed some stuff into the terminal to install circuit python. The steppers seem to rapidly switch between free spinning and powered - there is a pair of gpio pins which control whether or not the motor is powered, so it is as if these pins are both getting random outputs whenever my code sets them to an output state of 1. Its a similar situation for the direction; there is a pair of pins which control the direction, and the rapid changing of direction could be explained by these pins getting random output settings. I suppose the next thing to try would be running the pi off a clean sd and see if it works fine again
I wonder if it's something like the pin numbering got changed (board vs BCM for instance)
I always run GPIO.setmode(GPIO.BCM) before setting up the pins. Would it still be possible for it to be using the wrong numberings?
Honestly, I don't know specifics when it comes to software, I'm mostly a hardware engineer at this point. If you don't have an oscilloscope / logic analyzer to investigate it further Idk how I can help further haha
That setmode() command should cover that possibility, but unfortunately that's the only one I thought of.
Alright, thanks for the help, ill keep fiddling about with it and see if i can get to the bottom of things
So i dragged my pi3 out after a few years. I wanted to operate headless and found webide. I have been struggling with getting it working via the tut on the website. after digging a little i learned about the pifinder app and that it supports installing webide. it finds the rpi but errors on the bootstrap with no such repository. i am in the middle of wiping and reinstalling/updating the os, but i thought id check here and see if pifinder and or webide are dead apps, and if not, am i missing something.
does anyone know if they changed the silk screening on the back of the pi zero w since it's release?
Hi why can we not use Adafruit NeoPixel on other Raspberry GPIO than 10 12 18 and 21 ?
any idea <@&617066238840930324> ?
Those might be the pins that PWM0 can be mapped to.
@gentle briar was on the money, can use a PWM, PCM, or SPI controller https://github.com/jgarff/rpi_ws281x
Which, matches with the pin numbers you gave https://pinout.xyz
The comprehensive add-on boards & GPIO Pinout guide for the Raspberry Pi
hey yall, what should i do if one of the bonnets i ordered arrived broken? the joystick doesn't work in the up direction
Email support@adafruit.com
@marble trout please post in the forums:
https://forums.adafruit.com/
so we can try and troubleshoot first.
Ok thank you. If feels like a physical issue tho. Like the switch doesn't click when pushed in the up direction
ok. could be a bad switch. you can try emailing support, but they may ask the same about forums.
it's the general process (1) forums to try and troubleshoot then (2) email support as needed based on outcome
Hello has anybody encountered this before? I'm connected to my Pi via Windows' Remote Desktop Connection (xrdp), and every time I run my PySimpleGUI script as sudo python3 gui.py I get this error about the display:
That looks to me like an X11 error. It could well be that you're not running X11 at all, so there's no X display for it to connect to, but I'm guessing a bit.
can you make it where you dont need a mini hdmi to display the raspberry pi zero w?
like is it posible to do it?
If you want HDMI video, you're pretty much stuck with the connector that's present. However, if you don't insist on HDMI, you can get composite video from a Pi Zero fairly easily.
so you dont need the mini hdmi to display like can you do it on phone or chromebook?
You can use VNC to remote in graphically or SSH for console
i do need help tho does it need a network ip to finnd it or somthing to remote?
Yes, you need the IP or the hostname. You can set the name with raspi-config and find the IP with ifconfig
Been scratching my head at this for a while now ๐ข
Oh wait, are you looking to set up without connecting a display?
no i already have the files on a sd card into the raspberry pi but i wanna display it
i couldnt afford the mini hdmi adater
Ahh... I think you can set a hostname in the boot.conf on the card...
how would i do that
I can't recall, anybody else remember? I haven't had to do this in ages
i dont think anyone els knows'
You should search for headleass setup raspi. But that envolves mounting the sd card on another machine. Not sure what Chromebook allows you.
Are you guys trying to set the hostname on a Pi or on a Chromebook?
On a Pi it's just using raspi-config.
They're trying to set up a Pi headless -- they don't have a monitor to even do initial setup, so they'd need to configure entirely via the Chromebook and then connect over the network
I didn't think about it last night but that requires setting the hostname and network info
Or at least network info, you can scan for it with an app...
I know you can do it, but I forget because I always have a display
yeah, me too. But if they look into two of the files in /boot they'll find the configs. This is all documented on the RPi site somewhere...
Somewhere... I had trouble finding it
I usually just connect an HDMI monitor to the Pi for its first 15 minutes of life, then never again.
Lol, yeah, that's most of mine
off to bed, cya
Night
Is it normal in Raspbian that I have to use sudo to run a Python file with gpiozero on my Raspberry Pi 2? If I don't use sudo, gpiozero errors out that it can't communicate with the pins.
Oops, shame on me. Should have read the docs better, it's a virtual environment thing
nevermind me. ๐
How do you find the Pi chip's stats/usage on the Pi - command line is preferable??
htop or top will show a "task manager" in the terminal.
I also believe uptime will show the CPU usage average
or did you mean stuff like
cat /proc/cpuinfo
echo $[100-$(vmstat 1 2|tail -1|awk '{print $15}')]
?
OK, thanks!
No
Firefox is much faster than Chromium on Raspberry Pi....
Chromium broke for me, so I was just saying....
Has Chromium broken for anyone else?
Article for a headless Pi setup.
https://learn.adafruit.com/raspberry-pi-computer-quick-start
https://learn.adafruit.com/raspberry-pi-zero-creation/text-file-editing
@raw solar The latest change to the Rasberry Pi Imager allows you to set the network and other things while putting the os on the card. Just do a CTRL-SHIFT-X.
It didn't break for me. But that was a month or two ago, and i didn't use it for long
Hmm. OK.
Ah, cool! Here you go @timber marten !
Customization right in the imager!
Since sliced bread ๐
the eletrical socket has the power to give u a bad head ache as a kid, if u did it wrong
hello, can i ask about how using multiple sensor INA219 with Raspberry Pi?
yes. this board?
https://www.adafruit.com/product/904
answered in #help-with-circuitpython . please don't post questions in multiple channels. if in doubt which channel, just make best guess.
What is the usual preferred library in Python to use GPIO? gpizero or or rpi.gpio?
In a nutshell, gpiozero is a higher level API over the same functions as rpi.gpio. If you're comfortable with gpiozero use it, if you want access to a more detailed API use rpi.gpio. They do exactly the same thing in the end, just a flavour of syntax.
@hardy plaza Thanks!
I just got my CM4 IO Board, and I think there is an issue with it.
The Ethernet port worked when I first ran Ubuntu, but after updating, it no longer does. I also saw some solder smoke come off the board, so I think it is toasted.
F
I was planning on getting the Rasberry Pi 4 model B, with 2 GB of ram, but it is out of stock. when will it be back in stock?
afaik adafruit doesn't usually say how long it takes until something is in stock so you gonna have to sign up for (email) notification once it's back in stock
I used to program the Adafruit Feather M0 with python (I used mu but I don't think that's too important). I use a raspberry pi. As I ran out of ram more often I wanted to switch to C. So, I downloaded the Adruino IDE and wrote a small blinking script. I played it on the microcontroller and it works. Problem is that since then the raspberry pi doesn't recognize the microcontroller when I plug it in. I can't program it with python or with c. Can you help? (pls ping)
There's a nice writeup here on various ways to enter the bootloader so the Pi can see it. https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/uf2-bootloader-details
Is it possible to take 299 pixel x 299 pixel images with the Raspi Camera Module V2?
When my raspberry Pi freezes but I have some import unsaved files, how long should I wait for it to un-freeze before I pull the power supply?
@indigo shore scaled down from full frame? or a 299x299 pixel subframe?
@remote cove what is nature of freeze? the GUI locks up? your ssh session feezes? other?
I guess it's a GUI problem. Had 3 tabs open and opened 2 more at the same time. I can't move my mouse and nothing moves. the picture remains still
hmmm. so you have a monitor and keyboard attached?
And a mouse. (At the time of the freeze there also was a microcontroller attached)
is green ACT LED doing anything?
It's blinking from time to time
have you tried pinging the pi from another machine?
ok. maybe not a good option then. it's just a simple command, but you'd need to know the address, or try to use the mdns approach.
is keyboard also frozen?
@steady rose A subframe would be best (if I understand the question/terminology). I'm building a contraption that will take a whole bunch of pictures for use with an AI architecture (Inception v3) that prefers 299 x 299 square images.
Wdym how can a keyboard be frozen?
@indigo shore subframe = pixel per pixel capture. so you'd only get back 299x299 pixels of the much larger 3280 x 2464 sensor.
vs. a resize = like a photoshop scaling / cropping of full sensor image
Nice! So I will likely be able to use the same settings to take pictures that will be used in classifying the images. The training dataset will be very similar to the images being classified!
@remote cove typing on it doesn't do anything? and maybe try something like window key to bring up a menu. can try <alt><tab> also - i think that will cycle thru open apps. or even num lock and see if light toggles.
Ok .now something changed. I can see a overlay telling me that chromium doesn't respond and it asks me if I want to close it but I can't say yes because when I type anything or move the mouse nothing happens
@indigo shore the main reason for a subframe would be to reduce the amount of data flow and potentially increase frame rate. do you have a high frame rate requirement? otherwise, just take full images and scale them. the pi's GPU can do that.
Typing doesn't do anything. I'm pretty shure that the raspPi is too slow to process/ to change anything on the screen
Btw what does the green led indicate? I believe it has something to do with the memory?
@remote cove some chromium process is probably hogging the cpu. and even slowing down keyboard reading. is the "YES" button the default option in the dialog you got?
green led = activity
No. It was to the right so I tried to press the right key. Also an the moment the popup isn't there anymore
is the chromium still active? does it have focus? i.e. - is it what is currently selected to take in keyboard input? (vs. some other open application)
Yes , yes
try <ALT><F4> and wait a bit and see what happens
Ok
How long should I wait? To redo the document would take around 10 minutes, but i don't know the chances of the raspPi un-freezing. Do you know how likely it is?
@steady rose No frame rate issues -- still photos. I'd rather crop than scale so as to maintain the images' detail.
@indigo shore if you're working in python, this is an excellent library:
https://picamera.readthedocs.io/en/release-1.13/index.html
pair that with PIL/pillow and you can pretty much do anything
@steady rose Wow! mind reader... I was just going to ask if you had a link... was having trouble finding info on subframes
@remote cove wait 10's of seconds. but not more than a minute i guess. but if the runaway process has grown, it may be totally rendering the gui non-responsive. and maybe the pi in general.
chromium causing this is probably not too surprising
Wow! again. It appears that I can save to numpy arrays with a designated resolution. That might be perfect.
yep. there's some great low level hardware info in that readme also.
So I restarted the raspPi after 2 minutes of waiting. I need to do my work again ๐ฆ
@remote cove have a terminal window open running top so you can watch what process was causing the issue. and maybe another so you could try kill -9 ing it.
not sure if pi has other tty's created you could <CTRL><ALT><Fx> to?
does anyone know a way for me to send vl53l0x sensor data over from a raspberry pi zero to PC via bluetooth and run a script on PC?
I can do it via HTTP but I don't know how to on Bluetooth. Why Bluetooth? It has shorter range and slower performance. No WiFi available?
the wifi is needed to connect to my tello drone so its not available. so right now i am trying to find a way for me to get TOF sensor data from raspberry pi zero to pc via bluetooth so i can run the script to the tello drone
Why can' t you use WiFi for both the Tello drone and your PC? I.e., everything via WiFi? I don't think bandwidth would be an issue...
i need to run a script on my PC to Tello drone API via WiFi, so i cant connect to my raspberry pi zero to my PC WiFi, which prevents me from getting my TOF sensor data
so im trying to think of a way to connect my PiZero to my PC via Bluetooth and get the sensor data and implement the data to the script
I guess I'm unclear why you can't do both. A Raspberry Pi is a multi-user, multi-process Linux computer. You can run a script to create the drone connection as well as getting the VL53L0X sensor data from the sensor, and connect via HTTP (create a single endpoint of a RESTful web service) to your PC. They can all be running simultaneously. I just did "ps -A | wc -l" and my Pi is currently running 127 processes.
You'd just be creating a few more...
the script i run on my PC is a object detection script that requires my GPU for calculation and run on the Tello drone via WiFi
so i am sure if that method will work
Well, your computers (PC and Pi) can run multiple processes (they always do) and can make multiple connections over WiFi, all at the same time. It's not like the computer is only running one script, it can run many.
I guess my point is that using Bluetooth rather than WiFi doesn't gain you anything. If you can figure out how to communicate over HTTP it's probably easier than doing it over Bluetooth.
In any case, I'm sorry I've got to take care of some business here at home, good luck!
i will try looking into thanks!
Anyone know with busio if it's possible to tell it to ignore the MISO pin? As in, not initialise it? My LCD on my rPI has no MISO pin, so I am using that IO for something else, when when I init SPI, it takes control of that pin anyway and messes with it.
I'm looking at making my 3b+ into a smart display
I just want something laid out that I could run with big buttons that could still run on raspbian so I can use that as a base and have big buttons like a smart device
Idk how to go about starting
The first step is to take a step. Break the project into workable pieces and choose one to begin on.
The step would be knowijg how to make raspbian or similar into a os that has a bunch of big shortcut buttons
There have to be hundreds of UI libraries. One of them should be able to give you big buttons
What site do I go on to get these elements
can anyone help me out with this ?
https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/issues/183
running this Raspberry-Pi-Installer-Scripts/blob/main/libgpiod.sh script gives me the following error ` Installing build requirements - this may take a few minutes! Hit:1 http://deb.debian.org/debi...
does anyone know how do i send vl53l0x sensor data from raspberry pi to windows PC with pycharm via bluetooth?
isn't pycharm an IDE?
and when you say "raspberry pi", I am assuming you mean a full fledged raspberry pi microcomputer, not the pico microcontroller?
I suggest you break this down into two problems. First, get the rpi to print data from the vl53IOx to the terminal. The fastest way to do this would probably to try and run the circuitpython code on Linux. I used this tutorial the other day to run the seesaw circuit python code an an rpi zero w: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
The second part of the problem is bluetooth communication. I haven't done a lot with it, but I believe it's possible to treat like a UART (serial connection).
for the bluetooth communication do u have some examples? thnaks
I've never used it, so I don't have any examples I can really endorse. But I read this the other day: https://www.raspberrypi.org/documentation/configuration/uart.md
Documentation in this section includes basic guides to configuring your Raspberry Pi.
which suggests that the secondary UART on raspberry pi devices (/dev/serial1) is hooked up to bluetooth
so I believe on the pi side, it may be as simple as forming a bluetooth connection to your laptop, and then sending data to /dev/serial1. I am not really sure how to get the other end of the UART up on your laptop though
Why don't you put them both in a wlan/Network and post the data to the windows pc ? Or use some Webfrontend on the pi ?
Hello all, I have a few questions regarding my raspberry pi zero. I am attempting to record accelerometer data (adxl343) and microphone data (Bluetooth) at the same time. Is this possible to do with the Zero or will I need something with more computing power?
A Pi Zero is a Linux computer so being able to run multiple processes at the same time is no issue. That will really depend on the data density/throughput of both sources, like how often the accelerometer is getting updated, the quality of the audio and the overhead for Bluetooth processing. But I'd say try it out, and if that doesn't work you could move up to a Pi 3 A+, which is still pretty small but has four cores (the Pi Zero has only one). But the Pi Zero is still a pretty capable machine, so I'd say give it a go, it probably can handle it.
I'd actually be curious to hear if you're successful or not, as it's kinda at the point where I think a Pi Zero should be able to, but I'm not sure.
Hello! I recently bought a Raspberry pi 4B. I am trying to control Gpio's but pi always shows no module named Rpi.. Even after I installed the package. Can anyone help me out?
Capitalization is important - I believe it should be rpi instead of Rpi
Hey, guys
I'm trying to get my rpi pico to run a code but nothing seems to happen
This is all I get
Adafruit CircuitPython 6.3.0 on 2021-06-01; Raspberry Pi Pico with rp2040
%Run -c $EDITOR_CONTENT
I know there's nothing wrong with the code because it works on my arduino board
nvm I figured it out, the code was too large for it's memory
I want to control 2 stepper motors and 12 LEDS (not individually) using a raspberry pi B+
Can I just buy a 4 output motor driver for this?
The cheap one is marketed as a "stepper motor driver" so would this work?
@oak frost What did you have in mind to buy? Might be worth posting a link to it then we can evaluate.
A lot of the cheaper stepper drivers or motor/stepper hybrid drivers are still very timing restrictive, meaning that while an Arduino or a Pi Pico would handle these with relative ease, a processor module like a Raspberry Pi would struggle to utilize this kind of driver well. If you want to control a stepper motor with a Raspberry Pi, I recommend at a minimum getting a stepper driver with a step/dir interface, so you can ease the burden of tightly controlled synchronus oscillation.
For higher-precision applications, I recommend using a microcontroller as an intermediary to control the stepper timing.
I am building an app that currently runs on a Raspberry Pi Zero W, but needs to be able to communicate simultaneously using BLE and serial (UART). Iโve discovered that this is a problem on Raspberry Piโs and Iโm looking for some other processor that supports BLE and doesnโt have the UART limitations of a Pi. Any suggestions? App was originally written in Java and communicating with a serial device, but adding BLE to make a BLE peripheral was a problem in Java. Switched to Python and have the BLE peripheral working, but now trying to add the serial I/O Iโve run into the Raspberry Pi issues with UARTs.
What's the problem with using BLE and UART at the same time?
I thought one UART was hooked up to the bluetooth stack, and the other UART was hooked up to pins? Can you not use both of those at the same time?
Please see docs.bitscope.com/pi-serial. With BT turned on the useful UART is used by BT, leaving the miniuart for serial i/o. The miniuart is tied to the VPU clock which varies, dynamically changing the bit rate (who came up with that brain-dead idea?). Alternative is to overclock the device, which โcauses the Pi to draw a lot more currentโ. I need a low power battery-powered device, to go along with Bluetooth Low Energy, that can utilize both BT and serial comms.
it looks like you can lock the VPU clock without overclocking
(I assume you were already aware of this)
but wouldn't that solve the issue?
interesting reading btw, thanks for the link
I'm running it very slowly 1 day and 1 year per rotation
I thought that you can just energize the different sections to rotate the motor, I'm just using the motor driver as a prebuilt h bridge
Maybe ill get three transistors and unipolar stepper motors instead
Is there any distribution for the raspberry pi for creating an easy to use access point?
I want to reuse a Pi I have here, and I do know how to work with hostapd, but I was wondering if there is a specialized distro for it.
I'm not aware of a specialized distro. Is there something you hoped a specialized distro would do?
You could set something up to build a special image of raspios with all your software preinstalled if that's the kind of thing you're looking for
I would like it to have an interface similar to an OpenWRT router, where you just burn the firmware and then get a web page to control the AP.
I have done something similar with FruityWifi, but in this sense, it's not a specialized distro, but something you install on top of a general purpose distro.
I use it on a infosec course to demo some nice wifi attacks, which fruitywifi also has a bunch integrated.
http://fruitywifi.com/index_eng.html
I havenโt been able to configure the Pi correctly to get BT working on the miniuart and free up the good UART for my app.
I am currently writing a program that uses textfiles to write in but if the program gets interrupted and can't close the file correctly, all the written data gets deleted and a blank textfile is left over. Is there a way to make some kind of caching without closing and reopening the file?
I believe for file objects there is a flush function which will write to the disk (idk going off of memory lol)
ok thank you
Does anyone have any experience with using spi devices on Pi?
You're probably going to get better results asking your actual question.
One fairly straightforward approach would be a stepper HAT like this one: https://www.adafruit.com/product/2348
Doesn't seem that great as it's huge, expensive and straightforward
I'm new to electronics so it would be nice to solder some ICs and resistors or something
I could get a "regular" motor driver which I think should be able to control the motor by using it as a system to control a high power wire with a low power one and in both directions
I also have a LED load which it could also power
But in my head it should work but I think I saw some contradictions online
You're going to need to be more specific with what you mean by a "regular" motor driver. if you're looking at a "regular" motor H-bridge, you'll need a pair of them, and you will need to be able to reliably switch them at speeds relative to how fast you need the stepper to turn.
5 outputs?
Not sure if you need an H-bridge for an LED....
Hi friends, so confession: I don't understand the value of the CM4 boards... it feels like you need to build a board underneath with IO similar to a traditional RPi (sd cards, usb), and is more expensive (albeit is better specced, sometimes). For example, this project: https://www.crowdsupply.com/diodes-delight/piunora
Doesn't that duplicate a RaspberryPi? Yes, it has more novel IO, but can't a RPi Hat provide that, too?
What am I missing?
The CM4 boards are intended more for a mass-production scale than a hobbyist use. If you are developing a product you plan to sell, a compute module takes all the functionality of a standard pi4 and makes it much easier to assemble to a finished PCB.
Mass production requirements for your projects, I assume. ๐
As for that Piunora project in particular, it appears to be a good drop-in replacement for an existing Arduino project with an additional computing requirement added. Can't say it's for everyone, but it does have a smaller footprint than a Pi with a PiHAT.
Well actually, I am producing a product for sale haha. Built on an RPi, but we are building a HAT. http://pioreactor.com/
If I choose a cm4, I still would end up implementing sd card, etc. Different stokes I suppose
Ahhh, I see. I guess in that case the difference isn't in mass-production, but the goal of the deliverables haha. If you ever do move away from HATs to a complete, integrated solution, a CM4 would be an option to consider then.
Since QT Pi rp2040 is out of stock, I am going to use a tiny2040. I believe this will work. I am having trouble figuring out the SPI pins though. Could you tell me what TFT pins go to what tiny2040 pins. I got most of them figured out.
TFT Tiny2040
V+ 3V3 (Pin 3)
GND GND (Pin 2)
CK SCK (Pin 14)
SI ???
TC RX (Pin 0)
RT TX (Pin 13)
DC SCL (Pin 6)
BL SDA (Pin 7)
What does the SI pin traslate to?
Thanks
what TFT?
So what would the pin equate to on the tiny2040?
CK = SCK and SI = RX (SPI)
does the SI pin assign the slave number?
the TFT has better pin labels on the back
Hmmmm....
SI is short for MOSI which is Microcontroller OUT, Sensor or device IN
so in this case, IN to the TFT
when using the QT Pi rp2040:
Wiring TFT to QT Py
Solder the wires from the TFT display to the pins on the QT Py. Make the following connections.
V+ from TFT to 3V on QT Py
GND from TFT to GND QT Py
CK from TFT to SCK QT Py
SI from TFT to MOSI on Qt Py
TC from TFT to RX on QT Py
RT from TFT to TX on QT Py
DC from TFT to SCL on QT Py
BL from TFT to SDA on QT Py
so TC -> RX already so what does the SI go to?
SI would go to one of the SPI RX pins
not to be confused with UART RX
CK would go to SPI SCK
Yeah. I was using the diagram the SPI column
So, TFT Tiny2040
V+ 3V3 (Pin 3)
GND GND (Pin 2)
CK SCK (Pin 14)
SI ???
TC RX (Pin 0)
RT TX (Pin 13)
DC SCL (Pin 6)
BL SDA (Pin 7)
so based on the TFT -> QT Py and the pins I'm using on the Tiny2040, are they correct and again what would the SI pin go to if the TC is going to SPI RX already
Sorry if I am confused
SPI RX can show up in two places. use one for TFT. the other can be used for TC if you want.
Oh, so the SI and RT from the TFT can go to the same SPI RX?
it's only on one pin at any given time
V+ from TFT to 3V on Tiny 2040
GND from TFT to GND Tiny 2040
CK from TFT to GP2 Tiny 2040
SI from TFT to GP0 on Tiny 2040
TC from TFT to GP4 on Tiny 2040
RT from TFT to GP5 on Tiny 2040
DC from TFT to GP6 on Tiny 2040
BL from TFT to GP7 on Tiny 2040
something like that maybe?
Oh ok!!! Thank you. I will give that a try. Thank you very much!!!
Is any one familiar with rgb image data type option from the pi.camera capture function?
the guide im looking at is suggesting i use >
data = np.empty((cam_res[0],cam_res[1],3),dtype=np.uint8)
as the data type to save an image into but it returns an error cause the first position of the np.empty object is a 3item vector when it needs a single value item instead
Hi! I'm trying to connect a Pico to the OTG USB port of a Pi Zero and see it in the terminal - I'm connected to the Zero using an FTDI adapter (serial), but when I run sudo blkid it doesn't show up in the list. I can see and mount the SD card I have connected to the GPIO header, but bot the Pico as a Mass-storage device (I plugged it in with BOOTSEL held down to activate it's RPI-RP2 drive). The USB OTG connection is direct (not through a hub). Any ideas?
Emergency self destruct
Okay after research I learnt the very disappointing truth about connecting an LED the wrong way around
The actual reason was to save money
But transistors can cost as low as S$0.03
I took a shot at connecting a pico to my zero w with a micro-usb to micro-usb cable. blkid shows the pico as a mass storage device when I hold bootsel when plugging in the pico (although this also causes the zero w to reboot!)
what role does an ftdi adapter play here?
Question on powering RP2040 Feather, with a battery for use outside year round. Since LIPO's are not recommended to be used below 0 degrees C and I need to have this run Below 0 F I am puzzled as to a appropriate battery and solar charge to use. Does anyone have any suggestions? Thanks
I have a hyperpixes hookded up to a cyberdeck plugged inti a pi400 I installed the software but nothin shows up on displa
are there ant common gotchas I should look for?
sorry hyperpixel 4.0 "
I used "curl https://get.pimoroni.com/hyperpixel4 | bash" for the software, is that correct?
@fresh marsh there is a known hardware issue with that combo. one sec. let me find links to relevant info.
awesome thanks
start here and read rest of thread:
https://forums.adafruit.com/viewtopic.php?f=50&t=179733&start=15#p875641
k will do thanks
wait do i need a 64-bit OS image on the pi400?
i never get anything not even a screenflash
oh
I tried cutting the trace and either that doesn't work in my case or I didn't do it correctly (my vision isn't that good and I am paralyzed in the left arm and hand)
When cutting a trace, use an exacto knife and make a 45 degree cut from one side, then a (roughly) 45 degree cut from the other, so you're creating a tiny channel. Then if you clear out any remaining material between the two cuts there won't be any connection. Don't dig too far or you may cut a trace within the PC board (some PC boards have multiple layers, not only on the surface).
This 45 degree cut isn't quite so tricky as just scraping at it and hoping you've disconnected the trace, it's just two angled cuts just slightly apart, then a bit of cleanup between.
ugh I don't think I'm able to do that kind of work
Is it possible to get an updated one sent to me?
Wll that didn't work, \ncode.py output:
Traceback (most recent call last):
File "code.py", line 44, in <module>
NotImplementedError: No default SPI bus
Can you find a magnifying glass somewhere? Or a jeweller's loupe? They sell magnifying glasses with attached lights, some expensive, some quite a bit cheaper.
https://www.wish.com/product/5c8620b983ef6253b171141d?hide_login_modal=true&from_ad=goog_shopping&_display_country_code=NZ&_force_currency_code=NZD&pid=googleadwords_int&c={campaignId}&ad_cid=5c8620b983ef6253b171141d&ad_cc=NZ&ad_curr=NZD&ad_price=18.00&fallback_cids=5ce798e14ee6f65a2aa820d9&campaign_id=9973252488&exclude_install=true&gclid=CjwKCAjw87SHBhBiEiwAukSeUTcCkOpqvLvG-pt6aicX1EIUmpnu-Rxcy5hXG8ZeO0bxWP1L9-r-ARoCBxcQAvD_BwE&share=web
That one is $16. I've also found that no matter how good one's eyes, adding a lot of really bright light helps a lot. When I'm soldering something very small I turn on a really bright white LED spotlight, which makes a lot of difference. I can appreciate the difficulties for the hard-of-sight, or those with shaky hands. I doubt you could get a modified one but you might be able to find someone around you who could do the work since it's only a few minutes' effort.
(though I don't believe that "Wish" is "Shopping Made Fun")
it is a combination of being partially blind and lack of use of two hands( results of major stroke six years ago)
If you're asking about sending it back to adafruit (seems reasonable if it really is a hw defect) you may be best emailing their support
(many of us here are just fellow customers :) )
okay thanks I'll try that
Understood, and sincerely, I'm sorry to hear. I think this may be one of those times in life to "find a willing teenager"...
However, if you live near Seattle I'd be happy to take a shot at it
funny thig is I do live near Seattle (what are the odds)?
but that is too much to ask of someone
I dunno. I live in New Zealand (so not quite so close to Seattle) but if you were within an hour of me I'd be happy to meet in a cafe and help you. People can be complete jerks but there are also those willing to help others out, which is one of the lovely things about people.
@cobalt forge you'll need to manually create the spi bus with busio and not use the board.spi one
It wouldn't be a inconvenience for me, it's good for me to get out of the house and get some fresh air. I also can't guarantee that I could even fix it haha. No worries if you'd rather RMA it though.
@fresh marsh and @torn trench I'd be a bit skeptical that cutting a trace as per the link provided would necessarily fix the problem, though perhaps you could diagnose it, dunno. In reading over the messages about this it's certainly not clear what's wrong, it is possible that the board is damaged. I've got the rectangular HyperPixel on a Pi 4 and it works fine, but it wasn't the most straightforward installation.
But I highly encourage you to get out of the house. ๐
Yeah what's the theory behind this? Severing the trace to the STEMMA connector that's shared with CS on the display?
And the idea is that the long trace for the STEMMA connector is picking up a signal or something?
The fact that it only seems to happen with the pi 400 is kinda interesting, and does kinda lead one to suspect electrical gremlins
@hardy plaza what standards do you use for off-pcb comms on your robots?
TIL about the pinout command in the terminal. Try it out! Provided by https://github.com/gpiozero/gpiozero
Ok thanks
is there a way to get raspberry pi ip address automatically for server-client connection via same network?
Are you asking "what is a static IP address?"
if i set a static ip address does it still work with vnc viewer?
I'm not sure what you're trying to do. But if you need to get a fixed IP address for your VNC configuration, you'll need to figure out how to set a static IP address.
okay thanks
zeroconf networking may be a better solution to your problem
which would allow you to access the pi by its hostname