Commit Graph

102 Commits

Author SHA1 Message Date
Edvinas 3d91785018
Bugfix conn metatable method call (#3012)
Here `conn` is net.socket instance, so it should be called as one.
Otherwise request is very likely to end up with crash and PANIC.
2020-02-23 09:46:35 -08:00
Terry Ellison 6d9c5a49a4
Example Lua module for coroutining (#2851) 2019-07-26 16:43:56 +01:00
Marcel Stör c50d007f9e Add README
Fixes #2725
2019-04-19 15:51:32 +02:00
Nathaniel Wesley Filardo 1070466feb Revise fifo{,sock} (#2671)
Fixes to #2650:

- Convert fifosock to returning tables containing ctors
- Improve docs
- Add a missed :on("sent", nil) in the http server
2019-02-17 18:32:16 +00:00
sergio d77666c0e8 trailing spaces cleanup (#2659) 2019-02-17 18:26:29 +00:00
Nathaniel Wesley Filardo dcc1ea2a49 A generic fifo and fifosock wrapper, under telnet and http server (#2650)
* lua_modules/fifo: a generic queue & socket wrapper

One occasionally wants a generic fifo, so here's a plausible
implementation that's reasonably flexible in its usage.

One possible consumer of this is a variant of TerryE's two-level fifo
trick currently in the telnetd example.  Factor that out to fifosock for
more general use.

* lua_examples/telnet: use factored out fifosock

* lua_modules/http: improve implementation

Switch to fifosock for in-order sending and waiting for everything to be
sent before closing.

Fix header callback by moving the invocation of the handler higher

* fifosock: optimistically cork and delay tx

If we just pushed a little bit of data into a fifosock that had idled,
wait a tick (1 ms) before transmitting.  Hopefully, this means that
we let the rest of the system push more data in before we send the first
packet.  But in a high-throughput situation, where we are streaming data
without idling the fifo, there won't be any additional delay and we'll
coalesce during operation as usual.

The fifosocktest mocks up enough of tmr for this to run, but assumes
an arbitrarily slow processor. ;)
2019-02-16 13:51:40 +01:00
Lukáš Voborský 27e9e6c085 Fix to telnet Lua example and ftpserver Lua module in consequence of PR #2603 (#2654) 2019-02-13 06:49:45 +01:00
Marcel Stör b126c6b2d2 Re-organize documentation
Drop support for localized content, #2213

Restructure some content to match more closely what we have in master, #2542
2019-01-13 22:01:57 +01:00
galjonsfigur ebdfd1ff6a Rename http server Lua module and fix its documentation (#2594) 2018-12-19 12:23:14 +01:00
galjonsfigur f5fcd0d984 Recreate and unify documentation for Lua modules (#2592)
* Recreate and unify documentation for Lua modules

* Fix typos in docs

* Added/modified READMES to link to new documentation
2018-12-16 21:39:43 +01:00
Nathaniel Wesley Filardo 61433c448e Deprecate C ds18b20 module (#2581) 2018-12-05 21:38:11 +01:00
Gregor 520b853bf4 Small typo in ftp server fails compilation
There sneaked in an 'o' at the beginning of the file
2018-07-09 01:19:19 +02:00
TerryE 8dcc3c8a55 New FTP module 2018-07-02 03:22:15 +01:00
Marcel Stör cb2808835d Fix Markdown syntax issues, fixes #2347 2018-04-06 17:35:23 +02:00
Arnim Läuger 4367e6e9e0 remove deprecated init functions in adxl345, am2320, bme280, bmp085, hdc1080, hmc58831, l3g4200d, HDC1000, lm92 (#2276) 2018-03-12 07:56:07 +01:00
Marcel Stör c4440e47ba Link ds18b20 C/Lua module docs 2017-08-16 21:32:04 +02:00
Lukáš Voborský 55c368ac03 DS18B20 module - update (enhanced, optimized) (#1996) 2017-08-16 21:04:52 +02:00
devsaurus f1bc858021 remove si7021 from lua_modules tree 2017-04-27 23:22:08 +02:00
Arnim Läuger 9c71c64dcd ds3231: require bit module, doc formatting (#1891) 2017-03-31 20:31:35 +02:00
Arnim Läuger 925991715f Fix float version, auto-detect int/float, OO tmr (#1866) 2017-03-16 23:10:04 +01:00
Arnim Läuger 46f651cccb Fix self.pin when specifying lpin for readTemp() (#1865) 2017-03-16 12:36:09 +01:00
Jonathan Karras 725feade27 Update DS18b20 examples (#1851)
- Remove old non-async examples from `lua-examples`.
- Rename `ds18b20.EN.md` to `README.md`
- Change remaining `toBase64` calls to the more standard `toHex` call.
- Fix some spelling and markdown formatting issues in README file.

Addresses issue #1841
2017-03-10 22:10:49 +01:00
Jonathan Karras 4acabab1cc Change address printing to Hex from Base64. (#1840) 2017-03-07 07:06:50 +01:00
vsky 5feae3fee1 Re-write DS18B20 asynchronous example (#1820) 2017-02-25 22:56:45 +01:00
TerryE 6fcd554e9c Delered as per #475 and creation of the encoder module 2016-03-02 00:33:51 +00:00
devsaurus ee96273191 Remove lua modules with equivalent ones in app/modules. 2016-02-14 23:03:33 +01:00
Vittorio Giovanelli ecd79d7914 Fixed some grammar on docs 2016-02-10 09:32:37 +01:00
Vittorio Giovanelli ca104a96ce Added full support for DS3231 2016-02-07 21:19:33 +01:00
Marcel Stör 4f330e4500 Merge pull request #946 from SebastianSchildt/fixds18b20
Fix unit constants to be consistent with code
2016-01-17 21:50:00 +01:00
Sebastian Schildt 0863a4c221 Fix unit constants to be consistent with code
Extend example to show querying different units or specific sensors
2016-01-17 14:39:39 +01:00
elgarbe 4c037bfeac Add support for Temperature Comparison register set/get functions 2016-01-06 15:05:32 -03:00
Nick Andrew 0a7b730e23 Support DS18S20 and fix negative temp handling
The DS18S20 has only 1 fractional bit whereas DS18B20 has 4, and their
temperature register alignment differs. Check the family code to choose
the correct multiplier for both devices.

Closes #610

Negative temperatures (less than 0°C) are returned as a sign-extended
two's complement number. Subtract 0x10000 to recover the proper
negative value.

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
2015-11-16 23:32:20 +11:00
Marius Schmeding f343af9683 adding lua_module for Grove Digital Light Sensor (http://www.seeedstudio.com/wiki/Grove_-_Digital_Light_Sensor) 2015-07-21 18:56:29 +02:00
Luna b4f0c2d1ee another one 2015-06-25 01:35:50 +02:00
Luna ba39d0961a tottaly found a bug 2015-06-24 23:01:58 +02:00
Luna 6f7542c1a9 working lua impl. of base64 2015-06-24 22:50:20 +02:00
HuangRui 3cd5a6a1ed Merge branch 'master' of https://github.com/bruceme/nodemcu-firmware into dev
Conflicts:
	app/modules/net.c
2015-06-04 15:04:12 +08:00
Levente Tamas de053cf479 Add support for lm92 temperature sensor
Added LUA module for the lm92 +-0.33C 12bit+sign temperature sensor.
2015-05-17 12:03:42 +03:00
Martin Han effb57247c Add Example to yeelink lib 2015-04-22 13:16:37 +08:00
Martin Han a60f28cf9c Ver 0.1.2 r1 Add init ok callback function 2015-04-22 13:10:06 +08:00
Martin Han 5bda87845f Update to Ver0.1.2, fix logic bug
Detail:
When require lib before connect to ap, program will return nil but the table.
2015-04-22 12:50:02 +08:00
Martin Han 0f203f32c3 Resuce RAM Usage 2015-04-20 19:43:24 +08:00
Martin Han a3b72906d5 Yeelink Modules 2015-04-14 20:42:16 +08:00
Sander Boele 4437c46825 fixed floating point problem in bcd conversions 2015-04-11 11:26:44 +02:00
Martin Han 9df94c7ee6 Really Fix the BUGs, add come comment
Sorry for the mistake, I forgot to save the file when gitting...
2015-04-06 14:38:35 +08:00
funshine 560ad8e029 remove dht22 lib, use dht_lib instead 2015-04-06 00:11:12 +08:00
funshine fee2cf476a Merge branch 'master' into dev 2015-04-06 00:06:08 +08:00
Martin Han c21dea9d8e Fix DHT11 10times BUG, add auto-select feature 2015-04-05 23:23:18 +08:00
Martin Han b1287756bc Adjust the detail, fix program bug 2015-04-05 23:22:25 +08:00
Vowstar 263179ea14 Merge pull request #329 from MarsTechHAN/patch-2
Add support to DHT11 and add some comments.
2015-04-04 08:12:29 +08:00