#help-with-linux-sbcs

1 messages ยท Page 15 of 1

raw solar
#

Ah

#

Hashbang I would have figured out easier XD

uncut lagoon
#

im used to that name

raw solar
#

This is the first I've ever heard it, lol

uncut lagoon
#

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

trim pond
#

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

trim pond
#

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/

terse canyon
#

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?

meager bay
#

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 ๐Ÿ™‚

prime tulip
#

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.

meager bay
#

Having trouble finding resources on how to generate different frequency tones with this module + speaker. Should it just be done with a Piezo?

prime tulip
#

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.

meager bay
gilded stump
#

stupid question but any winXP uses here?
Are there serial/uart drivers for winXP? for pico specifically. Looks like even win7 is unsupported :/

faint sparrow
#

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

gilded stump
lyric thicket
#

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.

robust geode
#

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.

pliant pebble
#

I think the guts are just a RPI4

#

with a few extra gizmos

potent rose
#

the kb does show up when doing lsusb

robust geode
potent rose
#

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

robust geode
pliant pebble
#

Thanks ๐Ÿ™‚

#

That's a lot ๐Ÿ™‚

potent rose
#

powered usb hub

robust geode
hardy plaza
short drift
#

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.

worn oak
#

this is a freshly installed and upgraded RPiOS

#

the sensor works fine on my clue btw

faint sparrow
#

Yeah they used to call that one Raspbian, but now they call it RPiOS. ;)

worn oak
#

not the question

#

๐Ÿ˜‰

#

been soldering cpus since 1980

#

I remember when there was only 3 distros

opaque wagon
#

Quick idea - are you using sudo with your I2C detect?

worn oak
#

I have tried sudo and after sudo su

#

should I run as user?

#

trying that

#

nothing

opaque wagon
#

Did you enable I2C in raspi-config?

#

(And rebooted after that?)

worn oak
#

yes, i2cdetect -l lists the bus

opaque wagon
#

What command did you exactly use?

worn oak
#

i2cdetect -y 1

opaque wagon
#

How's the wiring?

worn oak
#

2,3,5,6

opaque wagon
#

Could you post a pic?

worn oak
#

ok

opaque wagon
#

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 ๐Ÿ™‚

worn oak
#

ada says device works on either

opaque wagon
#

I gtg, hopefully you get it to work!

worn oak
#

getting pic

#

oh well

#

anyone else able to tell me why it doesnt show up?

#

I have tried reversing sda and scl

worn oak
#

even tried altering speed

steady rose
#

@worn oak most likely a connection issue. are those alligator clips the only STEMMA cable you have?

upper burrow
#

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

fresh patrol
#

Any symbols in your password?

upper burrow
#

I just realized the issue

#

yeah

#

the pi is prolly set to GB keyboard

fresh patrol
#

Pound sign ๐Ÿ˜‰

upper burrow
#

oof

lilac obsidian
#

Was gonna ask if you'd adjusted locale yet

upper burrow
#

โค๏ธ

#

every step setting up a new sd card has been like this today lol

#

first issue was quotes in my psk ๐Ÿ™„

upper burrow
#

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....

upper burrow
#

hmm, I just stumbled on that and am about to try it out

#

any idea on auto-inflating on first run?

tropic yew
#

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?

faint sparrow
#

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.

tropic yew
#

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

faint sparrow
#

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.

tropic yew
#

Hahaha

faint sparrow
#

;)

#

The Raspberry Pi is pretty good at doing something like that.

tropic yew
#

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?

faint sparrow
#

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.

tropic yew
faint sparrow
#

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.

tropic yew
#

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

faint sparrow
#

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

tropic yew
#

Yeah, okay

faint sparrow
#

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.

tropic yew
#

Haha

faint sparrow
#

(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.

tropic yew
#

I remember back when modems were a thing people actually had and routers looked like rugged military equipment

#

For whatever reason

faint sparrow
#

;)

#

The Ethernet cards I had were 10BASE2 cards.

#

They ran on pip cables (BNC terminated RF coaxial cable).

sinful shell
#

Thanks for your help```
tropic yew
#

Ah yes let me screw in my Ethernet real quick

faint sparrow
#

The public library ran 10BASE2 for a while. ;)

tropic yew
#

Ouch

faint sparrow
#

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.

sinful shell
#

I've found that development kit, but it's very bulky, I know that this display has nice documentation

faint sparrow
#

Don't worry - if my summary is off-base someone will step in to point that out. ;)

sinful shell
#

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

faint sparrow
#

I don't think you understood.

sinful shell
#

well, probably not, maybe you can explain ?

faint sparrow
#

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.

sinful shell
#

So you are saying, that I should get their development kit ?

faint sparrow
#

Yes indeed. ;) that's the usual path towards getting stuff like this working at all.

sinful shell
#

but that's too expensive

faint sparrow
#

They are not in the hobbyist market.

sinful shell
#

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

faint sparrow
#

Amazon broke the rules and made the Kindle. It was a very unusual event for personal electronics.

sinful shell
faint sparrow
#

I'm saying making a portable eInk display based project is not trivial.

sinful shell
#

yeah, I understand

faint sparrow
#

I think mobile read forums has a few experimenters who've repurposed Kindle.

sinful shell
#

but I am also not able to find any other type of display, that would have similarly low power consumption

faint sparrow
sinful shell
#

I don't have kindle, and it's to expensive...

faint sparrow
#

Why do you think you can do this project at all?

#

I'm confused.

sinful shell
#

What you mean, why do I think I can do it ?

#

I started this project very recently... so maybe I can't

faint sparrow
#

I've entirely forgotten what our electronics instructor used to say about this.

sinful shell
#

but I started watching great scott on youtube, and I guess, as there is a datasheet, there is a way

faint sparrow
#

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.

sinful shell
#

so, I was thinking, what with help of internet guys, like you, I will be able to get it somehow to work....

faint sparrow
#

I'm saying the shortcut is to spend the money and buy the dev kit.

#

And be prepared for significant setbacks.

sinful shell
#

yeah... but I have as much time as I can (I don't have time limit or so.... and I have some time)

faint sparrow
#

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.

sinful shell
#

Now I guess we are getting into Philosopy xD

faint sparrow
#

Pretty much.

sinful shell
#

I am gonna explain here my entire project here

faint sparrow
#

;)

sinful shell
#

and maybe you will be able to help me than

faint sparrow
#

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.

sinful shell
#

what I want is, to make VERY powerful calculator, that can do graphs etc. (I can program it)

faint sparrow
#

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.

sinful shell
#

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....

sinful shell
faint sparrow
#

It's programmable. They sold the last one but the kit itself is probably still on the market.

sinful shell
#

wait ? what ?

#

kit ?

faint sparrow
#

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.

sinful shell
#

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

faint sparrow
#

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.

sinful shell
faint sparrow
#

someone dropped that link on me the other day but I haven't found the time for it.

sinful shell
faint sparrow
#

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.

sinful shell
#

but they are not as powerful as rpi zero W, aren't they ?

#

that's my biggest problem, I really want that power

faint sparrow
#

They're roughly in the same performance range, I'd suspect. I don't know.

sinful shell
#

well, fairly surprising

#

and that's very old one

faint sparrow
#

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. ;)

median spear
#

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

hardy plaza
median spear
#

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

hardy plaza
#

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?

sterile barn
#

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
wraith grove
#

somehow those functions aren't being included

faint sparrow
#

'sudo apt-get install libgpiod-dev' that's something else, I think.

#

(just a guess)

wraith grove
#

I don't see gpioPWM in the function list for what I found, not explaining how time_sleep() fails on you

sterile barn
#

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.

wraith grove
#

I'm not sure it is that large scale of a problem

#

somehow pigpio.h simple isn't providing

sterile barn
#

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 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 -- -- -- -- -- -- --
hardy plaza
#

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?

sterile barn
#

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.

hardy plaza
#

If you investigate the test scripts, are any of them altering the default i2c address in a constructor, e.g., "i2c_addr=0x29"?

sterile barn
#

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?

hardy plaza
#

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.

sterile barn
#

Hmm interesting

hardy plaza
#

But off to bed for me, 'nite.

sterile barn
#

Good night! ๐Ÿ›๏ธ

hardy plaza
#

good luck

sterile barn
#

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.

hardy plaza
sterile barn
#

Yeah, I may have messed up my last raspberry pi by directly plugging motors in ๐Ÿ˜”

#

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.

meager bay
#

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?

opaque wagon
#

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/

meager bay
frosty hill
opaque wagon
#

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...

meager bay
meager bay
frosty hill
#

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

hardy plaza
sterile barn
#

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.

hidden pebble
sterile barn
#

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.

meager bay
#

Thank you

hidden pebble
#

You're welcome. It's an intriguing piece of functionality that is not often used! ๐Ÿ™‚

meager bay
#

Can confirm it works. I thought I'd need a transceiver module but this is so convenient

hidden pebble
#

๐Ÿ™‚

hardy plaza
sterile barn
#

rip ๐Ÿ˜„ ๐Ÿ™ˆ

hardy plaza
#

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.

meager bay
hardy plaza
# meager bay 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.

quiet agate
#

any pi people on?

fresh patrol
#

On what?

sterile barn
#

That is an interesting way to look at things thinkies

faint sparrow
#

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?

faint sparrow
#

force_turbo=1 and over_voltage=2 seemed to fix it

faint sparrow
#

;) 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.

faint sparrow
meager bay
#

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
#

@faint sparrow That makes sense. I wonder if RPi4B is any different than predecessor boards in that regard.

faint sparrow
#

@meager bay Here's an idea for a simple dispatcher I saw recently:

#

(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.

meager bay
#

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?

faint sparrow
#

@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.

faint sparrow
#
        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.

faint sparrow
#

That's a wallful of text from me; will termbin it and truncate at least some of it, now. ;) EDIT: done!

meager bay
meager bay
#

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?

daring spade
#

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 ?

green spire
#

What sort of user interface? Buttons & LEDs? Touchscreen?

daring spade
#

and also heart rate and humidity display

green spire
#

Small OLED and a bunch of buttons then.

daring spade
#

oh its a web server btw

#

yeah ,its my first raspb project so im kinda stuck

green spire
#

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.

daring spade
#

potatomelt thank you so much !!! i really had no idea where to start

green spire
#

Always happy to help. ๐Ÿ™‚

faint sparrow
#

@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.

celest girder
#

relay

meager bay
#

@faint sparrow Thank you again ๐Ÿ˜„

faint sparrow
jade thunder
#

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

faint sparrow
#

@jade thunder what did you try so far.

jade thunder
#

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

faint sparrow
#

In the old days we'd check to see if the node could be ping'd first.

jade thunder
#

@faint sparrow Okay, so how can I do that?

#

I know my rasp IP address

faint sparrow
#

$ sudo ping 192.168.1.1

jade thunder
#

Do i enter that into my cmd?

faint sparrow
#

(sudo may not be required; I don't remember)

#

Always use the shell when you see typed commands. Pretty much.

jade thunder
#

Ok, let me try now

faint sparrow
#

The IP address I gave was an example; use the one for the node you want to connect to.

jade thunder
#

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),
faint sparrow
#

$ sudo netstat -rn

#

If there's more than say ten lines those don't matter at the bottom)

jade thunder
#

There's IPv6 route table, IPv4 route table

#

What should I be looking for?

faint sparrow
#

generally two entries are required.

#

Gateway is the router on a regular setup.

#

The Iface column names your ethernet NIC device name.

jade thunder
#

By Iface, do you mean Interface List ?

faint sparrow
#

What operating system are you typing this in?

#

My assumptions are Linux (it's all I run)

jade thunder
#

Windows 10, sorry my bad for not mentioning this earlier

faint sparrow
#

;)

#

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.

jade thunder
#

Okay, so I should be seeing my raspberry pi IP address in the route table? Since i enabled SSH on it?

faint sparrow
#

Not usually, no. Do you have a regular router that 'everything' connects through?

jade thunder
#

Oh yes, of course.

faint sparrow
#

So it probably assigns each node on your LAN an IP address via the DHCP protocol.

#

Ordinarily they can all talk to one another.

jade thunder
#

I actually login into my wireless router to check out my rasp IP address

faint sparrow
#

Can any of your nodes talk to any other?

jade thunder
#

Erm... I'm not quite sure what do you mean by thatuhh

#

I mean I can see my computer's IP address, my phone's, my brother's phone, those devices Ip address over there

faint sparrow
#

You're trying to get two nodes talking to eachother. I was wondering if any nodes you have can talk to any others, already.

jade thunder
#

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

faint sparrow
#

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)

jade thunder
#

I see

faint sparrow
#

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).

jade thunder
#

Hmm, I tried using the VNC app to try login into rasp, no result too

faint sparrow
#

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)

jade thunder
#

That's what puzzled me too๐Ÿ˜ซ

faint sparrow
#

That the ping was received is a puzzle.

#

If you unplug the Raspberry Pi and ping, what happens? Does the ping look different?

jade thunder
#

Well, technically there wasnt any ping received when I tried pinging my rasp IP address

faint sparrow
#

Some NIC's blink the LED with each ping.

jade thunder
#

Unless I misunderstood the console message?

faint sparrow
#

I just want to see the output of ping, with and without the cable connected to the RPi for contrast.

#

They should be different.

jade thunder
#

Ok, so do I plug in my rasp into my router and try pinging again?

faint sparrow
#

Do it both ways and post both, in separate messages here. ;)

#

(long messages just jam up the Discord client)

jade thunder
#

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?....z_think3d

faint sparrow
#

good.

#

The time=370ms means the ping succeeded I think.

jade thunder
#

but why? This is so weird

faint sparrow
#

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.

jade thunder
#

Well, good news is I can access my rasp through VNC already, only with the LAN cable plugged in

faint sparrow
#

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.

jade thunder
#

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

faint sparrow
#

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.

jade thunder
#

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
faint sparrow
#

okay so .109 is eth0 (the wired NIC).

jade thunder
#

yup

faint sparrow
#

ssh to .109 not to .112

#

(I'm assuming sshd isn't listening on both wlan0 and on eth0 but just eth0).

jade thunder
#

Hmm, I tried pinging both .109 and .112

#

Both address give me a response

faint sparrow
#

Don't do anything you believe will change the relationship to VNC as that's your way in at the moment.

jade thunder
#

Yeah of course

#

Well, I can connect to rasp via VNC using both .109 and .112

faint sparrow
#

also wlan0 has super low traffic counts which sounds like it's being ignored by active network connections.

jade thunder
#

wlan0 is my raspi wifi, right?

faint sparrow
#

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

jade thunder
#
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?

faint sparrow
#

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.

jade thunder
#

ok, looks like I logged into my own raspi on my raspi?

faint sparrow
#

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)

jade thunder
#
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
faint sparrow
#

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.

jade thunder
#

okay

faint sparrow
#

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.

jade thunder
#

I see

faint sparrow
#

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.

jade thunder
#

Do I need to quit from my current ssh session on my raspi to do this?

faint sparrow
#

Nope. Better to leave it going!

jade thunder
#

ok

faint sparrow
#

Yeah don't post netstat -n that's too much information to put out in public.

jade thunder
#

haha ok

jade thunder
# faint sparrow ` $ sudo netstat -rn` also:
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?

faint sparrow
#

Looks to me like you can ssh out from the raspi on either interface.

#

Which would confuse things!

jade thunder
#

Either interface? means?

faint sparrow
#

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.

jade thunder
faint sparrow
#

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.

jade thunder
#

Well could it because of I have my raspi connected with wifi and also the LAN cable at the same time?

faint sparrow
#

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.

jade thunder
#

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?

faint sparrow
#

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.

jade thunder
#

I see, ok

jade thunder
faint sparrow
#

No because it may still try to route to eth0.

jade thunder
#

Ahh ok

faint sparrow
#

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.

jade thunder
#

what's a cold boot?

faint sparrow
#

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).

jade thunder
#

Ahh okok

faint sparrow
#

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.

jade thunder
#

i see

faint sparrow
#

My Raspi 3B takes like 90 seconds to power off. ;)

#

(never clocked it but it's quite a while)

jade thunder
#

That's.... really taking foreverlmao

faint sparrow
#

It's 90 seconds I'll never see again!

jade thunder
#

So if I do sudo ifconfig eth0 down, will that allow me to ssh/vnc my raspi wirelessly again?

faint sparrow
#

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)

jade thunder
#

but it will help my network routing on my raspi, correct?

faint sparrow
#

I'm thinking it'll simplify netstat -rn by exactly one entry. Maybe more.

jade thunder
#

I see, ok

faint sparrow
#
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.

jade thunder
#

I see, ok

faint sparrow
#

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).

jade thunder
#

Alright, got it

#

I'll give it a try tomorrow, gotta sleep now so i can wake up tomorrow morning for work

faint sparrow
#

So much has been ruled out already so this seems likely to help.

#

;)

jade thunder
#

Yeah, really thanks a lot @faint sparrow !

faint sparrow
#

Okay good luck!

jade thunder
#

truly appreciate your help!

faint sparrow
#

Glad to be of some help.

solar meteor
#

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

solar meteor
#

also can I get a lead on an arduino or raspberry pi baseball cap? or beanie? Arduino.cc is out of stock ๐Ÿ˜ฆ

faint sparrow
#

@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).

hybrid vortex
# faint sparrow (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.

faint sparrow
#

@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.

hybrid vortex
#

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.

faint sparrow
#

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)

graceful inlet
#
#

Software defined radio

meager bay
#

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

hardy plaza
meager bay
hardy plaza
# meager bay 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).

meager bay
#

My functions seem to be running sequentially though

#

How would you run them in parallel ๐Ÿค”

hardy plaza
#

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.

hardy plaza
#

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.

meager bay
#

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

hardy plaza
#

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!

meager bay
#

You're right thank you! Hopefully it goes well ๐Ÿ˜„

civic cloak
strange mulch
#

Are there any guides on using the raspberry pi with the bluefruit connect app?

primal turtle
#

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?

primal turtle
#

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.

charred sonnet
#

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?

charred sonnet
#

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

primal turtle
#

@charred sonnet send me a link to the kit, i'll see if I can help you

charred sonnet
primal turtle
#

@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

charred sonnet
#

So is it just pick any pins and then make sure the code it going to the same pins?

#

and thank you for looking

hardy plaza
charred sonnet
#

@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 ๐Ÿ˜›

pliant pebble
#

Is there any files for a good 3D printable laptop?

turbid rivet
raw solar
#

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

wooden blade
#

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

frigid moth
#

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.

safe laurel
#

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

frigid moth
#

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.

safe laurel
#

Although you should add a User=pi and Group=pi to the [Service] section

frigid moth
#

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```
safe laurel
#

did you enable it?

frigid moth
#

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

safe laurel
#

check /var/log/messages?

frigid moth
#

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

frigid moth
frigid moth
#

Just kidding, i didn't get it to work yet. But I think I made a good step forward.

iron zodiac
#

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?

turbid rivet
#

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.

wraith grove
#

some things aren't multithreaded, the pi has 4 cores

turbid rivet
#

Fair, then next problem with circuit python is its interpreted, and Idk what adverse effects that can have on timing.

west glade
#

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?

turbid rivet
west glade
turbid rivet
#

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.

west glade
turbid rivet
#

No problem. Adafruit has a whole subcategory dedicated to Pi4 cases, so took no time at all!

iron zodiac
# turbid rivet Steppers are known to be quite finicky with timing, which is usually why their c...

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

turbid rivet
#

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...

iron zodiac
#

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

gentle briar
#

I wonder if it's something like the pin numbering got changed (board vs BCM for instance)

iron zodiac
#

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?

turbid rivet
#

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

gentle briar
#

That setmode() command should cover that possibility, but unfortunately that's the only one I thought of.

iron zodiac
#

Alright, thanks for the help, ill keep fiddling about with it and see if i can get to the bottom of things

tiny raft
#

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.

primal turtle
#

does anyone know if they changed the silk screening on the back of the pi zero w since it's release?

civic cloak
#

Hi why can we not use Adafruit NeoPixel on other Raspberry GPIO than 10 12 18 and 21 ?

civic cloak
#

any idea <@&617066238840930324> ?

gentle briar
#

Those might be the pins that PWM0 can be mapped to.

cold monolith
marble trout
#

hey yall, what should i do if one of the bonnets i ordered arrived broken? the joystick doesn't work in the up direction

gentle briar
steady rose
marble trout
steady rose
#

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

meager bay
#

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:

gentle briar
#

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.

timber marten
#

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?

gentle briar
#

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.

timber marten
#

so you dont need the mini hdmi to display like can you do it on phone or chromebook?

raw solar
#

You can use VNC to remote in graphically or SSH for console

timber marten
#

i do need help tho does it need a network ip to finnd it or somthing to remote?

raw solar
#

Yes, you need the IP or the hostname. You can set the name with raspi-config and find the IP with ifconfig

timber marten
#

im on chromebook not pc tho

#

thats the thing'

meager bay
raw solar
#

Oh wait, are you looking to set up without connecting a display?

timber marten
#

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

raw solar
#

Ahh... I think you can set a hostname in the boot.conf on the card...

timber marten
#

how would i do that

raw solar
#

I can't recall, anybody else remember? I haven't had to do this in ages

timber marten
#

i dont think anyone els knows'

spiral mason
#

You should search for headleass setup raspi. But that envolves mounting the sd card on another machine. Not sure what Chromebook allows you.

hardy plaza
#

On a Pi it's just using raspi-config.

raw solar
#

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

hardy plaza
raw solar
#

Somewhere... I had trouble finding it

hardy plaza
#

I usually just connect an HDMI monitor to the Pi for its first 15 minutes of life, then never again.

raw solar
#

Lol, yeah, that's most of mine

hardy plaza
#

off to bed, cya

raw solar
#

Night

vocal lava
#

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.

vocal lava
#

Oops, shame on me. Should have read the docs better, it's a virtual environment thing

#

nevermind me. ๐Ÿ™‚

pliant pebble
#

How do you find the Pi chip's stats/usage on the Pi - command line is preferable??

opaque wagon
#

htop or top will show a "task manager" in the terminal.

#

I also believe uptime will show the CPU usage average

spiral mason
#

or did you mean stuff like

#

cat /proc/cpuinfo
echo $[100-$(vmstat 1 2|tail -1|awk '{print $15}')]

#

?

pliant pebble
#

Firefox is much faster than Chromium on Raspberry Pi....

#

Chromium broke for me, so I was just saying....

#

Has Chromium broken for anyone else?

faint sparrow
mint pagoda
#

@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.

vivid grail
raw solar
#

Customization right in the imager!

mint pagoda
#

Since sliced bread ๐Ÿ˜Ž

eternal sparrow
fickle storm
#

hello, can i ask about how using multiple sensor INA219 with Raspberry Pi?

steady rose
#

answered in #help-with-circuitpython . please don't post questions in multiple channels. if in doubt which channel, just make best guess.

vocal lava
#

What is the usual preferred library in Python to use GPIO? gpizero or or rpi.gpio?

hardy plaza
#

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.

vocal lava
#

@hardy plaza Thanks!

royal crypt
#

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.

normal vapor
#

F

hazy matrix
#

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?

opaque wagon
remote cove
#

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)

gentle briar
indigo shore
#

Is it possible to take 299 pixel x 299 pixel images with the Raspi Camera Module V2?

remote cove
#

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?

steady rose
#

@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?

remote cove
steady rose
#

hmmm. so you have a monitor and keyboard attached?

remote cove
steady rose
#

is green ACT LED doing anything?

remote cove
#

It's blinking from time to time

steady rose
#

have you tried pinging the pi from another machine?

remote cove
#

How?

#

I've never done that

steady rose
#

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?

indigo shore
#

@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.

remote cove
steady rose
#

@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

indigo shore
#

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!

steady rose
#

@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.

remote cove
#

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

steady rose
#

@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.

remote cove
#

Btw what does the green led indicate? I believe it has something to do with the memory?

steady rose
#

@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

remote cove
steady rose
#

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)

steady rose
#

try <ALT><F4> and wait a bit and see what happens

remote cove
remote cove
#

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?

indigo shore
#

@steady rose No frame rate issues -- still photos. I'd rather crop than scale so as to maintain the images' detail.

steady rose
#

pair that with PIL/pillow and you can pretty much do anything

indigo shore
#

@steady rose Wow! mind reader... I was just going to ask if you had a link... was having trouble finding info on subframes

steady rose
#

@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

indigo shore
#

Wow! again. It appears that I can save to numpy arrays with a designated resolution. That might be perfect.

steady rose
#

yep. there's some great low level hardware info in that readme also.

remote cove
#

So I restarted the raspPi after 2 minutes of waiting. I need to do my work again ๐Ÿ˜ฆ

steady rose
#

@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?

wintry steeple
#

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?

hardy plaza
wintry steeple
hardy plaza
wintry steeple
#

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

hardy plaza
# wintry steeple so im trying to think of a way to connect my PiZero to my PC via Bluetooth and g...

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...

wintry steeple
#

so i am sure if that method will work

hardy plaza
#

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!

wintry steeple
steady rose
#

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.

limpid hawk
#

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

chrome wasp
#

The first step is to take a step. Break the project into workable pieces and choose one to begin on.

limpid hawk
#

The step would be knowijg how to make raspbian or similar into a os that has a bunch of big shortcut buttons

chrome wasp
#

There have to be hundreds of UI libraries. One of them should be able to give you big buttons

limpid hawk
#

What site do I go on to get these elements

night marsh
wintry steeple
#

does anyone know how do i send vl53l0x sensor data from raspberry pi to windows PC with pycharm via bluetooth?

torn trench
#

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?

#

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).

wintry steeple
torn trench
#

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

spiral mason
#

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 ?

quartz tusk
#

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?

hardy plaza
# quartz tusk Hello all, I have a few questions regarding my raspberry pi zero. I am attemptin...

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.

faint sparrow
#

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?

opaque wagon
#

Capitalization is important - I believe it should be rpi instead of Rpi

gaunt hatch
#

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

oak frost
#

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?

hidden pebble
#

@oak frost What did you have in mind to buy? Might be worth posting a link to it then we can evaluate.

turbid rivet
# oak frost I want to control 2 stepper motors and 12 LEDS (not individually) using a raspbe...

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.

ancient iris
#

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.

torn trench
ancient iris
#

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.

torn trench
#

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

oak frost
#

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

oak frost
#

Maybe ill get three transistors and unipolar stepper motors instead

scenic jacinth
#

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.

torn trench
#

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

scenic jacinth
#

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.

ancient iris
fierce spire
#

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?

opaque wagon
#

I believe for file objects there is a flush function which will write to the disk (idk going off of memory lol)

fierce spire
#

ok thank you

humble badge
#

Does anyone have any experience with using spi devices on Pi?

gentle briar
#

You're probably going to get better results asking your actual question.

oak frost
#

True that

#

Anyone have any idea how i should run a stepper motor using my rpi

gentle briar
oak frost
#

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

turbid rivet
#

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.

oak frost
#

I need to run it very slowly

#

I will get one with 5 outputs then

turbid rivet
#

5 outputs?

oak frost
#

yessir

#

4 for 2 stepper motos and 1 for the lights

turbid rivet
#

Not sure if you need an H-bridge for an LED....

ripe pike
#

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?

turbid rivet
#

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.

turbid rivet
#

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.

ripe pike
#

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

turbid rivet
cobalt forge
#

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

steady rose
#

what TFT?

cobalt forge
#

adafruit 1.54 240x240 TFT Display

#

it is for the kitty paw macropad

steady rose
#

CK and SI are the main SPI pins

#

the others are just any available GPIO

cobalt forge
#

So what would the pin equate to on the tiny2040?

steady rose
#

CK = SCK and SI = RX (SPI)

cobalt forge
#

does the SI pin assign the slave number?

steady rose
#

the TFT has better pin labels on the back

cobalt forge
#

Hmmmm....

steady rose
#

SI is short for MOSI which is Microcontroller OUT, Sensor or device IN

#

so in this case, IN to the TFT

cobalt forge
#

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?

steady rose
#

SI would go to one of the SPI RX pins

#

not to be confused with UART RX

#

CK would go to SPI SCK

cobalt forge
#

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

steady rose
#

SPI RX can show up in two places. use one for TFT. the other can be used for TC if you want.

cobalt forge
#

Oh, so the SI and RT from the TFT can go to the same SPI RX?

steady rose
#

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?

cobalt forge
#

Oh ok!!! Thank you. I will give that a try. Thank you very much!!!

sturdy lodge
#

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

tribal hawk
#

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?

oak frost
#

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

torn trench
#

what role does an ftdi adapter play here?

marble hollow
#

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

fresh marsh
#

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 "

steady rose
#

@fresh marsh there is a known hardware issue with that combo. one sec. let me find links to relevant info.

fresh marsh
#

awesome thanks

steady rose
fresh marsh
#

k will do thanks

fresh marsh
#

wait do i need a 64-bit OS image on the pi400?

#

i never get anything not even a screenflash

faint sparrow
#

Sounds like it's not stable yet. So: no.

fresh marsh
#

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)

hardy plaza
# fresh marsh I tried cutting the trace and either that doesn't work in my case or I didn't d...

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.

fresh marsh
#

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?

cobalt forge
hardy plaza
# fresh marsh ugh I don't think I'm able to do that kind of work

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")

fresh marsh
#

it is a combination of being partially blind and lack of use of two hands( results of major stroke six years ago)

torn trench
#

(many of us here are just fellow customers :) )

fresh marsh
#

okay thanks I'll try that

hardy plaza
torn trench
#

However, if you live near Seattle I'd be happy to take a shot at it

fresh marsh
#

funny thig is I do live near Seattle (what are the odds)?

#

but that is too much to ask of someone

hardy plaza
#

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.

steady rose
#

@cobalt forge you'll need to manually create the spi bus with busio and not use the board.spi one

torn trench
hardy plaza
# torn trench It wouldn't be a inconvenience for me, it's good for me to get out of the house ...

@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. ๐Ÿ˜‹

torn trench
#

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?

ripe pike
wintry steeple
#

is there a way to get raspberry pi ip address automatically for server-client connection via same network?

hardy plaza
wintry steeple
hardy plaza
#

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.

torn trench
#

zeroconf networking may be a better solution to your problem

torn trench