Commit Graph

767 Commits

Author SHA1 Message Date
Philip Gladstone 5b4b1e0388 Autobaudrate detection by default -- to reduce problems with speed change (#1215)
* Auto autobaud detection by default

* Added stopping the autobaud if explicitly configured

* Add note about auto-baud to the uart.md
2016-04-17 23:44:18 +02:00
Johny Mattsson f428897810 SNTP module enhancements (#1243)
* Provide an error code to SNTP error callback.

* Switch SNTP to use ephemeral port.

In case we're being hit by ISP-level thou-shall-not-run-NTP silliness.
2016-04-15 12:49:18 +02:00
Philip Gladstone 61c2b4dfe3 Minimal changes to handle bad bodies (#1212)
Fix failure to compile

Move the check into the http module

Reverted change
2016-04-09 13:54:10 +02:00
Philip Gladstone 3a5e5f10e2 Take 2: Add regular sends to mdns. Check for (some) buffer overflows. Make it handle unicast
Merging as suggested by @TerryE (and squashing at the same time. Turns out that this feature is enabled for this repo).

* Squashed commit of the following:

commit f985f10d9d2ee035f5a6ee6245c60d9904d98cc1
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 27 21:52:46 2016 -0400

    Better mdns code

commit 6ee49ee106
Author: philip <philip@gladstonefamily.net>
Date:   Fri Mar 25 23:25:11 2016 -0400

    Update the docs

commit 7e455541c6
Author: philip <philip@gladstonefamily.net>
Date:   Thu Mar 24 21:58:16 2016 -0400

    Add retries and buffer checking to mdns

    Get the length right

    Now it seems to work

* Might work for combined mode

* Fix crash

* Simplified various bits of code. Changed the LUA interface

Added checking (to some degree) incoming quyery types

Move the defaults to the right place

Added reference to the RFC`
2016-04-03 14:10:52 -04:00
Jason Follas e16204d4f4 Corrected SPI CPOL/CPHA relationships
* Corrected CPOL/CPHA relationships

* Simplified to remove duplicated code

* Removed comments about when MISO is sampled. ESP seems to sample MISO on same clock edge as when MOSI is set.
2016-04-02 19:26:07 +02:00
Johny Mattsson f3cc39c2a2 Merge pull request #1214 from robertfoss/eus_js_fix
EUS JS select fix, part 2
2016-04-01 15:26:38 +11:00
dnc40085 5e9ab01523 Modified wifi module
Implement SDK event monitor
Move wifi status event monitor code into seperate file
(app/modules/wifi_eventmon.c)
Modify wifi lua callback registration code.
Add Functions wifi.ap.deauth and wifi.sta.getrssi
Rework wifi event monitor to use tasking interface
fix for Lua coroutine compatibility issue
Made changes Suggested by TerryE

Also, moved code that sets the default host name out of
luaopen_wifi_init and into a separate function and added a post_task_low
entry in it's place.

Replaced some if test then return error lines with
luaL_argcheck
Add check for malloc null return in wifi.eventmon 
to catch out of memory errors
2016-03-31 19:01:41 -07:00
Robert Foss 2e597e72e9 Improve previous EUS JS select fix to work better on mobile UIs. 2016-03-31 21:26:22 -04:00
Johny Mattsson 51efa2ab65 Fixed EUS password/ssid decoding. 2016-03-31 17:47:40 +11:00
Johny Mattsson 7e43c2c352 Merge pull request #1206 from robertfoss/eus_js_fix
enduser_setup: JS select fix
2016-03-31 13:05:48 +11:00
Johny Mattsson e7c6790b68 Merge pull request #1200 from DiUS/enduser-setup-status-fix
enduser_setup: Fixed missing status update.
2016-03-31 13:01:46 +11:00
Robert Foss 701d4121ed Fix SSID selection box when aplist only has one entry. 2016-03-30 11:04:37 -04:00
Johny Mattsson 7b95711636 Merge pull request #1203 from DiUS/reduce-tmr-time-drift
Make tmr.time() more resilient against RTC changing frequency
2016-03-30 21:58:25 +11:00
Terry Ellison e99f44350b Merge pull request #1202 from DiUS/crypto-fix-double-free
Fixed double-free in crypto module
2016-03-30 10:13:16 +01:00
Marcel Stör 568e83a775 Change index.html to eus-index.html 2016-03-30 08:09:15 +02:00
Bernd Meyer 858e4bf501 Make tmr.time() more resilient against RTC changing frequency 2016-03-30 13:33:01 +11:00
Bernd Meyer f2991f555d Remove improper free of userdata; It's for the garbage collection to free 2016-03-30 12:35:06 +11:00
Johny Mattsson 0e40477011 enduser_setup: Fixed missing status update.
Due to the hard-close, the status message did not get sent out reliably.
Connection closing logic now reworked to be nicer, while still avoiding
the problem of lots of connections lingering in fin_wait.
2016-03-29 17:32:07 +11:00
Johny Mattsson d515dfd8d6 Merge pull request #1138 from robertfoss/enduser_setup_improvements
Improve overall enduser_setup user experience.
2016-03-29 12:57:04 +11:00
Johny Mattsson e1fffe6ae4 Switch enduser_setup_module to LWIP raw API.
Shutting down an espconn server safely is impossible, and currently would
include at least one use-after-free. Even with that patched, at best this
would change things from impossible to "very tricky".

The native LWIP API does not have those issues, and is still quite easy
to work with.
2016-03-28 18:48:18 -04:00
Robert Foss 2d4f8f8e77 Improved overall enduser_setup user experience.
A single bug is fixed, a few features are added and overall the codebase has been worked through.

 - Added support for calls to /generate_204 that let's android know that the internet is accessible.
 - Added 10 second delay to the shutdown call to allow a final status update to be fetched by the client.
 - Added iframe to html to avoid having a form submission change the page.
 - Added support for dynamic /status responses.
 - Improved HTML appearance by removing AP-list button.
 - Improved CSS to center form, even when list of access points have loaded.
 - Improved debug prints to contain line numbers and not require lua_State*.
 - Fixed broken failure check when calling wifi_station_connect().
 - Fixed unguarded malloc().
2016-03-28 18:48:18 -04:00
Marcel Stör 117df40f58 Merge pull request #1179 from pjsg/unsubscribe
MQTT Unsubscribe support
2016-03-28 12:23:10 +02:00
Philip Gladstone bff75bc0f4 Merge pull request #1132 from pjsg/devtool
Merging on @TerryE say-so. No spurious output seen.
2016-03-25 23:36:41 -04:00
philip ab950ff518 Removed useless checks before calling luaL_unref 2016-03-25 23:35:07 -04:00
devsaurus f768e22293 shorten ucg constructors to keep them below LUA_MAX_ROTABLE_NAME 2016-03-25 23:49:22 +01:00
devsaurus 8bc2e8aa19 Enable -std=gnu11 for user dir 2016-03-24 00:06:09 +01:00
devsaurus 103cca303e Enable -std=gnu11 for tsl2561 dir 2016-03-22 22:26:44 +01:00
devsaurus 212cc8fdcd enable -std=gnu11 for u8glib and ucglib dir 2016-03-22 22:26:36 +01:00
philip 426e805c43 Initial version of unsubscribe 2016-03-20 18:44:06 -04:00
philip 84487d300b Remove unusedcode 2016-03-20 12:54:16 -04:00
Philip Gladstone 6822116d64 Merge pull request #1136 from TerryE/dev-quick-gpio-bugfix
one line bugfix to GPIO.c -- Oops!  (Finally!)
2016-03-19 10:02:55 -04:00
jfollas 92eb21cd02 Merge branch 'dev' into mqtt-connack
# Conflicts:
#	app/modules/mqtt.c
2016-03-17 20:22:12 -04:00
jfollas 354b9e9684 Merge branch 'dev' into mqtt-connack 2016-03-17 19:59:02 -04:00
Terry Ellison 09269a6452 Merge pull request #1154 from dnc40085/dev_1065_fix
fix for #1065
2016-03-17 00:20:44 +00:00
Terry Ellison 30f2c5ca1c Merge pull request #1148 from devsaurus/gpio_opendrain
Add support for GPIO open-drain output mode.
2016-03-17 00:17:33 +00:00
devsaurus 23137b4ed1 Add support for GPIO open-drain output mode. 2016-03-17 00:21:28 +01:00
philip d3fe213fbe Fix bug with PINGREQ not being sent on a timeout.
Remove the offending code
2016-03-16 08:13:17 -04:00
philip 09f9bc62b2 Merge remote-tracking branch 'upstream/dev' into mqtt-qos 2016-03-16 07:29:48 -04:00
TerryE 20465dd30f Updates to gpio.c and documentation to reflect review comments 2016-03-14 01:11:09 +00:00
dnc40085 7def6ec7cf fix for #1065
Also changed wifi.sta.eventMonStop("unreg all") to
wifi.sta.eventMonStop(1) and wifi.sta.eventMonReg(wifi.status, "unreg")
to wifi.sta.eventMonReg(wifi.status)
2016-03-13 09:51:48 -07:00
Terry Ellison 13f519ee41 Merge pull request #1142 from DiUS/fix-boot-input-race-crash
Fix null-pointer crash on early input
2016-03-11 00:47:44 +00:00
TerryE 76ff541244 Prevent UART input race without extra lua_started flag 2016-03-11 00:41:40 +00:00
philip 8f355d5d5f Fix problem with subscribing to multiple topics 2016-03-09 22:45:20 -05:00
Johny Mattsson 3490ffb285 Merge pull request #1125 from pjsg/ssl-verify
Adds support for verifying the certificate offered by an SSL server.
2016-03-10 14:02:16 +11:00
philip dd6359e7db Try to make qos~=0 work better
Added send_if_possible to clean up the code
2016-03-09 21:57:27 -05:00
philip 501bd1fb9a Adds support for verifying the certificate offered by an SSL server.
Squashed commit of the following:

commit 4439b8c45192f6dee1222df78bbb59f74509e0ee
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:23:21 2016 -0500

    Fix the ignore

commit a07ee5acdf91286607c3e2dce128c9b8bfd7bd80
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:20:41 2016 -0500

    Remove uneeded stuff

commit b3604ace92fc13b30161d385c354b0f1c5fe4046
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:15:26 2016 -0500

    Remove client cert auth

commit 6e48c633569630736a986cd07a59a12de954391e
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:11:42 2016 -0500

    More cleanup

commit d40eade405ef071d0d1b60d038566b5b8f2cafa3
Author: philip <philip@gladstonefamily.net>
Date:   Sat Mar 5 10:56:56 2016 -0500

    Move to almost working version

commit 1860a2d90afa94461c53bd41251d4870d6527f9d
Author: philip <philip@gladstonefamily.net>
Date:   Fri Mar 4 08:04:09 2016 -0500

    Changed the naem to server-ca.crt

commit e7a315660843273fe62943b7fe8ee6c0541dada2
Author: philip <philip@gladstonefamily.net>
Date:   Thu Mar 3 21:16:26 2016 -0500

    Update gitignores

commit 2b037d185c396209b64381399c40821c15e1840e
Author: philip <philip@gladstonefamily.net>
Date:   Thu Mar 3 08:56:17 2016 -0500

    Getting better

commit 763255cffba8e279158cd7f43391a3573efdeca8
Author: philip <philip@gladstonefamily.net>
Date:   Wed Mar 2 22:28:21 2016 -0500

    Works a bit better

commit a38325d1a47dbad255cb3e681da8415e8cf699ea
Author: philip <philip@gladstonefamily.net>
Date:   Wed Mar 2 09:11:04 2016 -0500

    First building version

commit 4aef13da33470ed954f2eaf5f7ac0ac3dcdf3774
Merge: 180e147 ebb0c33
Author: philip <philip@gladstonefamily.net>
Date:   Tue Mar 1 22:03:06 2016 -0500

    Merge remote-tracking branch 'upstream/dev' into ssl-client

commit 180e147c1abdcf4046ad9be9b3c1a48f4a875312
Author: philip <philip@gladstonefamily.net>
Date:   Sun Feb 28 21:34:21 2016 -0500

    Missing files from espressif

Try to imporve layout

Align the file names with the contents

Missing file

Review comments

More review coments
2016-03-09 21:51:23 -05:00
Bernd Meyer cf05c9cd08 Don't try to handle uart input until we have set up the buffer for it 2016-03-10 12:46:56 +11:00
Terry Ellison 1b3d8d4815 Merge pull request #1127 from marcelstoer/dev-new-default-config
Change a number of default values
2016-03-09 22:24:14 +00:00
Marcel Stör bcbf49f275 Change a number of default values 2016-03-09 23:16:43 +01:00
TerryE 5595ca35cb Small bugfix to GPIO.c -- Oops! 2016-03-09 00:06:09 +00:00
Johny Mattsson d3bfdf3ac8 Fixed race-crash in SNTP module. 2016-03-07 12:40:14 +11:00
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