#microcontrollers

1 messages · Page 15 of 1

normal elm
#

When you set the program up and do a few tests of the data capture rate, let me know! It coulddd be possible you don't need to do my weird thing

#

@orchid nest What do you want to do with them? I have done a fair bit of micro-controlling

#

'learning microcontrollers' is actually an entire industry and if you know how to program on the Arm controller, you could make 140-190k + a year in SF.

#

But just trying things out and see if you like it

#

This is a very decent intro to programming using a high level language + with an out of the box working micro controller

#

It also gives you wifi experience (I forget if itis has BL)

orchid nest
#

Wow thank you so much, I'm really just trying to get into this sort of thing, I know it's super deep.

#

I'm just a normal Dev rn.

gusty eagle
#

It's more physics than python though ^^

orchid nest
#

It's okay, I have no life and plenty of spare time

#

@normal elm do I need anything else?

normal elm
#

It depends on your use case

#

Like, if you wanted to control a robot, you need a lot a lot a lot of other things

#

(depending on what kind of robot, whatever)

#

Microcontrollers provides an electronic interface into the real world from your computer

#

For some people that means making drones, for others it means making cncs, weather reporters, soil mosture sensors, whatever.

#

Is it just for fun ? or like

orchid nest
#

It started out as a want to mod GameCube controllers to have a desirable trait but now I'm just generally curious, I don't have any project specifically but I just was curious about where to get a good baseline.

normal elm
#

So

#

There are modding communities that mod electronic hardware, there are people who try to invent things, there are people do hardware engineering as a living

orchid nest
#

Got it, thanks a ton for your time. I appreciate it.

normal elm
#

It's np

#

One thing I did is I built a wireless escape room

#

Using radio stuff as a mesh network

#

I like hobbiest level stuff too

#

But the stronger vision of what you want is going to yield better results I think

#

(Learning it professionally is like. . . .00001% as fun as doing projects)

#

If you have more questions I'll be around btw

#

just ping

scarlet kite
#

@normal elm ok so

#

I haven't actually been able to save any data

#

I'm going to be home in around 15 minutes so I can send you the code I'm testing

scarlet kite
#

ok so we have popped a few errors @normal elm. Here is the code:

 
tick = Image("00000:00090:09090:00900:00000")
cross = Image("90009:09090:00900:09090:90009")
 
file = open("data.txt", "wb")
 
if button_a.was_pressed():
 display(tick)
 for _ in range(10):
   file.write(accelerometer.get_x())
   sleep(1000)
 
display(cross)
file.close()
vague crane
frail beacon
#

hello, has anyone played with i2c and python in more depth yet?

stuck thicket
#

WE ARE LIVE! SHOW AND TELL! https://youtu.be/-pBEdDONKyQ

stuck thicket
#

WE ARE LIVE! ASK AN ENGINEER! 10% off all items in stock code is THANKYAEVE expires 11/27/19 @ 11:59pm ET #askanengineer http://www.adafruit.com & https://youtu.be/TCOPuM7hJo8

Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...

▶ Play video
mint atlas
#

Hello

#

I would like to buy a raspberry pi to learn

#

I landed on 3b+, 4 and Zero W

#

Which one should I get

#

Also, Arduino UNO or NANO

#

Also, the raspberry kits

#

There is a lot and I have no idea what they are, it would help if someone can tell me which to get

gusty eagle
#

I would council rpi4, which has more power of calcul.

inland cipher
#

i would go for a raspberry pi

#

probably 3b+, cause it's good enough

hallow igloo
#

yeah 3b+ instead of 4 casue its almost the same but you end up spending more money the only main big diffrence is that you can upgrade the ram on the 4 and the cpu is slightly better

#

if your learning go with 3b+

frail beacon
#

hi guys, how would you mock/fake an i2c device, like a simple sensor?

tawny fiber
#

in software by emulating return values of a driver

ruby agate
#

is there something like a mesh or net of little lamps like christmas tree lamps type thing that can connect to pi

#

please tag me if someones got anything

agile pine
#

hi all!

#

I am new to this forum

#

just wondering if anyone tries the gRPC with python?

lilac lance
#

i also have a question

#

how feasible is real time sound treatment on a rasberry

#

more precisly i would like to be able to listen to audio and find frequencies, and then have some led that move with the sound

#

not just the amplitude

jolly mural
#

feasible

#

but you've gotta optimize

lilac lance
#

i've looked around a bit to do it myself but it seems to be more math than my biologist soul can handle

#

but i've found a very nice blog post that explains it well

#

i'm not very sure about how i would transmit the sound information to my py

#

i guess the longest processing would be to get clean readings

gusty eagle
#

@mint atlas Most likely you'll have to use Fourier transform model

topaz bridge
#

hi

#

can i make a drone with esp8266 with miropython

#

or arduino

#

and which is best arduino or miropython

#
  • what projects did you do with miropython and esp8266
stuck thicket
stuck thicket
#

WE ARE LIVE! ASK AN ENGINEER! 10% off all items in stock code is TIMEFORUSBC expires 12/4/19 @ 11:59pm ET #askanengineer http://www.adafruit.com & https://youtu.be/8FzfZZSSMaw

Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...

▶ Play video
marble spade
#

I have a question on raspberry pi, but not exactly on python alone.

Are they a good choice for a home based server? I am going to host a python bot of my discord on it and perhaps eventually a simple website with little to no functionality. Im wondering what configuration of RPI to get.

#

Would appreciate a mention when you answer

gusty eagle
#

@marble spade Rpi are very often used for this purpose (I personally use one as a bot server) and they're doing it well!

marble spade
#

what configuration

#

rpi 3 1gb ram 0.5 gb ram etc

tame quiver
#

i would reccomend a rpi 4, as the newer optimizations are so good

stuck thicket
vague crane
#

There are 201 libraries available.
I missed it!

#

😄

sly relic
#

out of interest, would you be able to plug in a camera and a mic to a raspberry pi and from there be able to use it in a python module, or is there any config first beforehand?

#

the mic and camera will be plugged in

#

thanks all for the help 👍

tawny fiber
#

You maybe do have to enable the camera over the raspi-config tool....everything else shooould be plug and play

steel aurora
#

hell yeah, adabox being delivered today. can't wait.

stuck thicket
stuck thicket
#

WE ARE LIVE! ASK AN ENGINEER! 10% off all items in stock code is PARTICLEML expires 12/11/19 @ 11:59pm ET #askanengineer http://www.adafruit.com & https://youtu.be/McDYBBzq2Dw @stuck thicket

Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...

▶ Play video
royal pond
#

hey guys, python for arduino, is cool?

#

totally newbie

#

i have a board, i tried C back in time but i left my board lost in time

#

i'll probably take it to do some projects sometime

fiery sigil
normal elm
#

I use esp32 or esp 8266 (make sure you get the 1mb memory version )

#

Use MicroPython for the firmware

#

There are tutorials online

#

PyFirmata seems abandoned and it only uses basic commands for arduino

lean valve
vague crane
#

That’s a lot of pi!

normal elm
#

They are pretty great for backing up your code base locally

#

Not just for pirated videogames/shows

normal elm
#

I will work with mechanical engineers for this project, so hardware part is their part as I don't have technical information about hardware part. But they are insisting using of Arduino with C++. The software part is mine and another project member's part yet both of us don't know C++. They are saying on internet, there is no evidence of people making autonomous vacuum cleaner with Raspberry Pi and Python so we should use Arduino and C++. They are also saying Raspberry Pi with Python can be burnt because of the iterations. Is it true?

clear rover
#

What do mean 'burnt'? As in an overheated CPU?

normal elm
#

Some chips can only be written to once

#

But those were typically phased out in the 80's/ 90's

#

They are still somewhat used because they are incredibly cheap

clear rover
#

I am sure that's not the case with raspberry pi

normal elm
#

It's not

#

I'm helping someone so I reposted what they said

#

@azure light What could be the biggest issue is that your teammembers suck at programming in python.

regal saddle
#

Technically there will be a max number of write-cycles on the MicroSD. But the chance of you hitting is really low because it is so big. And if you do; just replace the MicroSD with a new one.

normal elm
#

If you buy the biggest/best arduino, you get 96kb of ram to play with

#

Attying85s have around 2000 or so

#

If you have a schema for how you plan on recording/using floor plans, that will inform your decision

#

Some people use point clouds with closest neighbor relaxation

#

A raspi is a small 35-50$ computer with 1 gb ram that runs python

#

It also has something like, 25 GPIO pins to control motors/ whatever

azure light
#

Yes it is my question, thanks @normal elm for reposting here. The problem is, both me and my project friend doesn't know C++ so we can't use Arduino. If this project can be done with Raspberry Pi and Python, I will insist to other project members to change Arduino to Raspberry Pi.

#

@clear rover They are saying iterations can result Raspberry Pi to burnt.

normal elm
#

For motors typically you have some sort of relay / H bridge that allows you to control bi/directional current motors

#

.....

#

Equasezy

#

If you write a program on your computer, does it get burned?

#

The only way to burn a raspi is if you shove amps of current into a GPIO pin or set it on fire

#

I spent 8 month writing programs on a raspi for my last job

clear rover
#

That's why i thought he meant CPU would get burned because I have heard of pi's overheating and going kaput. Was going to suggest a cooling fan.

normal elm
#

As long as you aren't doing things super computationally intensive , it's going to be fine

#

If you want to put a USB fan on it connected to an external power bank

#

That's fine too

#

(Even if it is completely unnecessary )

regal saddle
#

@clear rover If there using that much CPU power, the I can't see Arduino beinig a viable option either.

azure light
#

I also think that if you stress the Raspberry it will burn, our project adviser even said for other project (smart mirror project with facial recognition) they used Raspberry and it burnt before 1 week to presentation. According to our project adviser they had to use a "ventilator" (they placed behind the mirror) to cool down the Raspberry.

#

But for a project like autonomous vacuum cleaner, will it burn?

normal elm
#

If you stick a raspi in an very enclosed environment and ask it to do highly computational things like recognize images, then ya.

#

For your thing, it's going to be sitting ontop of a robot half exposed

#

You can just attach a 5$ fan to it if you are really paranoid

#

It's really easy to write code for and have it transmit over the network if you want

#

Some code I wrote for a raspi

#

The hardest part about raspi is learning linux and setting up python/whatever

azure light
#

@normal elm @clear rover @regal saddle Thank you for the help. I will talk with my project advisor tomorrow to talk about changing Arduino to Raspberry if it is possible. Mechanical engineers will probably use distance sensors to perceive close object and not hitting them. Would you guys use Arduino or Raspberry if you have no information about C/C++ but some information about Python. Also do you have any resource recommendations for this specific topic?

#

Now everything is in planning phase but we choose to not use computer vision. We will try to sense objects with other sensors placing them front of the robot.

normal elm
#

Arduino is written in c, not c++

#

but the IDE is in C++, so you don't get 'full' functionality

regal saddle
normal elm
#

Typical case

azure light
#

@normal elm Thank you for the help. Mechanical engineers will be responsible of project integration and designing and constructing the whole cleaner including proper allocation of sensors, battery, and etc. Me and other project teammate is responsible of developing the algorithm to memorize floor plans, navigate through obstacles, and etc. I won't intervene hardware part. But thank you.

normal elm
#

Mechanical engineers are going to have a fun time figuring out how to electrically set this up

#

there are a lot of diagrams and things

#

er, online tutorials

#

but this is typically how you do it

#

Also! When you are doing hardware stuff

#

Make sure you give yourself 1/3 -1/2 of the project time to test out your solution

#

You will find lots of stupid errors very quickly that will just take time to fix

#

So if you are putting things together 3 days before it is due

#

You're kinda boned

#

IMHO

azure light
#

@normal elm Yes thanks for the tips again.

jolly mural
#

I can give tips on this if you want

#

I'm working on tweaking my controller code for a quad motor tank

#

runs off a pi zero rn

normal elm
#

Where did you get the tank treads ?

jolly mural
#

bought 'em in an osepp kit

#

those aluminum parts kit were very helpful

normal elm
jolly mural
#

yea

normal elm
#

You can basically buy a kit from that wesbite as an all in one

jolly mural
#

i tweaked it a lot

#

looks a lot more like an actual tank now

#

i've been trying to find some motors with more torque to stick in it

normal elm
#

Why do you need more torque ?

jolly mural
#

im sticking a bunch of stuff on it

#

hope to get a camera on it at some point

normal elm
#

The raspi camera is like

jolly mural
#

and it gets stalled going up the stairs

normal elm
#

pretty light

#

GOING UP STAIRS

#

WHAT

jolly mural
#

yes

#

it can do like 2 and then it quits

normal elm
#

Epic

jolly mural
#

I'll post some pictures next time I get to work on it

copper pebble
#

Wondering about something pretty specific.

I'm using GPIOZERO for an LED project of mine on a raspberry pi. I have a function that kicks three GPIOs on at some point, but I'd like to do a try except finally that forces the gpio pins OFF after the function is done, OR something breaks. What's a good way to force GPIOs off using GPIOZERO, anyone know?

#

Never mind! <object>.close() will work! Found it buried in the FAQs.

normal elm
#

Wouldn't also if a break statement was being made like

try:
  pass
else:
  for i in GPIO_list:
    i.off()
  break
finally:
  for i in gpio_list:
    i.off
  break
#

or whatever

stuck thicket
hallow igloo
#

if I set a pin in low state, does it act like ground ?

hallow igloo
#

nwm I just tested, yes low acts as ground if on low state

#

I set pin 2 on low, 3 on high, led is on

tawny fiber
#

eeeeeeeeeeh

#

I wouldn't always be too sure on that

normal elm
#

@hallow igloo So, each pin can 'sink' some power into it as if it were a ground

#

Typically there is a max sink current/power rating per pin

#

But this is typically useful when you use pull up / pull down resistors that will typically make a pin ground/high and the pin will be able to change the state if it wants.

#

Normally high vs normally low

topaz bridge
#

Hi
I recently got an esp8266...
Can I do wifi deauther kinda thing with miropython (with esp8266)...
Also send me a example

#

Tagme

normal elm
#

Deautherizing other people's connections or what

#

@topaz bridge

abstract notch
#

Can I power my raspberry pi 3b with 3.0usb adapter on my motherboard?

normal elm
#

Raspi 3b minimal power consupt is 350ma

#

Your port on your computer I think typically provides 500ma

#

3.0 can have the range of 150-900 max ma

#

Some people report that you 'can' do this

#

but if some weird powerthing happens to your computer through power fluctuation you could hurt your computer's usb ub controller and maybe the onboard power system for the raspi or whatever

#

SO, you 'can'

#

but usually it is just strictly better to get a 5v hub at 1a

abstract notch
#

Thx

abstract notch
#

I think its ok to use usb 3.1 on my motherboard.
because it gives 0.8W more than raspberry pi 3 b can use!
730 mA (3.7 W)
is max raspberry pi 3b power usage
And 3.1 gen 1 can provide power:

normal elm
#

I mean, It's like, fine.

#

I just think getting a 1a wall wart saves a lot of issues

abstract notch
#

But can I use my sony 5V 1.3 Amps charger?

normal elm
#

yes I think 5v is fine

#

if it was a 5v 200 amp charger it's fine (typically chargers are constant voltage and regulate the current draw based on the load need

#

If it was cc then that would be ...not good

abstract notch
abstract notch
#

♦️ Charger output current: 1500 mA
♦️ Charger output voltage: 5.0 V
♦️ Charger input current: 200 mA
♦️ Charger input voltage: 50-60 Hz, 100 – 240 V AC
♦️ Charger standby consumption: Less than 30 mW

ember flint
#

Hello guys! How hard it is to make an house alarm? with gsm control

stuck thicket
stuck thicket
rustic jewel
#

Hello, folks. I'm looking for a power bank.
Requirements :
Minimum 45w output usb-c pd
Minimum 18 000 mAh
Bonus : Wireless charging 10w output

versed moth
stuck thicket
vague crane
#

Oh wow, what an explosion this year!

stuck thicket
#

Preview of the latest "Python for microcontrollers” newsletter! Last one for 2019! Featuring community projects, sneak peeks of hardware, and more! SIGN UP! “Python for microcontrollers” newsletter! https://www.adafruitdaily.com

https://youtu.be/iE5otclY4TQ

Preview of the latest "Python for microcontrollers” newsletter! Last one for 2019! Featuring community projects, sneak peeks of hardware, and more! SIGN UP! “Python for microcontrollers” newsletter! https://www.adafruitdaily.com

#circuitpython #python #micropython

▶ Play video
copper pebble
#

Been messing with my brand new LED strip I got today! However, I'm trying to test it and mess with color combos and stuff, but the process seems WAY too complicated.

I'm using a Raspberry Pi 3b+. Adafruit's Neopixel library. This means I have to sudo my python scripts, else it doesn't work. So, I can't just use Thonny to quickly run and stop the scripts unfortunately.
Well, this led to me editing in nano and sudo-ing the script, but now the lights are stuck on. I SIGKILLED the process that the script is running on, and the lights are STILL on. I'm not sure what to do about this lol. Any tips? Surely there's an easier way of doing this.

#

tldr: py3 script on pi turned on a LED strip. Killed the script, but the strip didn't turn off. How to turn off strip?

ruby agate
#

unplug it

plucky spruce
#

Pretty sure you need to set the LEDs to an off state if you want to turn them off (or just unplug it)

violet valve
#

@copper pebble The LEDs will remain on until you tell them to turn off, as long as they have power.

#

They aren't smart enough to know you killed the script, all they know is that you sent them data to turn on, and nothing else has come in since.

copper pebble
#

Gotcha. So I could give them a 0,0,0 rgb code and they'd turn off? Lit

violet valve
#

@copper pebble Yep!

copper pebble
#

Awesome! Thank you!! :)

violet valve
#

You're welcome!

copper pebble
#

Where is the ACTUAL documentation for the Adafruit Neopixel python3 library? Wtf. I cannot find it.

open dock
normal elm
#

UHH

#

I think that newpixels work by assigning them states through shift registering and engaging or something

#

So I would imagine that you would need to run a script to pass 0x0x0 to each led and engage or something

#

With raspi, I used network drive mounting to easily modify scripts on one computer and have them easy enough to run through putty on the raspi

#

But there are probably less stupid ways to conduct the computer -> raspi work flow

#

If you find a solution, post it here.

#

@copper pebble

open dock
#

ssh is my usual goto. even if it isn't headless.

#

vnc is available, but i've never used it.

normal elm
#

putty is an SSH

#

but you still need to update/work on the code on the raspi

#

The process of copy/paste whatever is too annoying

open dock
#

right. i SSH into the RPi, and work directly there.

#

just via my computer(s).

#

and SCP (SSH Copy) can make transfers easy.

normal elm
#

EH

#

That's pretty annoying because of update times and copy paste

#

SCP?

#

You have to run a command everytime you update the thing on the computer to transfer to raspi?

open dock
#

depends on what i'm doing. these days, most of my "work" is in a git repo, so if i'm coding off of the RPi, i'll just sync through github. if i'm coding directly on the RPi, its through a terminal that is SSH'd into the RPi. SCP use is rare for me, but its quick enough...

normal elm
#

UHH , Maybe you're code skillz are l33t as fuck, but for me when I am doing raspi stuff I am trying things and deploying maybe once every 1-2 minutes on average and the sync times build up pretty fast >.o

open dock
#

i would not consider myself 133t. but, if i'm doing direct RPi work, i just work through SSH. no need to update on a separate PC, then transfer.

normal elm
#

UHH, but then you are using thonny or some other inferior editor or something ?

open dock
#

nano is life. 😄

normal elm
#

Also the update times / refresh rate of your SSH is going to be annoying as fu

#

...You are doing direct text editor ?

#

wth

open dock
#

refresh rate of SSH? ethernet seems quick enough... 🤷‍♂️

#

don't get me wrong, IDEs & advanced editors (i use Atom & VSC) are awesome. but, not necessary.

#

and my up-arrow keys get abuse. thank the heavens for shell history.

normal elm
#

Yeah

#

For me I setup a auto mount network drive on startup

#

all I need to do then is modify the file on my computer which will auto update the file on the raspi

#

then I just up arrow into

#

python3 whatever .py

#

But it is pretty stupid to automount a drive

copper pebble
#

Oh that's not the problem. I remote desktop into the pi.

#

It's a gui display over wifi, so I get some lag, but it doesn't bother me that much.

normal elm
#

I did raspi coding for like, 8 months

#

For small things it's fine.

stuck thicket
#

SHOW AND TELL! 1/1/20 LIVE! 7:30pm ET TONIGHT https://youtu.be/ENVEeFbJBQ8
ASK AN ENGINEER 1/1/2020 LIVE! 8pm ET TONIGHT https://youtu.be/NISWrvV9vBY

To show and share your project at 7:30pm today, view the chat or in discord https://adafru.it/discord and look for the JOIN link to join.

For best results be on a wired connection and have a headset and mic!

▶ Play video
pallid heron
#

Does raspberry pi count as a microcontroller?

#

Nvm, I just read the channel description, sorry.

tawny fiber
#

the raspberry pi does technically not count as an MCU but rather a single board computer (SCB) already

pallid heron
#

Isn't it an SBC?

tawny fiber
#

yes it is an SCB

#

but it also has peripheral devices like its GPIO for example

#

so its also somewhat of an MCU

stuck thicket
stuck thicket
#

WE ARE LIVE! ASK AN ENGINEER! 10% off all items in stock code is TWENTYTWENTY expires 1/1/2020 @ 11:59pm ET #askanengineer http://www.adafruit.com & https://youtu.be/NISWrvV9vBY

normal elm
#

@pallid heron Raspi could be seen as a breakout board for a quad-core ARM Cortex-A7 processor

#

I don't think there is a really meaningful description between microcontroller and a regular computer other than some qualitative inferences for how we interact with it.

#

I would say the presence of GPIO pins controlled by logic is good enough for the consideration of a micro controller

#

ect ect

stuck thicket
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

As 2020 starts, let’s take some time to set goals for CircuitPython in 2020. Just like 2019 (full summary here), we’d like everyone in the CircuitPython community to contribute by posting the…

topaz bridge
#

Can I make a drone with raspberry pi zero with python

#

Is python is fast for a drone

normal elm
#

Yes you can, yes it is.

#

For drones, the chief concern is about weight + power

brave vigil
#

Not sure this is quite the Python question, but I thought I could ask here:
I've made a simple python script for connecting to the serial port COM7 that my microcontroller uses and upon building I get could not connect, access is denied.

#

I've used scripts like these with Arduino and they worked quite easy, just couldn't use arduino serial port at the same time as python script

#

but with stm32 I can't open python script at all

#

I'm using UART as a com protocol

copper pebble
#

Copying the whole thing over here...

I have a program on my raspberry pi that interacts with an LED strip that I use to light my office up. It takes in colors and lights up the strip with the RGB code associated with that color. I have a dict that contains the words and color RGB codes. Code here: https://pastebin.com/Zac4Z3H9

However, as of now, the script runs on a While True loop that just asks for input over and over again. I would like to modify it so that other programs can interact with it and "hook into" it. Like for example I'd like to build a GUI program with buttons on my desktop that can communicate to the script on my raspberry pi and turn on the associated color. I'm worried that this isn't possible to do with the way this program currently works (using the while true loop to "wait" for input). Does anyone have advice on making this program more interactive with other/outside programs/scripts? Also, what the heck do I even use to communicate from my desktop to my raspberry pi - and INTO a script that requires sudo access (neopixel python lib requires sudo for some dumb reason)?

normal elm
#

@brave vigil Access is denied? ??

#

I don't know why, but it could be a thing that once you plug in the STM32 whatever thing into your compy that it launches a program that takes control of the com port

#

You have to shut down that progam I think

#

Either that or that you didn't properly let go of your handle of that port previously

copper pebble
#

It definitely sounds like the COM port is "occupied" by something else, that's what I was thinking too. But I'm not super educated on that stuff yet so I didn't want to speak up

normal elm
#

israphial

#

I think this is solved through threading

brave vigil
#

I had that error when another program is using the port

#

But I can't find where it's open

normal elm
#

if queue not empty:
recieve info, ect

brave vigil
#

I'm using cubemx IDE, but I closed the console

copper pebble
#

@ sin can you further elaborate? Once Elmo's issue is solved. I can wait.

brave vigil
#

I'll continue searching

normal elm
#

UH

#

Try plugging it into a different port

#

and see if it is being handled

#

A small trick that could work is that once you plug it into a known port, you can go into device manager and uninstall/reinstall the port stuff

#

which should throw off any connection to any other program

#

@copper pebble Are you familiar with the socket module in python ?

#

I presume this is all a local network

copper pebble
#

I am not.

normal elm
#

Great

#

Because this is how you do over the network communication

copper pebble
#

Yes, it's all local. I connect to the pi headlessly via SSH.

normal elm
#

Let me just put my scripts here

#

I already solved this problem more or less

copper pebble
#

Wait.

normal elm
#

(I connected to a raspi from my windows comp through the socket over the network )

copper pebble
#

What part of my overall thing are you addressing first?

#

I'd prefer more details over less, as I am still rather new to this stuff.

#

I use puTTY to connect to the pi if I want just a terminal, and I use windows remote desktop if I want a GUI.

normal elm
#

EH

copper pebble
#

I've assigned the pi a static local IP or whatever it's called.

normal elm
#

I built my own gui to communicate with a raspi

copper pebble
#

Ayy, that's fucking AWESOME. Holy shit.

hasty zealotBOT
#

Hey @normal elm!

It looks like you tried to attach a file type that we do not allow. We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.

Feel free to ask in #community-meta if you think this is a mistake.

normal elm
#

Take a look at thi-

copper pebble
#

lol

normal elm
#

Let me know when your done with that

copper pebble
#

Yep, reading it now

#

Struggling to read the scanned pages, but I'm basically done.

normal elm
#

Yeah yeah

#

Those are just developer notes

#

Not important

copper pebble
#

It looks like you did a LOT of planning. Perhaps I need to figure out exactly what I need.

normal elm
#

UH

#

It was because I did it all in 4 days

#

including documentation

copper pebble
#

I mean- it is important though. I haven't done enough planning, it sounds like. But, I don't know where to begin, so.

normal elm
#

You'll pick it up

#

I took a few professional classes on how to plan technical projects

#

and i was a consultant for a few yeras

#

ect

#

So

copper pebble
#

Whoaaaa

#

That's really interesting actually 😮

normal elm
#

Yeah. I haven't turned it into $$ yet :/

#

But w/e. We will.

copper pebble
#

Soon, though, I imagine.

normal elm
#

No

#

next year

#

Uh

copper pebble
#

I wish I could pay you myself, and make this more formal, but I cannot afford to do so.

normal elm
#

I mean, this server is about payment 😛

#

pay it forward, ect

#

So

copper pebble
#

Then I promise to pay it forward when I have the ability and means to do so.

normal elm
#

There are two important things you'll need

Socket

Threading
----> queue

#

Great.

copper pebble
#

I know a fair bit about threading already, I've used it in the past (and actually used it for a past iteration of this led strip program!!)

normal elm
#

socket allows you to read data on the computer's ports and send data to ip:port on other computer across the network

copper pebble
#

Also - I'm going to start taking notes, so feel free to keep going even if I don't respond right away

normal elm
#

It's fine

#

for your raspi - you want to setup a constant listening deamon (thread) that will parse incoming data and place the data into a queue

#

Your while loop will at every loop check to see if anything is inside the queue object, if not, it continues as normal. if there is, it takes the object out of the queue and implements the command

#

You then will need to setup a script (gui, console, whatever) to send the correctly formatted info over to the raspi

copper pebble
#

is it best to host the daemon on my desktop, a server (which would be on the pi, preferably), or on the pi?

normal elm
#

Your server (Your raspi) will need to have a deamon that listens and passes data to your main running loop

#

That script (the second thing) I just posted is a class I made that transmits to the raspi

#

You see it is pretty goddamn easy to do

#

😛

copper pebble
#

so socket is stdlib?

normal elm
#

UH

#

maybe?

#

I don't know

copper pebble
#

i imagine

normal elm
#

It might not be

copper pebble
#

tho i guess it doesn't matter, really.

normal elm
#

Yah

#

It has dials and other things that you could use

#

It'll take like, 4-12 hours to learn/get good at

#

But it's w/e

copper pebble
#

Okay, so, let me get this straight... A daemon is running on my desktop that waits for information to be given to it to do something somewhere else. The daemon passes that information to the Pi's daemon, which is ALSO waiting for... Anything. The PiDaemon has pre-designed things it looks for, and acts accordingly when it receives expected inputs from the twin DesktopDaemon. When it receives things not expected, it throws an error, logs, and restarts/purges and starts the wait loop over again.

Does that sound correct so far?

normal elm
#

Isn't your raspi controlling the LEDS?

copper pebble
#

I'd prefer to use Kivy actually, if that's cool with you fam

#

Yes

normal elm
#

The threaded function/whatever should be on your raspi as a listener

#

You can setup your desktop however you want

copper pebble
#

Threaded function?

normal elm
#

Threaded function = deamon

#

I think

copper pebble
#

Ok, so the thing watching and waiting for information and doing something with the information.

#

Right?

normal elm
#

That sounds correct

#

The gui application has several threads running at once TBH

#

But that is neither here nor there

copper pebble
#

Right.

normal elm
#

It just depends on how you want to transmit the info

copper pebble
#

I actually use tkinter for a program I use on my desktop (it's like a hot-bar launcher) and it's definitely using some sort of threading

normal elm
#

Also remember when you are doing threading crap

#

that you don't have one deamon take all the resources

#

while(True):
pass

#

Will never allow any other threaded functions to work

copper pebble
#

I don't know how I want to transmit the info. I have no idea how to, or what good/bad practices are, how I should, how I shouldn't, etc. This is my first dive into this sort of thing.

normal elm
#

Yeah

#

It's a lot of googling

#

I mean, for this purpose, getting your thing working is 100%

#

Only when you have other concerns/constraints do you need to worry about the other technical crap

#

What you should be working on is either implementing or developing custom helper classes that make the handling of these things easy

#

put those classes in libraries and import them

#

If you do that, you're probably fine. Then it goes into making more sophisticated classes that can handle things more generally or whatever

#

There probably is someone already who already coded all this stuff

#

But if you want to do it yourself, this is where you can start

copper pebble
#

Okay.

#

Sorry for the delay, I got a phone call. I read what you said though and have thought about it, and it sounds like i need to draw out/plan exactly what I want to do, then just fill in the information blanks, like how to do stuff, then just develop one piece at a time.

#

I'm glad to hear that you think this is easily doable though.

#

What you've told me so far has been extremely valuable, and I'm really grateful. I didn't know what a lot of the technical terms for the things I need to use were. Now I know that those "watching threads" are called daemons, for example.

#

Okay... Can I ping you for random questions, @normal elm ? If not, sorry for this ping and I won't do it in the future. I'll google what I can, of course, but occasionally I do like to bounce ideas off of people who sort of know what I'm doing.

normal elm
#

It's np

#

Ping away

copper pebble
#

Awesome. Thank you very much.

normal elm
#

NPnpnp : P

#

Planning and tracking hours is the way to get better at projects btw

copper pebble
#

Can you explain that?

normal elm
#

Yeah

#

So, the 'skills' of project management actually that hard to pickup

#

So, you might ask a simple question like "How long will completing this project take? "

#

Well, you break the project up into actionable steps, you break those actionable steps into their most discrete constituents. You guess how long it takes to do each step, you add up all the time and you get 'total time'

#

You then plan steps across a number of days and say "It will be done by this date"

#

--
Easy process, straight forward, ect

#

The problem is that humans suck at estimating how long something will take

#

The general rule of thumb is that if you've done a project before, you give 2x the estimate for how long it will take

#

How long will it take for you to complete a project that requires you to learn something ?

#

ect ect

#

So one of the easiest ways to get better at this sort of crap is to

  1. plan out your project into actionable steps
  2. guess how long each step takes to complete
  3. record how long you spent on each step
  4. reflect on why your estimate was off
#

People hate this and many / most devs never learn this because it's -hard-

#

it holds them accountable to their own bullshit

#

Here

#

Example time

copper pebble
#

Sounds like something I would massively benefit from doing, then. Like, big time.

normal elm
#

LOL

#

I use this

#

Other people use other stuff

#

I also have used notebooks, ect

#

Once you understand how you work and figure out where you are weak and how you over estimate/ underestimate yourself, you'll get better at completing projects

#

This is incredibly important professionally because then you can be like

#

"Oh, this will only take me 30 hours to complete. This project is worth 20k to someone else. I can sell it to them for 10k, I am going to make 330$/h"

#

ect

copper pebble
#

Right. Again, that seems like something tedious to have to tack on top of my creative process, but also something EXTREMELY valuable.

normal elm
#

It gives you business since/accumen because you know exactly how much of whatever goes into projects and allows you to price them out

#

UHH I am a creative too

copper pebble
#

Shit. Fine. You've talked me into it lol. hahaha

normal elm
#

I actually don't believe in the freeform creative process at all tbh

copper pebble
#

I don't know what that is.

normal elm
#

UH

#

Like

copper pebble
#

(i don't have a process)

normal elm
#

"Schedules, paperwork, whatever interferes with my process " is something i hear a lot in artist/creative circles

#

To me it has always meant "I don't like facing reality. It doesn't 'hurt' your creative process by knowing how you spend your time."

#

IMHo

copper pebble
#

I agree, in short, although I've never been a very structural person. That's probably why I struggle to become truly excellent at things.

#

I struggle to take a systematic approach to things. I often just sort of yeet it.

normal elm
#

Structure is a muscle

#

You build it

#

Ect

#

Take some concerted effort and you'll get some of the powerful benefits

#

You may never be a structural person through and through

#

But you'll still be way above purely structure/purely yeet

copper pebble
#

Alright, so I've made up myself a master document for the project, including some basic documentation of where I'm at now, as well as different parts of the project I'll need to complete, questions/problems I need to figure out, development categories (I broke the whole project down into parts and gave each part a time to completion estimate). I'd be happy to show you it if you want to see it, @normal elm

stuck thicket
#

Preview of the first "Python for microcontrollers” newsletter for 2020! Sign up for some great content, community projects, sneak peeks of hardware, and more over on the “Python for microcontrollers” newsletter! https://www.adafruitdaily.com

https://youtu.be/k71PdFD0US0

Preview of the first "Python for microcontrollers” newsletter for 2020! Sign up for some great content, community projects, sneak peeks of hardware, and more over on the “Python for microcontrollers” newsletter! https://www.adafruitdaily.com

#circuitpython #python #mic...

▶ Play video
broken rover
#

Does anyone have experience with Processor Expert or MC9S12A64 programming?

stuck thicket
echo meteor
#

If I buy a thermistor with a max voltage of 25 mega watts, do I have to provide something close to that voltage?

vague crane
#

Watts aren’t voltage, and 25 megawatts is like a power plant. Are you sure you have the units right?

echo meteor
#

uhhh

#

that depends on whether I would be wrong in assuming that 30 mW's stands for 30 mega watts

jolly mural
#

milliwats

echo meteor
#

Alright well excuse me while I hide in embarassment

normal elm
#

MW?

#

With that much power you could almost go back to the future

#

saying a max voltage of 25 mw is also weird

#

Thermisters as I recall are temperature
varying resistors

#

As long as the Thermister varies at some measurable rate (typical 2-200 oms?)

#

you could use 5v and be fine

#

Of course check your spec!

frank mulch
#

@normal elm you need 1.21 GW to go back to the future (or maybe 1.21 JigaWatts, as the Doc said)

#

@vague crane powerplants are usually in the GW range. you can get 25MW from a locomotive, which is also about the largest portable generator size

#

@echo meteor your thermistor will have a nominal resistance, like 10k ohms (or 1k ohms) which is at 25c . NTC is typical and that means as the temp goes up the resistance goes down. (Negative Temperature Coeffcient). put it in series with a ordinary resistor that matches the nominal resistance, with 5v at one end and ground at the other, and read the voltage in the middle. 2.5v means 25c, and then it will vary (non-linearly) with temperature from there.

#

the 25mW part you can ignore unless you hook it up in a non-typical way (like if you try 100v instead of 5v or something)

jolly mural
frank mulch
#

Ah - actually a locomotive only generates about 3MW, So my memory is off there.

normal elm
#

@frank mulch In the 1985 that's true! But luckily we have better energy conversion technology today 😛

frank mulch
#

@normal elm I was just going off the top of my head, with a locomotive at 4000 HP * 746 W/HP = 3,000,000. that's 100% conversion. I know it's actually only in the high 90's for a generator that size. in the locomotives case, the 'generator' (actually an alternator) has not changed much in the last 50 years. However, the traction motors are now all AC with solid-state inverters, where as in 1985 the traction motors were DC motors with commutators and brushes. So the locomotive drive part is more efficient, Not the generating part. Now maybe they have bigger diesels or something, but that would only change my (approximate) total numbers, not the efficiency.

normal elm
#

I wasn't disputing the car needs to go above 88 mph, they didn't use plutonium to turn the wheels. The flux capacitor (an electronic component ) has improved vastly so you don't need to spend wasted energy into inefficient charging circuits to and other stabilizing elements. With more effiecent conversion ratios and better quality parts as well as no longer needing to use prototype equipment (Being able to be run on biofuel as shown at the end of the back to the future 1 from 2015) we can make the conclusion that it really shouldn't still take 1.21 jigwatts to run

#

@frank mulch

frank mulch
#

@normal elm Obviously I misunderstood the 1985. Actually there have been real scientific papers written that postulate real time travel (or is it FTL?, which implies time travel), but it involves more energy than a Galaxy can generate ( which probably means a JigaWatt is 10^60 not 10^9)

normal elm
#

Lol! I think that relativity says that you can't go FTL. I am only a BS in phys so I can imagine people theorizing about FTL somehow

#

But everything I've ever been told by people is that it is a hard rule that you can't go FTL

frank mulch
#

@normal elm Einstein only says you cannot travel at C. his equations do not say you cannot go faster. Of course most people think to get to a speed greater than C you would have to pass through every speed on the way there, including the 'impossible' C=1.000000000

normal elm
#

as you approach the speed of light, the relative time someone sees you in another reference frame goes to infinity

#

It takes infinite energy to go upto the speed of light

#

It's weird

frank mulch
#

@normal elm right . but above the speed of light the denominator is not 0. it is sqrt(-number)

#

which is an imaginary number, then you get t/xi which is not infinite (but it is a complex number, which maybe is not possible, it is just not as impossible as 1/0

#

so if you can somehow jump from 0.9 C to 1.1 C without passing though the speeds in between, your golden 🙂

open dock
#

so... negative mass?

frank mulch
#

I r un engeneer. The physics is beyond me 🙂

pallid heron
#

I got a BBC micro:bit go today

#

: )

normal elm
#

D:

#

I am trying to install micropython esp32s

#

I got it working

#

But I am trying to put a main.py script on it

#

and it's failing so hard

#

makes me cry

copper heath
#

any error log? Can you start python and print hello?

normal elm
#

Yes

#

UH

#

I can output stuff soon

#

I can putty /serial connect to my esp32 -s and do command line things

finite ledge
#

Ok, so I've got a micropython board with an accelerometer, BTLE module and some other goodies and I'm having issues just trying to test the accelerometer to make sure its working or solidly connected. Is this something I should be able to get working over REPL?

sharp grove
#

Just toggle an LED.

#

You can do simple stuff from the prompt

normal elm
#

I am trying to use Repl

#

what board are you using

finite ledge
#

My board?

normal elm
#

Yes

#

Which board!

finite ledge
stuck thicket
tropic iron
#

what is the most compact I can get a computer of some type that can at elast run python, other languages such as C# or C++ or Kotlin would be nice too

jolly mural
#

probably a pi zero

finite ledge
#

I second the pi.zero. Cheaper than an arduino too

frank mulch
#

microcenter sells the pi zero for $5 qty 1, $10 qty 2-5, and $15 for more than 5 (Pi zero without radio - with WiFi it is $5 more)

#

I have started to make it a point to always get one everytime I go there

finite ledge
#

Wish I had one myself, buying the intel compute stick was a mistake 😦

frank mulch
#

My current project is converting a Pi 3B running Win IoT 10 to linux and kivy

#

of course now that I decided to get a pi zero every time I go to the store, they are out (they have the pizero wifi though)

stuck thicket
#

hi folks, here's the DRAFT of the upcoming “Python for microcontrollers” newsletter that ships out tuesday at 11am ET via adafruitdaily.com - please send any links, news, events and more via an issue/PR, or @ us or really any thing 🙂 we'll get it added!

https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2020-01-21-draft.md

ruby granite
#

hello
i have a question about python and raspi
for example; i will use 8 pins for input
and i wanna check this input with out loop
can i do that and if i do, how can ?

umbral owl
#

hi

#

how do i get started with a raspberry pi

#

any recommended tutorials?

steel raven
#

do you have any particular interests, Joris? That may help guide the search for examples/tutorials on using a device like a Raspberry Pi

umbral owl
#

Not really

#

My dad bought it and my little sister wants to just play with it

#

So very basic projects are fine for now

steel raven
#

Since this is a Python-themed Discord, then a great goal would be to install a Linux distribution (start with Rasbian, and work up), with the goal of setting up basic Python-based web servers (look into Python-based tools like Flask and Django)... you'll learn things like managing a remote Linux instance (via SSH), and developing in Python on a remote environment

#

A neat non-Python use for the family is a private Minecraft server, if your family has done any Minecraft (doesn't need to be public... just get it to the point where you have a persistent server for your family to log in to)

umbral owl
#

ah cool

#

i actually have a vps which has a minecraft server haha

#

but that sounds like a good idea thanks :--)

steel raven
#

well, just be careful about exposing any home-related computer (like raspberry pi) to the wide internet... i meant the minecraft server + webserver ideas as a totally internal-to-your-home-not-exposed-to-world projects,

#

if you misconfigure the security on the VPS instance, then it can only screw up the VPS if someone gets in,

#

if you misconfigure the security of your internal home network, then the risk of bad stuff is much worse

finite ledge
#

in Micropython, when I run i2c = I2C(freq=400000) I get AttributeError: type object 'I2C' has no attribute 'MASTER' in response, am I missing a step or something?

stuck thicket
stuck thicket
hallow igloo
#

hey so i have a raspbrry pi 4 modle b and it seamse im not getting prower from usb / hdmi

real terrace
#

Have you bought the power source with the Pi or are you using a phone charger?

#

@hallow igloo

hallow igloo
real terrace
#

I see, so problem solved.

real terrace
#

Can someone help me with setting up sockets between two ESP8266 boards using micropython?

hasty zealotBOT
real terrace
#

And this is the main.py (I've just noticed a mistake in the main.py, on line 6, instead of socket. I have just'', )

#

So far.

#

On the server side.

#

The boot.py is the same on the client side.

#

I'm trying to connect them through my phones hotspot.

#

In the end this will be an RC car, and one ESP will be on the car the other one will be the controller.

#
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.connect(('', 1234))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 103] ECONNABORTED
>>> 
#

And this is what I get when I try to connect the client.

jolly mural
#

you have no address

real terrace
#

The tutorial I was trying to follow (and modify for my needs) uses socket.gethostname() but in micropython I don't have that.

#

I've tried to get the hostname with os.uname() but both my ESP boards give the exact same results.

#

I've seen another tutorial (on how ot set up micropython ESP8266 server) in which they've used just'' instead of hostname, so that's what I've tried the last time. But in that tutorial the ESP is waiting for response from a webpage, I was trying to mesh the 2 together somehow.

#

How do I find the hostname of the board in micropython, or how do I set it up, change it to what I want, so that it will always be the same?

#

Or can I find another board in the network by the MAC address?

tawny fiber
#

in fact boards only find each other over MAC Addresses

finite ledge
#

This is just driving me crazy, is there a better resource for micropython than micropython.org, or am I just doing everything possible wrong? Like, I'm trying to set the RTC, and just copy-pasting the examples throws errors on almost everything I've tried

tawny fiber
#

@finite ledge id say report everyone of those to micropython, thats gonna be helpful to both you (cuz you might get help) and the project (cuz they might fix bugs)

finite ledge
#

To be clear, I'm talking about the documentation page, not the forums.

#

I mean, could it be because I'm using an STM32 and not an ARM

tawny fiber
#

stm32 is arm....

finite ledge
#

Yeah, my bad

lilac trail
#

Hey guys, am wondering does anyone have any experience with moving a CNN application (classifying audio data) to an embedded system?

#

I’m using the SiPeed Maix Go board. I’m having trouble figuring out where to even begin as this is my first time attempting something like this

#

The board has MicroPython support

normal elm
#

Classifying audio data? What do you mean?

#

@lilac trail I did some embedded audio stuff awhile back

lilac trail
#

I’m extracting MFCC features from various different labelled sources of audio. For example a dog barking or a car siren. I’m then training a CNN using this in order to perform classification @normal elm

normal elm
#

LOL, that is too far outside my expertise. I only transformed data on a arduino. I am working on a python audio project though.

lilac trail
#

I have it working on my PC. I’m just curious whether I can modify it to do that audio pre processing on an embedded device

#

Ahh that’s fair enough

normal elm
#

It just depends on the speed of that device

#

On raspi- no problem

lilac trail
#

Yeah that’s what I’m gonna go for I think

#

I can keep all my libraries too

normal elm
#

44khz sound transformation means if you apply like, 3 steps, you need at minum if each step is 8 cycle, 500khz operations

#

Not to mention storage and other overhead

lilac trail
#

Yeah it definitely builds up

normal elm
#

It just depends on what you are doing, what it looks like, ect ect

#

Probably some arduino mega can power through whatever transformations you are doing

#

But translating python to c..

lilac trail
#

Yeah not a fun task

normal elm
#

Maybe just try it on esp32, esp8266 (MicroPython)

#

It can stream at like, 3 MB (Mega bits? p/s

lilac trail
#

Yeah the board I have runs micropython

#

Sadly the application I made on the pc contains a ton of libraries that I’ll need to rework

normal elm
lilac trail
#

Via cable

normal elm
#

I have been trying with mine, I can connect and have a runtime enviroment

#

...

#

LOL

#

I mean

#

I have access to terminal, but trying to shove files onto it seems hard/haven't been able to do it

lilac trail
#

Oh my bad lmao

#

I’m using this great little tool

#

Lemme grab its name

normal elm
#

"Using a cable" OH RLLY

#

lolol

lilac trail
#

uPyLoader

normal elm
#

I'm also looking for an over the air solution tbh

lilac trail
normal elm
#

I think I found one but it requires me to put it on the damn microcontroller 😛

#

Very dank, I'll take a look at it

lilac trail
#

Ahaha if you figure it out lemme know

normal elm
#

Yaya.

#

Oh btw, how long does it take to learn deep learning ?

#

I have a physics background w/ some data analysis and probably strong python skilz

lilac trail
#

In that case not too long

#

With that background you can probably have a very decent understanding of it within a couple of months

#

Linear Algebra + Stats/Prob are your main background pre requisites

#

Even then, you can do an awful lot with a very basic understanding

#

Tons of great books and articles on it that are really helpful

#

If you don’t know where to begin the Andrew Ng course is a good starting place imo. You can build up your knowledge base from there

normal elm
#

I can figure out how to go about it

#

I am supposed to learn software engineering with algos and data structs -> learn how to create code bases - > Maybe learn dev-ops -> mL?

lilac trail
#

Honestly if you just want to learn Deep Learning + ML, you can focus on just those topics

#

The Andrew Ng course is good because it assumes no programming background

#

He teaches it using either Matlab/Octave

#

Given your background you should fly through it

normal elm
#

I am only a bit biased because I am work focused.

#

Not that it is hard work or that there aren't resources available to learn

lilac trail
#

Software Eng/Dev Ops etc are great skills to have too of course, but if they’re not your priority, they aren’t pre requisites so to speak

#

In order to go about learning Deep Learning

normal elm
#

I'm just looking for that dank $$ I don't know the best way to go about it other than fundamentals -> Specialize into what seems highly profitable

#

Seems like security is the easiest/highest paid position

hallow igloo
#

Not getting a response

steady juniper
#

maybe try ip a or ifconfig

hallow igloo
#

Hey there guys

#

Is there someone who could help me setting up a breadboard + buttons and connect it to my raspberry pi 4

#

GPIO

#

I got my wires, buttons, connectors

#

I just dont know where to put it

#

I tried with google, but my pi started smoking as soon as i connected my wires to it

#

LOL

median grove
#

Hey, not sure if this is the right channel for this question. However I want to explore learning to program things using a Raspberry Pi and a load sensor, and or other sensors.

Is there a good resource to start learning?

I saw an overly simplified tutorial for building a scale but little real meat explaining how to work the code side of things.

#

I also know some people have GitHub resource but kind of want to understand the background a little better to build my own stuff.

tawny fiber
#

You want to understand the background better to what degree exactly

#

To, what does the library you're gonna use do internally

#

To, what operations does it perform on your hardware to communicate with other

#

To, what signals does it produce on the wires and why

normal elm
#

Uhhhhhh

#

Don't smoke your pi

#

Yeah, we can help

#

Give me a bit though @median grove

median grove
#

@tawny fiber , so I guess what I am trying to better understand and learn is.

What signals are being output by the sensor and how to interact with them.

I think there is an RPi.GPIO library that I would use to interface with the sensors signals. That are connected to the board.

I know there are GitHub programs for interfacing with the HX711. However, I wanted to understand how those programs worked. Especially if I might do something more complicated and need multiple load sensors attached to a pi.

#

@normal elm no rush

hasty zealotBOT
#

Hey @tawny fiber!

It looks like you tried to attach a file type that we do not allow. We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.

Feel free to ask in #community-meta if you think this is a mistake.

normal elm
#

Yah?

tawny fiber
#

So here is the datasheet for it....seems to be a 24 bit ADC that outputs it's data over a very simple interface with one clock and one data pin....I guess one could read through the datasheet and get at least the gist of it. I don't think I could explain a lot more than just the sheet itself without a specific question

normal elm
#

Got yourself a circuit for a wheatstone bridge

tawny fiber
#

Well it's pretty clear explained that it's a 24 bit ADC for weigh scales so yes you can use it for that if you want

#

Not my chip after all

normal elm
#

Yeah yeah. It's a nice convenient thing. You could prototype your own bridge and just hook it up to a raspi if you feel so inclined

#

But then you are reading voltages instead of signals out

median grove
#

Thanks for the info. I will have to do additional reading and probably play with it a bit to learn.

stuck thicket
hallow igloo
#

Guys should i buy Raspberry Pi 3 or Raspberry Pi 4 instead?

#

I’m on a budget and i just want to get started learning RPI

#

Is there a huge difference between the two?

#

And if i should get Raspberry Pi 4, is buying the 2GB ram version is a bad idea? i’m thinking of using it for computer vision mostly.

#

And any good budget camera recommendations for comp vision? Thx guys!

normal elm
#

@hallow igloo Budget meaning what

hallow igloo
#

I’m a student and my money is limited

#

Of course i could get RPI 4 but rip money then

#

I don’t want it to be too overkill, just using it for learning purposes, which one should i get?

normal elm
#

Budget means how much

#

For little as possible is what I am hearing?

#

You need a sd card with 16 gb min, 32+ gb preferred

#

and just a 5v micro usb charging cable /adapter

#

I spent 8 months developing opencv scripts on this

#

You'll want a fan to blow on it. If you didn't want to go to the cheapest option I would do

hallow igloo
#

Yep! as little as possible sorry for my absurd sentence xD

#

Thx dude this is exactly what i need

stuck thicket
burnt spear
#

I am looking for information on how to port circuitpython library into micropython. Videos or any type of instruction. Thanks in advance.

normal elm
#

That's like asking "How can I import python 2.7 into 3.6?

#

Circuitpython and micropython are different languages based off of python developed for embedded boards

long orbit
#

@burnt spear I believe the folks on the micropython forum have done it a number of times and may have tips.

burnt spear
#

Thank You tannewt.

normal elm
#

Am I just wrong @long orbit

long orbit
#

@normal elm wring about what? Circuitpython is based on micro python so there are similarities. Circuitpython has a different hardware api though so drivers can’t take a bit to convert.

hallow igloo
#

hello, I cant find a good libary for the IAQ core P air sensor all are outdatet and dont work

#

maybe someboy knows a good one

hallow igloo
#

:/

tawny fiber
#

If you can't find good ones

#

And nobody tells you good ones

#

Write your own lol

ebon owl
#

I'm about to try to write a simple python gcode host software to communicate with those 32-bit cheap 3d printer boards

#

Anyone who has done something similar please do sound out!

#

@hallow igloo how do those IAQ air sensors compare to the MQ ones

hallow igloo
#

they are better

#

you dont need to calibrate them, they dont need to heat up so long, they are smaller

#

the IAQ from ams

#

@ebon owl

ebon owl
#

ok cool, I had to write my own MQ series code

#

the code was equally trash

hallow igloo
#

mq's are bad

ebon owl
#

they are extremely cheap

hallow igloo
#

the ams ones are costing $17 too is really

#

okay

ebon owl
#

what is the sensitivity for the ams ones

#

I was looking for an ethylene sensor sometime back

ebon owl
#

as in like reactivity

hallow igloo
#

look at the datasheets

ebon owl
#

Its very well documented

#

but unfortunately they seem to function almost similarly to the MQ series sensors

#

there is a run-in time of 3-5 mins for the sensor

hallow igloo
#

yeah but mq need 24hrs

ebon owl
#

and a burn-in time of 24 hours

#

its quite the same actually

#

I can't say for sure, until I get my hands on one to test it out

#

I definitely like the documentation for one

hallow igloo
#

where do you see the burn in time?

ebon owl
#

so you writing for your own library?

hallow igloo
#

not yet

#

I first need a logic analizer

ebon owl
#

these are still gas mixture sensors

#

you just need an approximation that works really

hallow igloo
#

which sensor docu?

ebon owl
#

the AS-MLV-P2

#

it has a 10s respond time, and about 1 min for recovery

#

I'm getting about 2s on the MQ-3, but the asm sensor might actually be much shorter

hallow igloo
#

What ML projects i can do with ESP32 other than face detection?

normal elm
#

Typically the reason why ML for cameras is so great is because the vast amount of incoming data to work with

#

Something you could do and make maybe some money with

#

is setting up cameras with drivers license detection near intersections

#

and record cars when they come and go and log when they pass the intersection

#

Then you can do inferencing based on arrival/distance times for given customers or something

hazy anvil
#

has anyone ever got a voltage output or output of some kind from a PIR sensor

#

I know this isn't strictly python related but im doing my raspberry pi project all in python

stuck thicket
hallow igloo
normal elm
#

@hazy anvil It looks like the standard hc-sr501 pir sensor has a 5v v in with an output pin that goes high when it detects something of a certain threshold that you can change with a variable control on the sensor

#

The pin if it detects goes high or else it's low

#

@hallow igloo It seems pretty straightforward from the data sheet

#

Typically this is a sensor you would place on a circuit board and solder it in, but you can solder leads to the 4 pins

#

In the sheet there are suggested circuits + equations to figure out what voltages/ whatever you need to set it up is

hallow igloo
#

but which pin to which i cant figure it out

#

maybe you could higlight it ^^

normal elm
#

You need to modulate the heater somehow probably to get consistent readings in different environments?

hazy anvil
#

@normal elm thanks for the response I saw a paper where they were able to get an indicator of distance doing something like that.

normal elm
#

??

#

That isn't really what PIR is for

#

There isn't a directional light source

#

It is just a photosensor that has omnidirectional IR fed into it and if it goes over a certain threshold you say it is activated

#

You CAN use it as a distance sensor for calibrated light sources

#

But that is just a more tightly constrained problem of using a single camera as a distance sensor, which is pretty difficult and most companies opt to use 2 or more

hazy anvil
#

perhaps but it would be useful for what I am currently doing

stuck thicket
stuck thicket
normal elm
#

@hazy anvil There is a difference between using it as a distance sensor IE: 10cm -> 50cm vs using it (as I think is suggested in the paper) as a photogate

#

where you trip sensor one, then trip sensor 2 and a differt time

#

You know the distance between them

#

You know the distance, time, so you know the 'average velocity'

#

That isn't the same as object tracking lets say in a camera

#

For cars and other things that take a fairly linear path at relatively constant speed it's fine

#

It just depends

mild palm
#

I'm thinking of making for my A-level coursework an autoturret or, if that's too difficult, basic facial recognition with an LED.

I've never done anything hardware related like this before so this is all new to me.

2 questions.

  1. What should I use? Arduino, raspberry pi (I have a 1st gen one at home already)
  2. What library should I use which would be compatible with the above?
mystic nova
#

i would use a rpi. its way easier writing python for a rpi and they already have a bunch of stuff set up for working with cameras. and ofc a rpi is way more powerfull

#

for 2., do you mean what lib to use for facial recognition?

wheat loom
#

You'd probably a newer rpi, I think at least a 3b to keep the image processing relatively quick

mystic nova
#

(sorry for my shitty pic)

#

they also use very little power

#

but youd need a rpi that has usb 3.0 i think

wheat loom
#

Man, this thing cost a lot

#

A RPI 4b 4go would be enough powerful

mystic nova
#

really? i got it somewhere for free and i've never used it hah

mild palm
#

Ig I'll look into the newer gen Rpis

#

My 1st gen one struggled to even run chrome - built in for some reason

#

Oh damn 4th gen is cheap

wheat loom
#

The rpi 4 is built to be a real computer used daily

#

Yeah

mild palm
#

How on earth is that 4gb worth of ram wow

mystic nova
#

oh awesome! that stick has this:

Processor: Intel Movidius Myriad X Vision Processing Unit

wheat loom
#

The stick is around 100€

#

That's a lot haha

mild palm
#

If I bought the rpi + neural stick it would come to over £100. I think I'll just get a regular gen 4 rpi

#

It's only £60 on amazon Arkarys. Where were you looking?

wheat loom
#

Google shopping

#

¯\_(ツ)_/¯

mystic nova
#

yeah the stick is probs overkill

mild palm
#

Def

wheat loom
#

I didn't looked very far tbh

mild palm
#

The idea for my coursework is probably overkill but it'll be fun compared to purely writing software

#

Everybody gonna be making some boring apps

wheat loom
#

That's a good idea

mild palm
#

The best part is, if I use an rpi I can just send it the code as a compiled exe

#

Means I don't have to figure out how to install Python and the libs on it

wheat loom
#

Although, you should start small and make sure to have a valid product pretty quickly and then expand it, if you work under a short time limit

#

Well, the rpi is a computer

mild palm
#

Not sure how long we have for the project - I think it's a few months

wheat loom
#

You have billions of way to deploy the code

mild palm
#

Yh but I've never used a Linux system which Raspbian is based off of?

wheat loom
#

Yes

#

It isn't really hard

mild palm
#

I'm a dirty windows user

wheat loom
#

But it takes some time for sure

mild palm
#

I think compiled exe would be way quicker - less time spent learning the OS means more time programming

wheat loom
#

If it is a python script you don't have any binary

mild palm
#

What do you mean?

wheat loom
#

You don't have any exe (binary) with python

mild palm
#

I mean using Pyinstaller.

#
  • --onefile
mystic nova
#

the rpi4 comes with python3

mild palm
#

Am I being stupid here?

wheat loom
#

It would be probably hard to maintain for probably nothing

mild palm
#

Oh that's useful

wheat loom
#

You could just send the code and run it

mystic nova
#

you can just call python3 myfile.py

#

on the rpi

mild palm
#

And yh I forgot I would be constantly be developing on it...

#

Slight oversight on my part

wheat loom
#

You can also use pip to download external packages like on windows

mystic nova
#

its probs easier to develop on the rpi so you can test stuff, but if you want you can develop on your pc and then push the code onto the rpi

wheat loom
#

The shipped python with raspbian is probably not up to date though

mild palm
#

How would I connect components to the RPI such as a servo and a camera?

wheat loom
#

There are 40 GPIO pins

mystic nova
#

the rpi has a extra camera connector for a rpi cam

wheat loom
#

More or less the same concept as on the arduino

#

A bit harder to access though, but nothing too crazy

mild palm
#

Fair enough

#

Would I still have to buy a breadboard to make my life less of a living hell?

#

I'd presume so

wheat loom
#

Oh yeah

mystic nova
wheat loom
#

Well, expect if you use direct connection

#

But if you want like a debug led, you'd need a breadboard

mild palm
#

I've gotta go disappear and finish off some maths work due next, thanks for all the info. I'll probably be in the channel a fair bit going forwards.

mystic nova
#

not all gpio-pins are the same! as you can see some of them are for MISO/MOSI, others for SDA so id just use a "plain" one unless the part you are using wants something else

mild palm
#

No idea what a lot of that terminology means: [MISO, MOSI, SDA etc.]

mystic nova
#

dont really need to know any of it haha only stuff your parts use 😉

mild palm
#

Fair enough, thx

wheat loom
#

With microcontroller, Google and the datasheet are your friends ^^

mystic nova
wheat loom
#

Rpi aren't Intel though

mild palm
#

Unfortunately

wheat loom
#

But it apparently runs it okay

tawny fiber
#

So I know people that made an autoturret with facial recognition on an rpi3b as a level course work

#

The face recognition was pretty trivial with opencv2

#

And I remember that the vast harder part was estimating distance

mystic nova
#

Pff just use a powerful enough gun! No bulletdrop!

mild palm
#

Sniper autoturret

tawny fiber
#

estimating distance from just a picture is actually a preeett non trivial thing todo with a computer

normal elm
#

I worked on that problem for about a year actually from my previous job

#

Using a single camera for distance measuring is a nightmare unless you know anything about the object you are tracking

#

If you are looking at a human and you can guess the relative size, you are pretty good to go

stuck thicket
#

here's the DRAFT of the upcoming “Python for microcontrollers” newsletter that ships out tuesday at 11am ET via adafruitdaily.com - please send any links, news, events and more via an issue/PR, or @ us or really any thing 🙂 we'll get it added! https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2020-02-18-draft.md

quartz zenith
#

can anyone suggest me good resource for micropython

radiant depot
fathom bone
#

Hey Guys, are there any good tutorials out there to develop an app to control and read in/output from GPIO pins? Liked to use flask to have a web app

tawny fiber
#

well if you know how to use flask

#

and know how to use the GPIO lib of whatever youre targeting

#

and know html and JS

#

i dont see why you need a tutorial for doing the whole thing

normal elm
#

UHH

#

Just because you can create and put all the individual pieces together doesn't mean it is really useful to see how professional/someone else does it before you go about doing it

fathom bone
#

yeah plus i may not know the most productive or best way to put it all together

hallow igloo
#

Ugh

#

Can I power up and control some leds with one of these boards as if control turn one led on then turn off the other one and so on?

normal elm
#

YH

#

UH

#

You can, these are arduinos.

#

But you'll have to get an extra device to upload programs to it, which is a bit of a hastle

#

if you are just wanting to blink some leds

#

just get an arduino Uno

hallow igloo
#

kk

normal elm
#

Unless you are looking for a really tight form factor

hallow igloo
#

I just want to power and control some leds.

normal elm
#

What kind of LEDS

normal elm
hallow igloo
#

I dunno really

#

any light output

red tree
#

Hello

#

How can I control 5 DC Motors and 4 Servomotors with 1 raspberry pi?

violet valve
#

@red tree One option ^^

red tree
#

Lemme look into it

#

It says Stepper and DC

#

What about servo?

violet valve
#

Gets kind of beefy quickly though.

#

Size-wise I mean. But they should work together.

red tree
#

Hmm

violet valve
#

There's also "bonnet" sized versions of those, which are designed for Pi 0, but the header is the same. They'd be smaller though if that matters.

red tree
#

Anything cheaper?

#

It's a school project

violet valve
#

Ah fair enough. Um... You'd need some kind of GPIO expander I think... Honestly beyond the pre-built controllers, I haven't done much with motors and servos. But there are smaller chips that let you control things, you'd need a lot more wiring.

red tree
#

Hmm alright thanks

violet valve
#

Looking at it, all the controller boards like I linked are expensive. But those boards have the necessary chips on them, and as far as I know, Adafruit sells them separately. From the product description: "4 H-Bridges: TB6612 chipset provides 1.2A per bridge with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 13.5VDC."

#

Also out of stock.

#

But you get the idea.

red tree
#

Yeah

red tree
violet valve
#

Good to know!

open dock
#

the RPi has a 40-pin header. All 40 pins are not GPIOs. 12 pins are dedicated to power and ground...

red tree
#

Hmm

#

Hmm

open dock
red tree
#

So only 14 can be used for motors?

open dock
#

well, that's where things like HATs and breakouts come into play. you can drive multiple things from 2-4 RPi pins (I2C or SPI).

red tree
#

What do you suggest sommersoft?

#

Cost effective

undone wind
#

is there something like arduino that uses python or cpp?

open dock
#

i mean, Aliexpress and the like are super cheap. but, usually takes forever with shipping and quality/documentation is a "get what you pay for" type scenario.

red tree
#

I've got to finish it in like 10 days

#

And I mean like any alternative cost effective options?

#

Not delivery

open dock
#

i'm not super-versed in motors in this space. i'd likely just be re-visiting what kattni mentioned. if you have components available (H-bridges, passives [caps, resistors]), you could breadboard your own. should be plenty of schematics out there...

red tree
#

Hmm

#

Maybe improvise on my design

#

It's a recycle material separator

#

It uses an object detection model on my computer, send a string to the raspberry pi which controls the conveyor belts and gates

open dock
red tree
#

But I don't want to spend $60 on all of that

open dock
#

do you need the all of the hardware besides the RPi (motors plus controllers)?

red tree
#

I need wires, rpi, DC motors, servo motors and I think motor drivers

#

And code

open dock
#

ahh. including the rpi. k.

red tree
#

An RPI is 85?

#

RPI 3

open dock
#

should be $35US...

red tree
#

On?

open dock
#

Adafruit. The price may vary other places. $85 for a 3 sounds like a kit/bundle. at least, i would hope.