Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Replace main.py via UART?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Replace main.py via UART?

by dave_b on Fri Sep 27, 2019 12:46 pm

I have a growing number of TrinketM0s attached to XBees and sensors in my house. They all transmit data to my Raspberry Pi web server.
When I have a new whiz-bang idea, I currently have to unhook them and update each one manually.

Does anyone know if it's possible to replace main.py by transmitting it via the UART? For the moment, it might help to assume I have a method for sending the data to a specific TrinketM0.

dave_b
 
Posts: 3
Joined: Thu Sep 20, 2012 3:31 pm

Re: Replace main.py via UART?

by tannewt on Fri Sep 27, 2019 12:50 pm

While we don't actively support this, it is possible to write files via the REPL. Ampy is a tooling we used to support that does this: https://github.com/pycampers/ampy/blob/ ... es.py#L209

You may need to sort out file writing permissions as well: https://learn.adafruit.com/cpu-temperat ... filesystem

tannewt
 
Posts: 1692
Joined: Thu Oct 06, 2016 8:48 pm

Re: Replace main.py via UART?

by dave_b on Fri Sep 27, 2019 1:33 pm

I'll give it a go, thanks!

dave_b
 
Posts: 3
Joined: Thu Sep 20, 2012 3:31 pm

Re: Replace main.py via UART?

by kmatocha on Mon Apr 27, 2020 10:34 pm

Dave_b,

We’re you ever able to get this working of writing a file from UART? I’m interested in an example if you have one.

Regards,
Kevin

kmatocha
 
Posts: 12
Joined: Sun Sep 03, 2017 12:17 am

Re: Replace main.py via UART?

by dave_b on Mon Apr 27, 2020 11:48 pm

I got distracted by guitar pedals, so no, sorry. I ended up making the handshakes universal enough that I eliminated the need. Good luck though.

dave_b
 
Posts: 3
Joined: Thu Sep 20, 2012 3:31 pm

Please be positive and constructive with your questions and comments.