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.2.tar.gz (22.3 kB view hashes)

Uploaded Source

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