#microcontrollers
1 messages Β· Page 13 of 1
here is code:
def create_networks(amount):
for i in range(0,int(amount)):
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid=wifiNameList[num])
The result of this code is that it makes only one network and just keeps renaming it
@hallow igloo I don't think that the ESP8266 (or ESP32) can advertise/support multiple SSIDs at once. what are you trying to accomplish?
multiple networks a test
and the test subject is an external something that automatically scans/connects?
mainly doing to test capabilities of the ESP8266
the only way i could see that working, is to store state information in an object/file, set an SSID, run test(s), and then move to the next SSID.
i see
final question: what is the recommended method to generate a random number between two other numbers in micropython?
the random module isn't included and the only options give you bytes
give me a sec. i'm more versed in CircuitPython than uPython...
Aight
@hallow igloo do you have the micropython-lib installed? looks like there is a random module available, that includes random.randrange(start, stop=) funciton.
https://github.com/micropython/micropython-lib
doh. my bad, i seemed to have skimmed over this note:
Note that the main target of micropython-lib is a "Unix" port
ah
i think the uPy API docs are somewhat out of date. there is a urandom module in the repo, which also includes randrange. haven't checked if its included in the ESP8266 port, but you could try this:
import urandom
print(urandom.randrange(0, 10))
and, appears to be turned on for the 8266...
#define MICROPY_PY_URANDOM (1)
what does dir(urandom) print out?
['__class__', '__name__', 'getrandbits', 'seed']
are you using the latest version?
yes
π€
π you're welcome. looking at urandom again, it looks like there's an extra conditional that include/excludes randrange. which i assume excludes it on the ESP8266. π¦
if i'm understanding correctly, getrandbits should be able to generate a random number with a given amount of bits. you could write your own randrange function. i think you could get the difference between the two input numbers and figure out how many bits that number uses (i'm not sure if int.bit_length is available on micropython but it should still be quite easy to do yourself if necessary). then, using getrandbits, generate a random number with that amount of bits. then you could use modulo to clamp it within range or keep generating until it is in range if you're looking for a more uniform distribution. i'm not sure if i explained that well so have an example instead:
say i want a random number between 5 and 14. the difference is 8 (if we're going in terms of randrange), which occupies 4 bits (0b1000) so if i generate a number with 4 bits using getrandbits i can get a random number up to 0b1111 or 15. you could then do that number % 8 to keep it within the difference, or generate another random number until you get one below your difference 8 for a better uniform distribution. then, add this random number onto your minimum number (in this case, 5) and you've got yourself a random number in the range you wanted.
maybe that's obvious and i didn't need to explain it at all, i don't know. i'm tired :D
i wish i did
hey i'm just forcing my sleep schedule back to normal, holidays end soon. also, offtopic. 
π
oh neat :D
@tulip comet credits of what?
Has anyone installed asyncpg on raspbian before
@hallow igloo I have not, but I have a raspi on raspbian at home, which I can check it against if you are running into a problem
WE ARE LIVE! SHOW AND TELL! https://youtu.be/mSkKlXYmVI0
To show and share your project at 7:30pm today, view the chat here or in discord https://adafru.it/discord and look for the JOIN link to join the Google Hang...
WE ARE LIVE! ASK AN ENGINEER! https://youtu.be/80v1PGRYxOU
Multistreaming with https://restream.io/ ASK AN ENGINEER! ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on I...
I got PostgreSQL on my PC with my database and i've got my python discord bot on my raspberry pi. When I try run the bot it wont connect to my database
can you ping your PC from the Pi, and is it firewalled off on the PC?
?
there are multiple things that can get in the way of connecting to a remote database:
- improper network settings that make it so you cant route packets to the server
- firewall settings blocking the ports
- improper db config that causes it to not be listening on the network (eg maybe its only listening for processes on the db server itself)
- permissions on the db server blocking access from your machine
- username/password is wrong
- your software's connection information like IP/port/protocol is wrong
- your code is not correctly using the postgres library
etc
@hallow igloo you should check all of those above things
i created a dump file
i cant seem to get pg_restore to work on my pi
im moving my databse to my pi btw
How effective would it be to be to make a Discord bot with Python and then just have it running on a Raspberry Pi so I don't have to constantly have my pc running?
once i get my database working ill let u know
im trying to move my database to my pi
so ill be running my bot and db on my pi
@hallow igloo That would work fine
Okay thanks!! π
so ive looked slightly into circuitpython and I got a question. Why is it designed to actually still parse etc. the .py files instead of the user just compiling it down into a .pyc and then copying it over. Wouldnt that reduce the memory and/or flash required for the circuitpython binary (and the python script) making it easier to build bigger scripts?
@tawny fiber that is available, using the mpy-cross tool which converts files down into bytecode and gives them a .mpy extension. you can also freeze libraries in if you compile the firmware yourself, which will do the above.
alright cool!
on the smaller capacity boards (M0), having your code in a .mpy, and then just importing it inside main.py/code.py is often the only way once you start running into memory errors. on the M4 boards...haven't seen anyone hit that limit. yet. π
anyone knows where can i start learning about raspberry pi
@halcyon iron You can start here for the documentation https://www.raspberrypi.org/documentation/
We can answer questions here as well
oki doci thanks @lean valve π
WE ARE LIVE! SHOW AND TELL! https://youtu.be/28YGT4kYzWc
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 the Google Hangout O...
10% off all items in stock code is MAKECODE expires 5/1/19 @ 11:59pm ET #askanengineer https://youtu.be/dyFhE568-9Q & http://www.adafruit.com
Multistreaming with https://restream.io/ ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on Instagram: https:/...
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPix...
Hey, was wondering if anyone is good at Arduinos? Iβm having trouble setting up my Ultrasonic sensor and buzzer to stop/play. What I have working currently is the ultrasonic sensor(it displays in cm the distance in serial port) and the buzzer(works when it reaches required distance). What I cannot get to work is stopping the music after it gets removed from the required distance. I have it so if they have their hand < 6 cm then it will play the song but I cannot figure out how to stop at > 6 because after the song starts to play, it doesnβt read distance to console anymore.
you might set up an interrupt on a timer right before you start the music @peak bridge. keep the code in this interrupt super short so you cant hear the music pause and use it to check the sensors status
WE ARE LIVE! ASK AN ENGINEER! https://youtu.be/bomSOQ6HXVo
Multistreaming with https://restream.io/ ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on Instagram: https:/...
I always watch these back, but they're not in the right timezone for me, unfortunately
is that the normal start time?
It's usually somewhere between midnight and 2 am for me, as far as I can tell
Not surprising given the timezone they are in, though, so it's totally understandable.
Hello, Iβm having a trouble with my ultrasonic sensor and my buzzer. Iβm unable to stop the buzzer from playing a song mid song. I need help. I can share the code in a second
Thanks to anyone who will helpZ
.
I got a PYNQ FPGA board, which has been awesome. It's plugged into my laptop with ethernet. I'd like it to be able to download packages. I saw that I'll have to Bridge my connection in order to do that, but I'd lose internet access on my laptop unless I "have a third network adapter that is also connected to the network or a static IP address ." Not sure how to do that last thing. Trying to follow this: https://www.windowscentral.com/how-set-and-manage-network-bridge-connection-windows-10
@peak bridge from looking at your code, the reason it won't stop "mid song" is because playmusic() is blocking code. once it is called, it won't exit the function until it has completed the for loop by iterating over the entire melody array. one approach to solve this is simply to move the iteration control outside of that function, and into your main loop(). i threw this together, which should work; though it may need some tweaking. https://paste.pythondiscord.com/enurozapav.py
Thank you so much @open dock I will try this.
yw. hope it works! π€
So, I'm trying to host a webserver on a Raspberry pi. Anyone have any good tutorials to get started?
That is not really Raspberry Pi specific, so you can use any tutorial for hosting a web server on Debian or Ubuntu (assuming you're using Raspbian)
Does any one know anything about pymavlink?
No, but I fly and that looks really interesting
Does anyone know if this SunFounder L293D Motor Drive Shield For Arduino Duemilanove Mega UNO R3 AVR ATMEL could be used to control three motors at a time?
Using a raspberry pi
DC brushed motor
oh.. an arduino shield on an rpi?
I think it works
you can run 4 dc motors on that shield
Otherwise would this be better: SB New DC and Stepper Motorshield for Raspberry Pi 3 and Raspberry Pi Zero this expansion board can control up to 4 DC motors or 2 Stepper Motor, 2 IR sensors and a single ultrasonic sensor.
I cant say that using an arduino shield would work on an rpi, I feel like it would not.
im sure that later board cannot control 4 DC motors and two stepper motors,
think it would be able to do one or the other
I would go for the later suggestion then
Ok thanks
Does anyone have a recommendation for a quite cheap waterproof motor which is quite powerful- could be used in a boat? It would ideally also have a propellor.
you could always drive the propeller with a belt and not have to submerge the motor itself
(i have no recommendations though, just that thought)
Is it worth buying a raspberry pi?
Highly depends on the plan you are having of course.
If nothing else it's a fun tinkering around tool
And you might end up finding a good project to do with it
I think a raspberry pi is a great buy if you are looking for another computer to play around with or do projects...
i do have another question. is it possible to connect two grounds to my circuit? if i do it like this (foto below) my rpi crashes
at what point does it crash? when you start the motor?
also 6 AAA batteries is 6v not 5, which could cause issues.
when i plug the ground of the batteries it crashes
i watched a tutorial. there it worked with the battery but yeah maybe you are right
do you have another power source then?
because for it to crash it has to be already running
right now you have the + AND - of the batteries connected to the pi
if the pi ALSO has another power source then yes that will cause issues
you need to keep their + separated
@lyric oyster tagging you since i think its been a while since you posted last
sounds fair :D its already late here. i will try it tomorrow but thanks for your help!
@languid hill @lyric oyster for reference, Arduinos have an on board voltage regulator which you should be providing a minimum 7V, probably closer to 8-9 V
Oh that's a pi lmao nvm
The best way to power is pi is almost certainly a portable power bank
You really shouldn't be using AA batteries for powering pis
They don't provide constant voltages, they have a wildly varying voltage sag curve as they discharge
This means you'll eventually get brownouts even if at some point you're putting in the perfectly in-spec input voltage
Unless you're using a 5V switching converter
But as I said, just use a power bank, it's easier
the batteries are for the motors. not the pi. the pi is powered by a 5v adapter
Ah motors are far less sensitive to voltage choice, should be fine
I'd help debug but I refuse to read wiring diagrams
π
Bring me a schematic and I'll help
i am already in bed but thanks!
and the batteries are just for testing purposes. later on i will use an accu which needs to power 3 6v motors
yeah if you have a 5v supply for the pi and a 6v supply for the motors, then connecting their + AND - will result in issues
just connect the -
tbh that sounds logical. i should have fixed that myself. thanks so much
WE ARE LIVE! SHOW AND TELL! https://youtu.be/LQI_53ivlYE
Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on In...
WE ARE LIVE! ASK AN ENGINEER! https://youtu.be/8xd1zs9SCuY
Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...
@lean valve Yeah if you get that and pair it with a pixhawk you can do a lot
But pymavlink is so hard to work with
I was looking at their source code and they have a lot of ```
try:
code()
except Exception as e:
pass
Which means when it doesn't work you don't get any errors and it's very annyoing to debug
I am working on a fork that fixes this issue
Seen this article before? https://realpython.com/the-most-diabolical-python-antipattern/
I like to link it to people who do that
Yeah
I usally link poeple this video
Ex-Google Tech Lead explains examples of spaghetti code and other eggcelent coding malpractices that will rot your codebase into extenuating eggs. Let me kno...
I haven't seen that before, but I've seen a lot of anti-patterns articles before
I showed that one to my mom once (she's been working on a huge C codebase from the late 80s since the 90s) and she was nodding in full agreement on every antipattern, always coming up with examples from her work
I think this was the first yt video she thought was worthy enough to show her friends
But why is it presented as part of the Guy Talking In Car genre of youtube video
extremely weird choice imo
The guy is troll, but still manages to get his message across
connect one side of all of them to ground
connect their other sides to different IO lines
you can have the resistor in the ground line
Is there a diagram to follow? I'm not very sure about how to do that
I don't know if this is the right place... Right now my LCD 5" screen has a power button at the back.
This is very annoying, so I am trying to get the software to do this for me
Its just getting power from the GPIO pins. So how do I shut them all down, and turn them back on>
@humble kraken
@tidal wedge https://i.imgur.com/lsV8VuD.png
i didnt draw a breadboard because that would be too much work
yh its just hard to understand completely cos im not too familiarr with hardware
have all the button resistors go to the ground rail at the bottom of the board
same as the leds
wait
oh they're wired as pullup
connect the 3v3 pin to the red rail on the breadboard
then connect all the resistors to the red (power) rail
@tidal wedge https://www.youtube.com/watch?v=Bqk6M_XdIC0
This video outlines how to setup and read an input from a button. Pull-up and pull-down resistors are discussed, and the relevant Python code is explained. L...
WE ARE LIVE! SHOW AND TELL! https://youtu.be/rp5QQ7y9XB4
SHOW AND TELL LIVE! Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/di...
WE ARE LIVE! ASK AN ENGINEER! https://youtu.be/jGLyxy0RrGs
Multistreaming with https://restream.io/ ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on Instagram: https:/...
@humble kraken do i connect the male to female connector next to the switch?
i have no idea how that's supposed to happen S:
@tidal wedge although sd card corruption seems to be a very common issue on Pis in general
shorting a pin or a similar hardware issue and somehow corrupting bits on a sd card don't really seem relatable though. Lots of worse stuff should be happening before those two events are directly related
A new episode of Podcast.__init__ just came out, focusing on CircuitPython!
Nice work @long orbit , I'm gonna go listen to it now on my walk
Ive got a really weird question. I want to program an ai to learn fingerprint security and such mainly because i just want a project to do over the summer. I am curious if there is a simple cheap fingerprint reader for pc or if there is a way for my old ipadβs fingerprint reader information to be sent to my pc
Essentially using the ipad as a fingerprint reader
nope cant use ipad
there's probably cheap fingerprint readers. have you tried looking?
Yes but ive found some interesting results
Ill just buy one online since the ipad doesnβt work
Ty sir
Thanks @lean valve ! I hope it turned out ok. I haven't had a chance to listen yet.
So we could have had CircuitPerl π
π¬
oh, sweet! can't wait to listen to the dulcet tones of @long orbit
added to my list for tomorrow
π
Nice podcast. I properly discovered the circuitpython specificities. I recently build a project with micropython without even giving circuitpython a proper look. I'll stick to micropython for now (I' come from embeded c programming and use esp board I already had) but it's nice to know a more beginner friendly option to recommand around.
great podcast
Thanks @steel aurora ! @jade orchid Iβm glad you are liking micropython!
oh hey I'm mister shirt look at me
WE ARE LIVE https://youtu.be/KQF0m4-i-Rw
Multistreaming with https://restream.io/ ASK AN ENGINEER 5/22/19 LIVE! Visit the Adafruit shop online - http://www.adafruit.com -----------------------------...
"We want the tree to be able to fire off tacos in any direction" π
Oh, cool, CircuitPython day at 8-8-2019
We should do something with that here as well
@vocal cipher 
yes
I am only asking to see if i found channel that has members who can help me with the things confusing me in future @sturdy ridge
if it's not Python related, people here probably cant help large amounts. there's always discords like Electronicity, Discord Electronics Server and the Adafruit discord servers if it's less python related or the Electrical engineeing server if it's less arduino/hobbyist stuff
I am designing a custom ATSAMD51 M4 PCB and plan to program in CircuitPython. My hardware question is: Does my design need an external FLASH IC for the UF2 Bootloader feature to operate correctly?
I havent loaded custom bootloaders before but I dont see why you'd need it. seems to be the process is simply bossa flash the bootloader
So if a new ATSAMD51 M4 was plugged in and no external flash was present the bootdrive that would show up in windows would be the internal FLASH on the new ATSAMD51 ?
@main tiger it doesn't need an external flash, no. it would be similar to the "non Express" SAMD21 versions. like the gemma: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk#L7
Perfect, I am trying to keep my chip count down.
Just put my atom package on GitHub for Adafruit devices using CircuitPython in Atom https://github.com/jos-b/atom-circuitpython
Nicely done.
ok after some help from the folks in adafruit with some stability enhancements a version is available on the APM
Hey there, could someone help me? I used micro python with ESP8266 board. How do i use urequest module and what is the difference between it and urllib.request that exist in normal python? I couldn't find sources at Google because it's really specific
So i could get bytes HTML data from a link.
@hallow igloo The u* in urequest indicates library specificly writen for micropython. Also be aware that they sometimes implement only a portion of the standard equivalent library. You should prefer u* lib as possible as they are implemented with the microcontroller constraint. You can have a look at https://github.com/micropython/micropython-lib/tree/master/urequests for urequest, there is a small exemple.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "urequests.py", line 106, in get
File "urequests.py", line 56, in request
OSError: -2```
@jade orchid this popped up
WE ARE LIVE! SHOW AND TELL! https://youtu.be/rrG4HAJFO6Q
To show and share your project at 7:30pm today, view the chat here or in discord https://adafru.it/discord and look for the JOIN link to join the Google Hang...
WE ARE LIVE 10% off all items in stock code is unicode expires 5/29/19 @ 11:59pm ET #askanengineer https://youtu.be/EIHTz0hifjk & http://www.adafruit.com
Multistreaming with https://restream.io/ ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on Instagram: https:/...
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPix...
is there a way to send gps data from say an android to a RPI?
i would imagine its possible using WiFi or Bluetooth...
though, you may have to write the actual Android app if one isn't available...
or use a web app running on the pi that you connect to on an android browser
You can actually get sim support for a rpi.
I was thinking of implementing something this way
Is it possible to power an arduino uno with a wall outlet? Using a step down transformer and a voltage regulator of couse.
Via the DC jack or the input pin itself?
The Vin pin
The Arduino uses DC and wall outlets give AC so you'd need a rectifier too but yeah it will work
@main tiger (a few days later) yes, you can make a SAMD51 build using part of the internal flash for CIRCUITPY. Examples that already do this are ports/atmel-samd/boards/sam32 (using a SAMD51J20A) and boards/kicksat-sprite (SAMD51G19A
@open dock if I was to build some board using circuitpython myself which has to interact with two or three sensors at the same time (namely a bme280, some EEPROM and some LORA radio, maybe a RFM69 or something like that), what MCU would you recommend to me? (considering that I imagine such a program in circuitpython taking quite some Flash memory away, especially size wise)
the SAMD51s are the most capable right now. with an external SPI Flash, you should have plenty of RAM to load all of those libraries.
though, EEPROM will have to be a hand-rolled library. though you could also work in a C-side driver..
Alright, Ill look into both of that then thanks π
yw! i'll keep an eye out...i expect good things. π
eh it depends on the guy I know who would do the actual hardware side
Now put it on a single PCB and use it as a Business card
i'm trying to recreate this C code in python and i'm struggling, does anyone know of some good examples of i2c code in python? https://github.com/botbench/robotcdriversuite/blob/master/include/mindsensors-irdist.h
Looks like CircuitPython has also been featured in the 5/30 edition of Python Bytes, congrats again to those dudes
It looks like your main loop will hang until GPIO 18 is pressed
Then hang until GPIO 23 is pressed
You probably don't want to have those while True loops there
Or use .sleep commands
Sleep is fine
It's a hacky way of debouncing, though
Ohh, yeah, don't use sleep in the main thread.
derp
Sounds good, i'll update it when I get home
So now I have this code (revised) the game works fine and now I'm still trying to get some input from my GPIO pins (left and right movement)
@opaque lily rather than poll the GPIO, you should set up an event to detect falling/rising edges and set an internal variable accordingly
As a bonus, you could add some print statements to the event handlers to debug your buttons.
So you're saying i should use
GPIO.add_event_detect(23, GPIO.FALLING, callback=my_callback2, bouncetime=300)
and
def my_callback2(channel):
print "falling edge detected on 23"
?
Something like that. I'd implement it as a class:
class Button:
def __init__(self, gpio_number):
self.__gpio_num = gpio_number
GPIO.setup(self.__gpio_num, GPIO.IN, pull_up_down=GPIO.PUD_UP)
self.__gpio_state = GPIO.input(self.__gpio_num)
self.__lock = Lock()
GPIO.add_event_detect(self.__gpio_num, GPIO.FALLING, callback=self.__on_falling_edge, bouncetime=300)
@property
def is_activated(self):
with self.__lock:
return not self.__gpio_state
def __on_rising_edge(self):
print("The button was released")
with self.__lock:
self.__gpio_state = True
def __on_falling_edge(self):
print("the button was pressed")
with self.__lock:
self.__gpio_state = False
Then you could replace your GPIO.setup calls with button_1 = Button(18)
And in your polling function just check if button_1.is_activated
Note: that code isn't tested, so don't expect it to work right away π
When you're dealing with stuff that should be "polling" all the time which disturbs other ongoing computation the answer for higher levelish work is generally async or something similar and for lower level stuff, it's interrupts
Interrupts are very very important to know
Hm, so what would i have to do to implement this into my own code? (Where to put it and should I change anything in the above code
(sorry not too fluent in python) thanks for the quick replies and help!
i tried putting the gpio_number as 18, but then i realized that i have two buttons, would I have two classes?
Two buttons = 2 instances of the same class
button1 = Button(18)
button2 = Button(19) or whatever
okay.. but then how would I put it into the code that seepho had provided though?
button1 = Button(18)
button2 = Button (23)
class Button:
def __init__(self, gpio_number):
self.__gpio_num = gpio_number
GPIO.setup(self.__gpio_num, GPIO.IN, pull_up_down=GPIO.PUD_UP)
self.__gpio_state = GPIO.input(self.__gpio_num)
self.__lock = Lock()
GPIO.add_event_detect(self.__gpio_num, GPIO.FALLING, callback=self.__on_falling_edge, bouncetime=300)
@property
def is_activated(self):
with self.__lock:
return not self.__gpio_state
def __on_rising_edge(self):
print("The button was released")
with self.__lock:
self.__gpio_state = True
def __on_falling_edge(self):
print("the button was pressed")
with self.__lock:
self.__gpio_state = False
Put the class near the top of the file -- just after your import statements
alright, where would i define the buttons and would i keep my original code there as well?
Define the buttons just before your mainloop. Naturally, the mainloop will need to change to reference the newly defined buttons
So after all this, I have this code here: https://pastebin.com/0XuBRzPv
what should I do at line 108 since I have the class up there now
also, how would i set it so that button 1 (pin 18) and button 2 (pin 23) can go left and right in this class? (23 being the left and 18 being the right
OKay, so I changed it back
this is my code, it's a pygame where i use gpio buttons 18 and 23 to go right/left
Hi all!
I'm writing a simple micropython script for my esp32.
It's a simple http server and it's working fine. I would to control some smartlighting with this.
But how can I recognize query strings to use with commands?
response = """<h1>Hello World!</h1>"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 80))
s.listen(5)
while True:
conn, addr = s.accept()
print('Got a connection from %s' % str(addr))
request = conn.recv(2048)
request = str(request)
print('Content = %s' % request)
conn.send('HTTP/1.1 200 OK\n')
conn.send('Content-Type: text/html\n')
conn.send('Connection: close\n\n')
conn.sendall(response)
conn.close()```
I.E.:
192.168.31.182/?led=on
192.168.31.182/?led=off
WE ARE LIVE! SHOW AND TELL! https://youtu.be/tmmjlA0e0BI
Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE! http://adafru.it/discord Adafruit on In...
10% off all items in stock code is EXCAMERA expires 6/5/19 @ 11:59pm ET #askanengineer https://youtu.be/D6ZJ8JeJiY4 & http://www.adafruit.com
Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPix...
Hi @unkempt wedge, I think it would be much simpler to not handle the bare connection yourself. I suggest to use a framework for that. A quick search I found https://github.com/jczic/MicroWebSrv that is for micropython. You then can create function for any endpoints you like. In your case something like %ip%/led/on %ip%/led/off ( or a single one %ip%/led/<status>).
CircuitPython Organization
ty
any tutorials specifically for esp 8266 @past epoch
i only got a esp 8266, got nothing else lmao
that you have to use C to write, you need specific boards to write python.
when it comes to the 8266 i think you need the Feather variant
oh, so i need to use arduino
alternatively you could just check out what adafruit wrote about how to exactly use circuitpython on an esp https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266
however its no longer supported so that might not be your best approach
adafruit keeps their site up to date. if you want a board to write python, i recommend curcuit python express
Circuit Playground Express
this is the correct name
The Circuit Playground Express is Adafruitβs flagship educational board designed for CircuitPython.It brings the βbatteries includedβ approach of Python to h...
serial.serialutil.SerialException: could not open port 'COM1': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
serial.serialutil.SerialException: could not open port 'COM1': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)```
uh, help?
@past epoch any idea
assuming your arduino / esp / whatever is connected, this might not be the correct port to communicate with it, try COM0 and if that doesnt work maybe open up the arduino IDE and check what it shows for available serial ports
how do i do that?
what part of that
changing the port to com0
well for that we would have to know what you are even doing
i got my esp connected, and im trying to run a example on arduino
its the "blink" example
how exactly are you doing that
in the arduino IDE I assume?
can you click on the tools button
and scroll down to an option which should be named port (i got mine in german so idk exactly)
yeah go down to port
π
anything interesting i can do with these?
SATA OPTICAL DRIVE CONNECTOR BOARD
1gb ram
Mini PCIe mPCIe Notebook Wifi Wlan Card
a fan```
I mean you could build some wifi connected HD or something like that with lots of effort
@tawny fiber do u know how to make a bitcoin mining rig
i wanna make one for fun, i got a spare cpu
thats not profitable at all anymore
ik but i wanna make it for fun
a cpu is just a piece of electronic which can do arithmetic operations, it doesnt have any storage and barely any memory itself
yah
i got a cpu and
SATA OPTICAL DRIVE CONNECTOR BOARD
1gb ram
Mini PCIe mPCIe Notebook Wifi Wlan Card
a fan
well i guess you could make something up with that if you had a whole motherboard
is it possible to use raspberry pi for motor control(induction motor and vector control)?
should definitely be possible yes
GΓ©nΓ©rally the proper way to control an induction motor is a variable frequency drive because there's a lot of work to be done in controlling induction motors wrt controlling high voltages and input frequencies
You'll have to figure out how to interface the VFD with the pi
I don't have too much experience with dealing with VFDs other than what I've done with my courses so I can't give much more insight than that
Hi guys!
Gotta question for wiring this terrarium up.
Would an Arduino be a good choice to control both the light fixtures and the fan in this diagram?
Well, control and power
for power yes but you need relay
for control yes, I guess fan is just on/of? And are there any special lighting modes for light
Ahh, gotcha.
And no special modes. I'm thinking of maaaybe adding some speed settings depending on heat?
Also a humidity sensor so I can get reports on humidity inside the terrarium.
The only thing I want for the lighting is a timer for it, along with sensor reports.
yup arduino will have no problem with that
For good timer you may want to use some outside clock module, but I guess default is good too
I should compare prices too.
Would a pi-zero also work good?
ah that would be kinda an overkill
you can get cheap arduino from ebay for like 2$
it's basically just a chip on board
arduino nano
Oooh, gotcha.
That sounds a lot better. I'm aiming for cheaper options.
That still work well, ofc.
will take like a month to ship tho
But yeah.
That's no issue. I can buy and in the meantime I can build up the terrarium.
Since it hasn't been made yet
just make sure you have data connector ready since it's using format you probably don't have layint at home and most of them doesn't ship with it
you can find bundle with cable for like <5$
Oh cool! I'll check it out, yeah.
Thanks a lot BD!
Anyone got experience with Sim868 or any Sim8xx model?
Any one know if any good resources or tutorials for programming rgb strips using a rasp pi?
@main depot my first bet would be : https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython
@jade orchid Thank you! I'll dig in to that.
How alike is Lego Mindstorm to the things you do here?
I have recently become interested in robotics and such
the little experience I have in it as of now is only Lego Mindstorm, which I personally got very bored of quickly
so I'm just wondering how big the difference is between Adafruit related things and Lego Mindstorm
WE ARE LIVE! SHOW AND TELL! https://youtu.be/JrIJrWFWtmE
To show and share your project at 7:30pm today, view the chat here or in discord https://adafru.it/discord and look for the JOIN link to join the Google Hang...
10% off all items in stock code is GPSUSB expires 6/12/19 @ 11:59pm ET #askanengineer https://youtu.be/mlFJr_6fiO0 & http://www.adafruit.com
Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPix...
what microconntrols works with mpython?
@eager agate i don't keep up with partial/full support, but the supported boards that i know of are:
- MicroPython's in-house boards: pyboard & pyboard D-series
- ESP8266
- ESP32
- WiPy & CC3200
- micro:bit
- nrf52840
- Teensy (don't know which version)
how about a kid freindly python microcontroller?
how young? if you just want an all in one device suitable to someone that can handle a few wires you could try the https://www.adafruit.com/product/3333
it has a bunch of sensors and other fun things built in, so they dont have to actually learn soldering/breadboarding etc yet.
for micropython + kid friendly, i'd say the micro:bit. https://microbit.org/
for circuitpython, i'd agree with riff; a Circuit Playground Express is the way to go.
both are supported by MakeCode (block programming) as well, so no *Python necessary.
orrr...if you want block-based *Python, both are also supported by EduBlocks: https://edublocks.org/
no, i want a 10 - 13 ('cause i am 10 = 13) years old python text (not block programming) microcontroller like arduino, but with python, and kid freidly
and also can i do stuff with the microbit like the arduino?
can i do stuff with the microbit like the arduino?
yep. https://microbit.org/ideas/projects/
Working on a project of mine, thinking of getting some stuff for my RPi, any recommendations for display and/or buttons, preferably as cheap as possible (text-only works for me, and buttons is a minimum of 5)
I think 16*2 LCD displays would be the cheapest
For now it looks like I'll go for an adafruit LCD keypad kit, though I might get external buttons from pimoroni
The only problem I have is that I don't have soldering as option, which would make it a bad choice
So what I'm asking here is:
What are cheap parts for a Pi 2b, that
- Don't require soldering
- Are easy to install on it with no hardware knowledge
A text display and 5 buttons is all I need
Yeah no I prefer hardware buttons and I dont even have $80
A 16*2 display seems good but I can't find one that doesn't require soldering or doesn't take long to install on it
Ahh, then a Hitachi LCD is right for you: https://www.sparkfun.com/products/255
I'd imagine you could find one with a header pre-soldered
Do I just take it and put it on the pins or what
Again I have no hardware knowledge so this is all really confusing to me
Ahh, that would be a challenge, then.
The RPi touch display would work right out of the box; configuring this would require finding software to drive it.
Hmm
I know the adafruit ones have python libraries
But I'm not sure if installation is as easy
All of these displays that I've seen use the common HD44780 controller, which has a python library: https://pypi.org/project/HD44780/
https://kiwi-electronics.nl
This is where I'll be buying from, so if you can find anything, let me know
ye and you can find some which come presoldered https://www.adafruit.com/product/1447
so if you have wires you can connect it
Oh wait I'm making some mistakes here
I keep confusing the version
It's just a B+
Any RPi should be fine as long as you have 6 GPIO available.
General Purpose I/O. The RPI B+ has several:
So I'm assuming if I get one of these boards I just have to put it into the pins it requires?
Pretty much. If you have a breadboard, male-to-female header wires, and one of those LCDs with the header pre-soldered you should be good to go once that Python library is configured.
What's a breadboard and mtf header wires?
A breadboard is a tool used to easily prototype circuits: http://wiring.org.co/learning/tutorials/breadboard/
MTF jumper wires allows you to connect one end of the wire to your breadboard, and the other to your RPI:
https://www.adafruit.com/product/1953?gclid=EAIaIQobChMIj9uPu9zn4gIVCJ7ACh1hfAgsEAQYASABEgL2jfD_BwE
This is gonna cost me even more isn't it
One thing worth noting: when you're mixing wires around like this you can easily make a mistake and fry some or all of your components. So be careful :3
Oh god
Having said that, this is a great starter project for this kind of stuff
I mean the software is difficult enough already
There are plenty of tutorials, and plenty of people here who can help.
Especially since it needs to run real-time on a pi
if you're strictly on budget you can get that stuff very cheaply on ebay, but you'll have to wait like 1 month
Ouch
I was hoping to have the interface done by the end of this week ^^"
Looks like I'll have to wait a month either way; to get paid or to get it from eBay
to get paid?
Yup, gonna hear if I got the job tomorrow and if I did I can start next Monday, and get paid at the end of the month
Good luck!
So one issue I'm seeing here is that breadboards seem pretty large whereas I'd hoped to keep it as small as possible... any ideas?
You can solder stuff to blank boards instead, (dunno the proper english term)
stuff like that https://www.mikrocontroller.net/attachment/141361/IMAG3755.jpg
should be available from every electronics/DIY shop
again, unable to solder
oh, didn't see that
but yeah, a small breadboard is probably as compact as you can get without soldering
they come in all possible sizes
You can get smaller breadboards
is it possible to get one that fits on top of the rpi?
I'd rather keep it as small as it is right now
What kind of mechanical assembly are you picturing? Realistically, you don't need a breadboard.
I just want to add a small display and preferably some button inputs to my rpi
If you have female-to-female jumper wires you can connect directly from your RPi header to your LCD's header
Good π
oof, $3 for the cheapest ones
I wish there was something like pcpartpicker for this that showed what you need and maybe how it'd fit together
Because I'm really having some trouble visualizing how it would look with what parts
Ideally it'd look like this but with a smaller LCD and some buttons
actually
that's a touch LCD
I just don't know how to deal with taking full control of a SPI device
Would this be worth it, compared to the other ones? I don't know how SPI works and it doesn't seem very well documented on spidev, so that's the only con I see right now
so from what I've heard, Adafruit's ILI9488-compatible code should work for writing to the display, but I can't seem to find any details about the touchscreen, any ideas?
iirc the pi will take control of the display and be pretty much what you call Plug and Play
especially with raspbian anyway
i am sure thats how it went for me when i attached a screen to the header
got it
so then the only issue left is finding a cheap DAC because the builtin one is garbage
but I can't find one that goes somewhere other than where the screen already goes
and about the display I just want to make sure I can use it as a non-display screen since I want it to be under full control from python
What kind of microcontroller should I start with?
(copying sommersoft's answer here)
- MicroPython's in-house boards: pyboard & pyboard D-series
- ESP8266
- ESP32
- WiPy & CC3200
- micro:bit
- nrf52840
- Teensy (don't know which version)
with the microbit according to him being one of the most kid friendly / easiest ones
What about pi?
the pi isnt a micrcontroller
its a Cortex-A chip so its meant to run actual operating systems
however you can still do a lot of things with the Pi which you can do with a MCU
I am new to this space. What is circuit python? Different from MuPython?
CircuitPython is derivative of MircoPython with some changes that should make it easier to learn and use
It was developed by AdaFruit for AdaFruit boards, like the Circuit Playground Express
Hm. Since we are talking of micro controllers ( and I am oldish), does it actually complie to assembly code or does the new crop of microcontrollers actually work on interpreters?
the intrepreter of python is still a compiled c program which executes python code or bytecode
I dont know of any MCU CPU etc which actually just runs an interpeter
Thanks Ves and Nix
That Being Said,
You can still program all these microcontrollers in the old school way. For example even the shiniest Adafruit toy, the Circuit Playground Express, can be used as an Arduino. CircuitPython is optional.
What voltage should i provide at a Wemos D1 R2 in the Vin pin? Is it 5 or 3.3 volts?
Easily googleable. It's 3.3 https://wiki.wemos.cc/products:d1:d1
then how about the 5V output voltage?
I don't think it's a 5V output voltage as much as it is 5V input with a voltage regulator
what's better than micro:bit?
Define "better" in this context @eager agate
I do know the meaning of better
But what do you think is better
Easier to program
Faster
More peripherals
More memory
Less power consumption
Etx
So what exactly do you mean with better, there are dozens of things which can make an MCU better or worse and a lot of them depend on your use case / point of view
So the question is what do you want in your alternative microcontroller that the microbit does not have
Sooo?
@tawny fiber the micro:bit is easier to use
than what
And you again didnt say what you want in your MCU that is "better" than the microbit that it doesn't have yet
Question mark
idk anything you said im just a kid that likes my micro:bit
just shut it
anyway what do you think is the best and can you give a list pls
If I have your definition of best or your use case yes I presumably easily come up with a list, as you're not giving me enough information however I can't answer your question
in your opinion not mine
you choose
anything
what's your definition of bese?
best*
Well in my opinion there is a best MCU or at least a group of MCUs for every usecase, for example an Arduino will hardly be useable to build a digital camera because of its small memory, you'd be better if with a raspberry pi or a higher class MCU like for example a more modern STM one
you could join the code jam and perhaps win a pyportal, those use python and have touchscreens...
If it's about microcontrollers/python then for sure!
is this a arduino?
We include it in microcontrollers here, it's kind of on the edge of being something bigger
Also I really hate to have to ask this but aren't you too old for this camp?
I'm really sorry but we have to boot you out
We follow the Discord rules and those say you have to be 13 just to use it.
my father
tho
he ususes this and does not know i do
ik his pass lol
he teached me python
That's good, and I hope he continues, but you can't be on Discord by yourself, sorry
!tempban 568142562678800385 3y Underage user
:incoming_envelope: :ok_hand: banned @eager agate until Wed, 15 Jun 2022 00:49:21 GMT (Underage user).
Is it possible to interface with any device?
I have a pcb looks like some controller is on it
But how do i interface with it? is it a case of soldering a serial device to it?
that highly depends on the device
there are a million protocls
can you maybe show us a close up picture of your particular device? often manufacturers write down what is tis there @marble swan
is that a walkie talkie?
naw a camera
@marble swan Are you Scottish?
lol no
i speak many forms of "broken english"
So i was wondering
just thought i should throw that in
I mean it is unlikely but there are certain ways to circumvent the need of programming a device
But is it a chip that was programmed first then put on?
so its definitely not a must have
anyways
im trying to figure out what CH in this context might stand for
it might be the company
whats the name/model of the camera?
looks like there is a wifi camera called md81
Yeah has a wifi controller too
There is something referencing TX there
which if i am right there should be a RX too
transmit and receive
that might also just be a test point for anything on the chip
can you maybe swap it over and show us the back too?
the back contains the wifi controller and an sd card reader
I mean chances are high this is chinese MCU xxxxxxx and we'll never identify it but we can try
are there any other tes points?
two things
a) can you maybe try to rub this blue shade on the main controller away, maybe there is more intel hidden under it
b) if you happen to have an Arduino or whatever wire its rx up to the TX and check the serial monitor for some output
thats the flash memory
aka where the program is stored
or at least there is a chip from bright moon semiconductor which is an SPI flash memory., has this name and the fitting pin amount
thats just usb soldering points we very likely dont really care about
can you try one (or even both of the things) i listed above?
I was just wondering if they disabled the usb ability to interface via HID or something(sorry don't know the terminology)
I have a soldering kit coming tomorrow
I will try to work out how to get the tx to the gpio of the raspberry pi
just connect a wire to it
like literally put one end of the wire to the rx of the RPI, the other at the tip of the TX test pad and check if you receive something
yeah minicom should be just fine
just pick some baud rate like 9600 and if you see anything youre good (if its weird shit change the baudrate to other commonr ates)
yeah
just do the minicom thing
and after that we're gonna dump the SPI flash to see what its got
i am a bit wet behind the ears with electronics
Will i also need to put to the GND as well as RX?
Don't want to fry the poor pi
2 uarts?
ttyS0 and ttyAMA0 the latter is bluetooth
do the SO one
Yeah i thought that might be the one
thx
last question π
Do i have to be specific with the gauge of wire?
Because i have some old USB cables
i mean cut a wire from it?
something like thsi would be better
Ok i'l have a look where i can get it
I am super interested in this
The thing doesn't function properly
But i imagine its software related
Because its supposed to be able to search for wireless ap
i mean i doubtw e can fix this
Ah im not really bothered about that it was only $8
Just interested in what its actually doing
It puts out its own wireless AP to connect to though
and then you can view the cam from that
But its a bit gimmicky since its not password protected
So anyone can connect
cheap Chinese junk
yup
so get the wire and see what we can read from the TX pin
and if that doesnt give us enough intel yet we're gonna tackle the SPI flash
What data are we even looking for?
we still didnt identify the chip
so maybe it dumps some intel about itself on the tx pin
or whatever
Ok i'll have to figure out how to get minicom to dump to a file
Yeah ok
It looks like some of the chips have been scrubbed out of info by a marker pen or something
interesting
Maybe i'll ty some alcohol on them to remove it
yeah i already mentioned that around half an hour ago :p
oh yeah sorry
dont worry
found anything under the marker pen? @marble swan
Not yet family stuff in the way π
k, just hmu once you got something then ^^
iirc ^ that is the chip with the blue mark
nah it was the bigger MCU
this one
ah
anyways, you wont get around checking the SPI flash and the tx pinow
Can someone tell me what a so called "series 25" SPI EEPROM is? Ive stumbled upon this term in a library but cant seem to find anything on google
From the sounds of it, external EEPROM that you talk to through SPI. Series 25 is probably specific to the manufacturer/brand used
yes, should be fine
right
so
at this point I dont really see much more than dumping the content of this SPI Flash from the other day
Ok when you got time please explain how i will do that
I think the pi has the ability for SPI
it does
Oh boy so i have to desolder the chip
I mean you could also attach the 6 wires we need
interesting
either way we'll need the voltage + GND and the 4 connections for SPI
I did look at the data sheet for the flash chip
details the pin out
Must i solder the wires to the chip?
you have to connect them
Yeah silly question i guess π
I have a strip of wires like you pictured the other day
Does color coding matter?
I guess it doesn't
This sounds complex indeed
I think i read the chip has speed of 414mb
Or is that Mhz
idk am very new to this
it doesnt matter yeah
and with a bit of luck its supported by some linux tool builtin
if its not we're gonna have a heard time reading from it
EΓ3@Γ<PΓ·`PΒ<@Β ΓΌΓΏΓ AΒIΒ Β@ΒI ΒΒ HA AΒAΒAΒΒ Β@($@ $@ΒH A Β HΒ @ΒA$ ΒΒΒ$7sdram_init 1172a7--9c4 4 CAS:1--RFC:9--RP:2--RCD:2--DISIZE:0--AREFEN:1--SDCKHD:1--SDCKOE:1--SDRAMSIZE:3 SDRCON0:d72a7--2M init Β!?ΓΈ?ΓΎΓΓΒ Β Β@Β Β@ΒΒ Β@Β ΒΒ ΒΒΒΒΒΒ Β ΒΒΒ ΒΒΒΒ Β Β!Β
I tried again and got this
I believe that is 115200 buad
Tried 9600 too
@marble swan any idea why there are so many corrupted characters
Well..
I believe that data didn't come from the TX on the board
So i must of touched some of the other pins near by on the chips
OR that is the raspberry pi itself
Because i tried again carefully on the TX pin and got nothing
But i did solder the microphone back on.... Badly
Need much practise
I must have the + - mixed as there is interference
Or having bare wire is causing it idk
Oh
Hmmmm. Maybe it could be a (de)coupling problem or you need to have GND hooked up. I'm unsure.
I just need to clean the solder I tried to reflow it and not use new solder.
Iβll get some flux and a copper wire that should work to clean it
please fill this out, it's for more python on hardware, this time, from VS code. no personal info is needed to fill out...
"Hello there, we're a group of interns at Microsoft Vancouver, working in The Garage! We're looking for insights into your experience around physical computing projects. As well as your interest in trying out a new method of development for your project - say goodbye to waiting for your code to build and compile inside Arduino IDE with C/C++, Python is here to help! This survey will only take 3 - 5 minutes and your insights are very valuable to us!"
https://twitter.com/nnja/status/1140807884474732544
https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbRx50AHoXr3BImxtzTGKK4edUMEJNUUFTUUdGRFhOVUg0N0RBN0paOFJBRy4u
π Interested in Python or programming microcontrollers with Python π?
If you can spare a few minutes, the interns at @MSFTGarage in Vancouver need your input for a user testing a β¨newβ¨ @adafruit #PythonHardware VS @code plugin.
Fill out the survey πhttps://t...
I didn't even know the Vancouver office had interns
turtle on: pygamer, pybadge, pyportal, and not-out-yet-smaller-version-of-pyportal
Whoa, cool!
I hope thatβs the official branding for the new pyportal
Totally ready to preorder my NOYSVOPyPortal π
I can't get my PyPortal to connect to my Windows 10
Anyone had the same issue?
It boots up properly and tells me to edit the secrets.py-file
but none of my USB's detects anything
I guess I need to download some driver?
Yeaaah.. Nothing happens nowhere
@stuck thicket , have you had this before?
"Press the reset button twice" don't work :(
A lot of people end up using charge-only USB cables and it is very frustrating
That was it
do people really use mu-editor? it looks so ugly
it's for beginners, mostly.
it does have really neat integration for microcontroller boards, but @silver surge recently wrote a plugin for atom that does the same thing so you can use that if you prefer
please let me know of any install issues actually, some people are having issues with that
I know some members of this community were talking about doing the same for VSCode, Sublime Text and PyCharm too, but nothing that works yet. @chilly tusk
I'm sure we'll see it eventually, though.
I mean Iβve never done anything with physical hardware before. I couldnβt get it working (red LED and not running the code.py file) I assume I need some dependencies or something, but it seems kinda hard to find information on how to just get started hehe
Iβll check your Atom plugin! Not that I really know what the integration is supposed to do, though π
Seems like red flash is not connected to WiFi, maybe it donβt like my 5G
@chilly tusk go find the pyportal guide on learn.adafruit.com
you'll wanna clean it and then flash it with the latest software.
kattni has a great howto though
that should get you running.
@steel aurora looks like @chilly tusk was helped on our server (cable issue)
@chilly tusk mu is not "ugly" that's not nice π¦
looks better than IDLE
@stuck thicket excellent. glad he found some help. :)
WE ARE LIVE! SHOW AND TELL! https://youtu.be/PaFqToS2c6M
To show and share your project at 7:30pm today, view the chat here or in discord https://adafru.it/discord and look for the JOIN link to join the Google Hang...
WE ARE LIVE! ASK AN ENGINEER! https://youtu.be/21dOGryZ6Xo
Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...
Thanks guys, I fell asleep yesterday.
Iβll look more into it on Saturday βΊοΈ
Is it possible to buy humid sensors to the PyPortal? How modular is it?
sure you can.
some sort of humidy sensor breakout board could be wired to the I2C. there are probably other ways to do it, too.
you could chain a whole bunch of sensors onto that, if you wanted.
something like this: https://www.adafruit.com/product/2652
here's a related project on learn.adafruit.com - a pyportal weather station https://learn.adafruit.com/pyportal-iot-weather-station/overview
it does exactly that
@tawny fiber moving here. ot is crowded.. π
what is on the other end of the UART? PC?
a pi
im just wiring up my pi rx tx to the rx tx pins i found in the code for my chip in the micropython repo
Iβm looking for a clip that will work with the pi
I assume most will
But some Iβve seen have all the crazy legacy ribbons
@tawny fiber i think you might know for reading flash rom
i have no idea what a clip even is
This video walks through assembly of a CH341a SPI BIOS 25xx/24xx series USB programmer with a SOIC8 SOP8 Test clip for solderless reading and writing to flas...
This
OK π
Need help to write arduino or raspberry pi code to control 8 relays snd 2 pwd signals. Can pay for help.
people here dont write code for you for money, we'll help you with a specific problem if you have one or provide resources though
@tawny fiber the micropython repo gets so foreign when i read it; we differ at some major points. π
another q though: could it be the UART settings? bits, parity, stop bit?
I actually digged a bit into that and found the line of code where it sets them and i dont see an issue
the second one
ok. i would try playing around with the bits setting first. i think the REPL thing was a red herring that my brain took off on...
you mean the baud rate?
i didnt even get so far to write any software for it
id test on the three builtin ones of my chip
also this line of code here shows all the settings
https://github.com/micropython/micropython/blob/master/ports/stm32/main.c#L507
ahh! so maybe i wasn't crazy. https://github.com/micropython/micropython/blob/master/ports/stm32/main.c#L509
but that could also be an attachment to a normal repl couldnt it?
yeah. normal repl is default. raw repl is entered by sending ctrl-A
right
now i gotta wire everything up again as i had already given up on this and planned to continue with normal debugging
@tawny fiber this might be of help: https://forum.micropython.org/viewtopic.php?t=3960
yeah thats the second thing i was wonderin
how does one even execute python with micropython
like when I flash it my chip still comes up like normal on USB when i attach it to the STLINK interface
i cant put my script anywhere
it will look for main.py in the root folder, and run it automatically. boot.py, as mentioned in that forum thread, will run during...well, boot, before some things are setup.
yeah im aware but i dont see a root folder ot put things in
oh. you don't get a mounted drive? /media/Nix/MICROPY (or whatever standard FAT label micropython uses..)
Nah....I mean that might be the case becuase im just flashing it manually over openocd as nothing else is working but idk, never used this
there should be one mounted. it may need to be manually mounted. π€· other than that, its all REPL.
ampy used to be maintained by adafruit, but i think someone else took it over. you can transfer files without USB drive with it.
yep, taken over by pycampers: https://github.com/pycampers/ampy
like I literally cant deploy this any builtin way for the openocd deploy I get
Warn : UNEXPECTED idcode: 0x6ba02477
Error: expected 1 of 1: 0x2ba01477
so i suspect im using a version its not thinking of
for st-flash I get an unknown flash type as it doesnt support the h7 yet iirc and this dfu thing i dont even know how to set up
do the deploy scripts do something a simple openocd "load" command wouldnt do?
i've never dealt with STs. does ST-Link/Flash work with GDB? that's how we do it, though primarily with J-Link...
st-link works with gdb via openocd yeah
so ill just do my usual openocd procedure then....
ahh. ok.
i was Win10 only when i first got into circuitpython; openocd was a nogo, so i used Atmel Studio for the longest.
i mean I can see that I flashed the firmware, i can debug it with my gdb after all buuuuut i dont see any file system what so ever coming up
does dmesg show the MSC getting established?
so what I do get in my dmesg output is (HAH i was just fetching it ^^)
[136536.102470] usb 1-6: USB disconnect, device number 18
[136538.384166] usb 1-6: new full-speed USB device number 19 using xhci_hcd
[136538.512108] usb 1-6: New USB device found, idVendor=0483, idProduct=374b, bcdDevice= 1.00
[136538.512114] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[136538.512117] usb 1-6: Product: STM32 STLink
[136538.512120] usb 1-6: Manufacturer: STMicroelectronics
[136538.512122] usb 1-6: SerialNumber: 066FFF545257717867114125
[136538.571612] usb-storage 1-6:1.1: USB Mass Storage device detected
[136538.571991] scsi host0: usb-storage 1-6:1.1
[136538.572595] cdc_acm 1-6:1.2: ttyACM0: USB ACM device
[136539.631711] scsi 0:0:0:0: Direct-Access MBED microcontroller 1.0 PQ: 0 ANSI: 2
[136539.632433] sd 0:0:0:0: Attached scsi generic sg0 type 0
[136539.632787] sd 0:0:0:0: [sda] 4168 512-byte logical blocks: (2.13 MB/2.04 MiB)
[136539.632960] sd 0:0:0:0: [sda] Write Protect is off
[136539.632963] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[136539.633119] sd 0:0:0:0: [sda] No Caching mode page found
[136539.633121] sd 0:0:0:0: [sda] Assuming drive cache: write through
[136539.646950] sd 0:0:0:0: [sda] Attached SCSI removable disk
but the SCSI is this weird disck by stm themselves which contains a readme + manual
hmm. wrong bootloader?
uuuuh dont tell me you need a bootloader for this
now..i can't speak to need vs optional
i mean it does say "STM32F4xx and STM32F7xx" but it also says that in the other readme as they got no real support for the in specfic h7 atm they say it "should be sconsiderd a faster F7 one for now"
i mean first things first i would be interested in which usb interface theyer even talking about
Re: Understanding the difference between bootloaders mboot and hw dfu
Post by dhylands Β» Thu Dec 20, 2018 2:57 pm
The factory bootloader has limitations, like it only works on FS USB and not HS USB.
You might also want to bootload over alternate interfaces depending on your HW architecture.
The built-in bootloader only supports writing to internal flash. Mboot supports writing to an external flash chip as well.
so maybe not needed. debugging...so much funs! π
like i got the one to the ST-LINK and the power USB plug....and I assume that the one for the ST-Link is for the st-link only?
faster = 3.0SS vs 2.0HS? and yeah, i would assume its the user-facing USB, not the st-link one.
however when I plug it in there it doesnt get pwer and nothing lights up
conclusoin find a second fitting usb cable
if i plug something into the user facing one the kernel doestn even recognize it according to dmesg
π
dev kits are wonky like this. on the nRF dev kits, we had to flash our bootloader to disable the on-board j-link, and allow our USB CDC to take over...
but I want to get back to using Rust at some point too π im just doing this to check wether my Rust code or my chip are weird
these situations always seem like an easy "yeah, i'll verify with this". 6 weeks later...
yeah i know!
this time its not even like a logic analyzer or whatever could help me because im working on something inside the chip
nix now: "embedded dev sucks"
nix when he fixed the problem an hour to 4 weeks like: "my brain fucking sucks"
@open dock fixed my issue now, my peripheral clock for the ADC was too fast so the last three bits never got sampled π
always the clocks...bet never the first thing to think of. π
gladded you got it worked out though! π
Nix, what kind of MCU are you using '? π
STM32H7, if i was reading correctly.
@left gyro its an stm32h743zi (t6 revision y if youre *really interested :p)
Thanks Nix. I googled. π Interesting device π
My work is based around an Atmel Chip based single board
Have much to learn about MCU's and Single Board devices. Learning little by little though.
(and it runs windows CE, due to certification standards and stuff)
atmel chips can run windows?
Sure π
with Microsoft now also making the Linux Subsystem available, the lines are also starting to blur heavily, if you have the spare memory that is.
Probably more single board computer, than MCU though
what atmel chip are we tlaking about there?
i was going to guess a CortexA based chip... i've haven't even come across an ARM926. interesting.
arm9 is heavily outdated isnt it?
windows ce6
no I mean the chip family itself
Not as far as I know. This is a new product line
Since ARM9 cores were released from 1998 to 2006, they are no longer recommended for new IC designs, instead ARM Cortex-A, ARM Cortex-M , ARM Cortex-R cores are preferred.
Certification on these device, take months if not years sometimes
cough
They still make and sell them.
I should clarify. With devices, I mean our entire board. I work for an "OEM" for lack of a better description.
I see
but still, looking at the datsheet its from around 2001-2003. you should at least consider moving on to cortex-a ones in the future
Next gen sure. That will likely be in 10 years.
These are our "New" product line. π
From when is your thing originally?
Access control and security.
No I mean year whise
oh. This has been in development for 4 years i think
Im not a designer though. Just a firmware tester.
Hm maybe arm didn't have windows capable cortex a's at that time
Not been long enough into programming to judge this :p
When it comes to Banking and Military systems. Stuff moves SUPER SLOW
Usually because of Insurance company demands.
Getting stuff certified, takes forever and costs HUGE amounts π¦
Its not consumer electronics sadly.
the job I'm getting in it security by the end of the year keeps getting more and more unattractive
not to mention...$10 non-wholesale per chip vs $51 non-wholesale per chip...
Yup. a few cents even can make or break the uptake of a new system.
comparing against a cortex-A53
The scale of manufacture makes its a big pain if you add even a few cents per board.
though, they are in totally different leagues.
I got an email from the STM news letter (I unsubscribed 4 times from by now) today saying that they now have a 2 core h7....how does that even work, it's a MCU after all
That sounds more SOC that MCU
I stand to be corrected though π
I moved from Software to firmware testing this year.
Different beast totally.
What's the difference?
he distinction between an MCU and an SoC is much less clear, and the two terms are often used interchangeably. However, in common usage, the term SoC typically refers to MCUs with a greater number of onboard peripherals and functionality.
To copy and paste from Google π
SOC. System on chip usually has video and audio and heavens knows what else. MCU is more basic IO.
No no regarding your testing job
I know what those are
face palms
:P
Firmware involves the whole system, including testing the "OS" and whatever else is running on the device. with the software is normaly, more "user software"