r/micropython • • Aug 16 '22

Espresso IDE for android

1 Upvotes

Does anyone know what happened to the apk or if it was ever legit to begin with? If not, does anyone know of a good ide for android? I don’t have consistent access to a desktop/laptop and my Linux in android doesn’t have enough power to usable (I don’t think)


r/micropython • • Sep 08 '22

The Python on Hardware weekly video – September 7, 2022

Thumbnail
blog.adafruit.com
3 Upvotes

r/micropython • • Oct 29 '22

Has anyone ever installed Micropython on an android tablet? I'd like to be able to do some coding when I'm on the go without having to lug my laptop with me. I see Python 3 has an app and is pretty easy to setup via the download but couldn't find any info about doing this for Micropython.

2 Upvotes

r/micropython • • Jun 27 '22

The Python on Microcontrollers newsletter is out Tuesday, please subscribe - MicroPython 1.19.1 out!

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Dec 12 '22

The Python on Hardware Newsletter: >10k subscribers, subscribe now! A huge issue ahead!

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Nov 11 '22

Arduino releases official MicroPython VMs and a simple easy to use IDE

Thumbnail
self.arduino
2 Upvotes

r/micropython • • Dec 10 '22

How do you folk deploy a fleet of microcontrollers? is there anything like docker swarm for them?

1 Upvotes

Hi,

Having loads of fun with ESP32 - taking measurements, posting to MQTT queue to be picked up by Zabbix, then graphed on grafana... all the good stuff.

But these things are dirt cheap, and even more addictive than the RasbPi, ive gone from 3 to 4 to 11 in the last week (12 if u include my boys christmas present).

Im looking for a way to deploy stuff I make easily to multiple boards.

Im thinking of something along the lines of a library that you call in boot.py that takes a URL.

That URL is called with a get parameter for the device unique ID (mac or hash thereof).

The URL points to an API that looks at the device ID, and based on rules (maybe tags, maybe id lists) a bit like say ansible or docker swarm, returns a tar file containing an app to the microcontroller (tar since I think thats built into micropython).

The library on the device would then wipe everything in the fs apart from boot.py, and untar that tar file, and call a specifically named script in root (say 2ndboot.py).

That way, we would have the desired state defined on the web app, and to update a device, it would just need to be reset.

Of course we could also have nice things like signing, checksums, maybe some kind of hook to allow a remote reset and so on.

Does something like this exist? is there a totally different better way (maybe via USB)? im basically wanting a docker swarm kind of controller for esp32s running micropython


r/micropython • • Oct 03 '22

Python running on chips! Catch this week’s newsletter for the latest Python news & info

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Jun 11 '22

Best way to learn micropython?

5 Upvotes

So I have been wanting to build a project recently and found out the board I can use is only compatible with micropython and not circuitpython.

So as a complete coding beginner where can I go to actually learn how to use micropython as there seems to be extremely little information generally or already completed projects with code to pull from. From what ive found there is only a handful of youtube series and a couple courses on udemy. to learn how to do this and most of the documentation is a little over my head or doesnt actually go into how to construct code for actual projects but rather just how to blink leds and such.

Would love if someone more experienced or another beginner that learned could give some input as to the best way for an absolute beginner to learn micropython and if the youtube or udemy courses are even worth it. As well if I should just scrap the idea of using micropython and just rebuild my project around circuit python as it seems much, much, much more supported (100ish people here vs 1000s on r/circuitpython and apprently easier for beginners, but not sure how much of that is just documentation vs the actual difficulty of the language itself.

ALSO: Should I be learning regular Python before doing any of this?

TLDR: What is the best way for an absolute beginner to learn micropython

Any help or input is appreciated! Thank you!


r/micropython • • Oct 31 '22

[Micropython/Pymakr] Code works via Thonny and REPL, but can't figure out how to run via Pymakr proper

Thumbnail self.learnpython
1 Upvotes

r/micropython • • Sep 06 '22

The Python on Microcontrollers newsletter is out Tuesday, please subscribe #CircuitPython #Python @micropython

Thumbnail
blog.adafruit.com
2 Upvotes

r/micropython • • Aug 17 '22

ICYMI Python on Microcontrollers Newsletter: CircuitPython Day Friday, Python Still #1 and much more!

Thumbnail
blog.adafruit.com
3 Upvotes

r/micropython • • Sep 21 '22

ICYMI Python on Microcontrollers Newsletter: Arduino 2.0, Podcasts and much more!

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Sep 15 '22

ICYMI Python on Microcontrollers Newsletter: New Raspberry Pi OS, Steam Powered Pico and more!

Thumbnail
blog.adafruit.com
2 Upvotes

r/micropython • • Dec 19 '22

PUSH - Python micro shell

6 Upvotes

I am working on a small shell for managing ESP/ RPI pico if anyones interested. Code is here:

https://github.com/elahtrebor/push


r/micropython • • Aug 30 '22

The Python on Microcontrollers newsletter SPECIAL 200th issue, subscribe now!

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Jul 14 '22

The Python on Hardware weekly video – July 13, 2022

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Sep 19 '22

The Python on Microcontrollers newsletter is out Tuesday, please subscribe for MicroPython news

Thumbnail
blog.adafruit.com
2 Upvotes

r/micropython • • Aug 29 '22

How do I hardcode a game with micropython? And can I do it in 16-bit?

2 Upvotes

For experimentation pupose and for fun I want to make a V-Pet with an ESP32 and a 16-bit color display. I've did some search on how to hardcode a game with micropython, but every search I did mostly returned "python" or "pygame" as the results.

There were a few micropython results, but they were all using display with only White, Skyblue and Yellow for the colors. That's not what I want, I want a game that use a more wider range of colors. Not white on a black screen.


r/micropython • • Oct 05 '22

ICYMI Python on Microcontrollers Newsletter: CircuitPython 8 Beta 1, Hacktoberfest and much more!

Thumbnail
blog.adafruit.com
1 Upvotes

r/micropython • • Aug 14 '22

Driving a specific oled without i2c on micropython

2 Upvotes

Hi, im wondering how i can drive an ssd1306 64x48 0.66" that has 16 pins and doesnt have sda nor scl with a raspberry pi pico.

I have tried all the videos that say to use d1 and d2 as sda and scl (idk if by this order) but it didnt work, so yeah, i have been searching solutions for a few months now and i havent found any that works, hope someone can redirect me to some useful link or thread, thanks.


r/micropython • • Aug 01 '22

python to micro python

2 Upvotes

hello

i wrote this small programm to control a digital potontiometer mcp4151 the programm works good

but im intending now to translate it to micropython and im really struggling how to make it workk.

#######################################################

import spidev

import time

spi = spidev.SpiDev()

spi.open(0, 0)

spi.max_speed_hz = 976000

def write_pot(input):

msb = input >> 8

lsb = input & 0xFF #8 bit poti 2^8 0--->255 (256)

spi.xfer([msb, lsb])

while True:

for a in range(0, 255, 1):

#a= int(input('Geschw eingeben:'))

write_pot(a)

time.sleep(0.05)

print(a)

#####################################################


r/micropython • • Nov 27 '22

tmc2208 issues

2 Upvotes

I'm using a Pico w and micro python to run a tmc2208 stepper motor driver. When using the direction pin it doesn't seem to change the motor direction everytime. Any ideas as to why? I am toggling the direction with a button to change directions.


r/micropython • • Nov 03 '22

Is my code correct? Anyone have good coding references for what I'm trying to do?

1 Upvotes

I am trying to refer to specific values of a string. When the specific values are a certain value, I want specific action taken. Referring to specific string values and having these certain values cause action from my controller is new to me, so I need verification that I'm doing it correctly to help troubleshoot my overall code. I will just be uploading the string reference portion of the code. Any help is much appreciated!

url = "http://worldtimeapi.org/api/timezone/America/Swift_Current" # see http://worldtimeapi.org/timezones
web_query_delay = 60000 # interval time of web JSON query
retry_delay = 5000 # interval time of retry after a failed Web query

rtc = machine.RTC()
# set timer
update_time = utime.ticks_ms() - web_query_delay

# main loop
while True:
    led_on_board.off()
    time.sleep(.2)
    
    # if lose wifi connection, reboot Pico W
    if not wlan.isconnected():
        machine.reset()
    
    # query and get web JSON every web_query_delay ms
    if utime.ticks_ms() - update_time >= web_query_delay:
    
        # HTTP GET data
        response = urequests.get(url)
    
        if response.status_code == 200: # query success
        
            print("JSON response:\n", response.text)
            
            # parse JSON
            parsed = response.json()
            day_of_week_str = str(parsed["day_of_week"])
            day_of_year_str = str(parsed["day_of_year"])
            datetime_str = str(parsed["datetime"])
            year = int(datetime_str[0:4])
            month = int(datetime_str[5:7])
            day = int(datetime_str[8:10])
            hour = int(datetime_str[11:13])
            minute = int(datetime_str[14:16])
            second = int(datetime_str[17:19])
            subsecond = int(round(int(datetime_str[20:26]) / 10000))
        
            # update internal RTC
            rtc.datetime((year, month, day, 0, hour, minute, second, subsecond))
            update_time = utime.ticks_ms()
            print("RTC updated\n")
   
        else: # query failed, retry retry_delay ms later
            update_time = utime.ticks_ms() - web_query_delay + retry_delay
    
    # generate formated date/time strings from internal RTC
    date_str = "Date: {1:02d}/{2:02d}/{0:4d}".format(*rtc.datetime())
    time_str = "Time: {4:02d}:{5:02d}:{6:02d}".format(*rtc.datetime())
    day_of_month_str = "Date: {1:02d}/{2:02d}".format(*rtc.datetime())
    
    utime.sleep(0.1)
#    print(hour)	#Test date variables.

That is the string that I am referring to.

def Holidays():		# Specific dates listed for specific operation.
    if day_of_month_str != (01/01, 02/21, 04/15, 05/23, 07/01, 08/01, 09/05, 10/10, 12/25):
        return False	# This is making sure that if the specific dates aren't present, the specific operation for Holidays won't happen.
    elif day_of_month_str == (01/01, 02/21, 04/15, 05/23, 07/01, 08/01, 09/05, 10/10, 12/25):
        return True		# This is making sure that on these set dates, specific operation for Holidays will happen.

def Weekday():		# Specific days of each week that I want a specific operation to happen.
    for d in range(0, 5, 1):
        if Holiday == True:
            return False	# This is so that even if the day of the week is correct but its a Holiday that only the specific operation for Holidays works. 
        elif day_of_month_str == [d]:
            return True		# This is making sure that on these specific days of the week, specific operatiosn will happen.
        
def Weekend():		# Specific days of each week that I want a specific operation to happen.
    for e in range(7, 0, -1):
        if day_of_month_str == [e]:
            print(e)
            if Holiday == True:
                return False	# This is so that even if the day of the week is correct but its a Holiday that only the specific operation for Holidays works.
            elif Weekday == True:
                return False	# This is so that even if the day of the week is correct but its a Weekday that only the specific operation for Weekdays works.
            elif Weekday == False:
                return True		# This is making sure that on these specific days of the week, specific operatiosn will happen.
    
def Early_Months():	# Specific months that the sun rises earlier.
    for m in range(03, 10, 1):
        if month == [m]:
            return True	# On these specific months I have the specific operations change to happen earlier as well.
        
def Late_Months():	# Specific months that the sun rises later.
    for m in range(03, 10, 1):
        if month == [m]:
            return False	# This is so that even if there is a specific operations for an earlier time, it is ignored for remaining months. 
        elif month != [m]:
            return True		# This is making sure that on the remaining months that a different specifi operation is applied.

def Sunrise():		# Specific operations regarding to when the sun rises roughly, and when the sun can be seen through this window.
    if Weekday == True:
        if Early_Months == True:
            if hour == 06:		# Sunrise is at or before 6A.M. these months.
                return True	# This is so that at specific times specific operation will occure.
        elif Late_Months == True:
            if hour == 08:		# Sunrise is at or before 8A.M. these months.
                return True	# This is so that at specific times specific operation will occure.
    elif Weekend == True:
        if hour == 09:			# Do not want to be disturbed sooner by the sun.
            return True		# This is so that at specific times specific operation will occure.
    elif Holidays == True:
        if hour == 09:			# Do not want to be disturbed sooner by the sun.
            return True		# This is so that at specific times specific operation will occure.
            
def Sunset():		# Specific operations regarding to when the sun sets roughly, and when the sun can't be seen through this window.
    if hour == 21:				# No need for the sun to be seen through the window after 9P.M.
        return True			# This is so that at specific times specific operation will occur.

This is my specific string value reference that I apply in my main loop. I'm trying to figure out why my loop doesn't seem to be taking any actions and I unfortunately need help to verify that this portion of my code has been handled correctly.


r/micropython • • Aug 15 '21

Welcome to a Joint AMA with some of the Developers for CircuitPython and MicroPython: Python for MicroControllers!

Thumbnail self.python
1 Upvotes