中文 | English
This project implements a charging pile management system, including OTA upgrades, device application management, external meter data processing, and other functions. Through these features, the system can handle OTA upgrades, device management, data transmission, and other tasks to ensure the normal operation of the charging pile system.
MFRC522.py
: Implementation of the card reader module.main.py
: Main program, including the initialization and startup logic of the device application.
In main.py
, first initialize the configuration storage:
conf_store = ConfStore()
conf_store.init()
Initialize the media module for playing prompts or voice:
media = Media()
media.init(conf_store.get("media"))
Create and initialize the device application instance:
app = DeviceApplication()
app.init()
Initialize all commands in the device application:
init_cmd(app)
Set the device access module:
app.set_da(DeviceAccess())
Set the network manager:
net_manager = NetManage()
app.set_nm(net_manager)
Set the socket manager and add sockets:
socket_a = Socket(**config[SOCKET_A])
socket_b = Socket(**config[SOCKET_B])
sock_m = SocketManage()
sock_m.add(socket_a)
sock_m.add(socket_b)
Set other necessary components:
app.set_vm(VoltaMeter()) \
.set_sm(sock_m) \
.set_media(media) \
.set_rd(MFRC522_SPI()) \
.set_smm(security_msg_map) \
.set_dlt(DLT645())
Initialize the server connection:
state = app.init_server()
Start the device application:
app.start()
Wait for the device registration to complete:
while not DefaultDeviceState.REGISTER:
utime.sleep(1)
Initialize sockets and check upload information:
sock_m.init(conf_store)
app.check_upload_info()
print("MCU VERSION = {}".format(MCU_VERSION))
The MFRC522.py
file implements the card reader module's functions, including reading card IDs and other operations.
The main.py
file is the main program, including the initialization and startup logic of the device application.
We welcome contributions to improve this project! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a Pull Request.
This project is licensed under the Apache License. For more details, please refer to the LICENSE file.