#help-with-linux-sbcs

1 messages ยท Page 21 of 1

steady rose
#

just keep it mind. know the general limitation, etc.

civic rune
#

would you use a MOSFET or a BJT? I would lean towards FET

steady rose
#

i think you can use a BJT ok for the ~20mA level stuff you'd be dealing with on an LED

civic rune
#

ok I'll just go with what fits best on the board

#

Should those guides be amended to suggest that?

#

I haven't used subprocess before will the command subprocess.Popen(['sudo','shutdown','-h','now']) do the same thing as running sudo shutdown -h now in the terminal?

steady rose
#

which guides?

civic rune
#

any guide that details running an LED off of a GPIO pin

steady rose
#

yes/no

#

not really

#

it is the easiest way to get an LED blinking

civic rune
#

makes sense

#

Any thoughts on the subprocess call? I've seen a few ways to call a shutdown but don't know enough to distinguish which is preferred

steady rose
#

otherwise it requires more discussion and quickly becomes less beginner friendly

civic rune
#

yeah that makes sense. Maybe an addendum to each guide that points to a new guide that talks about safest practices? I'd love to write that if you allow outsiders to contribute

steady rose
#

hmm..subprocess...it's been a while since i've done that. can't remember what the best option is.

#

but basic python docs should cover that

civic rune
#

I'll check them out

#

thanks for your assistance

#

would that be on pypi?

steady rose
#

not really. that's where packages are hosted.

civic rune
#

ahh ok

steady rose
#

like add on libraries, etc.

#

look more in the core docs

#

i think...pretty sure it's a core thing

civic rune
#

I'll just google core python docs, that should find it

steady rose
#

part of the "batteries included" aspect of a python install

civic rune
steady rose
#

"running external command" etc.

civic rune
#

hmm this guide has you do it somewhat differently. I've got some reading to do it seems

#
#

hey it worked! woooooo

#

the original way I had it worked

potent hedge
#

I believe its max 16 source, 17 sink.

civic rune
#

Oh good to know. I'm under that so we're good

heady cedar
#

Any advice on getting a neopixel strand working on a Raspberry Pi? Code seems to be working with libraries installed & sudo run. No errors showing. I think I had the wiring setup with the Adafruit 74AHCT125 (pictured). Am using GPIO 12, which is apparently OK, although I also tried same code switching to D18. Still no lights. Power supply strand is wired to is 5v 3a. Notice when I unplug & plug the power supply back in sometimes random lights in random colors show on the strip (hope I didn't damage anything). Thx for advice!
import board import neopixel pixels = neopixel.NeoPixel(board.D18, 20, brightness=0.2, auto_write=True) pixels.fill((0, 0, 125)) pixels.show() while True: pass

steady rose
#

can you verify the neopixel strip is good on some other non-pi board?

still notch
#

i am attempting to get a Brain Hat working on Rasp Pi 4. There is a step: lobe-basic-prediction.py which gives this error: picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.camera_info': Function not implemented I bumble around and read Adafruit's article: https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/kernel-module-troubleshooting so i run the script there which puts an older version on. Now I get picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled. I have enabled the camera..but still get this. There is something screwy but I don't know what?

Adafruit Learning System

Easily use Machine Learning on a Raspberry Pi 4 using the BrainCraft HAT

civic rune
#

I have a service that starts my code on power on, if I stop that service, what happens to the gpio pins I have set up? Do they stay in the same configuration?

pliant pebble
heady cedar
steady rose
#

ok, go back to pi, skip the level converter for now, and set number of pixels to 1 in code, and see if you can get that to work

heady cedar
#

OK - will give that a try. Just verified power supply was working by breadboarding up an LED. No prob there. I'll go direct from neopixel strip to the Pi & see what I can come up with.

heady cedar
# steady rose ok, go back to pi, skip the level converter for now, and set number of pixels to...

I tried directly to Pi and although it wasn't working on outtermost pins (18, 12), when I switched to GPIO 10 it worked directly connected! When experimenting with the board, I tried a more powerful power supply & damaged another strip of lights. Could this have damaged pins on the Pi as well? My perception is this may be what happened. And now that I may have harmed a board, is there a decent test to check the integrity of pins? Thanks!

umbral sable
civic rune
#

Interesting ok. I'll just make sure not to press the button that shorts a GPIO to gnd when testing

steady rose
#

@heady cedar unfortunately possible ๐Ÿ˜ฆ try just using them as simple digital in/out as a sanity check.

heady cedar
#

@steady rose thanks so much for your help. All this is useful. Will button test on the suspect pins. Cheers!

still notch
pliant pebble
#

Brain Hat on RPI Bullseye

light mural
#

Question: what would be the best product for powering and charging a pi zero 2 w with lipo

#

preferably with usbc but not 100% a requirement as I could swap the port manually

worn oak
#

`pi@grpi:~ $ speaker-test

speaker-test 1.1.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
Playback open error: -2,No such file or directory`

worn oak
#

fixed it, purged pulseaudio and removed ~/.asoundrc

potent hedge
#

I suspect I'm gonna have to reinstall my 4b - it threw up in the middle of a headless upgrade to bullseye...

#

I can't find the weird hdmi adapter for it though

worn oak
#

ssh?

potent hedge
#

Yeah, I just upgraded an original B successfully right before.

#

So nothing in theory wrong with my procedure

heady cedar
#

Any Mac users using Disk Utility to make backups of their Raspberry Pi SD cards? I used to use Disk Utility, New Image > DVD/CD Master Image, then rename it with an .iso extension, then I could etch it to a new SD card using balenaEtcher. I'm on BigSur now & haven't done this in a while, but the imaging is way faster than it ever was before (used to take about 20 mins), but the image, when copied with etcher, doesn't boot the pi. I know you can use terminal commands, but that's an ugly alternative b/c the prompt just remains bank after a press until the process is done (you can repeatedly press CTRL+T for updates on status, but it's very unfriendly). If folks have a better alternative (GUIs are always nice for new users) would love to hear what you use. Thanks!

civic rune
#

Would appreciate pointers for backup software on windows as well

cobalt estuary
#

Hello I found trouble starting bluetoothctl on a raspberry pi zero w

#

I am using raspberry pi lite with the latest update

#

Linux raspberrypi 5.10.63+ #1459 Wed Oct 6 16:40:27 BST 2021 armv6l GNU/Linux

#

and bluetoothctl version 5.50

#

whenever I start the bluetooth I get stuck as you see in the screenshot

#

any advice on how to debug the problem ?

lyric oak
rocky cove
#

Hi ๐Ÿ‘‹ I am new to using pico-sdk library, but how can I change my board configuration? I am using Adafruit Qt Py RP2040, and I have not found a way how to switch the board from pico.h to adafruit_qtpy_rp2040.h. I am also having trouble with the pin numbering. If I want to use C/C++ for coding, where I can find a pinout for Qt Py RP2040 with numbers?

lost wolf
#

The GPIO numbers are the ones I think you're looking for.

rocky cove
lost wolf
#

Like I said, I can't help with most of that. ๐Ÿ˜„ I don't know anything about using the pico-sdk, unfortunately. Someone else may be able to help. But please be patient, most folks here are community members volunteering their time when they can.

#

If that's how it works, I would assume it would be gpio_put(26, true) for "A3"? But like I said, I'm stretching a guess here.

rocky cove
#

Yes, thank you. I will play with it for a while. But I see that the GPIO numbering is what I was looking for. Thank you once more for your time ๐Ÿ˜Š

lost wolf
#

You're entirely welcome! Glad I had something to offer!

elder palm
#

so im trying to use raspberry pi imager, i get this message when i try to write the recommended os to sd card. Error downloading, http/2stream 1 was not closed cleanly before end of the underlying stream - server ip <numbers listed here>

#

what does this mean?

civic rune
#

possibly a shaky internet connection?

steady rose
elder palm
#

once i download it do i use imager then to put it on the sd card?

steady rose
#

maybe something happening with their servers right now

#

i just got that launching the imager

elder palm
#

well its been happening for two days now

steady rose
#

but once you download the file, you can select it in the imager

#

"CHOOSE OS" button, and then scroll to last option

#

the "Use custom" option

#

just relaunched that app and it worked second time

#

so not sure what might be happening

elder palm
#

thanks i'll give that a try

#

its been so frustrating. can't get the hyperpixel 4 to work, so trying to see if downloading the os fresh might do the trick

steady rose
#

might want to check with pimoroni too. the latest OS could be breaking things.

#

that unfortunately happens

#

lots of under the hood linux changes that libraries then have to catch up to

pulsar trellis
#

hi, im trying to make the raspberry pi into a rubber ducky, the problem is that i did all the steps from diferrenrent guides, but it dosent run the code when plugged to the computer, it opens it as Drive E

heady cedar
#

Anyone with experience with mosquitto / paho mqtt on the Raspberry Pi? I've used this to send commands to the Pi to do things like play sounds & move a robot, but for some reason on my new Pi with Bullseye installed, I can't seem to get a connection to work with the same code. Output below:

  File "/home/pi/control-pibot.py", line 119, in <module>
    mqttClient.connect(serverAddress)
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused```
ruby night
# heady cedar Anyone with experience with mosquitto / paho mqtt on the Raspberry Pi? I've used...

FWIW -I was able to run this example on a Raspberry Pi Zero 2w with BullsEye ```
import random

from paho.mqtt import client as mqtt_client

broker = 'nam1.cloud.thethings.network'
port = 1883
topic = "REDACTED"

generate client ID with pub prefix randomly

client_id = f'python-mqtt-{random.randint(0, 100)}'
username = 'testv3application@ttn'
password = 'REDACTED`

def connect_mqtt() -> mqtt_client:
def on_connect(client, userdata, flags, rc):
if rc == 0:
print("Connected to MQTT Broker!")
else:
print("Failed to connect, return code %d\n", rc)

client = mqtt_client.Client(client_id)
client.username_pw_set(username, password)
client.on_connect = on_connect
client.connect(broker, port)
return client

def subscribe(client: mqtt_client):
def on_message(client, userdata, msg):
print(f"Received {msg.payload.decode()} from {msg.topic} topic")

client.subscribe(topic)
client.on_message = on_message

def run():
client = connect_mqtt()
subscribe(client)
client.loop_forever()

if name == 'main':
run()

heady cedar
#

Thx @ruby night I'm running my own mosquitto broker on the same pi as the client. I've not used thethings network. I'll give your code a look and see if I can get a connection happening from my Pi. I suspect it's an issue with the local mosquitto server, given the error, but any leads I can investigate / eliminate are useful.

civic rune
#

I'm looking to back up and image of my pi onto a flashdrive in order to back it up to the cloud. Is there a canonical/preferred method of doing that? Everything I've tried to do on the pi has had a half dozen methods of doing the "same" action.

#

or is it better to take the SD card out of the pi and use my windows machine somehow?

steady rose
#

there is no canonical way. just use whichever seems easiest given your setup.

civic rune
#

ok thanks. Real computers are confusing sometimes. Per that guide I'm supposed to run
sudo dd if=/dev/mmcblk0 of=[mount point]/myimg.img bs=1M
my call to lsblk produced the following (image incoming)

#

so does my call become sudo dd if=/dev/mmcblk0 of=/media/pi/pi_backup/myimg.img bs=1M?

#

I can mostly parse this, but what does bs=1M do?

faint sparrow
civic rune
#

was just there. Didn't initially realize that the bs parameter was related to dd

#

thx

#

sudo dd if=/dev/mmcblk0 of=/media/pi/pi_backup/myimg.img bs=1M doesn't seem to have any print outputs to tell status. Should I just wait?

steady rose
#

yep

#

dd is like that

faint sparrow
#

I haven't done that for a couple of years but back then it didn't show anything unless there was an around or it was done

civic rune
#

ok I'll just try to exercise patience

faint sparrow
#

GUI wrapped around it will usually show a warning that it will destroy all data on the media etc and show progress bar

#

but DD by itself isn't very friendly

steady rose
#

there's a way, by teeing or some other hook. but it's a hackish extra step. in general. just wait.

#

dd is a low level tool

faint sparrow
#

btw if your linux is on the boot don't forget you can switch tty

#

and do something else

civic rune
#

my linux on the boot?

faint sparrow
#

if it's on the multi-user multi-apps mode

civic rune
#

how can I tell that? It's just a stock pi with the latest raspbian installed

faint sparrow
#

not sure if it works on pi

#

but try CTRL+ALT+Fn keys.

#

ie: ctrl+alt+f1 for tty1 ctrl+alt+f2 for tty2 etc

civic rune
#

will that interrupt my process?

#

let me look up what tty is

faint sparrow
#

no, it won't let you if it's not in multi-user multi-apps mode

#

tty is just another session

#

you usually have 8 virtual sessions built-in in linux (ie: 8 possible sessions in local)

#

I often use that on my always up linux server so I can concentrate on web hosting process in a tty, mud/game server in another/ ftp in the 3rd etc

civic rune
#

When I open another shell while one is running, is that using another session?

faint sparrow
#

it's a tty in linux world, and yeah it will spawn another thread on the tty executable

#

that won't bother dd unless you use the media it's operating on

civic rune
#

I got this message. Does everything seem OK?

#

Ah hard to see, one sec

faint sparrow
#

it's similar to connecting to another user throught RDP on windows except very lightweight and with a terminal

civic rune
faint sparrow
#

just need to be careful with TTY7 because sometimes that's Xwindow and might be too much for a pi

civic rune
#

Interesting

faint sparrow
#

might also want to lookup runlevel along with tty

#

if you are 100% sure you are never going to use it might as well not run in the runlevel that allows it to not waste the additional ressources

civic rune
#

ok thanks. Thoughts on the output I got? It seems right

faint sparrow
#

the general output seems okay but can't validate the 16gb or if you followed the guide correctly. I have a pi 2 that have like 4 or 8gb...

heady cedar
#

Still struggling to get my mosquitto set up as a broker on the same machine as my Pi & unsure what's going on. Same conf I'd used previously, just with latest software (Pi & paho-mqtt). When I try:
mosquitto_sub -h localhost -t โ€œtest"
I can connect but
mosquitto_sub -h profgpi -t โ€œtest"
gets Error: Connection refused
I have also added as allow_anonymous true line to mosquitto.conf. And as would be expected from above, I get active from systemctl is-active mosquitto Any thoughts?

faint sparrow
#

so I couldn't do a 16gb backup partition on it

civic rune
faint sparrow
#

can't even install windows 10 IoT on it

#

Like it said to contact microsoft at somne windows 10 IoT support chat so they can facepalm and sigh at me for an hour ๐Ÿคฃ

civic rune
#

lol

faint sparrow
#

I bought one 4 years ago and forgot it under a pile of xbox games boxes

#

was still connected to my TV and running for 4 years when I found it. Was like 1 clicck away from ordering one since I didn't think I had one ๐Ÿคฃ

civic rune
#

Ordering another pi 2 or a pi 3 or 4?

faint sparrow
#

I would have done pi4 but I don't really need something powerful because some microcontroller are almost as fast as the newest pi4

#

like the latest grand central or the teensy 4.1

civic rune
#

can you disable wifi on a pi? I don't think it's likely that someone would try to hack our installation, and the consequences wouldn't be severe, but it might be nice to make it so someone can't sneak in. Would the pi need to be in range of wifi in the first place for that to happen?

faint sparrow
#

which confuse me even more btw between if a pi is even necessary anymore, I understand the differences but they seem to be blurring lately

civic rune
#

pi was good for me because pygame is such a useful library for playing music and tracking position in the music

faint sparrow
#

something like a teensy 4.1 is reallt powerful, can do tons of gpios in real-time...

#

that's why I'm holding on to my pi2 until I can understand why it would be necessary to upgrade

civic rune
#

thoughts on my security concern?

faint sparrow
#

my model of the pi need a usb nanowifi dongle to have wifi so

#

and it already doesn't have a big range because it's so small

civic rune
#

after starting pishrink I got the message that:
The filesystem on /dev/loop0 is now 940923 (4k) blocks long.
What does this mean?

faint sparrow
#

but to attempt to answer from google it seems you can do it from the default raspberry pi desktop or otherwise it reduce to a can a disable wifi on linux problem

#

and for the linux problem every distro has a config file somewhere in /etc to do so

civic rune
#

cool thanks

#

I might disable wifi in the future, we'll see

faint sparrow
#

but that also mean you will need an ethernet cable to connect to it remotly

#

until you turn wifi back on

#

obvious but need to be stated ๐Ÿ˜„

faint sparrow
#

give me a sec

civic rune
#

wow pi-shrink shrank it from 15 GB to 1.3 GB

#

hmm, I can't eject my flashdrive because it says bash is using it.

#

ahh, I need to cd out of there

faint sparrow
#

oh loop is just ffor mounting image files

#

4k blocks is logical blocks size, 940923 * 4k longs in this case mean 3.5gb

#

do you have an sdcard in around 4gb or 8gb?

#

you can type mnt to see a list of what is mounted

faint sparrow
#

once you are sure bash isn't using it anymore in any tty

civic rune
#

I know how do to just do cd .. to go upwards, but how can I get back to pi@rasberrypi:~ $?

#

in one swoop

faint sparrow
#

cd ~ or cd /

#

~ย means home

#

don't know what home is on your device

civic rune
#

ahhh

#

I think it's ~

#

ok let me try that

#

that worked, I was able to eject

faint sparrow
#

make sure you use sudo and not su until you are skilled with linux

civic rune
#

yeah I am decidedly not. I just use sudo wherever guides tell me to.

faint sparrow
#

same for SSHing with root etc

civic rune
#

Thanks for all your input. Quite valuable.

#

I don't plan to SSH into any of these

faint sparrow
#

you could brick your pi if you accidently break something as root as with a random command in su and you'd have to reinstall from zero

#

but no need to search something like what does command X does on raspberry pi to get a good idea generally

#

what does command X does on linux is sufficient. You are using linux 1st, a pi 2nd

cold pilot
#

Is this where I'd ask about pi pico stuff?
I am just trying to make sense of using the pi pico as an HID and needing to drive 12 LEDs with power from the USB port.
I'd just hook them up to VBUS, in parallel and then a resistor before any of GND pins, right?

#

I want to control them, but I'm thinking I'd better do that through some transistors

civic rune
#

It's been recommended to me not to drive LED's directly from GPIO pins, I would recommend transistors

snow timber
# heady cedar Thx <@!343570430042308609> I'm running my own mosquitto broker on the same pi as...

if you've verified the service is running (sudo service mosquitto status for example), see if you can do sudo netstat -aon | grep 1883 and see if returns anything (aka is the broken listening on the expected port (assuming 1883)) and if so, which ip(s). If configured to use SSL, then might need to configure a TLS setting to say 1.2. Hopefully, it's not firewalled on itself. Oh and just saw your replied where it shows running and works to localhost.. is profgpi the name in /etc/hosts going to the localhost address? What does sudo hostnamectl show for the hostname?

hardy plaza
heady cedar
#

I'm getting closer on getting mosquitto running on my Pi. Problems left seem like Pi config experts can help. One:
I had been booting mosquitto automatically using:
sudo systemctl enable mosquitto.service
The only way I can get mosquitto to boot with the conf file is via:
mosquitto -c /etc/mosquitto/conf.d/mosquitto.conf
Is there a way to enable the mosquitto service with the .conf file by default?
Also - I must have some sort of permissions thing happening that I don't understsand. When I run:
mosquitto -c /etc/mosquitto/conf.d/mosquitto.conf
1637422507: Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.
Code doesn't crash, but this error shows up. I had to comment out the include & pid_file lines in the conf file to get things to run at all. At least I've got things running, @snow timber

heady cedar
#

Did same install I'd done earlier with Bullseye, but now all of a sudden the audio test & aplay play static instead of expected sounds. Have tried two different speakers. Any ideas? Thx!

#

Here is the command & output. Produces complete static - like no radio station on the dial:


speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 2097152
Period size range from 64 to 699051
Using max buffer size 2097152
Periods = 4
was set period_size = 524288
was set buffer_size = 2097152
 0 - Front Left
Time per period = 11.016858```
Have tried two working hamburger-style speakers plugged directly into Pi 3 A+'s speaker jack. raspi-config says headphones is the audio setup, which is what had been working before.
#

Other strange thing on audio issue. If I log in via VNC, open VLC player, load a local sound, and play it, it plays fine through the desktop. But through terminal the speaker-test or a simple aplay of the mp3 file comes up all static.
If I aplay, the output says:
Playing raw data 'gobble.mp3' : Unsigned 8 bit, Rate 8000 Hz, Mono
(yes, that is a turkey sound I'm trying to play).

#

And more weirdness on sound. Python code via pygame worked, even though these commands didn't.

faint sparrow
#

@heady cedar happened to run into speaker-test today.

#

Try a sine wave.

faint sparrow
#
 $ cd /var/lib/dpkg/info/
 $ egrep freedesk *list | egrep front | egrep oga
sound-theme-freedesktop.list:/usr/share/sounds/freedesktop/stereo/audio-channel-front-center.oga
sound-theme-freedesktop.list:/usr/share/sounds/freedesktop/stereo/audio-channel-front-left.oga
sound-theme-freedesktop.list:/usr/share/sounds/freedesktop/stereo/audio-channel-front-right.oga
#

Two of those were used by some command line thing that tests audio. I don't remember what invoked them.

#

I just used Audacity (very simply) to emulate the same exact test. ;)

#

Basically a person saying "Front, Left" or "Front, Right" or "Front, Center".

#

Apparently the command line program adjusted the balance so that only one speaker or the other would play (for Left and Right tests).

#

GNOME based installs probably included this; I was careful to install no GNOME stuff at all (as much as I could) for Bullseye (amd64, not for the RPi, in all of this).

heady cedar
#

Thx @faint sparrow Yes, the behavior is very strange. Speaker works playing .mp3s from Python using pygame, which is what I want, but I had using the speaker-test in my tutorial for students. Pretty sure I ran it under same exact bullseye install but got those different test results. Not a big deal, but was wondering if there was something simple I missed.

drowsy steppe
#

I want my Pi to be able to survive a power outage, but UPS's are expensive. So... would putting a Pi on a power bank work (assuming the bank could provide enough current, of course)?

heady cedar
#

In case anyone else runs across the mosquitto config issues moving to 2.0, you can still allow anonymous connections (which I needed to continue for an app I wrote that connected to the Pi).
Just add a connect.conf in directory: /etc/mosquitto/conf.d with just:
port 1883
include_dir /etc/mosquitto/conf.d

zinc jackal
drowsy steppe
zinc jackal
#

Yarp, or DIY.

drowsy steppe
zinc jackal
#

"Yes"

drowsy steppe
zinc jackal
#

Watch a film called "Hot Fuzz". ๐Ÿ™‚

faint sparrow
#

My bench supply ($85 Korad) said the RPi4 drew about 800 mA routinely, but also requires > 1200 mA during start-up (from a power-off condition).

#

I'd be comfortable with a minimum of 20,000 mAH but how long that'd last is another question.

zinc jackal
#

I really should get my powerbank/desk supply done.

drowsy steppe
faint sparrow
#

Yeah if you can get it to automatically switch to the battery only when a wired supply fails that'd be great.

zinc jackal
#

I'm looking at a couple of 12v SLA batteries and some 18650 packs, so I can get 12v and 5v to my desk.

faint sparrow
#

Adafruit target boards that have battery connections (JST) have the right circuit to do that (create a fail-over).

heady cedar
#

I'm trying to understand why a systemctl service isn't working. From the output below it looks like I'm having a problem importing adafruit_cricket, which works when executing the code (control-pibot.py) from the command line, just not via the systemctl.
My service script:
pibot-mqttclient.service
can be found here:
https://github.com/gallaugher/crickit-pi-bot/blob/main/pibot-mqttclient.service
So when I use the command:
systemctl is-active pibot-mqttclient.service
I get a message:
failed
I'm still pretty new to the whole system log thing, but this should also be running on boot & when looking at:
journalctl -b -e
I can see:

Nov 21 19:39:20 profgpi python3[1230]:   File "/home/pi/control-pibot.py", line 23, in <module>
Nov 21 19:39:20 profgpi python3[1230]:     from adafruit_crickit import crickit
Nov 21 19:39:20 profgpi python3[1230]: ModuleNotFoundError: No module named 'adafruit_crickit'
Nov 21 19:39:20 profgpi systemd[1]: pibot-mqttclient.service: Main process exited, code=exited, status=1/FAILURE
Nov 21 19:39:20 profgpi systemd[1]: pibot-mqttclient.service: Failed with result 'exit-code'.```
But again, this code runs fine when executed from the prompt as
`python control-pibot.py`
The python code absolutely does what it's supposed to do from that point on. Any idea what I'm doing wrong? Thanks!
GitHub

A robot using an Adafruit Crickit and a Raspberry Pi - crickit-pi-bot/pibot-mqttclient.service at main ยท gallaugher/crickit-pi-bot

kind spindle
#

Anyone have a good example code or project for using Raspberry PI as a bluetooth BLE or classic bluetooth server device? I would like to connect to the RPI B3+ from my phone. I want to send/receive simple commands

civic rune
#

Or if less expensive then less reliable

hardy plaza
faint sparrow
#

@civic rune a UPS starts with a battery .. and an oscillator.

#

The Adafruit target board load-switching scheme assumes two stable DC power supplies at exact voltages.

#

It selects between the two, and, I think, ensures power delivery is constant enough to guarantee no interruption in service to the client device.

dusky pivot
#

I have an Ulimate GPS Hat plugged into my RPi. I am trying to find a guide to let me use the RTC to set my system time. All I have found is a guide for the i2c module. Any help is appreciated. Thanks.

faint sparrow
#

@dusky pivot I'd mount the VFAT type volume and look at the config file(s) first.

#

I saw this but don't remember what obtained.

dusky pivot
#

@faint sparrow yep, thats the i2c guide i was talking about. my gps hat uses UART though.

dusky pivot
distant monolith
#

Does anyone know if there is a formula to know how big your input voltage can be for an opamp with a given slewrate, to stay under that slewrate

#

So there is no distortion

vocal lava
#

I've hooked up an arcade button with an LED to my Pi 2 to gracefully shut it down and boot up following this guide: https://www.embeddedcomputing.com/technology/open-source/development-kits/raspberry-pi-power-up-and-shutdown-with-a-physical-button - however, the LED stays always on, I would expect it to turn off when the Pi is off. I have the LED plugged into the 5v power and GPIO 7. Any suggestions?

#

I did add gpio=7=op,dh to my config.txt and tried #4 as well in case I had them backwards (I can never remember how the numbering works)

turbid rivet
vocal lava
#

If I used the ground and GPIO the light never turned on - I'll try the 3v now. Thank you!

turbid rivet
#

For GPIO-GND, make sure the positive end of the LED is on the GPIO, and the negative side on the ground, and the GPIO is high on startup.

vocal lava
#

thanks, will try that

#

got it! Thank you @turbid rivet

#

Now I can gracefully shut down my Pi connected to my 3d printer!

still notch
#

i am using RPI with Adafruit motor HAT. I hook up a Stepper motor. Go through examples. These work great. MY CHALLENGE is the stepper motor is being sent power (constantly hear a click and the motor itself is getting hot) after the python code runs. Is there a way to disable/enable? It seems once I do a command like kit.stepper1.onestep() the stepper motor continues to get power.?

hardy plaza
still notch
#

@hardy plaza Thank you. I understand holding position as expected behavior. But if I have code running on the RPI 7/24, the stepper motor is going to burn out and it's wasting power. ??

hardy plaza
#

There may be a hardware or software enable you can use if you want to power down the motor. I donโ€™t know the specifics of that controller

#

Maybe a pin labeled โ€œENโ€?

still notch
#

@hardy plaza I'll look. Seems to me this is something that would be important to expose at the abstract level. But....hmmmm....

faint sparrow
#

I would cut off power with a transistor as a starting point.

#

Maybe a solid state relay.

#

Battery powered projects that operate for many hours are (imo) non-trivial to implement.

hardy plaza
#

Thereโ€™s the Pimoroni H10 digital switch, an I2C controlled switch that can handle 40v @ 10A. But youโ€™d need two of them.

faint sparrow
#

meanwhile if someone use an exotic power source at my fablab it becomes a topic of discussion for 3 hours

#

I bought a mystery power supply at a hamfest and waited years before experimenting with it.
Turns out it's a 12 VDC power supply that can deliver 'quite a bit' of current (> 10A but I think it may be closer to 20 A).

#

Weighs as much as my old Astron did.

#

the old school guy I'm listening to explain how to be careful with old electronics by using a variable regulated power supply

#

ie: add 5-10V to it every hour monitoring for stored power and temperature until you reach the rated voltage

#

stored power as in he once had an electronics that used 12V and would have 2000V stored in it after a few hours

#

When re-forming electrolytic capacitors on vintage (tube type) radios something like that can be done, to avoid popping them when full power is applied.

#

.

turbid rivet
#

Try kit.stepper1.release() when you get a chance.

heady cedar
#

Pi friends, I can use help figuring out why my systemctl service script isn't executing. It's supposed to run a python script after the mosquitto client is running. I think this is a systemctl issue, not a mosquitto issue. The mosquitto client does run on boot, but the script, called pibot-mqttclient.service, fails.
I'm new to diagnosing these problems, but if I enter the command:
journalctl -b -e
the output is:

Nov 23 14:48:47 profgpi systemd[1]: pibot-mqttclient.service: Main process exited, code=exited, status=1/FAILURE
Nov 23 14:48:47 profgpi systemd[1]: pibot-mqttclient.service: Failed with result 'exit-code'.```
The `adafruit_crickit` module is definitely there because I can execute this python code that's supposed to be executed by the service by typing the following into the prompt:
`python control-pibot.py`
The `pibot-mqttclient.service` script I'm trying to run, but that's failing, is:
```[Unit]
Description=Pibot MQTT Script Service
After=mosquitto.service
[Service]
Type=idle
ExecStart=/usr/bin/python /home/pi/control-pibot.py
Restart=always
[Install]
WantedBy=multi-user.target```
Any ideas are most welcome!
steady rose
#

could be issue with how library module was installed vs. how script is run in terms of user

#

sudo python control-pibot.py

#

^^ does that also run ok?

heady cedar
#

Ah @steady rose I think you've found out what's up! Running under sudo fails with that same error! So I assume this means that I need to modify my systemctl service so that it runs under the pi user instead of sudo (assuming that what you've pointed out is sudo must be what's running at startup). I assume I'd change this line:
ExecStart=/usr/bin/python /home/pi/control-pibot.py
It's not clear to me that this is running as the root user, or how I might switch this so it runs under pi, if that's what I need to do. Thx again for your patience (and expertise).

steady rose
#

running as root is default

#

i haven't actually done this, but there's probably a way to specify a user id for the service to run as

#

so, yep, use that and set it to be the pi user

#

try adding a User= entry

heady cedar
#

@steady rose that works! Thank you for sharing your gifts. If you're somewhere that celebrates Thanksgiving, wishing you a happy. And may your sauce always be awesome!

rustic karma
#

Hello, I build a little circuit with a raspberry,npn transistor and led. I can turn on/off the led with the rpi over gpio. Then I thought putting out the led for another raspberry to turn it on/off. But I does not work like the LED. Why?

ripe berry
#

Is there a place to get old discontinued Raspberry Piโ€™s? Iโ€™d like to get a spare RPi 2 for a project, but the ones on eBay are ridiculously overpriced. Wondering if thereโ€™s a site like swappa.com for R Pi?

solemn finch
#

why not just use a newer one?

ripe berry
#

The software Iโ€™m using is not compatible with Python 3.

rustic karma
#

why is that a problem ?

#

on any rpi you can run python2

civic rune
#

I have pi that I need to get an MP3 off of onto a flashdrive, but it's telling me the MP3 is write only. I tried:
sudo cp myfile.mp3 /pi/media/my_flashdrive
but it didn't work. What can I try next?

#

please ping me, I'm gonna be away from my PC

rustic karma
#

@civic rune maybe mount the flashdrive first ?

civic rune
#

What do you mean by mount? It's plugged in and showing up

rustic karma
#

sudo mount /dev/sdb1 /media/usb

civic rune
#

What does that do?

rustic karma
#

it mounts a device on /media/usb

#

I think you need to look up which device is your flashdrive in /dev/

civic rune
#

Huh

rustic karma
#

then mount it on media

civic rune
#

It showed up in media in the file system

rustic karma
#

what filesystem does it have

civic rune
#

What's "it" here?

rustic karma
#

it is flashdrive ?

civic rune
#

Yeah

rustic karma
#

wdym ?

#

also make sure the flashdrive is also writeable

civic rune
#

You asked if it's a flash drive, I indicated yes it is. I may have gotten myself confused. I've used this drive on a separate pi before with no issues

#

I wonder if the problem is that the code running on the pi in question is being used

rustic karma
#

hmm maybe it is corrupt

#

type blkid

civic rune
#

Let me head over there and try that, got caught up in another task

#

Is it the flash drive?

rustic karma
#

it=flashdrive

#

I don t understand, what could it be else ?

civic rune
#

Yeah I don't either

#

But the drive seems fine to me.

#

Interesting, there's no "eject" button for the drive

rustic karma
#

๐Ÿ˜†

civic rune
#

What does that mean?

#

Do i need to mount it?

rustic karma
#

you confused me and I don tunderstand you. funny to me

civic rune
#

What was confusing? I can be more clear

ripe berry
# rustic karma why is that a problem ?

I should say then, that the micro SD card with all the software I worked on for months will not boot in an RPi 3, but does just fine in the two RPi 2Bโ€™s I have but one of them is less than ideal for a spare. Iโ€™m not interested in redoing all my software, which brings us back to the original question. Is there a web site where you can get an RPi 2?

rustic karma
#

so your rpi2 is dead and you want a new one ?

#

did you make a backup of you system ?

ripe berry
#

Perhaps I incorrectly assumed it was because the system on the microSD card is not using Python 3 and the software Iโ€™m using will not run on Python 3.

ripe berry
#

Iโ€™d like to just pop in the microSD card so I donโ€™t have to rewrite everything like I would for a newer RPi, which will not boot up from the microSD card that works just fine in an RPi 2.

#

So, is there a site you know of where people can get an RPi 2B besides eBay?

civic rune
#

Is it possible to eject the flash drive from the terminal? I'm worried something went wrong

ripe berry
civic rune
#

Thanks. I'm gonna try a known good flash drive. Windows complains that this one needs to be fixed sometimes. Should have just used the known good one to start

civic rune
#

So would it be umount /dev/sda?

ripe berry
#

sda should be the system disk

#

much simpler ๐Ÿ‘†

civic rune
#

My flash drive is Patriot brand and the drive under SDA is labeled as "patriot memory"

ripe berry
#

Hm. Must be different. How does using the method in the video work for you?

civic rune
#

I'm checking it out now. I have bad reception here so it's not loading quickly

turbid rivet
civic rune
#

Hmm, running ls in /media doesn't show my drive

#

But it does show up in /media/pi

turbid rivet
civic rune
#

Do I run cd /dev first?

#

I don't see the drive there

turbid rivet
#

I know the ls command can take a filepath arg to look in a directory other than your current one.

#

There's nothing in dev?

civic rune
#

Ok, I ran cd /dev first

#

Oh there's a bunch of stuff there, just not my flashdrive

#

ls in /media/pi shows only my flash drive

#

Can I run sudo umount my_drive there?

turbid rivet
#

Oh, umount? Yeah, that's fine

#

Should work

civic rune
#

Let me try it thanks. Is it actually mounted?

turbid rivet
#

sudo umount /media/pi/flashdrive should work

#

I believe so?

#

One way to find out

civic rune
#

Hmm it says it's busy

turbid rivet
#

Are you in the flashdrive directory?

#

You'll have to back out of it first, then make sure it's not reading or writing any data to it.

civic rune
#

I've backed out of all of them, let me double check

#

I've closed all windows besides the terminal that's pointing at /media/pi

turbid rivet
#

Worst comes to worst, you can try shutting down, unplugging, and then restarting haha

civic rune
#

Lol

#

Yeah

#

I think I'll do that

#

Didn't actually think of that, thanks

#

Any idea why I can rename a file? I'm getting permission denied errors

#

And any idea why an MP3 would be read only?

steady rose
#

ls -l to see what's set, who owns, etc.

civic rune
#

Ok thanks. I think I made a problem for myself by misusing sudo cp. I thought my drive was in pi/media but I actually seem to have copied and renamed the file to the name of my drive.

Having the same issue of no mounted flash drive/no eject button with a known good drive

#

My drive shows up as a drive on the desktop but no way to eject it

#

My file is on the desktop, do these commands move it to my flash drive? The drive is in /media/pi/pi_backup where pi_backup is the name of the drive.

cd Desktop
sudo cp my_file.mp3 /media/pi/pi_backup

?

#

man cp seems to indicate I'm right but I'm not sure

steady rose
#

yes

#

but you may not need sudo

civic rune
#

Let me try it. Any idea why the drives aren't showing up as normal?

steady rose
#

it's likely mounted such that user pi has access

#

ls -l /media/pi

civic rune
#

Now the desktop is frozen :(

steady rose
#

can then check what pi_backup has

civic rune
#

What do you mean by "what pi_backup has"?

steady rose
#

in terms of permissions and ownership

civic rune
#

Ahh ok. I had to reboot, let me try what you're saying. Any idea why flash drives are not mounting as normal? I have no documentation as to what's been done to this pi

#

Do I include the file extension when I cp?

steady rose
#

"flash drive" = like a USB thumb drive?

civic rune
#

Like cp myfile.mp3?

civic rune
steady rose
#

what do you mean by normal?

civic rune
#

It shows up on the desktop but doesn't show up in the usual place in the file explorer and there's no option to eject. umount gave me a "target is busy" error

steady rose
#

what shows up on desktop?

#

an icon?

civic rune
#

Yeah looks like an old fashioned mech hard drive

steady rose
#

if you double click it, what happens?

civic rune
#

Opens up in /media/pi as /media/pi/pi_backup

steady rose
#

what happens on the desktop? does a new window open?

civic rune
#

Yup new file explorer window

steady rose
#

with that window open, does it then show up as expected in file explorer?

civic rune
#

I'm gonna try cp my_music.mp3 /media/pi/pi_backup unless something seems wrong there.

civic rune
steady rose
#

in the file explorer window that does open up, can you navigate around ok?

civic rune
civic rune
steady rose
#

weird. not sure why it shows up there but not in another.

#

what does ls -l /media/pi show?

tired marsh
#

what is pi_backup ?

civic rune
#

Ok even with sudo I get the error
cp: cannot create regular file /media/pi/pi_backup/mymusic.mp3 Permission Denied

civic rune
civic rune
#

Here's what I get. Had to walk over into wifi range.

#

That long string is an MP3 that I mis copied (renamed it it seems to the name of my flash drive)

#

My old flash drive that I took out

steady rose
#

it's owned by user pi and has read/write/execute permissions

#

what does df -T -H show?

civic rune
#

One sec, had to help someone with something, be right back

#

What directory should I be in?

#

One sec, pic incoming

#

Drat you can't see the bottom one. I have to walk back and forth to get wifi signal

#

It's my drive it says /media/pi/pi_backup

#

What does this show me?

steady rose
#

no worries. that photos is good enough.

civic rune
#

What would your next step be? Idk what the people who set this up did to the mp3 to make it so inaccessible

#

Or to make flash drives mount wrong

steady rose
#

ls /media/pi/pi_backup

#

can you even ls its contents?

civic rune
#

Yes it shows the files

steady rose
#

ok, try touch /media/pi/pi_backup/foo.txt

civic rune
#

Permission denied

#

All I have done with this drive is create an rpi image on it (separate pi)

#

It was formatted as NTFS

steady rose
#

yep. and it mounted as such.

#

not sure if you need anything extra to actually access it though?

civic rune
#

Let me try copying another file over

steady rose
#

i'd think if it mounted, you'd have ntfs support also

civic rune
#

Hmmm

#

I can't copy any files to it

#

Try a third flash drive?

steady rose
#

in the desktop file explorer thing - you're seeing the same stuff as ls?

civic rune
#

Yup

steady rose
#

can you create a new file/folder via that interface?

civic rune
#

In the flasg drive or elsewhere?

#

Permission denied in the flash drive

steady rose
#

the flash drive. double click on whatever icon shows up on desktop. and then in there, create a new folder.

civic rune
#

Cannot create a new folder nor new file

steady rose
#

sudo chmod 777 /media/pi/pi_backup

civic rune
#

What does that do?

steady rose
#

getting desperate, but see if that takes and helps

#

it opens it wide up in terms of permissions

civic rune
#

Ahh ok, that ran without issue. Let me try again

#

Same error

steady rose
#

i maybe ntfs related, but not sure

#

could also be something with desktop interfering

civic rune
#

I cannot even rename files on the pi....

#

What the heck did they do to this thing?!

#

Should I try a third flash drive?

steady rose
#

you have permission issues even outside of that flash drive?

civic rune
#

Yeah

#

I think?

steady rose
#

touch ~/foo.txt

civic rune
#

Let me try copying a file to another directory on the pi

#

Would that help?

steady rose
#

not sure. seems like something bigger is happening if you can't even create things in the local fs

civic rune
#

Yeah I can't copy the mp3 from the desktop to anywhere

steady rose
#

ok, something else is happening. but don't know what.

civic rune
#

Dang ok.

#

I really need to get this file off. Is there a way to get it off of the micro sd card?

steady rose
#

you're logged in as user pi based on the prompt

civic rune
#

Yeah there's no other user

#

I don't think

steady rose
#

does it boot directly into desktop? or do you have to enter id/password?

civic rune
#

Directly into desktop. I get the "ssh is enabled and default login is used" message

steady rose
#

that means user pi has password raspberry

civic rune
#

Yeah

#

This thing is away from wifi so I'm not worried about wireless intrusion

steady rose
#

i'd try a reboot at this point. and then after logging in, try to do something in the pi home directory

#

something seems really unhappy if you can't even access your own local files and folders

civic rune
#

Yeah the people who created the Mp3 (its a combo of songs) aren't here anymore and they didn't back it up anywhere...

#

What do you mean by "try to so something in the pi home directory"?

steady rose
#

try creating a file, renaming a file, etc.

#

just anything that should just work

civic rune
#

How can I create a file? With touch?

steady rose
#

don't worry about flash drive at this point

faint sparrow
#

try touch OatsNHoneyHello.txt

steady rose
#

yes. can use touch.

faint sparrow
#

and cat OatsNHoneyHello.txt

steady rose
#

it'll create a blank file with whatever filename

civic rune
#

touch foo.txt worked

steady rose
#

just now? without any changes?

civic rune
#

Yup

steady rose
#

pwd

civic rune
#

Where would that be created so I can look at it? I was just in ~

steady rose
#

where are you currently located?

civic rune
#

/home/pi

#

Per pwd

steady rose
#

ok. and you did touch foo.txt and it worked?

civic rune
#

Yup I see the file

steady rose
#

hmm. now try touch ~/foo.txt

civic rune
#

That ran

steady rose
#

you got permission error before with same thing?

#

what changed?

civic rune
#

Nope this is the first time I've tried touch on the pis filesystem itself.

#

Ok I was able to copy the music to another part of the pi. Let me see if I can copy it to the flash drive now using the GUI

#

Permission error

faint sparrow
#

flash drive like a sd card ?

civic rune
#

No thumb drive

faint sparrow
#

maybe it's ntfs formatted instead of fat32 ?

steady rose
#

it is

faint sparrow
#

can you write on it in windows creating a file manually on it with notepad ?

civic rune
#

I can

faint sparrow
#

and does it says ntfs from windows drive properties ?

civic rune
#

Yes I used windows to format it as ntfs

faint sparrow
#

Linux doesn't work with NTFS, kinda challenging on a normal linux

#

so worse on PI

civic rune
#

I'm gonna be away from the system for a minute, I've been working long enough that I am managed to clock out. One moment

steady rose
#

^^ was wondering that. don't think i've ever tried it.

faint sparrow
#

you'll have to format it as FAT32, it works on windows because it was formatted with your windows account NTFS

#

format will delete all files, so save the ones you need

civic rune
#

Ok I'll have to come back to this, I'm currently building another system that I'm behind on. Thanks for your help folks

faint sparrow
#

no problem, I sucks at pi but not at linux ๐Ÿ˜„

#

I can't even login to my Pi anymore and don't even know where it is ๐Ÿ˜„

steady rose
#

it worked at least enough to be able to ls the contents

civic rune
#

What's weird is another pi had no issue creating an image of itself on the NTFS drive. In fact the guide required NTFS

faint sparrow
#

creating an image format the drive

civic rune
#

and I was able to add files from the other pi to it

faint sparrow
#

and change its boot record

#

adding a file is another it

#

plus you have to mount it rw for that

civic rune
#

Hm

faint sparrow
#

where did I lose you?

civic rune
#

I'm just confused as to why NTFS was fine for one pi and not for another

#

I guess the other pi could have an older OS that's incompatible

steady rose
#

if you were dding, then it generally would not come in to play

civic rune
#

What wouldn't come into play?

#

I was using dd

steady rose
#

the filesystem

#

dd is low level. so just does a direct copy.

civic rune
#

Hmm ok, I'll have to come back to this after my deadline is past

civic rune
#

Are there any actions I can take in the terminal to see if the file I want to copy is read only or something?

slim linden
#

I am unable to mount my raspberry pi pico's filesystem. The device is new and just arrived today. When I hold boolsel and plug it into my windows laptop the filesystem does not mount.

steady rose
#

double check USB cable

civic rune
#

@steady rose (moving here) I used the power off button and now the pi isn't powering on

#

After removing and reinserting the power cable

#

Act light is not blinking

steady rose
#

power button is just a simple NO type switch connected to GPIO?

civic rune
#

Yup

steady rose
#

and that just run a script that just runs sudo shutdown

civic rune
#

I've tested the power on/off before and it worked fine. Crud

#

My main code which is run on startup handles shutdown

steady rose
#

nothing with that should be affecting power cycling

civic rune
#

Yeah.

#

Shoot. I don't know what to do next

steady rose
#

what has changed since the last time the pi was power cycled?

civic rune
#

I added the cables that connect the pi hat to the relays I'm using

#

But they are only connected to the pi itself via the spi pins

#

And the shift registers

steady rose
#

if you've tried a few times and it's not powering

#

then need to work backwards to last known working setup

civic rune
#

Shoot.

steady rose
#

simply running sudo shutdown and cycling power should not cause this

civic rune
#

I'll try using another pi with the same micro sd card and see if the SD card got borked

#

I'm using subprocess.Popen() to do it

steady rose
#

generally same thing. that's just how you got to running shutdown from within python.

civic rune
#

Ok

#

Thoughts on the SD swap?

#

Nothing on the main pi is hot or anything like that

steady rose
#

is the red LED coming on? just nothing on ACT?

civic rune
#

Yes.

#

Nothing on ACT

steady rose
#

either swap SD card or remove everything from GPIO

#

whichever is easier

civic rune
#

Swap is easier. I'll try that.

#

Ok act is blinking on the new pi. Desktop seems to be coming up

#

So something about my wiring? Could having the mouse and HDMI plugged in do anything?

steady rose
#

it shouldn't

civic rune
#

Hm

steady rose
#

would suspect interference on GPIO first

civic rune
#

How would I test that? This is super weird

#

I've run it all plugged in without using the power button before and it was fine. The power button seems to have done something to the system??

#

I'm going to swap the SD card back and see what happens

steady rose
#

unknown

#

it was working

#

now it is not working

#

what changed?

civic rune
#

I wired in my system but that's it

faint sparrow
#

maybe the speed of light suddendly changed in the universe ? or neutronio runaway collision with the Pi ?

civic rune
#

I'll try plugging everything in to the new pi and see if it's the same result

steady rose
#

if multiple things, then systematically remove things and try again, etc.

#

work backwards towards last known working configuration

civic rune
#

I don't see any shorts between my ferrules or anything like that

faint sparrow
#

Oats is using mains I think if that matter cater

steady rose
#

also possible something got zapped. but just need to work backwards to find out.

#

if you get all the way back to last known working, and it still does not work, then...well...not good. but should continue to investigate.

faint sparrow
#

Wish we could have a small card along our nickname in here to show what are working on/boards/setup/etc while asking questions

steady rose
#

working with mains is def a potential for zapping something

civic rune
#

Yeah I'm hoping something just got zapped

#

Crud....new pi won't boot either

faint sparrow
#

do you get video on the monitor ?

civic rune
#

No nothing. Something is going on with my hat.

#

Oh god

#

This is bad

faint sparrow
#

like blank screen or no input signal on the monitor ?

civic rune
#

No input

#

And no action on the ACT led

#

Ok what could be going on with the hat? A short somewhere? It was working fine before

#

No chips are hot, no indication at all that anything is wrong.

faint sparrow
#

I never used HAT before

steady rose
#

but it seems related to hat? pi boots ok once removed?

civic rune
#

Yup

faint sparrow
#

I'd disconnect everything and just hook the PI to an hdmi thing with keyboard

steady rose
#

at least you know where to look

faint sparrow
#

and see if it works on it's own

civic rune
#

I did that, that worked.

steady rose
#

and the pi survived whatever it is

faint sparrow
#

on both of them ?

civic rune
#

But why would it suddenly stop working....

#

Let me try both again.

faint sparrow
#

I think at this point we need to see and have details of what

civic rune
#

The issue comes when the hat is plugged in but it's a new issue

faint sparrow
#

ie: take pic of setup if possible, how it's wired/attached, involved hats and models etc

civic rune
#

Here's a pic

#

Worth it to continuity test the cables?

#

Ah I found a short...

#

Gotta trace it noe

#

Oh that's expected.

civic rune
#

The problem began after using the power off button. It's just using GPIO 5 and GND.

#

Dang. Took all the wires out and it still won't boot

faint sparrow
#

I think you are interesting OatsNHoney, I can't quite place how much you know or don't know ๐Ÿ˜„

civic rune
#

I know nothing about real computers

faint sparrow
#

You are probably like me in that you are like an alphabet soup

civic rune
#

My experience is with MCUs

#

So something about my hat is preventing boot, but didn't before....

#

I don't see any shorts on the hat

#

It's a bad idea to remove the hat while it's powered right?

#

Man I'm so deflated. I was so close

faint sparrow
#

wait you did a custom pcb ?!

civic rune
#

Yeah

#

Sorry I wasn't clear

pliant pebble
pliant pebble
#

PCB schematics??

#

Or is the PCB a secret

#

?

rustic karma
#

Hello, I build a little circuit with a raspberry,npn transistor and led. I can turn on/off the led with the rpi over gpio. Then I thought putting out the led for another raspberry to turn it on/off. But I does not work like the LED. Why?

#

Since I cannt explain why the circuit isnt working with a transistor, maybe a relay is better and easier to implement

wraith grove
#

relay probably uses enough current that you'd want to put a transistor in to drive it?

#

and add a diode against back emf from the coil, etc

#

I don't understand the part about putting the led out?

rustic karma
#

@wraith groveI want to switch the raspberrypi on and off with the transistor, like a LED.

#

Hmm, maybe the problem with the transistor is R_DS=0.1 ohm.

faint sparrow
# pliant pebble Shoot

they went to the pcb help channel to get help about it because the problem seemed to be their custom PCB

plush wave
#

Hi all, I trying to use a keyboard number on a rotary Encoder but what's killing me is the when I go one way it some times wants to go the other way.
So clockwise would be numbers 1
Anit clockwise would be number 2.
Any thoughts please

steady rose
#

need more info. what's the encoder and how are you reading it? what do you mean by "keyboard number"?

civic rune
# pliant pebble Or is the PCB a secret

sort of a secret? Idk, I bodged in an external power supply and it boots now, so I need to figure out what was going on to prevent booting in the first place

steady rose
#

is the hat drawing power from the pi's GPIO header?

civic rune
#

Yeah

#

Not any more but it was

#

I'm thinking that was the issue but I don't know. Next revision will have a separate 5V supply

plush wave
steady rose
#

@civic rune that could very likely be the issue. not sure how directly 5V gets routed through the pi. there's a polyfuse to limit current. and other aspects have changed with pi models. but in general, that behavior (no boot) seems to line up with something external using the 5V rail and not playing nice.

#

@plush wave how are you reading the encoder?

civic rune
#

I should have mentioned I jumpered in just the power and it wouldn't boot. So it was either the 3v3 line or the 5v line that didn't worm

#

Work

steady rose
#

@plush wave software-wise

plush wave
#

Thonny

steady rose
#

@civic rune using the 3V rail brings even more potential fun ๐Ÿ™‚

#

@plush wave can you link to your code?

plush wave
#

Need a min to get the laptop up again

civic rune
#

I'm gonna run the next board all on external 5v and use level shifting for the data lines

plush wave
#

@steady rose btn1 = digitalio.DigitalInOut(btn1_pin)
btn1.direction = digitalio.Direction.INPUT
btn1.pull = digitalio.Pull.DOWN

while True:
if btn1.value:
keyboard.press(Keycode.1)
time.sleep(0.1)
keyboard.release(Keycode.1)

#

didn't want to put the whole code down there is 26 functions on the thing

steady rose
#

so that's not full code? it doesn't have anything that's reading the actual encoder pulses.

plush wave
#

thats what i use for a keyboard encoder it was just not as good, what am i missing

steady rose
#

something to read the encoder pulses

#

which can be tricky depending on what all you have in your setup.

#

do you have just a bare EC11?

plush wave
#

yes

steady rose
#

reading those pulses without losing count is tricky.

#

but maybe you don't need absolute counts? could just sense direction and increment/decrement something?

#

what functionality are you wanting the turning of the knob to provide?

plush wave
#

its for lightroom

steady rose
#

what do you want to happen when the knob is turned?

plush wave
#

To engage number 1 or number 2

#

But I've got to do this on 7 other encoders as well

steady rose
#

not sure what that means

#

it looks like you are wanting to simulate pressing a keyboard?

#

like you have some device that is driven by pressing 1 and 2 on a keyboard?

plush wave
#

That's correct but I don't want to press the keyboard button loads of times

steady rose
#

and you don't need absolute position info from the encoder? it's just: (1) not turning, do nothing (2) turning one way, send out 1 s (3) turning the other way, send out 2s

plush wave
#

not 100% sure what your on about now but what are you thinking

steady rose
#

i'm still not understanding how you want the knob to drive things. it seems like only direction is important. not actual position.

plush wave
#

ok, i would like the encoder to pick up number 1 when turning clockwise, and when turning the other way i want it to pick up number 2, now I've done this and it works what i doing my head in is that it has a flicker of going the opposite direction that it shouldn't do

steady rose
#

gotcha. so just direction. that's generally easier than keeping track of all the pulses to maintain an accurate absolute position count.

#

is btn1 in your code one of the encoder channels? the A or B signal in that diagram

plush wave
#

import time
import digitalio
import board
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode

btn1_pin = board.GP0
btn2_pin = board.GP1

#

keyboard = Keyboard(usb_hid.devices)

btn1 = digitalio.DigitalInOut(btn1_pin)
btn1.direction = digitalio.Direction.INPUT
btn1.pull = digitalio.Pull.DOWN

#

btn2 = digitalio.DigitalInOut(btn2_pin)
btn2.direction = digitalio.Direction.INPUT
btn2.pull = digitalio.Pull.DOWN

#

while True:
if btn1.value:
keyboard.press(Keycode.KEYPAD_NINE)
time.sleep(0.1)
keyboard.release(Keycode.KEYPAD_NINE)

if btn2.value:
    keyboard.press(Keycode.KEYPAD_SIX)
    time.sleep(0.1)
    keyboard.release(Keycode.KEYPAD_SIX)
#

thats in 1 rotary encoder

steady rose
#

where's btn2_pin defined?

plush wave
#

GP bit?

steady rose
#
btn1_pin = board.GP0

should be something like this for btn2_pin?

plush wave
#

its in there i forgot to type it in when i did the message

steady rose
#

those are the two pins you've connected the encoder A and B channels to?

plush wave
#

retyped

steady rose
#

encoder A to GP0, encoder B to GP1?

#

(or reverse, doesn't really matter)

plush wave
#

sorry you lost me

steady rose
#

what is connected to pins GP0 and GP1?

plush wave
#

1 rotary encoder 1 for clockwise 1 for anit-clockwise

steady rose
#

that sounds like the A and B channels

#

you've wired those 3 pins to the pico?

plush wave
#

Yes.
A in GP0
B in GP1
C IN 3V tryed in group didn't work at all

steady rose
#

that seems OK in general, since you are enabling internal pulldowns

#

the other way would be C to GND and then use internal pullups

#

but just inverts the signal, and doesn't generally matter for your application

plush wave
#

So instead of digitalio.Pull.DOWN
It would be digitalio.Pull.UP if I wanted it on the GND

steady rose
#

yep

#

it's a very simple mechanism. it's essentially just two switches.

plush wave
#

But wouldn't make a difference would it?

steady rose
#

no. doens't matter for what you are doing.

plush wave
#

Ok

steady rose
#

that's the general signal that gets generated

#

read it left-to-right for clockwise

#

right-to-left for countercw

#

since you only care about direction, you'll want to change your logic to be something like:
watch for A to transition from LOW to HIGH. when it does, read B. if B is LOW, then you are turning CW. if B is HIGH then you are turning CCW

#

instead of separate calls to press and release

plush wave
#

So I need to change the code from press to send

steady rose
#

that's one thing. it's just a simplification. it takes care of generating both the KEY_DOWN and KEY_UP event signals.

#

it's functionally equivalent to your existing code, except for maybe the actual amount of delay

#

the main thing that needs changing is the logic being used to read the encoder

plush wave
#

tryed it same problem im now starting to think the encoder is too sensitive

#

just as i move it, the code is taking over before it gets to the clicking part

#

ok i tired something, i pulled the gp1 pin out and turned the encoder both ways and they both said the same number, even thou the gp1 pin has been pulled out

steady rose
#

@plush wave using the debouncer library could help, here's a rough example:

import board
import digitalio
from adafruit_debouncer import Debouncer

PIN_A = digitalio.DigitalInOut(board.GP0)
PIN_A.direction = digitalio.Direction.INPUT
PIN_A.pull = digitalio.Pull.DOWN

PIN_B = digitalio.DigitalInOut(board.GP1)
PIN_B.direction = digitalio.Direction.INPUT
PIN_B.pull = digitalio.Pull.DOWN

CHAN_A = Debouncer(PIN_A)
CHAN_B = Debouncer(PIN_B)

while True:
    CHAN_A.update()
    CHAN_B.update()
    if CHAN_A.rose:
        if CHAN_B.value:
            print("CW")
        else:
            print("CCW")
plush wave
plush wave
#

@steady rose morning bud, when you have a sec its coming up with an error on line 3 its the """import Debouncer""" part

steady rose
vocal lava
#

I'm looking at buying 2 64x32 LED matrices and the Rapsberry Pi Hat that drives them. Looking at this guide, the hat has a 5V 4A wall adapter plug that can power a matrix - if 2 are chained together does it power both?

faint sparrow
#

Is there any python module for controlling the brightness of an HDMI monitor connected to Raspberry Pi

#

I am using a UPERFECT 10.1" HDMI monitor hooked upto the raspberry pi, Now i want to control the brightness of that monitor via python program

#

There is a Python Module named as Screen-brightness-control that works great on Windows but is not working on raspberry pi

vocal lava
faint sparrow
# vocal lava <@456226577798135808> Did you look at PyPI? The one you mentioned is first, but ...

Hi Thanks for responding to my question, i did had look at the PyPi before asking the question here, I always look online myself to find the answer to my question and if i don't find the answer then i ask here,
The two modules you suggested doesn't work
The brightnessctl only works on intel Linux devices and as you probably know the Raspberry Pi is not an intel device, the other module sys-backlight allows only command line interface to change the brightness although i am not able to find any examples on how to run the command to even adjust the brightness from the terminal

vocal lava
#

Ah bummer, sorry

hardy plaza
#

I've been happy with the Samsung T5, which are readily available, not particularly expensive, USB C, small and light.

raven wave
#

Anyone got some resources for programming a diy joystick in micropython. Only examples I've seen are circuit python ๐Ÿ˜ฆ

#

trying to make a flightstick system

turbid rivet
#

Circuitpython is generally the preferred option for these types of peripherals due to its ease of usb hid implementation. However, the joystick code itself should be similar in both flavors of python, differences being circuitpython packaged it into a library somewhere for ease of use.

https://github.com/GuyCarver/MicroPython/blob/master/esp32/joystick.py is a good example of a joystick implementation, though itโ€™s pins are defined based on an esp32.

GitHub

All of my MicroPython stuff. Contribute to GuyCarver/MicroPython development by creating an account on GitHub.

raven wave
#

Thanks. I'll take a look around. failing anything else I'll just go for the circuit python option

turbid rivet
#

Might also be worth noting that a pi has no adc pins for joystick compatibility, and an rp2040 board only has 3-4 adc pins available for a maximum of 2 joysticks. If your flight controller needs more axes than that, you may have to look at some external hardware for help.

raven wave
#

Yeah. or just stick to arduino...damn

plush wave
#

so i made a file for it then this error came up

#

Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ImportError: no module named 'adafruit_debouncer.Debouncer'

#

sorted the file

plush wave
#

@steady rose hi bud all working now just one more thing when I do the test it response quick but when using program that is want it for its slow is there a code to speed the process time up

#

Or if anyone else can help

plush wave
#

hi allm right what ive found is that the dial will not jump backwards which is brilliant but its now missing the pulse. i can get about 3 or 4 clicks to 1 code rear out. so basicly when i turn the dial it will read the number but then it takes about 3/4 clicks to read the number again.

civic rune
#

I'm trying to write raspbian to fresh, just out of the box, SD card. The SD card shows up in windows in as D: but doesn't appear in raspberry pi imager. Is this weird?

#

although I can't seem to access the drive D:, I just get the blue spinning circle when I try

#

and my taskbar just crashed....something's up

civic rune
#

my computer crashing and fixing itself solved the issue

mortal pulsar
#

Hi everyone, I followed this tutorial successfully and it is awesome for using a VNC and just a computer directly connected to the pi. https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/ Iโ€™m wondering if anyone knows if Itโ€™s possible to use the pi as an ethernet and usb hub over usb-c to my MacBook? Specifically, can I plug into the pi Ethernet port and get ethernet and 4 additional usb-a ports through the 1 usb-c connection?

Iโ€™ve previously blogged about using Pi Zero (and Zero W) devices as USB Gadgets. This allows them to be powered and accessed via one of the micro USB sockets and it shows up as both a CD-Drivโ€ฆ

faint sparrow
#

Hi guys, super basic question, I hope it's ok, but...
Is it possible to use a passively cooled Pi as a streaming device for a flat screen HD TV? If so, what would be the minimum specs able to smoothly stream?

west sierra
faint sparrow
west sierra
# faint sparrow 1080p, stereo sound. Nothing wild.

you'd need at least 4GB of RAM, I'd say, at a minimum. So a Raspberry Pi 4 B. I'd recommend either a USB 2.0 external drive with separate power supply or some kind of NAS setup that also is externally powered for storing videos. There's lists of compatible drives and such. It should be able to deliver 1080p video as long as you do not need to recode video.

#

Use Plex, obviously.

#

So, best bet is to download videos that are already 1080p. If you need to transcode video, a RPi is not going to be sufficient. You'd probably be better of with an Intel NUC or similar.

faint sparrow
#

Only streaming from those sites.

#

And youtube.

west sierra
#

Oh, so if you're using it through Raspbian and streaming, it should work fine. You may get penalized for browser compatibility and not get 1080p, like if you try to stream Amazon Video from a super powerful rig that runs Linux. It'll still give you the crap bandwidth option for no reason.

faint sparrow
#

With only this streaming in mind via browser, your first recommendation is still valid?

west sierra
#

Yeah, you can use an RPi 4 for this.

#

If all you're doing is hooking it up to a TV and running video off of YouTube or similar, then it'll work fine.

#

I mean, it's not going to blow your mind or anything, but it'll work. Then again, it's a $45 computer. ๐Ÿ˜‰

faint sparrow
hardy plaza
# faint sparrow I'm a simple man ๐Ÿ™‚ Thank you for taking the time.

I don't claim to be an authority on this (so perhaps someone in the know can chime in if I'm mistaken), but my understanding is that with a Pi 4 you'll get better video performance using the new Bullseye version of the Raspberry Pi OS, as it's now using the Linux KMS video driver. That would of course be if you're using the Pi's desktop environment.

faint sparrow
gray hollow
#

I have installed pi_video_looper (tdicola) many times successfully. Recently, I came across an issue with the video looper installer. Its seems that the pyudev link must have changed, so it cannot find pyudev. I have installed pyudev manually, but the installer still fails. Any ideas? Here is the output from the installer. Searching for pyudev
Reading https://pypi.python.org/simple/pyudev/
Couldn't find index page for 'pyudev' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or working download links found for pyudev
error: Could not find suitable distribution for Requirement.parse('pyudev')

humble marsh
gray hollow
#

Thank you. I also have a post in the forums. Have not received a response.

humble marsh
ripe berry
#

Yeah, the same thing happened to me (as that discord link shows). The disk image download that I mention works beautifully. Would be nice if the pyudev part could be fixed thoโ€™.

ornate glacier
#

Hey, I have this product, and I am wanting to run it off a Raspberry Pi 3B, is that possible? and how can I do it? And will the code still work with NixOS? (sorry, super new to hardware) https://www.adafruit.com/product/3202

#

Oh, sorry, I should specify I am wanting to take a picture ever 5ish seconds, which requires shorting the green line to ground.

steady rose
#

generally possible, since it just requires GPIO pins to control

#

it's a trinket/arduino, but the code is super simple

ornate glacier
#

So, I take a GPIO pin and run its voltage at like 5 volts and then drop it down to 0 for 500MS every 5 seconds?

turbid rivet
#

GPIO pins on a Pi would be 3.3v, but you certainly have the right idea. On by default, then pulse off for ~50ms every 5 seconds.

steady rose
#

you could probably wire directly

#

the camera module might be OK with 3v logic level

turbid rivet
#

500ms would trigger a video, if I'm not mistaken.

#

Oh, it's 3.7-5V.

steady rose
#

for power

turbid rivet
#

There's no datasheet, either, huh.

ornate glacier
#

Yah, they say "because its so simple" or something.

turbid rivet
#

Usually, logic high is defined by Vss, so powering it directly off of 5V might make it harder for the data to trigger properly?

#

I know Neopixels struggle with that at times.

#

I guess you can try it out, and introduce some basic level-shifting if it doesn't work...

#

I'd rather not reverse-enginner the entire module for this haha

ornate glacier
#

Lol yah. The reason I got it was because I needed to run three cameras and needed to get it fast.

turbid rivet
ornate glacier
ripe berry
#

Not to be sacrilegious in the RPi channel, but you could save a lot of weight by using a Wyze cam with an SD card in it set to record. I havenโ€™t looked into that capability of the new ones, but at least the old ones would record if they werenโ€™t connected to the internet.

ornate glacier
#

Hmm, I did think about that, but wight is still an issue. Plus I already have the cameras, so....

still sundial
#

anyone have problems with the pi touchscreen not being recognized under Buster?

civic rune
#

what could have been done to an MP3 file to make it seemingly impossible to transfer to a thumbdrive? I have used the same thumbdrive on another pi without issue so I'm thinking it must be the file itself

umbral sable
#

What kind of error are you getting?

civic rune
#

Permissions error.

#

I'm away from the system now, and have bad internet access there, but I can head over any time if you have ideas

steady rose
#
whoami
ls -l (insert filename)
#

compare file permissions/owner to whatever you're logged in as

#

and same for destination

civic rune
#

Is whoami a command?

umbral sable
#

Yes. It just tells you what the username of the logged-in user is.

civic rune
#

Ok I'll try that soon. Thanks

#

Any idea why flash drives are mounting wrong?

umbral sable
#

Define "wrong"...?

civic rune
#

Wrong is they show up in the file system but don't have the usual eject button

wheat rain
#

I'm trying to use the MCP2221A board. The passthrough serial port works fine, but I can't access the GPIO pins (using Blinka). When I try import board it tries self._hid.open(MCP2221.VID, MCP2221.PID) and gets "OSError: open failed". I could check the rights but I don't know which file to check.

steady rose
wheat rain
#

hid.enumerate finds the board.

#

device.open() fails with the OSError: open failed.

#

I'm confident in the USB connection because I'm using the serial port.

steady rose
#

what operating system?

wheat rain
#

Linux denim 5.10.11-v7+ #1399 SMP Thu Jan 28 12:06:05 GMT 2021 armv7l GNU/Linux -- Raspberry Pi OS.

#

(but not the latest Bullseye release)

steady rose
#

try launching python with sudo and run open check again

#

likely a permission issue

wheat rain
#

Yeah that worked as root.

steady rose
#

udev, etc.

wheat rain
#

I did. I blacklisted the native MCP2221 driver and added a udev file.

steady rose
#

have you rebooted since adding the udev? or unplug/replug the mcp may also work

wheat rain
#

I haven't rebooted.

steady rose
#

try just unplugging/replugging the MCP in USB port

wheat rain
#

Okay, still can't open the device as 'pi' user.

steady rose
#

did you rmmod the driver? or just add to blacklist?

wheat rain
#

I did both.

steady rose
#

hmm. go ahead and try a reboot.

#

seems like something's interfering or some aspect of the permissions is not working

#

can also verify the VID/PID are as expected. it'd be in the output of hid.enumerate(), but buried in with all the other stuff

wheat rain
#

I get ['0x4d8', '0xdd'].

steady rose
#

that looks correct

#

still won't open?

wheat rain
#

root: yes, pi:no.

#

My 99-mcp2221.rules file:

SUBSYSTEM=="USB", ATTRS{idVendor}=="04d8", ATTR{idProduct}=="00dd", MODE="0666"```
steady rose
#

^^ that file is in /etc/udev/rules.d/ ?

wheat rain
#
total 8
-rw-r--r-- 1 root root 1917 Oct 26  2020 99-com.rules
-rw-r--r-- 1 root root   80 Nov 30 07:09 99-mcp2221.rules
steady rose
#

hmm

#
(blinka) pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hid
>>> hid.enumerate()
[{'path': b'1-1.3:1.5', 'vendor_id': 9114, 'product_id': 32824, 'serial_number': '', 'release_number': 256, 'manufacturer_string': '', 'product_string': '', 'usage_page': 0, 'usage': 0, 'interface_number': 5}, {'path': b'1-1.1:1.2', 'vendor_id': 1240, 'product_id': 221, 'serial_number': '', 'release_number': 256, 'manufacturer_string': '', 'product_string': '', 'usage_page': 0, 'usage': 0, 'interface_number': 2}]
>>> device = hid.device()
>>> device.open(0x04d8, 0x00dd)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "hid.pyx", line 113, in hid.device.open
OSError: open failed
>>> exit()
(blinka) pi@raspberrypi:~ $ sudo vi /etc/udev/rules.d/99-mcp2221.rules
(blinka) pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hid
>>> device = hid.device()
>>> device.open(0x04d8, 0x00dd)
>>> 
#

not sure

#

it's working here

wheat rain
#

Any idea which file it is actually trying to open?

steady rose
#

it's accessing via hid

#
(blinka) pi@raspberrypi:~ $ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi
#

what groups is your user pi in?

wheat rain
#
pi adm dialout cdrom sudo audio video plugdev games users input netdev lpadmin gpio i2c spi```
steady rose
#

weird. not sure what's happening.

#

seems like all the setup is correct

#

just to mention - the ADC is about the only useful thing on the MCP, the pi already has SPI, I2C, and GPIO

wheat rain
#

I'm using it to drive the zero2w with CircuitPython. Ctrl-C isn't working, so I want to have a control line (G3 to D18) I can use for out-of-band signalling.

#

Instead of while True: I test the value of D18.

#

I'll look at using one of the raspberry pi GPIO pins instead.

#

Thanks for walking me through it all.

#

The passthrough UART is nice, and I was surprised to learn that the pi zero 2 W can run on the shared USB power line.

modern tundra
#

has anyone experienced that you cant autoboot applications anymore with rc.local?

civic rune
#

Yeah I think that doesn't work anymore

#

Let me find an article for you

modern tundra
#

so for ExecStart i should enter the absolute location of the pico 8 file

#

what is rc.d?

civic rune
#

The rpi gpio header doesn't expose the pin that uses the ACT led right?

modern tundra
#

it does need some extra command configuring right?

civic rune
#

Yeah you have to make your script executable

#

The one you want to run on start

#

It should all be in the guide but it's been a few weeks since I read it.

#

There's an adafruit guide that I think does it the wrong way so I pointed you to that one

mint pagoda
#

Added the Retroflag PiStation to the family. Repurposed a 2G Pi 4. Now, if I can just find an SSD that will fit under the flip top๐Ÿค”

civic rune
#

Is it possible that I was having trouble copying an mp3 file to a thumb drive because it was in use by a running program?

faint sparrow
#

was the running program playing it ?

civic rune
#

Yes

faint sparrow
#

yes, could be a I/O thing too, like the io channel is busy with playing a file

#

that happen on a computer when you install a program and reading othe files during install is really slow, the io channel is busy

civic rune
#

Hmm that makes sense but doesn't explain my other issue: thumb drives not mounting right. They show up in the system but not as thumb drives and without the eject button

faint sparrow
#

can you provide more info? are you sitll using linux? console? or XWindow? if so whicxh graphical manager? are you remotly connecting to it ?

#

if on linux/console, in mnt you won't see such things, that's a windows thing

#

eject would be properly doing umount on it before you remove it

#

and for the I/O remember when we spoke about TTYs ?

civic rune
#

Yeah let me get over to the system. I was running a diagnostic on a different thing

#

The eject button I expect from the gui as I see it when the same drive is plugged in to a different pi

#

I had no hand, nor did anyone working here, in setting this up

civic rune
#

Ok I stopped the program from running and rebooted. I still can't copy the mp3 to a thumb drive

civic rune
steady rose
#

file should be readable by everyone

civic rune
#

Hm

#

Can I tell if it's currently in use?

#

The problem is that I can't just find another copy of the mp3, it's a combination of multiple .mp3 files and was only stored here as far as I can tell

#

When I try to copy it, it says read only file system

#

Is there a way to get the file off of the SD card?

steady rose
#

copy should only need read

#

seems weird

#

how are you copying?

civic rune
#

Right click, copy, and then using ctrl v in the flash drive because right click doesn't work in there for some reason

#

Is it possible that that's the read only file system?

steady rose
#

it could be complaining about the flash drive, not the mp3

#

try just making a local copy

civic rune
#

Hmmm but this drive works literally everywhere else.

#

Let me try one sec

#

That works.

#

I guess I can get a fresh flash drive

steady rose
#

try copying some other file to flash drive

civic rune
#

Hey that didn't work either! So it's the flash drive

#

Although weird that this drive works fine elsewhere including other pis. Should I format the fresh drive as EXT4?

steady rose
#

is a USB thumb drive and using the graphical interface your only option?

#

have you tried scp?

civic rune
#

I don't know?

#

I don't think I can ssh in, there's no wifi here

#

What's scp?

steady rose
#

file copy over wifi

#

so no wifi would be show stopper

#

and limit other options as well

#

is wired network available?

turbid rivet
#

Is it possible to turn the pi off and physically pull out the sd card?

civic rune
#

Ah yeah no wifi here. I've asked for a hot spot but no luck yet

#

I would need like a 300+ foot ethernet cable

civic rune
steady rose
#

try copying mp3 to /boot partition

#

that's FAT and will show up on pretty much any PC

#

then what Hem is suggesting. power down, remove, use another machine to copy off

#

(i think that's the idea?)

civic rune
#

Ok anything I should be aware of when copying to boot drive?

steady rose
#

nothing special

#

just don't overwrite anything there

civic rune
#

It would just be /boot, correct?

#

I need to use sudo it seems. Would that be

cd /home/pi/Desktop
sudo cp myfile.mp3 /boot

?

turbid rivet
#

try it and see

civic rune
#

Good pt

#

I've got a stomach bug, my thinking is slow atm

#

There it is. Now I gotta figure out how to get to the SD card without unplugging all the undocumented electronics

steady rose
#

^^ oof. that doesn't sound easily accessible.

#

might have been worth trying to figure out why USB thumb drive was acting read only ๐Ÿ˜ฆ

#

but could also spend just as much time on that

civic rune
#

Yeah and it suddenly stopped booting

#

As well

#

I'm glad I got the file off when I did

#

Well a power cycle fixed it. I'm very glad

unkempt cave
#

Im really new to Linux and the pi and have some probably very basic questions and was wonder if anyone could help me out!

civic rune
#

it's usually suggested to just ask your question and if someone knows/is free, they'll help you ๐Ÿ™‚ Welcome to the server!

unkempt cave
faint sparrow
#

that's not basic ๐Ÿ˜„

unkempt cave
#

Oh no

#

Hahaha

faint sparrow
#

I was expecting you to ask how to list the files in a folder or mount a usb stick or how to run commands as root/what is root ๐Ÿ˜„

unkempt cave
#

Iโ€™ve done a whole tutorial that adafruit did on autoplaying videos from a usb which worked I just want to have the files on the pi and directly play them haha ๐Ÿ˜…

faint sparrow
#

do you mean on a LCD or play them on the hdmi output ?

unkempt cave
#

Hdmi, I have a 7โ€ screen that Iโ€™ve connected

karmic pivot
#

Iโ€™ve used the app VLC on pi to run videos from a list. There are command line options, so I bet there is a loop. @unkempt cave

agile depot
umbral sable
agile depot
#

So could I just use an analog to digital converter for that?

umbral sable
#

Yep, there are ADC chips which also interface over I2C or SPI.

#

Just depends on how many channels you need, the sampling rate, the bit resolution, etc.

west sierra
#

Will the square PIM470/PIM475 HyperPixel fit on the CYBERDECK HAT while mounted to a RPi 400?