Commit Graph

716 Commits

Author SHA1 Message Date
jfollas aa50eca4f6 Refactoring of MQTT module to consolidate duplicate code into a function
- per @pjsg's suggestion
2016-03-06 20:11:16 -05:00
jfollas 0abe2fe964 MQTT Client - CONNACK processing
- Process the CONNACK message received from the broker after Connect
- Provide feedback to Lua via failure callback on client:connect()
- Also provide failure information for other situations not covered by CONNACK
2016-03-06 16:33:57 -05:00
Terry Ellison 76f2654f82 Merge pull request #1105 from TerryE/dev-node-task
Extend the node library to include a Lua implementation of task posting
2016-03-06 17:17:55 +00:00
TerryE acddf29fb0 Address Philip's review comments 2016-03-06 17:11:18 +00:00
TerryE 1e49d03dbc Limit file.open() names to 31 char max C string format. See #1112 2016-03-04 01:46:35 +00:00
TerryE 9977b13bcd Update to address review comments in PR #1105 2016-03-03 15:48:09 +00:00
Johny Mattsson 5684392911 Merge pull request #1111 from TerryE/dev-fix-luac-compile
Fix break in luac.cross build and add some documentation
2016-03-04 01:22:41 +11:00
TerryE f2ea3df8a4 Fix break in luac.cross build and add some documentation 2016-03-03 02:03:23 +00:00
philip 6efbf13eae Omit all the PWM code if the PWM module is not included 2016-03-01 21:55:21 -05:00
Terry Ellison ebb0c33364 Merge pull request #1040 from pjsg/struct
Direct port of the struct module
2016-03-02 01:57:17 +00:00
TerryE 4f8f192cbe Extend the node library to include a Lua implementation of task posting 2016-03-01 23:37:41 +00:00
Marcel Stör f087908d62 Disable SmartConfig by default 2016-03-01 21:32:24 +01:00
Terry Ellison 00cc4b42dc Merge pull request #1067 from pjsg/rotarymod
Module to handle rotary decoders
2016-03-01 16:36:24 +00:00
Terry Ellison d883f2c4be Merge pull request #1088 from TerryE/dev-dis-smart-wifi
Make the wifi.smart functions options and remove wofs and upgrade
2016-03-01 16:34:00 +00:00
Terry Ellison 128177acd4 Merge pull request #1102 from DiUS/enduser_setup-less_crash
Crash-fixes for enduser_setup module
2016-03-01 16:28:18 +00:00
philip dbaad1b81c Add call to get_pin_map() in pwms_init()
Move get_pin_map() into platform_init
2016-03-01 09:18:36 -05:00
Johny Mattsson 969e9f2e90 Fix fatal crash if enduser_setup.stop() called twice. 2016-03-01 18:59:30 +11:00
Johny Mattsson a3d9d3ea47 Include the SSID in enduser_setup status message.
For more userfriendly feedback.
2016-03-01 18:59:24 +11:00
Johny Mattsson 04889813f3 Fix nasty case of memory corruption by enduser_setup.
Turns out that running wifi_station_config() from a network callback can
be a Really Really Bad Idea(tm).
2016-03-01 18:59:18 +11:00
philip d40ee50a8e Squashed commit of the following:
commit 2c7c3fc3985cc32866e8af496abea9971eaee90a
Merge: 9179dae 41022c3
Author: philip <philip@gladstonefamily.net>
Date:   Sun Feb 28 14:47:47 2016 -0500

    Merge remote-tracking branch 'upstream/dev' into rotary_2

commit 9179dae0824e6b35ad09e5113aacc26dc91692c0
Author: philip <philip@gladstonefamily.net>
Date:   Fri Feb 26 20:53:27 2016 -0500

    Review comments

commit 67741170e20ccb2b636e701f0664feff2aafbb4c
Author: philip <philip@gladstonefamily.net>
Date:   Fri Feb 26 20:59:49 2016 -0500

    Squashed commit of the following:

    commit 8c9a64731c4a8b9aedda18a399b433b173d2199f
    Merge: 085935f 19d3c1d
    Author: philip <philip@gladstonefamily.net>
    Date:   Fri Feb 26 20:58:10 2016 -0500

        Merge remote-tracking branch 'upstream/dev' into rotarymod

        Conflicts:
        	app/platform/platform.c

    commit 085935fc56986d607ff5e05d1663970331959c34
    Author: philip <philip@gladstonefamily.net>
    Date:   Fri Feb 26 20:53:27 2016 -0500

        Review comment

    commit 7732fd2d1044f28b8fcf5b0aa0f76d76fe80f449
    Author: philip <philip@gladstonefamily.net>
    Date:   Sat Feb 20 12:10:38 2016 -0500

        Module to handle rotary decoders

        Eliminate ROTARY_DEBUG

        Remove unused file

Eliminate a malloc call

Cleaned up the register code. Now 0x114 bytes

Fix bug with clearing bits in one case

Fix the type in the #define name
2016-02-29 08:21:12 -05:00
vsky fac579fbb8 BME280 - fixing 2 issues
1) Signal incorect reading when the sensor is disconnected.
2) Reset humidity oversampling settings when calling `bme280.startreadout()` - if the sensor is reconnected and readouts are in forced mode there is no need to re-initialize the sensor (`bme280.init()`).
2016-02-27 15:44:15 +01:00
Arnim Läuger 19d3c1d581 Merge pull request #1041 from pjsg/performance
Simple low level performance monitoring tool as a module
2016-02-26 22:20:25 +01:00
TerryE 46ea2aa42e Make the wifi.smart functions options and remove wofs and upgrade
AFAIK no one uses the wifi.startsmart() and wifi.stopsmart().  Removing
them frees up an extra 20-25K of Flash to use as filesystem.  So I have
added a new config define WIFI_SMART_ENABLE which is enabled by default
so the default functionality is the same, but if this is commented out
then this code is omitted.

I have also removed wofs and upgrade from this build as we no longer
support these.
2016-02-26 17:23:38 +00:00
Terry Ellison ef5eed307c Merge pull request #1082 from pjsg/gpio-int
Made level triggers work better than before
2016-02-26 14:18:14 +00:00
philip ad3f267da6 Fix review comments 2016-02-26 09:07:06 -05:00
Johny Mattsson c2bd582c36 Merge pull request #1083 from dnc40085/dev_tmr_lua_state_fix
Fix coroutine incompatibility in tmr module
2016-02-26 18:16:15 +11:00
Johny Mattsson 88369a5bd3 Merge pull request #1072 from TerryE/dev-encoder
Addition of encoder module with base64 and hex encode/decode as per #925
2016-02-26 12:35:02 +11:00
TerryE 8353991722 Update encoder files after #925 & #1072 review comments 2016-02-26 00:44:33 +00:00
philip 72d8c73763 Made level triggers work better than before
Move the level trigger to be after the callback
2016-02-25 08:38:25 -05:00
dnc40085 8e88612276 Fixed issue where timer callback wasn't using the proper lua_state.
This made the timer module incompatible with the lua coroutining module.
2016-02-24 17:56:16 -08:00
Terry Ellison 323d302829 Merge pull request #1068 from TerryE/dev-node-egc
Add node.egc.setmode() + constants as per #609
2016-02-24 23:53:20 +00:00
Arnim Läuger 78e9873d33 Merge pull request #988 from pjsg/mdns
Simple mdns implementation using the Espressif code
2016-02-24 22:54:39 +01:00
dnc40085 9a8edd8ae8 Fix inconsistency between flash_init_data in flash_api.c and
esp_init_data_default.bin in SDK 1.51
2016-02-23 01:22:41 -08:00
philip e516a0e9a2 Performance monitoring tool.
Squashed commit of the following:

commit f1820af82bb5467d0c79c03290fca809b0273030
Author: philip <philip@gladstonefamily.net>
Date:   Sun Feb 21 15:08:31 2016 -0500

    Now uses userdata

commit 74a2298f5f2d2b07097a9501046efb8d4061ec5e
Merge: 4ffab15 716e682
Author: philip <philip@gladstonefamily.net>
Date:   Sun Feb 21 13:54:40 2016 -0500

    Merge remote-tracking branch 'upstream/dev' into performance

    Conflicts:
    	app/platform/hw_timer.c
    	app/platform/hw_timer.h

commit 4ffab15a2a15e0c6b2d7e93611a02be47bafdc79
Author: philip <philip@gladstonefamily.net>
Date:   Fri Feb 12 17:36:12 2016 -0500

    Simple low level performance monitoring tool

    Make it work with the new hw_timer code

commit 944db2bdb8
Author: philip <philip@gladstonefamily.net>
Date:   Sun Feb 14 10:32:41 2016 -0500

    Initial version of the hw_timer as part of the platform

Addressed review comments

Add the binsize return
2016-02-22 08:50:07 -05:00
Adam Bonner 96f905bf81 Crypto-new_hash Improved code based on review in #1037 2016-02-21 21:13:06 -08:00
Adam Bonner 332b53b9db Initial implementation of a chunk capable hash function in crypto module 2016-02-21 21:13:06 -08:00
Arnim Läuger b171ca35ba Merge pull request #1008 from vsky279/bme280
BME280/BMP280 Digital Pressure Sensor module
2016-02-21 20:58:37 +01:00
vsky 6bd0ec4480 BME280/BMP280 Digital Pressure Sensor module 2016-02-21 19:51:08 +01:00
TerryE ffa7ee9b67 Addition of encoder module with bas64 and hex encode/decode as per #925 2016-02-21 04:18:27 +00:00
TerryE 0ef362472c Add node.egc.setmode() + constants as per #609 2016-02-20 19:15:52 +00:00
Arnim Läuger 8743319b02 Merge pull request #1000 from devsaurus/sigma_delta
Add sigma_delta module.
2016-02-20 20:11:42 +01:00
Arnim Läuger e82cb974a6 Merge pull request #1057 from pjsg/hwtimer
Add real hw_timer support and convert the pwm module to use it
2016-02-20 20:05:40 +01:00
Terry Ellison 68919dea65 Merge pull request #1004 from cheloftus/dev
Added crypto.fhash function for hashing files
2016-02-19 20:16:09 +00:00
devsaurus 8982650df9 Add sigma_delta module. 2016-02-18 21:35:58 +01:00
Terry Ellison dc905f080b Merge pull request #1063 from DiUS/fscfg
Add file.fscfg() command for fs location + size.
2016-02-18 08:51:03 +00:00
philip 669543bbf2 Hardware timer support and convert the PWM module to use it 2016-02-17 21:07:33 -05:00
Johny Mattsson 1fd98d9f86 Add file.fscfg() command for fs location + size. 2016-02-18 12:52:40 +11:00
Johny Mattsson 1afa72d53a Merge pull request #1061 from TerryE/dev-task-if
Add New Tasking I/F and rework GPIO, UART, etc to support it
2016-02-18 11:51:27 +11:00
Terry Ellison 16953690bb Merge pull request #902 from Alkorin/ws2812-buffer-1.5
ws2812 strip data buffer
2016-02-17 22:05:47 +00:00
Terry Ellison 4501f655f6 Merge pull request #1050 from jfollas/file-exists
Added file.exists() method
2016-02-17 22:04:09 +00:00
TerryE 49733f6f6d Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.

-   **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.

-   **Tasking I/F**.  New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit.  Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`

-   **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`

-   **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 17:13:17 +00:00
devsaurus c88f0bd3f8 Enable UART baudrate 256000 in platform layer. 2016-02-15 21:40:20 +01:00
Henk Vergonet a1c1e015ff Add i2c based module for am2320 humidity sensor
Example use:
> sda=1
> scl=2
> am2320.init(sda,scl)
> rh, t = am2320.read()
> print(string.format("Temperature: %s degrees C", t / 10))
> print(string.format("RH: %s %%", rh / 10))

signed-off-by: henk.vergonet@gmail.com
2016-02-14 15:12:42 +01:00
jfollas d4ae67d0b4 Changed filename length error handling per TerryE's suggestion 2016-02-13 18:58:04 -05:00
jfollas 44786a22ff Added file.exists() method to save the need to use file.list() for checking file existence 2016-02-13 17:37:04 -05:00
philip 0e9a0d43d4 Direct port of the struct module that provides access to
packed structures in strings. Very useful for network protocol
packing/unpacking. The docs are directly converted from the original.

Review feedback

Fix typo
2016-02-13 08:32:25 -05:00
Marcel Stör 2c687313de Merge pull request #1002 from pjsg/mqtt
Fix memory exhaustion in mqtt under circumstances from issue #975
2016-02-10 12:58:26 +01:00
Marcel Stör 2e37a52aaa Merge pull request #1030 from devsaurus/spi_pinconfig
Enable spi functionality on pins after internal config has been applied.
2016-02-10 07:06:13 +01:00
devsaurus 5d8848ecaf Enable spi functionality on pins after internal config has been applied. 2016-02-09 23:26:40 +01:00
devsaurus dc2e1efefb Extend data type for spi miso/mosi buffer offset to 16 bit. 2016-02-09 22:05:05 +01:00
Arnim Läuger 25585672ae Merge pull request #1014 from urish/patch-1
Fix secure TCP connections for `net` and `mqtt` modules.
2016-02-07 19:51:32 +01:00
Uri Shaked 31a62a9eb1 Fix secure MQTT connections
Call `espconn_secure_set_size()` before calling `espconn_secure_connect()`, similar to how the http module works
2016-02-07 18:11:30 +02:00
Arnim Läuger d760a5e29c Merge pull request #940 from devsaurus/dev-ssd1327
implement architecture dependent delay functions for u8glib
2016-02-06 21:46:01 +01:00
Uri Shaked ce498462f7 Fix secure TCP connections
Call `espconn_secure_set_size()` before calling `esp_secure_connect()`, should fix issues like #710 and #520
2016-02-06 17:12:46 +02:00
cheloftus 58dd15e1d1 Added crypto.fhash function for hashing files 2016-02-05 22:19:00 +00:00
philip c9cf02ba31 Send any queued packets when possible 2016-02-01 22:29:32 -05:00
Johny Mattsson fcb14a33b3 Merge pull request #987 from DiUS/enduser_enhanced
Enhancements to enduser_setup module
2016-02-02 00:39:47 +11:00
Johny Mattsson 86839d6e71 Fixes and enchancements for enduser_setup module.
Fixes:

* Removed spurious \0 bytes being sent to the client in many cases.

* Properly terminated 404 header.

* Now including Content-length: header for index.html (including built-in).

  Clients otherwise had to wait for their own timeout before considering
  the page load complete, which resulting in an unpleasant sluggish
  experience.

* Switched form submission to GET, as iOS sometimes does not include the
  body in the same packet as the POST header, which led to the module
  not finding the form values.

* Added redirect after form submission to avoid blank-page-in-browser.

* Moved common "enduser_setup" prefix to a lua_pushfstring() to reduce
  string literal overhead.

* Replaced cached lua_State* with calls to lua_getstate(), as in other
  modules.

* Fixed broken appending of MAC to the SSID.

* Fixed up macro definitions to not break `if` clauses unintentionally.

Enhancements:

* Support for scanning for available WiFi networks, and picking from the list.

* Support for retrieving the current WiFi station status.

* Added "manual" mode, where the module does not (re)configure the AP setup,
  nor shut down automatically. Default is still automatic, as before.

* Updated docs for new `enduser_setup.manual()` function.
2016-02-01 14:42:24 +11:00
philip 76b28c1f74 Simple mdns implementation using the Espressif code 2016-01-29 21:37:19 -05:00
devsaurus 8db93bcabf make delay optional 2016-01-29 18:52:38 +01:00
devsaurus 3a597f1698 implement architecture dependent delay functions for esp8266 port 2016-01-29 18:52:38 +01:00
devsaurus 1c32d20502 improve error checking in mqtt module
connect(), close(), subscribe(), publish()
2016-01-28 21:36:38 +01:00
Johny Mattsson 9fd215b028 Corrected sprintf() prototype & behaviour. 2016-01-28 17:56:01 +11:00
Johny Mattsson 74d27b3486 Merge pull request #968 from devsaurus/crypto_http_mqtt_lua-gnu11
Enable -std=gnu11 for crypto, http, mqtt, and lua dir
2016-01-28 17:36:27 +11:00
jfollas edbcbe1b0f Fixed issue where default ESP_xxxxxx SSID was appearing for enduser_setup 2016-01-27 10:24:10 -05:00
Johny Mattsson 9741f2c678 Merge pull request #977 from vowstar/fixed-http-1-1
Fix HTTP response bug while server only support HTTP/1.0
2016-01-27 10:51:48 +11:00
Robert Foss 6ef7ece046 Cleaned up APA102 module registration. 2016-01-26 17:14:19 -05:00
Huang Rui 1a20f2eda8 Fix HTTP response bug while server response HTTP/1.0
Signed-off-by: Huang Rui <vowstar@gmail.com>
2016-01-26 16:06:11 +08:00
Robert Foss 0f3c0ffbb0 Added support for the APA102 LED. 2016-01-25 20:54:27 -05:00
Huang Rui 5e2eb3588c Fix redefine bug on some other version SDK(such as espressif's lubuntu environment)
Signed-off-by: Huang Rui <vowstar@gmail.com>
2016-01-25 03:06:18 +08:00
devsaurus cd06905b58 include user_interface.h to avoid implicit decls 2016-01-24 00:22:11 +01:00
devsaurus f149b60c7f enable -std=gnu11 for lua dir 2016-01-24 00:02:27 +01:00
devsaurus b3b50646ef enable -std=gnu11 for mqtt dir 2016-01-23 22:42:55 +01:00
devsaurus 19fda87e33 enable -std=gnu11 for http dir 2016-01-23 22:41:41 +01:00
devsaurus 8befcf0888 enable -std=gnu11 for crypto dir 2016-01-23 22:36:35 +01:00
Johny Mattsson 91b2533aa6 Merge pull request #965 from devsaurus/platform-gnu11
Enable -std=gnu11 for platform and driver dir.
2016-01-24 01:23:27 +11:00
Terry Ellison 85bd7bbeda Merge pull request #951 from Alkorin/ws2812-uart
Rewrite ws2812 serialization code to use UART1 instead of bit-banging.
2016-01-23 10:42:56 +00:00
devsaurus 9f54c8f5d4 enable -std=gnu11 for driver dir with corrected os_printf* decls 2016-01-23 11:22:03 +01:00
devsaurus 0c3fc6cc78 enable -std=gnu11 for platform dir 2016-01-22 23:21:34 +01:00
Arnim Läuger 3b589e2177 Merge pull request #958 from DiUS/modules-gnu11
Enable -std=gnu11 for modules dir.
2016-01-22 23:20:29 +01:00
Johny Mattsson 0cd287e67b Added -Wimplicit to modules build.
Plus associated fixes.
2016-01-22 10:55:57 +11:00
Terry Ellison a4e7885a6e Merge pull request #923 from DiUS/spiffs-alignment-fix-915
Ugly workaround for broken SPIFFS GC alignment.
2016-01-20 09:48:47 +00:00
Johny Mattsson 182d45f928 Enable -std=gnu11 for modules dir.
Plus boat-load of fixes to actually make that build.
2016-01-20 19:40:47 +11:00
Johny Mattsson 5b381d2f1e Added AES support to crypto module.
Merely a wrapper around the (undocumented) internal SDK AES functions.
2016-01-19 15:19:11 +11:00
Thomas Soëte 47b44229bf ws2812 data buffer
To create a size led long buffer:
buffer = ws2812.newBuffer(size);

To fill the buffer:
buffer:fill(g, r, b)

To get a particular led color:
g, r, b = buffer:get(index)

To set a particular led color:
buffer:set(index, g, r, b);

To send the buffer:
buffer:write(pin);
2016-01-18 17:21:08 +01:00
Thomas Soëte 51bb8a50ba Rewrite code to use UART1 instead of bit-banging.
It allows keeping interrupts enabled but force to use GPIO2.
2016-01-18 17:16:18 +01:00
Marcel Stör 82b19c4c37 Merge branch 'newdocs' into dev 2016-01-17 14:23:13 +01:00
Terry Ellison 7e8c54890f Merge pull request #878 from dnc40085/dev_wifi_sta_Xethostname
Add functions: wifi.sta.sethostname and wifi.sta.gethostname
2016-01-15 08:56:37 +00:00
Johny Mattsson 52e121f469 Merge pull request #887 from vowstar/dev-all-in-one
Add HTTP client module and documents.
2016-01-15 17:44:41 +11:00
Johny Mattsson 30f8f62420 Optimized node.bootreason() for size.
Reduces the size from 179 to 102 bytes.
2016-01-15 11:42:20 +11:00