Commit Graph

793 Commits

Author SHA1 Message Date
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 f0780e399e Add ssd1306_128x32 for U8G (#1571) 2016-10-30 00:19:04 +03:00
Marcel Stör 7c3f76009a Change HTTP failures from debug to error messages (#1568)
* Change HTTP failures from debug to error messages

* Add tag to HTTP error messages

* Create macro for error msg and improve dbg msg
2016-10-29 14:04:23 +02: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 2227383843 Small improvement to http client (#1558) 2016-10-27 14:07:04 +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 0ee1ab68b0 Improve reliability of FS detection. (#1528)
* Version to make filesystem detection more reliable
* Improve bad fs detection
2016-10-25 22:51:59 +02:00
Arnim Läuger 020afdcf33 avoid task queue overrun for serial input (#1540)
Thank you.
2016-10-17 21:56:38 -04: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
Arnim Läuger 101eb201ab add map ids for flash sizes 32m-c2, 64m, 128m in user_rf_cal_sector_set() (#1529) 2016-10-13 16:51:48 +09:00
Arnim Läuger b8e00120b6 fix dereferencing NULL pointer in vfs_errno() (#1539) 2016-10-13 16:48:37 +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
Jim Paris 407eaa45ac Replace hardcoded init data with generated data from SDK
The esp_init_data_default.bin is now extracted from the SDK (and its
patch file, if present), and the contents are automatically embedded
into user_main.o.
2016-10-04 13:11:34 -04:00
Johny Mattsson 088d2c3820 Reimplemented esp_init_data_default.
To work around the pesky "rf_cal[0] !=0x05" hang when booting on a chip
which doesn't have esp_init_data written to it.

It is no longer possible to do the writing of the esp_init_data_default
from within nodemcu_init(), as the SDK now hangs long before it gets
there.  As such, I've had to reimplement this in our user_start_trampoline
and get it all done before the SDK has a chance to look for the init data.
It's unfortunate that we have to spend IRAM on this, but I see no better
alternative at this point.
2016-10-04 12:04:09 +11:00
Johny Mattsson 90c6e86872 Fix start-up race between UART & start_lua. (#1522)
Input during startup (especially while doing initial filesystem format)
ran the risk of filling up the task queue, preventing the start_lua task
from being queued, and hence NodeMCU would not start up that time.
2016-10-03 10:19:20 +02:00
Arnim Läuger a86fb74c34 implement file.size for spiffs (#1516)
Another bug squashed!
2016-10-02 21:32:48 -04: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
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
Luís Fonseca 19f80abb32 Fix float math.pow when number was negative and power was odd (#1492) 2016-09-07 22:45:06 +02:00
Arnim Läuger b02450f5e0 fix debug compile (#1487) 2016-09-06 12:28:46 +10: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
Marcel Stör 5e01b51123 Make DNS engine RFC 5452 compliant (#1324)
The original code did not deal with UDP binding failures, this new code
does one random port attempt and then sets port to 0 to get 'OS
default' behaviour, and ASSERTs that that has to work.

Patch also moves the local UDP port range definition to udp.h from
udp.c.
2016-08-20 22:19:31 +02:00
Marcel Stör ced7ddc926 Fix math.floor for negative integers (#1454)
Fixes #1453
2016-08-19 16:35:35 +10: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 567b0a5553 Allow to override User-Agent and Host HTTP headers (#1426)
* Allow to override User-Agent and Host HTTP headers

Fixes #1410

Idea borrowed from (unmerged) #1157

* Do not send port for host header for default ports
2016-08-11 13:22:31 +10: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 ff46abe61f Fix DHCP server heap corruption per recommendation by Espressif (#1421)
To avoid crash in DHCP big packages modify option length from 312 to MTU - IPHEAD(20) - UDPHEAD(8) - DHCPHEAD(236).
2016-08-02 22:30:11 +02:00
Arnim Läuger 7f8a2b2c19 Update u8glib to v1.19.1 and add setContrast() (#1385) 2016-08-02 22:29:34 +02:00
Marcel Stör aa5fd1445d Change 'formatting file system' message (#1413) 2016-07-24 14:39:42 +02:00
Arnim Läuger 84c005e85c Update to SDK 1.5.4.1 (#1390) 2016-07-22 23:18:47 +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
bert hubert 05baef325d Increase DNS transaction ID space from 250 to 65536 states (#1323) 2016-07-19 21:24:54 +02:00
Arnim Läuger b21b3e08aa Free HTTP headers and post data memory in disconnect and DNS failure callback (#1403) 2016-07-17 22:27:26 +02:00
Marcel Stör cc2fee5ec0 Seed CoAP message id, fixes #847 (#1401) 2016-07-17 15:17:57 +02:00
Yury Popov 549f42107e Update to SDK 1.5.4 (#1377) 2016-07-10 15:18:46 +02:00
Jonathan Karras 04b86b80f6 Fix open drain level issues when _not_ using parasitic power mode. (#1291)
Port of @pstolarz work on PaulStoffregen/OneWire#8
2016-06-28 22:51:55 +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