Skip to main content

MyEVSE Webinterface based on MicroPython

Project description

MyEVSE Webinterface

Downloads Release MicroPython License: MIT

MicroPython based Webinterface of MyEVSE


General

This is the webinterface of the MyEVSE

I sell on Tindie

The current implementation does only run on a board with external SPI RAM. As of now up to 300kB of RAM are required. This is more than an ESP32-D4 Pico provides by default.

Get started

Install required tools

Python3 must be installed on your system. Check the current Python version with the following command

python --version
python3 --version

Depending on which command Python 3.x.y (with x.y as some numbers) is returned, use that command to proceed.

python3 -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt

Flash firmware

To flash the MicroPython firmware as described on the MicroPython firmware download page, use the esptool.py to erase the flash before flashing the firmware.

esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART erase_flash
esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART --baud 921600 write_flash -z 0x1000 esp32spiram-20220117-v1.18.bin

Install package on board with pip

Connect to a network

import network
station = network.WLAN(network.STA_IF)
station.connect('SSID', 'PASSWORD')
station.isconnected()

and install this MicroPython packages on the device like this

import upip
upip.install('myevse-webinterface')

Upload additional files to board

Copy the boot.py and main.py files to the MicroPython board as shown below using Remote MicroPython shell

Open the remote shell with the following command. Additionally use -b 115200 in case no CP210x is used but a CH34x.

rshell -p /dev/tty.SLAB_USBtoUART --editor nano

Perform the following command to copy all files to the device

cp main.py /pyboard
cp boot.py /pyboard

Usage

Available Webpages

URL Description Additional info
/scan_result Latest Scan result Available networks as JSON
/configure Manage WiFi networks
/data MyEVSE data Table of MyEVSE data
/modbus_data Raw Modbus data Latest Modbus data as JSON
/reboot Reboot system
/select Select WiFi network
/setup Setup system
/info System info
/system_data Raw System info Latest system data as JSON

Available ModBus registers

The available registers are defined by a JSON file and placed inside the /pyboard/lib/registers folder on the board during the pip package installation. This registers definitions file is loaded by the Webinterface class function setup_modbus_connection to configure the RTU-TCP Modbus bridge.

As an example the registers of a brainelectronics MyEVSE, MyEVSE on Tindie board is provided with this repo.

Configuration

The system can be configured via the config.json file. This file does not contain any sensitive data like network passwords or other keys.

The following things can be configured by the user on the /setup webpage.

Name Description Default
TCP_PORT ModBus TCP port 180
REGISTERS ModBus registers file, placed inside /lib/registers  modbusRegisters-MyEVSE.json
CONNECTION_MODE Mode of WiFi connection 0

The CONNECTION_MODE supports the following modes

Value Mode Description
0 Setup Setup WiFi connection via initial AccessPoint WiFiManager
1 Client Connect to the configured networks as client, fallback to an open AccessPoint otherwise
2 AP Create an open AccessPoint named MyEVSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myevse-webinterface-0.8.1.tar.gz (22.3 kB view details)

Uploaded Source

File details

Details for the file myevse-webinterface-0.8.1.tar.gz.

File metadata

  • Download URL: myevse-webinterface-0.8.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

File hashes

Hashes for myevse-webinterface-0.8.1.tar.gz
Algorithm Hash digest
SHA256 9ec4cd2b8ab641048bde668cd82f879358152c1b500cfc140a42b0ddcef27a70
MD5 ad0e14d3606072955702056f80f60f8a
BLAKE2b-256 bff0a0d626193d20973b6ea0743c2e07ea9ed6b9dd6e5a636347a5a4bfe28c83

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page