loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

WiFiMCU LUA port with many new modules and enhancements

Wed Nov 04, 2015 3:49 pm

LUA implementation for WiFiMCU/EMW3165

Based on DoIt Lua for WiFiMCU with many new modules, original modules are enhanced and bugs fixed.

Last update: 1.0.4_LoBo, 01. Apr 2016.

Downolads:
Videos:

New modules:
  • RTC module - Real Time Clock support
  • OLED module - Support for SSD1306 based display modules (SPI or I2C interface)
  • LCD module - Support for SPI TFT display modules (based on ST7735 and ILI9341 controllers)
  • MQTT module - Complete MQTT client module with up to 3 independent clients
  • FTP module - Complete FTP client module

Enhanced modules:
  • FILE module - completely rewritten, added possibility to open multiple files, directories, ymodem send/receive functions, ...
  • WiFi module - completely rewritten, added ntptime function to get date&time from ntp server, enhanced functionality, ...
  • Sensor module - added 1-wire, DS1820, DHT22 support, enhanced DHT11
  • ADC module - added readV, setref, setautocal functions, many enhancements ...
  • UART module - added software emulated UART, enhanced functionality, ...
  • SPI module - added hardware SPI, enhanced functionality, ...
  • I2C module - completely rewritten, added hardware I2C, ...
  • MCU module - added functions to define and manipulate system parameters, ...
  • NET module - completely rewritten, added blocking/non blocking mode for client sockets, http GET/POST support, ...

System enhancements:
  • Enhanced watchdog functionality, added WWDG support
  • Added system parameters support (parameters are saved in SPI Flash)
  • SPI Flash file system expanded to ~1.7M (formatted 1691042 bytes available), updated to latest spiffs
  • Added STM32F411 STOP and STANDBY functionality (available via RTC module)
  • Enhanced callback functions functionality
  • Added redirect functionality for standard output
  • Updated and enhanced bootloader (still compatible with WiFiMCU Studio) with flash from file function added

Planned/In development:
  • SD Card (FAT32) module
  • Support for external SPI flash (up to 32 Mbytes)
  • Touch screen support for ILI9341 based TFT modules
  • IDE working on Windows and Linux
  • ...

Sources are available in GitHub repository

To build it with IAR, open the project in Projects\WiFiMCU\LUA\EWARM

If you find my work useful, you are welcome to DONATE
Last edited by loboris on Fri Apr 01, 2016 2:07 pm, edited 22 times in total.

lpifer5655
Posts: 4
Joined: Fri Oct 30, 2015 2:35 pm

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Fri Nov 06, 2015 1:19 pm

Are you using the trial version of IAR or full? Also which version are you using?

loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Fri Nov 06, 2015 7:36 pm

I have access to the full version, but I've tested also with the 30-day time-limited evaluation version (7.4)

doit_yp
Posts: 21
Joined: Wed Aug 19, 2015 1:06 am

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Fri Nov 13, 2015 6:56 am

Hi, loboris,
It's a great job for wifimcu. I have forked your project.
I consider to merge your work into the wifimcu thread(), is that ok?
Software engineer from DoIT
yangping@doit.am

KevinA
Posts: 13
Joined: Tue Nov 03, 2015 7:33 pm

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Sat Nov 14, 2015 7:19 pm

@yangping
Will this be in the MiFiMCU Lua ?
I could use RTC!
Thanks

KevinA
Posts: 13
Joined: Tue Nov 03, 2015 7:33 pm

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Sat Nov 14, 2015 11:59 pm

When I try
>rtc.set(00,48,16,5,14,11,15)
> print(rtc.getasc())
Fri Nov 14 16:49:03 2015
> rtc.standbyUntil(16,55,5)
Wake up at 16:55:05
WiFiMCU Lua starting...(Free memory 65544 bytes)
[5][Platform: mico_platform_common.c: 99] Platform initialised, build by IAR
Current Time: Fri Nov 14 16:52:13 2015
[ Ver. 0.9.6_lobo_0.1 WiFiMCU Team, modified by LoBo @2015 ]
init.lua not found

But the system is not asleep, so what is rtc.standbyUntil() doing?
Thanks

loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Mon Nov 16, 2015 9:20 am

KevinA wrote:...
But the system is not asleep, so what is rtc.standbyUntil() doing?...


rtc.standby & rtc standbyUntil put the CPU into standby mode (minimal power consumption - STANDBY mode) and RTC wakes it at specified time.
Thed CPU resets on wake up but you can use init.lua script to resume/initialize your work. It is intended for battery operated applications where the system wakes up periodically. WiFiMCU board is not best suited for that, because the wiring is such that it always consumes some power.
I'm using my own board and I can get ~20 uA in standby.

I'll try to implement also the STOP & SLEEP modes in which CPU does not reset.

BTW, I've just finished some new modules and corrected some bugs.
The SPI module is completely rewritten and two hardware SPI channels are added. Added 1-wire module, added DS18B20 to sensors module, added oled module (SSD1306, for now only text). I'll commit the changes soon.

Image

KevinA
Posts: 13
Joined: Tue Nov 03, 2015 7:33 pm

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Tue Nov 17, 2015 8:34 am

Nice looking display! When I get some spare change I'll try one, by then they will be 15"! Thanks for explaining the sleep/stop thing, it would be a good thing to get all the functionality working for the EMW3165. I looked at another device MAX6675 SPI based thermocouple controller that could be used in 'Safety of Life' application. Just for fun I dumped a library for the device configured to run on the SMT32F411 with IAR
as the compiler... aaes.us/max6675_iar_nucleo_f411re.zip if you want to play with one they are on Ebay for $3.50 + $.99 for a sensor probe.
At any rate looking forward to 9.7 !

loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Sun Nov 22, 2015 8:41 pm

UPDATED GitHub repository with WiFiMCU LUA 9.7.
Many fixes, some new modules added, documentation updated.
Read WiFiMCU LUA Reference_9.x-lobo.pdf in GitHub for more information

MICO 2.3.0.2 API documentation generated with doxygen available here
Last edited by loboris on Sun Dec 20, 2015 4:29 pm, edited 1 time in total.

keithr
Posts: 5
Joined: Wed Nov 04, 2015 4:33 am

Re: WiFiMCU LUA ported to MICO 2.3.0.2

Tue Nov 24, 2015 7:59 am

Thanks for your work Loboris, itis good to see the improvements that you have made.
I am having a problem trying to connect to an AM2302 (DHT22 clone) with 0.9.7_lobo_0.3 using the sensor module. If I enter

Code: Select all

=sensor.dht11.init(pin)

I should see either "1" or "0" depending on whether the device connects or not. I am however seeing "nil" instead.

BTW the manual mistakenly uses "DTH11" instead of "DHT11"


Return to “WiFiMCU”

Who is online

Users browsing this forum: No registered users and 1 guest