Giter VIP home page Giter VIP logo

seplos_mqtt's People

Contributors

byte4geek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seplos_mqtt's Issues

Script with Seplos 3.0

Hi,
Do you know if this script is working with the version 3.0 of the Seplos BMS ?
I bought a battery with this version of bms and for the moment i got directly this error : "Failed to read start of input char (~), read ""
I have no line with "Sending...."
I check the rs485 connector and it works fine the seplos Monitor tool

Not an issue - Rocky linux 8 installation notes

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

Error code 5A

Hi i just installed the script and did run nohup ~/SEPLOS....../.....sh & and received the Error code 5A
[3]+ Exit 127

I have three Victrons multi on the Seplos canbus and 4 battery packs on the RS458 port.
Because of the Victron i have to set the dipswitches for the CAN bus.
Master: 5 and 6 On rest oFF
Slave 1: 1 On rest Off
slave 2: 2 On rest off
slave 3: 1 and 2 On rest off.

I can read the data with the provided software from Seplos with the RS2USB interfase. I would love to readout in HAS.

Can you help me out with the error and get me started?

Greetings,
Frits

Esp32/8266

Hi, I dont know anything about codeing, but is there any way to run your code on a esp32 or 8266. ? That would help me a lot, cause I dont want to spend a lot of money for a raspi to monitor the battery pack. I run the other code from github, but Im not satisfied with it.
regards
Joerg.

Error Code 05

I’m desperate for this to work, just keep getting an error code 5, anything I can try?

Receive MQTT Message

Thank you for writing this byte4geek! It will be unbelievably useful... amazeballs!

I have got to the stage where I test the communication ~/SEPLOS_MQTT/query_seplos_ha.sh 4201 and all is well - all of the measurements are displayed in my terminal window.

However, I have been unable to receive the MQTT message. I have triple checked my broker details and they are correct. I am running mosquito on another raspberry pi and it definitely works well because it is throwing around hundreds of messages between various pis running node red.

I run
~/SEPLOS_MQTT/run_bms_query.sh & nohup ~/SEPLOS_MQTT/run_bms_query.sh &
but nothing happens. I ran sudo ~/SEPLOS_MQTT/run_bms_query.sh and it displays the following on the terminal:

grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
grep: /root/SEPLOS_MQTT/config.ini: No such file or directory
/home/pi/SEPLOS_MQTT/run_bms_query.sh: line 34: cd: /root/SEPLOS_MQTT/: No such file or directory
touch: cannot touch '/root/SEPLOS_MQTT/BMS_error.log': No such file or directory
touch: cannot touch '/root/SEPLOS_MQTT/nohup.out': No such file or directory
/home/pi/SEPLOS_MQTT/run_bms_query.sh: line 43: /root/SEPLOS_MQTT/BMS_error.log: No such file or directory
ls: cannot access '/root/SEPLOS_MQTT/BMS_error.log': No such file or directory
mv: cannot stat '/root/SEPLOS_MQTT/BMS_error.log': No such file or directory
ls: cannot access '/root/SEPLOS_MQTT/nohup.out': No such file or directory
cp: cannot stat '/root/SEPLOS_MQTT/nohup.out': No such file or directory
/home/pi/SEPLOS_MQTT/run_bms_query.sh: line 55: /root/SEPLOS_MQTT/nohup.out: No such file or directory
/home/pi/SEPLOS_MQTT/run_bms_query.sh: line 58: /root/SEPLOS_MQTT/query_seplos_ha.sh: No such file or directory
(standard_in) 2: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
/home/pi/SEPLOS_MQTT/run_bms_query.sh: line 110: /root/SEPLOS_MQTT/BMS_error.log: No such file or directory
sleep: missing operand
Try 'sleep --help' for more information.

Is this a permissions thing? I note the response above mentions /root/SEPLOS_MQTT/... is that correct?

Any help would be very much appreciated, thank you.

Regards
Keith

SEPLOS_MQTT

Hello byte4geek,

unfortunately I need your support with the SEPLOS_MQTT project. I don't get along with the configuration. At the following command line I didn't know exactly what to do and in which format to send the command. It is the following line:
ssh-copy-id root@ ---> and choose yes

Can you help me please?

Greetings Steffen

Home Assistant not receiving Data

Hi folks,

Bit of a novice here so would appreciate the help please

  • Have installed on Rpi3
  • configuration.yaml is edited as per script

Communications working
pi@raspberrypi:~ $ ~ /SEPLOS_MQTT/query_seplos_ha.sh 4201
3272
3274
3274
3273
3272
3271
3270
3270
3268
3273
3273
3272
3273
3271
3273
3271
23.7
23.8
20.3
22.1
23.7
22.9
-21.52
52.35
226.93
341.83
66.3
400.00
80
100.0
52.33
pi@raspberrypi:~ $

  • Can confirm that HA receives other MQTT data
  • nohup.out file contents below
    /home/pi/SEPLOS_MQTT/run_bms_query.sh: 23: Syntax error: Bad for loop variable
    /home/pi/SEPLOS_MQTT/run_bms_query.sh: 23: Syntax error: Bad for loop variable
    /home/pi/SEPLOS_MQTT/run_bms_query.sh: 23: Syntax error: Bad for loop variable

IP, Username and Password is corect

insert the mqtt info below

mqtt host name

MQTTHOST=192.168.1.102

name inserted into topic

TOPIC=seplos

mqtt user name

MQTTUSER=username_mqtt

mqtt password

MQTTPASWD=password_mqtt

time to read and update datas vs mqtt server and Home Assistant

TELEPERIOD=10

is a prefix inserted into topic, chage it if you need

id_prefix=364715398511

Max size of the BMS_error.log and nohup.out

MAXSIZE=2000000

Log file name

LOGNAME=~/SEPLOS_MQTT/BMS_error.log

nohup file name for standard and error output

NOUPFILE=~/SEPLOS_MQTT/nohup.out

  • BMS Error Log

Sun 4 Dec 13:57:46 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 13:57:56 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 13:58:07 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 13:58:24 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 13:58:34 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 13:58:44 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:35:04 GMT 2022 - Possible bad read data from BMS - Error 2
Sun 4 Dec 18:35:05 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:37:33 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:37:33 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:37:48 GMT 2022 - Possible bad read data from BMS - Error 2
Sun 4 Dec 18:37:52 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:38:26 GMT 2022 - Possible bad read data from BMS - Error 2
Sun 4 Dec 18:38:29 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:39:54 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:39:57 GMT 2022 - Possible bad read data from BMS - Error 1
Sun 4 Dec 18:40:02 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:45:29 GMT 2022 - Possible bad read data from BMS - Error 2
Sun 4 Dec 18:45:32 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:46:35 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:46:38 GMT 2022 - Possible bad read data from BMS - Error 1
Sun 4 Dec 18:46:43 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:53:50 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:53:54 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:54:49 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:54:53 GMT 2022 - Possible bad read data from BMS - Error 6
Sun 4 Dec 18:55:49 GMT 2022 - Possible bad read data from BMS - Error 2
Sun 4 Dec 18:55:52 GMT 2022 - Possible bad read data from BMS - Error 6

image

If anyone could point me in the right direction that would be great thanks

Multiple Seplos BMS

Thanks for the great code. Do you have any information about what data is returned when you have a master BMS and multiple slaves attached? I have 4 of the Seplos/Mason 48v boxes. Do you need a RS485 connection to each box or can you just query the master?

Error Code 05

Hi

I am just getting error code 05 when trying to run the script - I believe this is a BMS read error?

work over tcp

can we modify this to work any a modbus -> tcp adapter over ip ?

Problem with shell command

Hi byte4geek,

unfortunately I need your support with the SEPLOS_MQTT project.
At the following command line I didn't know exactly what to do and where:
"create a shell command in HA:
seplos_query: ssh -i /config/.ssh/id_rsa -o StrictHostKeyChecking=no root@ "cd /share/SEPLOS_MQTT;nohup /share/SEPLOS_MQTT/run_bms_query_ha.sh &""

can you help me?

best regards
Jan

Extending the scope to cover a second pack

The Master is always "Pack 00", but if you daisychain a second Seplos, it will be given the identity Pack 01

It would be good if the script can pull the data for Pack 0x

Great work

HA receives connection but is lost instantly

Hi I can read the data when using ~/SEPLOS_MQTT/query_seplos_ha.sh 4201

The credentials for the MQTT broker on HA are fine but there is no data coming in, here is the logile from mosquito in HA:

2023-12-07 18:34:25: New connection from 192.168.1.248:38846 on port 1883.
2023-12-07 18:34:25: New client connected from 192.168.1.248:38846 as auto-F834B65A-290B-92DE-F11C-4947C000CF5F (p2, c1, k60, u'energie').
2023-12-07 18:34:25: Client auto-F834B65A-290B-92DE-F11C-4947C000CF5F disconnected.

During the run on the raspberry this appears:

pi@raspberrypi:~ $ nohup: ignoring input and appending output to 'nohup.out'
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 50: printf: 0x0C??: invalid hex number
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 50: printf: 0x????: invalid hex number
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 50: printf: 0x????: invalid hex number
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 50: printf: 0x????: invalid hex number
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 55: printf: 0x?]: invalid hex number
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 13: printf: 0x?(?: invalid hex number
/home/pi/SEPLOS_MQTT/query_seplos_ha.sh: line 13: printf: 0x?70B: invalid hex number
(standard_in) 1: syntax error
(standard_in) 1: syntax error

Any suggestions ?

Works with Waveshare rs485 ip converter

Hi. I use waveshare rs485 to eth ip adapters for my inverter control. Can this work with one of them for my bms? I run ha on a remote pi. If not can this run on pi local to seplos with USB rs485 adapter and send data to my ha pi?

Thanks!

Potential to use over network via RS485 to TCP/IP Converter

More of a feature request.....

Would it be possible (forgive me if it already is possible and I've misread the docs) to manage this via something like the waveshare below?

Waveshare Industrial Serial Server RS485 to RJ45 Ethernet TCP/IP to Serial Module Support Rail-Mount Modbus Gateway https://amzn.eu/d/aFbXNxA

I'll have network in my planned inverter and battery location (shed) but my pi running HA will be quite far away (in the house) so planned to have one of these units for talking to inverter anyway so another setup to talk to the seplos would be great.

Error code 5A

I have verified my USB Adapter to be /dev/ttyUSB0 and I am trying ADDR of 00 and 01, but I keep getting "ERROR CODE 5A" in the response. I used the same USB to configure with the Windows program

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.