{"id":15540286,"url":"https://github.com/rm-hull/lua-garden","last_synced_at":"2025-03-29T00:15:01.060Z","repository":{"id":145431007,"uuid":"93275438","full_name":"rm-hull/lua-garden","owner":"rm-hull","description":"Work in progress","archived":false,"fork":false,"pushed_at":"2017-06-26T00:19:10.000Z","size":761,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-03T12:17:46.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rm-hull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-03T21:44:01.000Z","updated_at":"2017-06-08T00:04:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b8820ed-506a-4241-b8c1-03a2c94e519e","html_url":"https://github.com/rm-hull/lua-garden","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Flua-garden","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Flua-garden/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Flua-garden/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Flua-garden/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/lua-garden/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246117762,"owners_count":20726069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T12:13:27.216Z","updated_at":"2025-03-29T00:15:01.040Z","avatar_url":"https://github.com/rm-hull.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lua-garden\n\n\nA solar-powered environmental data collector, based on ESP8266 SoC. Results are uploaded\nto a [ThinkSpeak](https://thingspeak.com/) channel.\n\n![Image of ESP8266](images/ESP8266.jpg)\n\n## Bill of Materials\n\n* [ESP8266 module](http://www.ebay.co.uk/itm/1PCS-NodeMcu-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266-module/191737348230) - £2.71\n* [TSL2561 Lux sensor](http://www.ebay.co.uk/itm/262905196196) - £1.38\n* [BME280 Temp, humidity and pressure sensor](https://www.aliexpress.com/item/GY-BME280-3-3-precision-altimeter-atmospheric-pressure-BME280-sensor-module/32711703783.html) - £2.49\n* [ADS11115 Analogue-digital converter](https://www.aliexpress.com/item/16-Bit-I2C-4-CH-ADS1115-ADS1015-Module-ADC-Development-Board/32761329492.html) - £1.52\n* [Rain sensor](https://www.aliexpress.com/item/1set-lot-Snow-Raindrops-Detection-Sensor-Module-Rain-Weather-Module-Humidity-For-Arduino/32711871234.html) - £0.43\n* [Soil hygrometer](http://www.ebay.co.uk/itm/3PCS-Soil-Hygrometer-Detection-Module-Soil-Moisture-Sensor-For-arduino-Smart-car-/311732225358) - £1.38\n* [Solar LiPo charger](https://www.aliexpress.com/item/Elecrow-Mini-Solar-Lipo-Charger-Board-CN3065-Lithium-Battery-Charge-Chip-DIY-Outdoor-Application-Kit-Charging/32808069239.html) - £2.71\n* [3.7V 1000Mah LiPo battery](https://www.aliexpress.com/item/Upgrade-RC-Part-7-4V-650mAh-Lipo-Battery-H8C-10-650-for-JJRC-H8C-DFD-F183/32459323188.html) - £3.86\n* [6V 1W Solar panel](https://www.aliexpress.com/item/Mini-6V-1W-Solar-Power-Panel-Solar-System-Module-DIY-For-Cell-Phone-Chargers/32763434119.html) - £0.84\n\n## NodeMCU pinouts\n\n![Pinouts](images/NodeMCU_Pinout.png)\n\n## ThinkSpeak Setup\n\nCreate an account on [thinkspeak.com](https://thingspeak.com/users/sign_up).\n\nThen create a channel with the following fields in order:\n* System Voltage (Vdd)\n* Temperature (°C)\n* Humidity (% rH)\n* Pressure (hPa)\n* Lux (lx)\n\nMake a note of the channel ID and the 'Write API key' (this will be required later).\n\n## Tools\n\nInstall [esptool](https://github.com/espressif/esptool) _(A Python-based, open\nsource, platform independent, utility to communicate with the ROM bootloader\nin Espressif ESP8266)_ and [nodemcu-uploader](https://github.com/kmpm/nodemcu-uploader)\n_(A simple tool for uploading files to the filesystem of an ESP8266 running\nNodeMCU as well as some other useful commands)_.\n\n    $ sudo -H pip install esptool nodemcu-uploader wrapt\n\n### macOS\n\nFor macOS host, install the [CH340G driver](drivers/CH34x) before proceeding.\nA reboot will be required. Plugging in the ESP8266, and it should\nappear as a device as **/dev/tty.wchusbserial1410**.\n\n### Ubuntu\n\nSupport for the CH34x chipset is already built into the kernel, so you\nshould see `dmesg` report the following when plugged in:\n\n```\n[ 5567.136984] usb 3-6: new full-speed USB device number 11 using xhci_hcd\n[ 5567.278374] usb 3-6: New USB device found, idVendor=1a86, idProduct=7523\n[ 5567.278379] usb 3-6: New USB device strings: Mfr=0, Product=2, SerialNumber=0\n[ 5567.278382] usb 3-6: Product: USB2.0-Serial\n[ 5567.313372] usbcore: registered new interface driver usbserial\n[ 5567.313409] usbcore: registered new interface driver usbserial_generic\n[ 5567.313439] usbserial: USB Serial support registered for generic\n[ 5567.315328] usbcore: registered new interface driver ch341\n[ 5567.315347] usbserial: USB Serial support registered for ch341-uart\n[ 5567.315366] ch341 3-6:1.0: ch341-uart converter detected\n[ 5567.315905] usb 3-6: ch341-uart converter now attached to ttyUSB0\n```\n\nThe device will appear as **/dev/ttyUSB0**, however it has group permissions of\n'dialout', so run the following at the command line:\n\n    $ sudo usermod -a -G dialout \u003cYOUR_USER_ID\u003e\n\nLog out and restart your session.\n\n## Firmware\n\n[nodemcu-build.com](https://nodemcu-build.com) was used to build the firmware against the master branch and\nincludes the following modules: adc, ads1115, bme280, file, gpio, http, i2c,\nnet, node, sjson, tmr, tsl2561, uart, wifi.\n\nUpload the firmware with (substituting the correct USB device name):\n\n    $ esptool.py --port /dev/tty.wchusbserial1410 write_flash -fm dio 0x00000 firmware/nodemcu-float.bin\n    esptool.py v1.3\n    Connecting....\n    Auto-detected Flash size: 32m\n    Running Cesanta flasher stub...\n    Flash params set to 0x0240\n    Wrote 434176 bytes at 0x0 in 37.7 seconds (92.2 kbit/s)...\n    Leaving...\n\n## Pinouts\n\n* D0 (GPIO16) \u003c--\u003e RST (to enable the wakeup from deep sleep)\n* D3 (GPIO0) \u003c--\u003e I2C SDA (data)\n* D4 (GPIO2) \u003c--\u003e I2C SCL (clock)\n* 3V \u003c--\u003e Vdd (power)\n* GND \u003c--\u003e GND (ground)\n\nAdd 4.7K (or 10K) pull-up resistors to 3V3 on the SDA and SCL pins.\n\n## Uploading code\n\nFirst, create a file called _src/credentials.lua_ with the following content:\n\n```lua\nSSID = \"Your WiFi Access Points SSID\"\nWIFI_PASSWORD = \"Your access point password\"\nTHINGSPEAK_API_KEY = \"Your ThingSpeak Write API key\"\n```\n\nIf present in the root file system, the `init.lua` file will execute first.\nUpload it with:\n\n    $ cd src\n    $ nodemcu-uploader --port /dev/tty.wchusbserial1410 upload *.lua\n    opening port /dev/tty.wchusbserial1410 with 115200 baud\n    Preparing esp for transfer.\n    Transferring application.lua as application.lua\n    Transferring credentials.lua as credentials.lua\n    Transferring init.lua as init.lua\n    All done!\n\n## Connecting using `screen`\n\nConnect to nodemcu using:\n\n    $ screen /dev/tty.wchusbserial1410 115200\n\nHit the reset button, and you should see console messages displayed to the\nterminal as follows:\n\n    NodeMCU custom build by frightanic.com\n            branch: master\n            commit: c8ac5cfb912ff206b03dd7c60ffbb2dafb83fe5e\n            SSL: false\n            modules: adc,ads1115,bme280,file,gpio,http,i2c,net,node,sjson,tmr,tsl2561,uart,wifi\n     build  built on: 2017-06-24 17:51\n     powered by Lua 5.1.4 on SDK 2.1.0(116b762)\n    Connecting to WiFi access point...\n    Connection to AP(XXXX-XXX-XXX) established!\n    Waiting for IP address...\n    Wifi connection is ready! IP address is: 192.168.1.110\n    Startup will resume momentarily, you have 3 seconds to abort.\n    Waiting...\n    Running\n    System voltage (mV):    2984\n    \u003e\n\nTo exit out of screen, press `CTRL-A-\\`. Occasionally the terminal may go insane after\nusing screen, so reset the terminal with:\n\n```\n$ stty sane\n```\n\n## References\n\n* http://espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf\n* http://nodemcu.readthedocs.io/en/master/\n* https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-nodemcu-lua\n* https://blog.sengotta.net/signed-mac-os-driver-for-winchiphead-ch340-serial-bridge/\n* https://github.com/espressif/esptool\n* https://github.com/kmpm/nodemcu-uploader\n* https://www.thingspeak.com\n\n## License\n\n### The MIT License\n\nCopyright (c) 2017 Richard Hull\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Flua-garden","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Flua-garden","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Flua-garden/lists"}