byte4geek / SEPLOS_MQTT

Read data From Seplos BMS and send them to the Home Assistant
GNU General Public License v3.0
39 stars 13 forks source link

Not an issue - Rocky linux 8 installation notes #5

Closed ztardik closed 1 year ago

ztardik commented 1 year ago

I have installed this on Rocky linux 8 VM running inside Proxmox. Here are the steps needed to make it work.

$ sudo dnf update
$ sudo dnf upgrade

$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
$ sudo dnf update
$ sudo dnf install mosquitto nohup

// Prepare serial port

$ udevadm info –attribute-walk path -n /dev/ttyUSB1 |grep -i serial

S: serial/by-id/usb-FTDI_FT232R_USB_UART_A9WT9VFQ-if00-port0
S: serial/by-path/pci-0000:01:1b.0-usb-0:2:1.0-port0
E: DEVLINKS=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9WT9VFQ-if00-port0 /dev/serial/by-path/pci-0000:01:1b.0-usb-0:2:1.0-port0
E: ID_MODEL_FROM_DATABASE=FT232 Serial (UART) IC
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_SERIAL=FTDI_FT232R_USB_UART_A9WT9VFQ
E: ID_SERIAL_SHORT=A9WT9VFQ

$ lsusb

Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

// Edit /etc/udev/rules.d/10-seplos.rules. this will ensure the same name of the serial port every time

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A9WT9VFQ", SYMLINK+="seplos", MODE="0660", GROUP="dialout"

$ sudo udevadm control --reload-rules && udevadm trigger

$ sudo ls -ld /dev/seplos
lrwxrwxrwx. 1 root root 7 Dec  6 09:27 /dev/seplos -> ttyUSB1

// Change the serial port permissions.
$ sudo usermod -a -G dialout $USER

// Get the script

$ git clone https://github.com/byte4geek/SEPLOS_MQTT.git
$ chmod 700 ~/SEPLOS_MQTT/query_seplos_ha.sh ~/SEPLOS_MQTT/run_bms_query.sh
$ touch ~/SEPLOS_MQTT/BMS_error.log

// Edit the script as per documentation, use /dev/seplos as serial port

// Test connection

$ ./query_seplos_ha.sh 4201

// Edit cron

$ crontab -e

@reboot nohup ~/SEPLOS_MQTT/run_bms_query.sh &

// Press :wq to save and exit

$ sudo reboot

// Enjoy
byte4geek commented 1 year ago

good job, I'm glad it's useful to others