micropython-eduponics


Namemicropython-eduponics JSON
Version 2.0.2 PyPI version JSON
download
home_pagehttps://github.com/STEMinds/micropython-eduponics
SummarySTEMinds Eduponics Mini MicroPython library
upload_time2023-04-28 10:31:48
maintainer
docs_urlNone
authorSTEMinds
requires_python
licenseMIT
keywords steminds micropython upython eduponics-mini eduponics esp32 ads1x15 mcp23017 tds ph bh1750 bme280 ds1307 at24c02
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=bugs)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=ncloc)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=security_rating)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)

# MicroPython-Eduponics

The official MicroPython Eduponics library for Eduponics Mini ESP32 dev board.

## What can this library do

This library allows you to control all the functionalities of the ESP32 Eduponics mini dev board from one place.
The classes that are currently supported are:

- umqttsimple.py - implementation of simple MQTT protocol for MicroPython.
- ads1x15.py - ADS1x15 precide Analog-to-digital chip (available on extension board).
- mcp23017.py - MCP23017 16-bit IO Expander (available on extension board).
- at24c02.py - AT24C02 EEPROM module.
- bh1750.py - BH1750 photodiode (light sensor).
- bme280.py - 3 in 1: temperature, humidity and barometric sensor.
- ds1307.py - DS1307 RTC module.
- pcf8574.py - PCF8574 8-bit IO Expander (available on valve extension board).
- tds.py - To control TDS sensor through extension board.

The ADS1x15 class is integrated with MCP23017 in order to control the on-board MOSFET's and allow super low power consumption.
When the program ask for data form the ADC the MOSFET will open allowing current to flow (which will activate the sensor) once probing is done, the MOSFET will be deactivated.

This approach also allows to control multiple sensors such as: pH, EC, TDS etc .. without conflict! also extending the sensors lifespan.

The MCP23017 class also contains code to control the valve which can be found on the Eduponics Mini extension board.

## How to install

First, connect the ESP32 board to the WiFi by creating boot.py file and writing the following:

```python
import network
import esp
import time
esp.osdebug(None)
import gc
gc.collect()

# set WiFi credentials
ssid = ''
password = ''

# check if there is username and password for wifi
if(ssid != '' and password != ''):

    station = network.WLAN(network.STA_IF)

    station.active(True)
    station.connect(ssid, password)

    timeout_interval = 10

    # try to connect with timeout interval
    for i in range(0,timeout_interval):
        if(station.isconnected() == False):
            time.sleep(1)
            pass
        else:
            break;

    if(station.isconnected()):
        print('Connected to WiFi successfully, IP: %s' % station.ifconfig()[0])
    else:
        print("Something went wrong, connection timeout, try again!")
else:
    print("Please add WiFi credentials properly")
```

Make sure to change WiFi ESSID and Password. Once the ESP32 is connected to the Wifi, run the following commands:

```python
import upip
upip.install("micropython-eduponics")
```

This will install the latest version of micropython-eduponics package through upip.

Examples are available in the examples/ directory.

## Using firmwares

Alternatively, you can burn a ready made firmware which located under the repository firmwares directory
currently 2 firmware available:

1. 4M-eduponics-micropython.bin - firmware includes micropython-eduponics library pre-installed (without the MQTT client).
2. 4M-eduponics-MQTT.bin - firmware includes the MQTT library and everything you need to get started with the Eduponics mobile app.

To flash the firmware, run the following command using esptool.py
```
esptool.py --baud 115200 --port <port_name> write_flash 0x0 <firmware_name>.bin
```
Where <firmware_name> is the file name (the bin file you want to flash) and <port_name> is the port name to flash through.

Current firmware version: MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32

## Changing MQTT broker

In order to change the MQTT broker, change the umqttsimple.py file inside the [/Eduponics/](/Eduponics/umqttsimple.py) directory
Make sure to properly mark whenever you use SSL or not.

## License

MIT License

Copyright (c) 2014 Adafruit Industries,
              2016 Radomir Dopieralski (@deshipu),
              2016 Paul Cunnane 2016,
              2016 Peter Dahlebrg,
              2017 Robert Hammelrath (@robert-hh),
              2019 Mike Causer (@mcauser),
              2021 STEMinds (@STEMinds),

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/STEMinds/micropython-eduponics",
    "name": "micropython-eduponics",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "STEMinds,MicroPython,uPython,Eduponics-Mini,Eduponics,ESP32,ADS1x15,MCP23017,TDS,pH,bh1750,BME280,DS1307,AT24C02",
    "author": "STEMinds",
    "author_email": "contact@steminds.com",
    "download_url": "https://files.pythonhosted.org/packages/03/2d/e46c317cb0008dd08b892c4e15b22775f85e82c38ccd67a8b5db096c60ea/micropython-eduponics-2.0.2.tar.gz",
    "platform": null,
    "description": "[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=bugs)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=ncloc)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=security_rating)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=STEMinds_micropython-eduponics&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=STEMinds_micropython-eduponics)\n\n# MicroPython-Eduponics\n\nThe official MicroPython Eduponics library for Eduponics Mini ESP32 dev board.\n\n## What can this library do\n\nThis library allows you to control all the functionalities of the ESP32 Eduponics mini dev board from one place.\nThe classes that are currently supported are:\n\n- umqttsimple.py - implementation of simple MQTT protocol for MicroPython.\n- ads1x15.py - ADS1x15 precide Analog-to-digital chip (available on extension board).\n- mcp23017.py - MCP23017 16-bit IO Expander (available on extension board).\n- at24c02.py - AT24C02 EEPROM module.\n- bh1750.py - BH1750 photodiode (light sensor).\n- bme280.py - 3 in 1: temperature, humidity and barometric sensor.\n- ds1307.py - DS1307 RTC module.\n- pcf8574.py - PCF8574 8-bit IO Expander (available on valve extension board).\n- tds.py - To control TDS sensor through extension board.\n\nThe ADS1x15 class is integrated with MCP23017 in order to control the on-board MOSFET's and allow super low power consumption.\nWhen the program ask for data form the ADC the MOSFET will open allowing current to flow (which will activate the sensor) once probing is done, the MOSFET will be deactivated.\n\nThis approach also allows to control multiple sensors such as: pH, EC, TDS etc .. without conflict! also extending the sensors lifespan.\n\nThe MCP23017 class also contains code to control the valve which can be found on the Eduponics Mini extension board.\n\n## How to install\n\nFirst, connect the ESP32 board to the WiFi by creating boot.py file and writing the following:\n\n```python\nimport network\nimport esp\nimport time\nesp.osdebug(None)\nimport gc\ngc.collect()\n\n# set WiFi credentials\nssid = ''\npassword = ''\n\n# check if there is username and password for wifi\nif(ssid != '' and password != ''):\n\n    station = network.WLAN(network.STA_IF)\n\n    station.active(True)\n    station.connect(ssid, password)\n\n    timeout_interval = 10\n\n    # try to connect with timeout interval\n    for i in range(0,timeout_interval):\n        if(station.isconnected() == False):\n            time.sleep(1)\n            pass\n        else:\n            break;\n\n    if(station.isconnected()):\n        print('Connected to WiFi successfully, IP: %s' % station.ifconfig()[0])\n    else:\n        print(\"Something went wrong, connection timeout, try again!\")\nelse:\n    print(\"Please add WiFi credentials properly\")\n```\n\nMake sure to change WiFi ESSID and Password. Once the ESP32 is connected to the Wifi, run the following commands:\n\n```python\nimport upip\nupip.install(\"micropython-eduponics\")\n```\n\nThis will install the latest version of micropython-eduponics package through upip.\n\nExamples are available in the examples/ directory.\n\n## Using firmwares\n\nAlternatively, you can burn a ready made firmware which located under the repository firmwares directory\ncurrently 2 firmware available:\n\n1. 4M-eduponics-micropython.bin - firmware includes micropython-eduponics library pre-installed (without the MQTT client).\n2. 4M-eduponics-MQTT.bin - firmware includes the MQTT library and everything you need to get started with the Eduponics mobile app.\n\nTo flash the firmware, run the following command using esptool.py\n```\nesptool.py --baud 115200 --port <port_name> write_flash 0x0 <firmware_name>.bin\n```\nWhere <firmware_name> is the file name (the bin file you want to flash) and <port_name> is the port name to flash through.\n\nCurrent firmware version: MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32\n\n## Changing MQTT broker\n\nIn order to change the MQTT broker, change the umqttsimple.py file inside the [/Eduponics/](/Eduponics/umqttsimple.py) directory\nMake sure to properly mark whenever you use SSL or not.\n\n## License\n\nMIT License\n\nCopyright (c) 2014 Adafruit Industries,\n              2016 Radomir Dopieralski (@deshipu),\n              2016 Paul Cunnane 2016,\n              2016 Peter Dahlebrg,\n              2017 Robert Hammelrath (@robert-hh),\n              2019 Mike Causer (@mcauser),\n              2021 STEMinds (@STEMinds),\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 NON-INFRINGEMENT. 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",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "STEMinds Eduponics Mini MicroPython library",
    "version": "2.0.2",
    "split_keywords": [
        "steminds",
        "micropython",
        "upython",
        "eduponics-mini",
        "eduponics",
        "esp32",
        "ads1x15",
        "mcp23017",
        "tds",
        "ph",
        "bh1750",
        "bme280",
        "ds1307",
        "at24c02"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "032de46c317cb0008dd08b892c4e15b22775f85e82c38ccd67a8b5db096c60ea",
                "md5": "d26b9aededbfaa3e3b1bb07b250c7d3c",
                "sha256": "52527d3b0075f9b9329b28bcc9122ffc0b280a4f206a193a6863786f6214ae11"
            },
            "downloads": -1,
            "filename": "micropython-eduponics-2.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d26b9aededbfaa3e3b1bb07b250c7d3c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24671,
            "upload_time": "2023-04-28T10:31:48",
            "upload_time_iso_8601": "2023-04-28T10:31:48.592011Z",
            "url": "https://files.pythonhosted.org/packages/03/2d/e46c317cb0008dd08b892c4e15b22775f85e82c38ccd67a8b5db096c60ea/micropython-eduponics-2.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-28 10:31:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "STEMinds",
    "github_project": "micropython-eduponics",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "micropython-eduponics"
}
        
Elapsed time: 0.06949s