MicroPython News

Anything not related to STM32
stevech
Posts: 441
Joined: Thu Aug 27, 2015 6:32 am

Re: MicroPython News

Post by stevech » Wed Apr 20, 2016 3:15 am

Agree... I'm trying my home automation phase-next with the $5 RPi zero instead of as usual, grinding out more C. As I said earlier, I was going to use micropython (Viper/ZERYNTH), on the existing STM32F4 port, but too many absent libraries.

First the Xbee 802.15.4 with the Python library for it... though I've written the equivalent professionally in C, I wanted to try Python. 56Kbps link to Xbee which links to other XBees in a star toplogy. End nodes w/Xbee have no added microprocessor... I use over the air config of XBee S1 very versatile A/D, D/A,PWM, GPIOs, pin change, sampling then sending batches of samples at my sample rate and batch size, etc. The Xbee receiving is a thread with callbacks from the library. That library uses callbacks from the serial port driver in Linux. No polling loops anywhere.
Example: Sprinkler controller with failsafe and Python + PyQt GUI and Apache web server on the RPi. SSL option. Rapid app.

Next I tried a shaft encoder (grey code). $3. Connected it to GPIO pins of the RPi Zero. Ran the Python GPIO library. It has callbacks for pin change notifications (threaded). The encoder I'm using has 24 steps in one rotation. Very quick Python program to track and time tag each rotation, which direction, up/down count on angular position, etc. Printouts show it keeps up fine with steps I could create by twisting the knob on the encoder... like 50mSec per step as I spun the dial.
Example: I've got the encoder connected to the axle of the sectional garage door. Goal is to use an audio-fader type of potentiometer to choose door position. RPi has an opto-isolator to the garage door control button. We leave the garage door ajar a foot or two so when the garage is too warm. It's an attached garage w/2 cars in it, and washer/dryer. I suppose the automation can close the door if we forget, late night when no one is likely to be in harm's way. Kind of fun too, I hope, to make door position an "analog" thing instead of mashing on/off/on with the door opener's button.

This is with both the XBee code and the encoder code as two independent Python apps. And all the Linux stuff. These RPi have WiFi dongles plugged into the USB port, and an SMB share from my shared folder on the LAN for GB of storage. SD card on RPi is not used by my programs. So I use VNC to run the python programs. And the Python IDE (freeware) runs on my desktop and puts the file on shared folder on the LAN for the RPis to get to via WiFi.

There is DMA for all this but I don't need it.

At some input sampling rate or some such I'd need DMA or off-load to a traditional MCU. Unlikely I'll need sub-mSec events in this project.

So this is an exercise with some utility.

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

MicroPython is growing up

Post by mrburnette » Tue Nov 14, 2017 2:15 pm

18 months down the road with microPython...

Maturing and capable and ported to many platforms.

I am actually playing with this on the ESP8266 and the ESP32: here.

You can install and run microPython right on your PC (tested) and Windows and OS-X ports are available.

My second First Impression indicates that on uC with a little bit more SRAM, this is a very productive environment. The ecosystem now includes webservers, display drivers, and full control of I/O. Performance? For Byte-Code compiled, not bad.

Developing directly on the bare-metal hardware is interesting and a wild departure from the normal edit source --> compile --> link --> upload --> test cycle.

If you Python, things are getting very interesting.

Ray

ag123
Posts: 798
Joined: Thu Jul 21, 2016 4:24 pm

Re: MicroPython News

Post by ag123 » Tue Nov 14, 2017 2:49 pm

actually one of those things that got me looking at micro python is their highly compact / miniaturized *boards* :lol:
https://store.micropython.org/store/#/store

sometime back i started a thread looking out for tiny stm32f4* boards, and it turns out micro python pyboard 1.1 is one of the very compact functional boards that has a stm32f4 and is one of the top tiny f4 boards
viewtopic.php?f=39&t=1977

User avatar
RogerClark
Posts: 7445
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: MicroPython News

Post by RogerClark » Tue Nov 14, 2017 7:26 pm

Mircro python is certainly getting interesting.

However the boards in the micropython store are around 4 times more expensive than comparable generic boards

Perhaps if @racemaniac's F405 BluePill board had micropython pre-installed it would be more economic to produce as people would pay $50 rather than $10

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: MicroPython News

Post by mrburnette » Wed Nov 15, 2017 1:36 pm

RogerClark wrote:
Tue Nov 14, 2017 7:26 pm
Mircro python is certainly getting interesting.

However the boards in the micropython store are around 4 times more expensive than comparable generic boards

Perhaps if @racemaniac's F405 BluePill board had micropython pre-installed it would be more economic to produce as people would pay $50 rather than $10
... just a thought. For playing, it really does not matter what the underlying hardware is: PC, RPi, ESP32 ...
Here in Atlanta, the RPi Zero W is $5 qty 1 every day and stock has been ample since September. For non-OS boards, the ESP32 is a low-priced unit and almost everyone has an ESP8266 module lying in a drawer :D

Ray

stevestrong
Posts: 1813
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: MicroPython News

Post by stevestrong » Wed Nov 15, 2017 2:37 pm

Isn't the generic 407 mini board (only costs ~10USD) a real alternative to micropyton pyboard 1.1?
https://github.com/micropython/micropyt ... C-GND-F407

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: MicroPython News

Post by mrburnette » Wed Nov 15, 2017 4:47 pm

stevestrong wrote:
Wed Nov 15, 2017 2:37 pm
Isn't the generic 407 mini board (only costs ~10USD) a real alternative to micropyton pyboard 1.1?
https://github.com/micropython/micropyt ... C-GND-F407
IMHO, yes as long as you remember that s/h from AliExpress is going to bring the board to something over $14 U.S.D. Taobao price is $8 U.S.D. and I do not read Chinese and Google translate is not helping to determine s/h on quantity 1. But were I purchasing this board, I would consider purchasing 10x since the board appears to be rather nice in the under $10 category. Another option is a small group buy for members in a small geographic area.

Here is a bit of a write-up on microPython running on the STM32F407

On these bare metal boards, microPython is considered the OS (like the old DOS on 8088 days.) Booting your python script from SD is an option as well as OTA software program updates.

On the RPi Zero W, microPython is just another thread in the Linux OS and therefore the programmer must be a little (more) knowledgeable about dealing with tasking delays then when running on bare metal. This is how not to do it...



Ray

User avatar
RogerClark
Posts: 7445
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: MicroPython News

Post by RogerClark » Wed Nov 15, 2017 7:10 pm

Ray

I don't think I expressed my sentiments very well.
I was just commenting in the boards on that site, which seem rather overpriced IMHO.

I always find it surprising that people are willing to pay such a premium to have firmware pre-installed, but I'm not your average consumer by a huge margin ;-)

Anyway...
I have lots of boards which could potentially run MicroPython, including several F4 boards, and ESPxx and nRF52.

So I will definitely have to put installing MicroPython on my To Do list

But todays fun thing is to buy a kids kite, to see if I can make and airborne LoRa node ;-)
(Its often windy here)

zmemw16
Posts: 1484
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: MicroPython News

Post by zmemw16 » Wed Nov 15, 2017 10:46 pm

tomorrow, add a motor, vector motor, gps, ov7xxx, gyro, gimbal, ...... ... ... :?:
srp

User avatar
ahull
Posts: 1650
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: MicroPython News

Post by ahull » Thu Nov 16, 2017 9:30 am

But todays fun thing is to buy a kids kite
Even more fun is to make your own kites. When I was much younger I used to build big kites out of heavy duty polythene (thick bin bags or plastic animal feed bags). The lift these things generated was sometimes a little scary (especially since I lived under the flight path to the local airport). When it got a little bit breezy (which is most of the time round here), they could pull you off your feet if you weren't careful. They would have easily lifted a fairly substantial camera rig.
- Andy Hull -

Post Reply