MyEVSE Webinterface based on MicroPython
Project description
MyEVSE Webinterface
MicroPython based Webinterface of MyEVSE
General
This is the webinterface of the MyEVSE
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file myevse-webinterface-0.7.0.tar.gz
.
File metadata
- Download URL: myevse-webinterface-0.7.0.tar.gz
- Upload date:
- Size: 21.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb6b1777ca43127e0a8614e31280084278ef594924f285de0d10668ec5b2309 |
|
MD5 | 6ff21478a75d3f7a90e20d0e04d7e150 |
|
BLAKE2b-256 | 5863745f7b4fba306a9afefa462719577ef15c74f1d0d5a99cceae48a149dd94 |