New modules, improvements, added functionality, bug fixes and more...
During the next week, detailed documentation and examples for all added or changed modules will be pushed to the GitHub repository.
display module
support for
SPI TFT displays based on ILI9341, ILI9488 & ST7789V controllers based on my
TFT library
- full set of graphics drawing methods, pixel, line, lineByAngle, triangle, circle, ellipse, rect, roundrect, arc, polygon
- 9 embeded fonts, including vector 7-segment font and unlimited number of fonts from file
- flexible text method, displaying text at any angle, transparent or opaque, ...
- image support, jpg or bmp images with scalling
- clipping window support
- touch panel support
- reading from display memory support
- and more...
curl module
- get method, http & https are supported
- post method, http & https are supported, using multipart/form-data, unlimited number of fields/files can be sent
- sendmail method, send mail with unlimited number of attachment files, ssl/tls supported, tested with gmail
- ftp methods, get, put, list
- more will be added later ...
ssh module
- get method, download the file using scp protocol
- put method, upload the file using scp protocol
- list & llist methods, list files on server using sftp protocol
- exec method, execute any command/application on server and get the rusult
Neopixel module
- uses ESP32 RMT peripheral for precise timing
- custom timings can be set, any RGB chip can be driven (defaults to WS2812)
- any color order is supported
- included methods: clear, set, setHSB, get, show, brightness, HSBtoRGB, RGBtoHSB, timings, color_order
hwI2C module
_thread module
- _thread module is greatly improved and more reliable
- creating thread returns unique thread id used by various thread methods
- inter-thread notification support, methods: notify, getnotification
- inter-thread messaging, threads can exchange data, methods: sendmsg, getmsg
- helper methods: getReplID, replAcceptMsg, getThreadName, getSelfName, allowsuspend
- threads can be suspended, resumed and killed, methods: suspend, resume, kill
- list method, list running/suspended threads to screen or return tuple with threads information
Multiple threads can run smoothly, for example I'm running 5 threads for more than 24h without any problem:
Code: Select all
>>> _thread.list()
ID=1073548004 Name: Neopixel State: running
ID=1073413296 Name: BME280 State: running
ID=1073412568 Name: FTPServer State: running
ID=1073411840 Name: B_Led State: running
ID=1073411360 Name: R_Led State: running
ID=1073454488 Name: MainThread State: running
>>>
[Message from thread "BME280"] [12:02:24] T=26.92C P=1004.63hPa H=55.77%
[Message from thread "BME280"] [12:03:32] T=26.89C P=1004.62hPa H=55.11%
>>> _thread.notify(npth,1000)
True
>>>
[Message from thread "Neopixel"] [Neopixel] Run counter = 888279
>>>
>>> _thread.suspend(bth)
True
>>> _thread.list()
ID=1073548004 Name: Neopixel State: running
ID=1073413296 Name: BME280 State: running
ID=1073412568 Name: FTPServer State: running
ID=1073411840 Name: B_Led State: suspended
ID=1073411360 Name: R_Led State: running
ID=1073454488 Name: MainThread State: running
>>>
- B_Led & R_Led blinking leds for 100 ms every second
- BME280 reading BME280 sensor data using hwI2C and sending inter-thread message to main (repl) thread, accepts notifications for changing/disabling report interval and measure&report on request
- Neopixel cycling rainbow colors thru 24 WS2812 RGB leds, accepting inter-thread notifications to change brightness and report counter status
- FTPServer running python FTP server
Repl still runs smoothly, without noticeable effects on other threads even when performing such a task as downloading the file from ftp server.
Check
GitHub repository for more info and sources.