Commit Graph

529 Commits

Author SHA1 Message Date
Philip Gladstone 017b4637c2 Adds uart.getconfig(0) to get the current uart parameters (#1658) 2016-12-11 20:35:04 +01:00
vsky 12a7b1c239 BME280: fixing humidity trimming parameter readout bug (#1652) 2016-12-09 21:19:58 -05:00
Philip Gladstone 79013ae79a Improve SNTP module: Add list of servers and auto-sync [SNTP module only] (#1596) 2016-12-04 21:03:49 +01:00
ffedoroff 9f9fee9008 add new rfswitch module to handle 433MHZ devices (#1565) 2016-12-01 22:19:01 +01:00
Yury Popov 83eec61874 Fix iram/irom section contents (#1566) 2016-12-01 22:14:20 +01:00
Philip Gladstone 00b356be84 HTTP module can now chain requests (#1629)
* Fix up the HTTP module to use less memory
2016-12-01 22:13:33 +01:00
Jason Follas a48e88d4a3 EUS bug fixes (#1605)
- Bug fixes and improvements
- FIX: Ensure that station is enabled before doing network scan (this seems to be the cause of #1578)
- FIX: Check if state == NULL on enduser_setup.stop()
- IMPROVEMENT: Look for both enduser_setup.html.gz and enduser_setup.html as valid filenames, for semantic reasons
- IMPROVEMENT: Show a generic status message on HTML page if failure occurred before user even submitted data (i.e., would have come from previously stored config when the STA was started by EUS)
2016-12-01 22:12:47 +01:00
Arnim Läuger c70dc7497e Handle error condition in file.read() (#1599)
* handle error condition in file.read()

* simplify loop initialization
2016-11-19 10:36:00 -05:00
Mariusz Kryński 59b9b3e26f support for custom websocket headers (#1573)
Looks good to me. Thank you.

Also:
 - allow for '\0's in received messages

* add client:config for setting websocket headers

Also:
 - headers are case-insensitive now

* fix docs

* fix typo

* remove unnecessary luaL_argcheck calls

* replace os_sprintf with simple string copy
2016-11-19 10:35:20 -05:00
Marcel Stör 1d0cf5e8d0 Virtual u8g display driver for RFB/VNC support (#1514)
* add u8g.fb_rle display
* move comm drivers to u8g_glue.c
* disable fb_rle per default
2016-11-14 13:40:45 +01:00
Arnim Läuger fdc766be9f fix vfs_lseek() result checking in enduser_setup and clarify SPIFFS_lseek() return value (#1570) 2016-11-08 22:27:12 +01:00
Jason Follas 058777ea60 Eus channelfix (#1583)
Squashed commits included:

Bug fixes and final implementation
- Added Content-Length: 0 to all headers
- Endpoint name checks not using trailing space so cache-busting techniques can be used (i.e., append a nonce to the URL)
- Track when connecting so APList scan doesn't take place during (which changes the channel)
- More debugging output added to assist in tracking down some issues

Added /status.json endpoint for phone apps/XHR to get JSON response

Station Status caching for wifi channel workaround + AJAX/CORS
- During checkstation poll, cache the last station status
- Shut down the station if status = 2,3,4 and channel is different than SoftAP
- Add Access-Control-Allow-Origin: * to endpoint responses used by a service
- Add a /setwifi GET endpoint for phone apps/XHR to use (same parameters as /update endpoint). Returns a JSON response containing chip id and status code.
- Add handler for OPTIONS verb (needed for CORS support)

Wi-Fi Channel Issue Workaround
- Do a site survey upon startup, set SoftAP channel to the strongest rssi's channel
- Compare successful station connect channel to SoftAP's. If different, then defer the Lua success callback to the end. Shut down Station and start the SoftAP back up with original channel.
- After the 10 second shutdown timer fires, check to see if success callback was already called. If not, then call it while starting the Station back up.

HTTP Response and DNS enhancements
- If DNS's UDP buffer fills up, keep going as non-fatal. It's UDP and not guaranteed anyways. I've seen this occur when connecting a PC to the SoftAP and every open program tries to phone home at the same time, overwhelming the EUS DNS server.
- Support for detecting/handling pre-gzipped `enduser_setup.html` (and `http_html_backup`) payload. Nice for keeping the size of the `state->http_payload_data` as small as possible (also makes minimization not as critical)
- Corrected misuse of HTTP 401 response status (changed one occurrence to 400/Bad Request, and changed another to 405/Method Not Allowed)

* Normalized formatting (tabs-to-spaces)
* Added documentation
* Corrected misuse of strlen for binary (gzip) data.
* Added NULL check after malloc
2016-11-08 21:58:33 +01:00
Arnim Läuger a0e2e0ca37 Implement object model for files (#1532) 2016-11-08 21:02:51 +01:00
Philip Gladstone b74a9dbdf7 Make the MQTT PING functionality work better. (#1557)
Deal with flow control stopped case
2016-11-08 21:00:17 +01:00
dnc40085 73773fd8a5 Update to the wifi module (#1497)
* Removed inline documentation for several functions and update comments
Since documentation is now part of the repository, the inline
documentation just adds to the already huge wifi.c

* Wifi module: add new functionality, update documentation

Functions Added:
wifi.getdefaultmode(): returns default wifi opmode
wifi.sta.apchange(): select alternate cached AP
wifi.sta.apinfo(): get cached AP list 
wifi.sta.aplimit(): set cached AP limit
wifi.sta.getapindex(): get index of currently configured AP
wifi.sta.getdefaultconfig(): get default station configuration
wifi.ap.getdefaultconfig(): get default AP configuration

functions modified:
wifi.setmode: saving mode to flash is now optional
wifi.sta.config: now accepts table as an argument and save config to
flash is now optional
wifi.sta.getconfig: added option to return table
wifi.ap.config: save config to flash is now optional
wifi.ap.getconfig: added option to return table

Documentation changes:
- Modified documentation to reflect above changes
- Removed unnecessary inline documentation from `wifi.c` 
- Updated documentation for `wifi.sta.disconnect`to address issue #1480 
- Fixed inaccurate documentation for function `wifi.sleeptype`
- Added more details to `wifi.nullmodesleep()`

* Move function `wifi.sleeptype()` to `wifi.sta.sleeptype()`

* Fixed problem where wifi.x.getconfig() returned invalid strings when
ssid or password were set to maximum length.

* fix error in documentation for `wifi.sta.getapindex`

* Renamed some wifi functions
wifi.sta.apinfo -> getapinfo
wifi.sta.aplimit -> setaplimit 
wifi.sta.apchange -> changeap

also organized the wifi_station_map array
2016-11-06 20:51:01 +01:00
Philip Gladstone 77b2e85d09 Add support to mix ws2812.buffer objects. (#1575)
* Add load/dump/mix/power operations on the buffer object
* Calculate the pixel value in mix and then clip to the range.
* Fixed the two wrong userdata types
* Added a couple more useful methods
* Add support for shifting a piece of the buffer.
* Fix a minor bug with offset shifts
2016-11-05 13:53:42 +01:00
Arnim Läuger 9db07783f4 Remove luaL_buffer from file_g_read() (#1541)
* remove luaL_buffer from file_g_read()
- avoid memory leak when function gets terminated by lua_error
- skip scanning for end_char when reading until EOF
* attempt to free memory in any case
2016-10-28 17:32:12 +03:00
Philip Gladstone ebb537c502 Version of printf that doesn't suffer from buffer overflows (#1564) 2016-10-27 09:38:47 +03:00
Philip Gladstone f9533ed85a Reduced LUAL_BUFFERSIZE to 256. Should free up some stack (#1530) 2016-10-16 21:18:03 +09:00
vsky 880bd9850b Somfy/TELIS driver (#1521) 2016-10-14 07:49:58 +09:00
Philip Gladstone 025805b0e8 Fixes the gpio.serout problem from #1534 (#1535)
* Fix some issues in gpio.serout
* Minor cleanup
2016-10-11 21:51:00 +09:00
Philip Gladstone 04e93b2433 Add the esp-gdbstub to enable debugging (#1506)
* Initial version of gdbstub support

* Add DEBUG argument to Makefile to add more debug data and turn off -Os

* Add the output redirection handling

* Added documentation

* Cleaned up the english a bit

* Make gdboutput actually trap all the output

* Review comments
2016-09-21 11:38:12 +10:00
devsaurus 837cf20633 move comm drivers to u8g_glue.c 2016-09-20 23:59:23 +02:00
devsaurus 492ee578ae add u8g.fb_rle display 2016-09-20 23:37:13 +02:00
Johny Mattsson a112296850 Added crypto.new_hmac() feature. (#1499)
Docs for crypto module refactored for easier maintenance.
2016-09-16 17:46:39 +02:00
Arnim Läuger ecf8bd98d6 Add FatFs and SD card support (#1397)
* Add FatFs
* enable BUILD_FATFS for all-module build
* push vfs into rest of firmware
* align maximum filename length
* increase timeout for acmd41 during card initialization
* switch from DOS to Unix path semantics chdrive() is substituted by chdir()
* update to fatfs R.012a incl. patches 1-6
* add callback for rtc provisioning in file
* update docs
2016-09-05 20:17:13 +02:00
Philip Gladstone 99cd2177bb Make struct.unpack wrapped in setlist actually work (#1486)
Fixes #1434.
2016-09-05 11:16:27 +10:00
Yury Popov be263dacde Set espconn's secure buffer size once at initialization (#1466)
Fixes #1457
2016-09-04 22:45:46 +02:00
dnc40085 3328c66f2c Add function `wifi.nullmodesleep()` (#1475)
Enable auto sleep in NULL_MODE by default.
2016-08-27 11:46:24 +02:00
Luís Fonseca 16051d51d6 Implement initial version for websocket module (#1433) 2016-08-18 13:59:44 +02:00
Yury Popov 3c55e8c026 MQTT memory / connection issues fix (#1445) 2016-08-14 10:32:11 +02:00
Luís Fonseca 67750c4a72 Make HTTP module follow redirects (#1450)
Fixes #1366
2016-08-14 00:48:13 +02:00
Marcel Stör 07aa210c50 Remove DEVKIT_VERSION_0_9 and deprecated functions (#1439) 2016-08-04 23:03:37 +02:00
Yury Popov f1afe7b6ab Add support for dynamic timers, deprecating the static ones (#1424) 2016-08-02 22:35:53 +02:00
Yury Popov a499716cc1 Update modules to be Lua coroutine compatible (#1423) 2016-08-02 22:33:05 +02:00
Arnim Läuger 7f8a2b2c19 Update u8glib to v1.19.1 and add setContrast() (#1385) 2016-08-02 22:29:34 +02:00
Thomas Soëte 8866297c6d Remove buffer:write() as ws2812.write() handles buffers (#1408) 2016-07-20 23:04:33 +02:00
Thomas Soëte 854ad7c80f Handle two WS2812 strips in parallel using the two UARTs through GPIO2 and TXD0 (#1310) 2016-07-20 22:28:47 +02:00
Arnim Läuger 56839fb20b Add rtctime.epoch2cal() (#1386) 2016-07-19 22:01:26 +02:00
FrankX e14dd7aba0 Adjust EUS to new SPIFFS (#1376) 2016-06-28 22:50:23 +02:00
Philip Gladstone 4a8abc2060 Add support for driving instrument gauge stepper motors (#1355) 2016-06-26 14:19:06 +02:00
vsky f2d0195732 gpio.serout going asynchronous (#1359)
* gpio.serout going asynchronous

* fixing several issues following PR comments
2016-06-16 20:33:26 +02:00
Arnim Läuger d445ae97fb Enable spi clock_div < 4. (#1283) 2016-06-15 21:01:52 +02:00
Konrad Hübner 500bbceded added fadeIn, faceOut and shift to ws2812 module (#1343)
* added fadeIn, faceOut and shift to ws2812 module

* improvements to rotate, unified fade method

shift renamed to rotate and usage of more efficient memory operations.
fadeIn and fadeOut unified into fade method with optional parameter for direction.

* rename method to "shift" with optional mode parameter
2016-06-10 22:23:37 +02:00
Arnim Läuger d416648990 Add pcm module. (#1255)
* Add pcm module.
* Add network streaming example.
* document hw_timer dependency with pwm
* Add vu peak callback.
2016-06-05 23:21:36 +02:00
Philip Gladstone af39a0bc25 Upgrade to latest SPIFFS and add building of file systems (#1226)
Fixes #1164 and thus also #1150, #1149, #1147 and #898.

* Move to latest version of SPIFFS
* Add SPIFFS porting layer for NodeMCU
* Add option to delete output if it doesn't fit
* Change FLASHSIZE to be in bits by default: default 4mb 32mb
* Add SPIFFS_MAX_FILESYSTEM_SIZE override
* Add notes on SPIFFS_FIXED_LOCATION
* Add 1M boundary
* Include the current version of the LICENSE
2016-06-05 23:10:58 +02:00
Jason Schmidlapp e3f7e6321f Added support for STM L3G4200D digital gyroscope (#1251) 2016-06-05 23:00:37 +02:00
Jason Schmidlapp be10ccdb6b Added support for Analog Devices ADXL345 accelerometer (#1252) 2016-06-05 22:59:55 +02:00
Jason Schmidlapp bb9e210441 Added support for Honeywell HMC5883L digital compass (#1253) 2016-06-05 22:59:39 +02:00
dnc40085 4a1775c2e8 Fixed bug where default hostname is not set on boot when in SoftAP mode (#1341) 2016-06-05 13:38:12 +02:00